openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r504216 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
Date Tue, 06 Feb 2007 17:46:35 GMT
Author: ppoddar
Date: Tue Feb  6 09:46:33 2007
New Revision: 504216

URL: http://svn.apache.org/viewvc?view=rev&rev=504216
Log:
Dynamic implementation class of a subInterface is loaded with the classloader of the dynamic
implementaion of the superInterface.


Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java?view=diff&rev=504216&r1=504215&r2=504216
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
Tue Feb  6 09:46:33 2007
@@ -73,11 +73,15 @@
 
         ClassLoader parentLoader = iface.getClassLoader();
         BCClassLoader loader = new BCClassLoader(_project, parentLoader);
+        BCClassLoader enhLoader = new BCClassLoader(_enhProject, parentLoader);
         BCClass bc = _project.loadClass(getClassName(meta));
         bc.declareInterface(iface);
         ClassMetaData sup = meta.getPCSuperclassMetaData();
-        if (sup != null)
+        if (sup != null) {
             bc.setSuperclass(sup.getInterfaceImpl());
+            enhLoader = new BCClassLoader(_enhProject, 
+            		sup.getInterfaceImpl().getClassLoader());
+        }
 
         FieldMetaData[] fields = meta.getDeclaredFields();
         Set methods = new HashSet();
@@ -103,7 +107,6 @@
         if (result != PCEnhancer.ENHANCE_PC)
             throw new InternalException(_loc.get("interface-badenhance", 
                 iface)).setFatal(true);
-        BCClassLoader enhLoader = new BCClassLoader(_enhProject, parentLoader);
         try{
             // load the class for real.
             impl = Class.forName(bc.getName(), true, enhLoader);



Mime
View raw message