X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=common%2Fconcepts%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fconcepts%2Futil%2FClassLoaderUtils.java;h=e898e72479f441b6a1db405e42ac50f7ff1ec96a;hb=85c0405ed187f2d00d47c12c20f3c5ab8029cd2f;hp=f2402270efeaa409102c3ceffa3553f50e5d515e;hpb=45259276c965022d43fa4cc8854da5b8120add8e;p=yangtools.git diff --git a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/util/ClassLoaderUtils.java b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/util/ClassLoaderUtils.java index f2402270ef..e898e72479 100644 --- a/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/util/ClassLoaderUtils.java +++ b/common/concepts/src/main/java/org/opendaylight/yangtools/concepts/util/ClassLoaderUtils.java @@ -12,18 +12,21 @@ import java.lang.reflect.Type; import java.util.concurrent.Callable; import java.util.concurrent.locks.Lock; - +/** + * @deprecated Use {@link org.opendaylight.yangtools.yang.binding.util.ClassLoaderUtils} instead. + */ +@Deprecated public final class ClassLoaderUtils { private ClassLoaderUtils() { throw new UnsupportedOperationException("Utility class"); } - public static V withClassLoader(ClassLoader cls, Callable function) throws Exception { + public static V withClassLoader(final ClassLoader cls, final Callable function) throws Exception { return withClassLoaderAndLock(cls, null, function); } - public static V withClassLoaderAndLock(ClassLoader cls, Lock lock, Callable function) throws Exception { + public static V withClassLoaderAndLock(final ClassLoader cls, final Lock lock, final Callable function) throws Exception { if (cls == null) { throw new IllegalArgumentException("Classloader should not be null"); } @@ -46,7 +49,7 @@ public final class ClassLoaderUtils { } } - public static ParameterizedType findParameterizedType(Class subclass, Class genericType) { + public static ParameterizedType findParameterizedType(final Class subclass, final Class genericType) { if(subclass == null || genericType == null) { throw new IllegalArgumentException("Class was not specified."); } @@ -65,7 +68,7 @@ public final class ClassLoaderUtils { return null; } } - + private static Callable> findFirstGenericArgumentTask(final Class scannedClass, final Class genericType) { return new Callable>() { @Override @@ -81,7 +84,7 @@ public final class ClassLoaderUtils { }; } - public static Type getFirstGenericParameter(Type type) { + public static Type getFirstGenericParameter(final Type type) { if(type instanceof ParameterizedType) { return ((ParameterizedType) type).getActualTypeArguments()[0]; }