geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: rev 47233 - geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/propertyeditor
Date Sun, 26 Sep 2004 01:56:23 GMT
Author: jboynes
Date: Sat Sep 25 18:56:23 2004
New Revision: 47233

Modified:
   geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/propertyeditor/PropertyEditors.java
Log:
When loading a property editor we need to search using the supplied classloader

Modified: geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/propertyeditor/PropertyEditors.java
==============================================================================
--- geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/propertyeditor/PropertyEditors.java
(original)
+++ geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/propertyeditor/PropertyEditors.java
Sat Sep 25 18:56:23 2004
@@ -93,7 +93,16 @@
             type = ClassLoading.loadClass(typeName + "$PropertyEditor", classLoader);
         }
 
-        return findEditor(type);
+        // PropertyEditorManager uses the classloader for object, then system, them context
+        // We need to force the context loader to that of the user as the Editor may be
+        // located in a child loader from the type being loader 
+        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(classLoader);
+            return findEditor(type);
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldLoader);
+        }
     }
 
     /**

Mime
View raw message