Allow use of lamda functions in onLoad callback. Lambda function classes cannot be loaded by name, so avoid doing so when onLoad is specified.
authorJaroslav Tulach <jtulach@netbeans.org>
Thu, 21 Jan 2016 18:54:01 +0100
changeset 1045f152fe9735f0
parent 992 6f1a8b251b7d
child 1046 7c129f8897a0
Allow use of lamda functions in onLoad callback. Lambda function classes cannot be loaded by name, so avoid doing so when onLoad is specified.
boot/src/main/java/net/java/html/boot/BrowserBuilder.java
     1.1 --- a/boot/src/main/java/net/java/html/boot/BrowserBuilder.java	Mon Sep 21 21:19:13 2015 +0200
     1.2 +++ b/boot/src/main/java/net/java/html/boot/BrowserBuilder.java	Thu Jan 21 18:54:01 2016 +0100
     1.3 @@ -106,7 +106,6 @@
     1.4      
     1.5      private String resource;
     1.6      private Class<?> clazz;
     1.7 -    private Class[] browserClass;
     1.8      private Runnable onLoad;
     1.9      private String methodName;
    1.10      private String[] methodArgs;
    1.11 @@ -312,10 +311,9 @@
    1.12                      final Fn.Presenter currentP = aP != null ? aP : dP;
    1.13                      
    1.14                      Thread.currentThread().setContextClassLoader(activeLoader);
    1.15 -                    final Class<?> newClazz = Class.forName(myCls.getName(), true, activeLoader);
    1.16 -                    if (browserClass != null) {
    1.17 -                        browserClass[0] = newClazz;
    1.18 -                    }
    1.19 +                    final Class<?> newClazz = onLoad != null ?
    1.20 +                        myCls :
    1.21 +                        Class.forName(myCls.getName(), true, activeLoader);
    1.22                      Contexts.Builder cb = Contexts.newBuilder(context);
    1.23                      if (!Contexts.fillInByProviders(newClazz, cb)) {
    1.24                          LOG.log(Level.WARNING, "Using empty technology for {0}", newClazz);