The OSGi classloading is not really transitive: So, if a loader that can see our class, can't see Test class, use the Test class that is next to us. osgi
authorJaroslav Tulach <jaroslav.tulach@netbeans.org>
Sun, 05 Jan 2014 08:33:29 +0100
branchosgi
changeset 3997ebf3eb127f0
parent 398 ab0210bfaa0c
child 400 feb094ada684
The OSGi classloading is not really transitive: So, if a loader that can see our class, can't see Test class, use the Test class that is next to us.
boot/src/main/java/org/netbeans/html/boot/impl/FnUtils.java
     1.1 --- a/boot/src/main/java/org/netbeans/html/boot/impl/FnUtils.java	Sun Jan 05 08:24:58 2014 +0100
     1.2 +++ b/boot/src/main/java/org/netbeans/html/boot/impl/FnUtils.java	Sun Jan 05 08:33:29 2014 +0100
     1.3 @@ -80,7 +80,11 @@
     1.4          }
     1.5          Class<?> clazz;
     1.6          try (Closeable c = Fn.activate(new FnUtils())) {
     1.7 -            clazz = Class.forName(Test.class.getName(), true, l);
     1.8 +            try {
     1.9 +                clazz = Class.forName(Test.class.getName(), true, l);
    1.10 +            } catch (ClassNotFoundException ex) {
    1.11 +                clazz = Test.class;
    1.12 +            }
    1.13              final Object is = ((Callable<?>)clazz.newInstance()).call();
    1.14              return Boolean.TRUE.equals(is);
    1.15          } catch (Exception ex) {