Fixup javassist class use 92/75092/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 10 Aug 2018 08:51:45 +0000 (10:51 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 31 Aug 2018 07:59:50 +0000 (07:59 +0000)
We need to cast the returned class, as the Javassist API no longer
does so.

Change-Id: Ib19477ece9e76b735285df3b553ca9504579f8c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/gen/impl/AbstractStreamWriterGenerator.java

index 51ef4320390cbce3c5ae8d6c5d1738e92d54b9a2..31825405bfa9d68e5aa507876deea83f7eb9fa4d 100644 (file)
@@ -147,9 +147,8 @@ abstract class AbstractStreamWriterGenerator extends AbstractGenerator implement
                     type.getTypeName(), type.getClassLoader(), serializerName);
             final DataObjectSerializerSource source = generateEmitterSource(type, serializerName);
             final CtClass poolClass = generateEmitter0(type, source, serializerName);
-            @SuppressWarnings("unchecked")
             final Class<? extends DataObjectSerializerImplementation> cls = poolClass.toClass(type.getClassLoader(),
-                type.getProtectionDomain());
+                type.getProtectionDomain()).asSubclass(DataObjectSerializerImplementation.class);
 
             /*
              * Due to OSGi class loader rules we cannot initialize the fields during