openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgras...@apache.org
Subject svn commit: r1176528 - in /openjpa/branches/1.0.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java openjpa-kernel/src/main/java/org/apache/openjpa/meta/JavaTypes.java
Date Tue, 27 Sep 2011 19:04:13 GMT
Author: jgrassel
Date: Tue Sep 27 19:04:12 2011
New Revision: 1176528

URL: http://svn.apache.org/viewvc?rev=1176528&view=rev
Log:
Revert 'OPENJPA-758: Added code to check the ClassResolver to get a class loader when attempting
to load a ValueHandler or FieldStrategy.' rev-1155104

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
    openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/JavaTypes.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java?rev=1176528&r1=1176527&r2=1176528&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
Tue Sep 27 19:04:12 2011
@@ -942,7 +942,7 @@ public class MappingRepository
         try {
             Class c = JavaTypes.classForName(name, val,
                 (ClassLoader) AccessController.doPrivileged(
-                    J2DoPrivHelper.getClassLoaderAction(FieldStrategy.class)),false);
+                    J2DoPrivHelper.getClassLoaderAction(FieldStrategy.class)));
             Object o = AccessController.doPrivileged(
                 J2DoPrivHelper.newInstanceAction(c));
             Configurations.configureInstance(o, getConfiguration(), props);
@@ -969,7 +969,7 @@ public class MappingRepository
         try {
             Class c = JavaTypes.classForName(name, val,
                 (ClassLoader) AccessController.doPrivileged(
-                    J2DoPrivHelper.getClassLoaderAction(ValueHandler.class)),false);
+                    J2DoPrivHelper.getClassLoaderAction(ValueHandler.class)));
             if (ValueHandler.class.isAssignableFrom(c)) {
                 ValueHandler vh = (ValueHandler) AccessController.doPrivileged(
                     J2DoPrivHelper.newInstanceAction(c));

Modified: openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/JavaTypes.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/JavaTypes.java?rev=1176528&r1=1176527&r2=1176528&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/JavaTypes.java
(original)
+++ openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/meta/JavaTypes.java
Tue Sep 27 19:04:12 2011
@@ -197,37 +197,11 @@ public class JavaTypes {
     }
 
     /**
-     * Try to load a class using the provided loader. Optionally tries the 
-     * configuration's ClassResolver if the supplied loader cannot find the class.
-     *
-     * @param name Name of the class to load. 
-     * @param context 
-     * @param loader ClassLoader to use. If null, the configuration's ClassResolver will
be used. 
-     * @param mustExist Whether the supplied loader <b>must</b> be able to load
the class. If true no attempt to use a 
-     *        different classloader will be made. If false the ClassResolver from the configuration
will be used. 
-     */
-    public static Class classForName(String name, ValueMetaData context,
-            ClassLoader loader, boolean mustExist) {    	
-            return classForName(name,
-                context.getFieldMetaData().getDefiningMetaData(),
-                context.getFieldMetaData().getDeclaringType(), context, loader, mustExist);
-        }
-
-    /**
-     * OJ-758: Delegates to the final classForName.  This is needed
-     * to maintain the existing code path prior to OJ-758.
-     */
-    private static Class classForName(String name, ClassMetaData meta,
-            Class dec, ValueMetaData vmd, ClassLoader loader) {
-    	return classForName(name, meta, dec, vmd,  loader, true);
-    }
-    
-    /**
      * Check the given name against the same set of standard packages used
      * when parsing metadata.
      */
     private static Class classForName(String name, ClassMetaData meta,
-        Class dec, ValueMetaData vmd, ClassLoader loader, boolean mustExist) {
+        Class dec, ValueMetaData vmd, ClassLoader loader) {
         // special case for PersistenceCapable and Object
         if ("PersistenceCapable".equals(name)
             || "javax.jdo.PersistenceCapable".equals(name)) // backwards compat
@@ -249,21 +223,9 @@ public class JavaTypes {
             pkg = Strings.getPackageName(vmd.getDeclaredType());
             cls = CFMetaDataParser.classForName(name, pkg, runtime, loader);
         }
-
-        //OJ-758 start: If the class is still null, as a last/final attempt to 
-        //load the class, check with the ClassResolver to get a loader
-        //and use it to attempt to load the class. 
-        if (cls == null  && !mustExist){
-            loader = rep.getConfiguration().getClassResolverInstance().
-            getClassLoader(dec, meta.getEnvClassLoader());
-            cls = CFMetaDataParser.classForName(name, pkg, runtime, loader);
-        }         	
-        //OJ-758 end  
-    
         if (cls == null)
             throw new MetaDataException(_loc.get("bad-class", name,
                 (vmd == null) ? (Object) meta : (Object) vmd));
-        
         return cls;
     }
 



Mime
View raw message