brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [1/5] brooklyn-server git commit: Fix rebind of DSL instances
Date Tue, 18 Apr 2017 12:41:55 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/0.11.x 13eedd531 -> 94eb57793


Fix rebind of DSL instances

Previously xstream was injecting the wrong class loader, so we’d
get errors like:

ClassNotFoundException:
org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslConfigSupplier
(cherry picked from commit d350f705a1da7adba87178802ed68aeb9262d910)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/eef08cfd
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/eef08cfd
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/eef08cfd

Branch: refs/heads/0.11.x
Commit: eef08cfd3029c163fd3ced87eaa74f085102f5da
Parents: 13eedd5
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu Apr 13 12:54:58 2017 +0100
Committer: Richard Downer <richard@apache.org>
Committed: Tue Apr 18 13:34:59 2017 +0100

----------------------------------------------------------------------
 .../core/xstream/ObjectWithDefaultStringImplConverter.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/eef08cfd/core/src/main/java/org/apache/brooklyn/util/core/xstream/ObjectWithDefaultStringImplConverter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/util/core/xstream/ObjectWithDefaultStringImplConverter.java
b/core/src/main/java/org/apache/brooklyn/util/core/xstream/ObjectWithDefaultStringImplConverter.java
index 116a309..62e3711 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/xstream/ObjectWithDefaultStringImplConverter.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/xstream/ObjectWithDefaultStringImplConverter.java
@@ -25,6 +25,7 @@ import com.thoughtworks.xstream.converters.Converter;
 import com.thoughtworks.xstream.converters.ConverterLookup;
 import com.thoughtworks.xstream.converters.MarshallingContext;
 import com.thoughtworks.xstream.converters.UnmarshallingContext;
+import com.thoughtworks.xstream.core.ClassLoaderReference;
 import com.thoughtworks.xstream.io.HierarchicalStreamReader;
 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
 
@@ -43,10 +44,10 @@ import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
  */
 public class ObjectWithDefaultStringImplConverter implements Converter {
     private final ConverterLookup lookup;
-    private final ClassLoader loader;
+    private final ClassLoaderReference loader;
     private final Class<?> defaultImpl = String.class;
 
-    public ObjectWithDefaultStringImplConverter(ConverterLookup lookup, ClassLoader loader)
{
+    public ObjectWithDefaultStringImplConverter(ConverterLookup lookup, ClassLoaderReference
loader) {
         this.lookup = lookup;
         this.loader = loader;
     }
@@ -78,7 +79,7 @@ public class ObjectWithDefaultStringImplConverter implements Converter {
             clazz = Boxing.getPrimitiveType(clazzName).get();
         } else {
             try {
-                clazz = loader.loadClass(clazzName);
+                clazz = loader.getReference().loadClass(clazzName);
             } catch (ClassNotFoundException e) {
                 throw Exceptions.propagate(e);
             }


Mime
View raw message