You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2004/09/26 03:56:23 UTC

svn commit: rev 47233 - geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/propertyeditor

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);
+        }
     }
 
     /**