BUG-868: use a single version of ClassLoaderUtils 35/7735/6
authorRobert Varga <rovarga@cisco.com>
Thu, 5 Jun 2014 11:24:31 +0000 (13:24 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 10 Jun 2014 08:46:09 +0000 (08:46 +0000)
This removes the static import, which hid the fact we are using two
different ClassLoaderUtils (both deprecated).

Change-Id: If37786d591a4c9975d2d10539c70f888dd7d6c5c
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend

index 4fb95d9..eea9ad6 100644 (file)
@@ -16,7 +16,7 @@ import javassist.LoaderClassPath
 import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper
 import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory
 import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory.NotificationInvoker
-import org.opendaylight.yangtools.sal.binding.generator.util.ClassLoaderUtils
+import org.opendaylight.yangtools.yang.binding.util.ClassLoaderUtils
 import org.opendaylight.yangtools.sal.binding.generator.util.JavassistUtils
 import org.opendaylight.yangtools.yang.binding.BaseIdentity
 import org.opendaylight.yangtools.yang.binding.DataContainer
@@ -28,8 +28,6 @@ import org.opendaylight.yangtools.yang.binding.RpcService
 import org.opendaylight.yangtools.yang.binding.annotations.QName
 import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext
 
-import static org.opendaylight.yangtools.concepts.util.ClassLoaderUtils.*
-
 import static extension org.opendaylight.controller.sal.binding.codegen.RuntimeCodeSpecification.*
 import static extension org.opendaylight.controller.sal.binding.codegen.YangtoolsMappingHelper.*
 
@@ -48,7 +46,7 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co
     }
 
     override <T extends RpcService> getDirectProxyFor(Class<T> iface) {
-        val T instance =  withClassLoaderAndLock(iface.classLoader,lock) [|
+        val T instance = ClassLoaderUtils.withClassLoaderAndLock(iface.classLoader,lock) [|
             val proxyName = iface.directProxyName;
             val potentialClass = ClassLoaderUtils.tryToLoadClassWithTCCL(proxyName)
             if(potentialClass != null) {
@@ -83,12 +81,12 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co
     }
 
     override <T extends RpcService> getRouterFor(Class<T> iface,String routerInstanceName) {
-        val metadata = withClassLoader(iface.classLoader) [|
+        val metadata = ClassLoaderUtils.withClassLoader(iface.classLoader) [|
             val supertype = iface.asCtClass
             return supertype.rpcMetadata;
         ]
 
-        val instance = <T>withClassLoaderAndLock(iface.classLoader,lock) [ |
+        val instance = ClassLoaderUtils.<T>withClassLoaderAndLock(iface.classLoader,lock) [ |
             val supertype = iface.asCtClass
             val routerName = iface.routerName;
             val potentialClass = ClassLoaderUtils.tryToLoadClassWithTCCL(routerName)
@@ -228,7 +226,7 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co
 
 
     protected def resolveInvokerClass(Class<? extends NotificationListener> class1) {
-        return <RuntimeGeneratedInvokerPrototype>withClassLoaderAndLock(class1.classLoader,lock) [|
+        return ClassLoaderUtils.<RuntimeGeneratedInvokerPrototype>withClassLoaderAndLock(class1.classLoader,lock) [|
             val invoker = invokerClasses.get(class1);
             if (invoker !== null) {
                 return invoker;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.