Reviewers: rjrjr, bobv,

Description:
Issue 6092: Inconsistent use of classloaders in RequestFactory

http://code.google.com/p/google-web-toolkit/issues/detail?id=6092

Use the Thread.currentThread().getContextClassLoader() everytime we need
to load a class using Class.forName

Please review this at http://gwt-code-reviews.appspot.com/1371803/

Affected files:
  M user/src/com/google/gwt/requestfactory/server/LocatorServiceLayer.java


Index: user/src/com/google/gwt/requestfactory/server/LocatorServiceLayer.java diff --git a/user/src/com/google/gwt/requestfactory/server/LocatorServiceLayer.java b/user/src/com/google/gwt/requestfactory/server/LocatorServiceLayer.java index d5efc0413e99d27d78700a03ec68d636d72d0b48..02db9c0314b469725576e46747eed332046d9e3b 100644
--- a/user/src/com/google/gwt/requestfactory/server/LocatorServiceLayer.java
+++ b/user/src/com/google/gwt/requestfactory/server/LocatorServiceLayer.java
@@ -116,7 +116,7 @@ final class LocatorServiceLayer extends ServiceLayerDecorator {
       try {
         @SuppressWarnings("unchecked")
Class<? extends Locator<?, ?>> found = (Class<? extends Locator<?, ?>>) Class.forName(
-            ln.locator(), false, domainType.getClassLoader()).asSubclass(
+ ln.locator(), false, Thread.currentThread().getContextClassLoader()).asSubclass(
             Locator.class);
         locatorType = found;
       } catch (ClassNotFoundException e) {
@@ -146,7 +146,7 @@ final class LocatorServiceLayer extends ServiceLayerDecorator {
     } else if (ln != null && ln.locator().length() > 0) {
       try {
         locatorType = Class.forName(ln.locator(), false,
-            requestContextClass.getClassLoader()).asSubclass(
+            Thread.currentThread().getContextClassLoader()).asSubclass(
             ServiceLocator.class);
       } catch (ClassNotFoundException e) {
         return die(


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to