openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1760580 [5/5] - in /openjpa/branches/fb-3.0-asm: openjpa-examples/openbooks/ openjpa-kernel/src/main/java/org/apache/openjpa/ant/ openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-kernel/src/main/java/org/apache/openjpa/enhance...
Date Tue, 13 Sep 2016 17:29:02 GMT
Propchange: openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerSerp.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java
Tue Sep 13 17:29:01 2016
@@ -199,7 +199,7 @@ public class PCSubclassValidator {
      */
     private BCField checkGetterIsSubclassable(Method meth, FieldMetaData fmd) {
         checkMethodIsSubclassable(meth, fmd);
-        BCField field = PCEnhancer.getReturnedField(getBCMethod(meth));
+        BCField field = PCEnhancerSerp.getReturnedField(getBCMethod(meth));
         if (field == null) {
             addContractViolation(loc.get("subclasser-invalid-getter",
                 fmd.getName()), fmd);
@@ -216,7 +216,7 @@ public class PCSubclassValidator {
      */
     private BCField checkSetterIsSubclassable(Method meth, FieldMetaData fmd) {
         checkMethodIsSubclassable(meth, fmd);
-        BCField field = PCEnhancer.getAssignedField(getBCMethod(meth));
+        BCField field = PCEnhancerSerp.getAssignedField(getBCMethod(meth));
         if (field == null) {
             addContractViolation(loc.get("subclasser-invalid-setter",
                 fmd.getName()), fmd);

Modified: openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ReflectingPersistenceCapable.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ReflectingPersistenceCapable.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ReflectingPersistenceCapable.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ReflectingPersistenceCapable.java
Tue Sep 13 17:29:01 2016
@@ -68,7 +68,7 @@ public class ReflectingPersistenceCapabl
     }
 
     public int pcGetEnhancementContractVersion() {
-        return PCEnhancer.ENHANCER_VERSION;
+        return PCEnhancerSerp.ENHANCER_VERSION;
     }
 
     public Object pcGetGenericContext() {

Modified: openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
Tue Sep 13 17:29:01 2016
@@ -27,8 +27,9 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.WeakHashMap;
 
-import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.enhance.PCEnhancer;
+import org.apache.openjpa.lib.util.StringUtil;
+import org.apache.openjpa.enhance.PCEnhancerSerp;
 import org.apache.openjpa.util.InternalException;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
@@ -114,7 +115,7 @@ class InterfaceImplGenerator {
         // copy the BCClass<?> into the enhancer project.
         bc = _enhProject.loadClass(new ByteArrayInputStream(bc.toByteArray()), 
             loader);
-        PCEnhancer enhancer = new PCEnhancer(_repos, bc, meta);
+        PCEnhancerSerp enhancer = new PCEnhancerSerp(_repos, bc, meta);
 
         int result = enhancer.run();
         if (result != PCEnhancer.ENHANCE_PC)

Modified: openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Tue Sep 13 17:29:01 2016
@@ -37,7 +37,7 @@ import java.util.concurrent.ConcurrentHa
 
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.enhance.DynamicPersistenceCapable;
-import org.apache.openjpa.enhance.PCEnhancer;
+import org.apache.openjpa.enhance.PCEnhancerSerp;
 import org.apache.openjpa.enhance.PCRegistry;
 import org.apache.openjpa.enhance.PCRegistry.RegisterClassListener;
 import org.apache.openjpa.enhance.PersistenceCapable;
@@ -2507,7 +2507,7 @@ public class MetaDataRepository implemen
             return;
         }
         Log log = _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
-        boolean res = PCEnhancer.checkEnhancementLevel(cls, _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME));
+        boolean res = _conf.getPCEnhancerInstance().checkEnhancementLevel(cls);
         if (log.isTraceEnabled() == false && res == true) {
             // Since trace isn't enabled flip the flag so we only log this once.
             _logEnhancementLevel = false;

Modified: openjpa/branches/fb-3.0-asm/openjpa-kernel/src/test/java/org/apache/openjpa/enhance/TestPCSubclassNameConversion.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-kernel/src/test/java/org/apache/openjpa/enhance/TestPCSubclassNameConversion.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-kernel/src/test/java/org/apache/openjpa/enhance/TestPCSubclassNameConversion.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-kernel/src/test/java/org/apache/openjpa/enhance/TestPCSubclassNameConversion.java
Tue Sep 13 17:29:01 2016
@@ -24,9 +24,9 @@ public class TestPCSubclassNameConversio
     extends TestCase {
 
     public void testPCSubclassNameConversion() {
-        String name = PCEnhancer.toPCSubclassName(Object.class);
-        assertTrue(PCEnhancer.isPCSubclassName(name));
+        String name = PCEnhancerSerp.toPCSubclassName(Object.class);
+        assertTrue(PCEnhancerSerp.isPCSubclassName(name));
         assertEquals(Object.class.getName(),
-            PCEnhancer.toManagedTypeName(name));
+            PCEnhancerSerp.toManagedTypeName(name));
     }
 }

Modified: openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
Tue Sep 13 17:29:01 2016
@@ -342,13 +342,11 @@ public class Configurations {
             String anchor = result.get(CONFIG_RESOURCE_ANCHOR);
 
             File file = new File(path);
-            if ((AccessController.doPrivileged(J2DoPrivHelper
-                .isFileAction(file))).booleanValue())
+            if ((AccessController.doPrivileged(J2DoPrivHelper.isFileAction(file))).booleanValue())
                 provider = ProductDerivations.load(file, anchor, null);
             else {
                 file = new File("META-INF" + File.separatorChar + path);
-                if ((AccessController.doPrivileged(J2DoPrivHelper
-                    .isFileAction(file))).booleanValue())
+                if ((AccessController.doPrivileged(J2DoPrivHelper.isFileAction(file))).booleanValue())
                     provider = ProductDerivations.load(file, anchor, null);
                 else
                     provider = ProductDerivations.load(path, anchor, null);
@@ -728,8 +726,7 @@ public class Configurations {
      *
      * @since 1.1.0
      */
-    public static boolean runAgainstAllAnchors(Options opts,
-        Configurations.Runnable runnable) {
+    public static boolean runAgainstAllAnchors(Options opts, Configurations.Runnable runnable)
{
         if (opts.containsKey("help") || opts.containsKey("-help")) {
             return false;
         }
@@ -770,6 +767,6 @@ public class Configurations {
     }
 
     public interface Runnable {
-        public boolean run(Options opts) throws Exception;
+        boolean run(Options opts) throws Exception;
     }
 }

Modified: openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
Tue Sep 13 17:29:01 2016
@@ -77,6 +77,7 @@ public interface ProductDerivation {
      * Load the given given resource into the returned ConfigurationProvider, 
      * or return null if it is not a resource this receiver understands. 
      * The given class loader may be null.
+     * An anchor is e.g. a specific Persistence Unit name
      *
      * @param anchor optional named anchor within a multiple-configuration
      * resource

Modified: openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
Tue Sep 13 17:29:01 2016
@@ -390,10 +390,13 @@ public class ProductDerivations {
      * product derivations or if no product derivations could find anchors,
      * this returns an empty list.
      *
+     * An 'anchor' is the name of a persistence unit, e.g. 'MYPU'
+     * A 'fully qualified anchor' is the resource it got found in + # + the name of the persistence
unit,
+     * e.g. 'META-INF/persistence.xml#MYPU'
+     *
      * @since 1.1.0
      */
-    public static List<String> getFullyQualifiedAnchorsInPropertiesLocation(
-        final String propertiesLocation) {
+    public static List<String> getFullyQualifiedAnchorsInPropertiesLocation(final String
propertiesLocation) {
         List<String> fqAnchors = new ArrayList<String>();
         StringBuilder errs = null;
         Throwable err = null;

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/AbstractUnenhancedClassTest.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/AbstractUnenhancedClassTest.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/AbstractUnenhancedClassTest.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/AbstractUnenhancedClassTest.java
Tue Sep 13 17:29:01 2016
@@ -277,7 +277,7 @@ public abstract class AbstractUnenhanced
     public void testPCSubclassName() {
         assertEquals("org.apache.openjpa.enhance."
             + getUnenhancedClass().getName().replace('.', '$') + "$pcsubclass",
-            PCEnhancer.toPCSubclassName(getUnenhancedClass()));
+            PCEnhancerSerp.toPCSubclassName(getUnenhancedClass()));
     }
 
     public void testEvictionInUserCreatedInstance()

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestEnhancementWithMultiplePUs.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestEnhancementWithMultiplePUs.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestEnhancementWithMultiplePUs.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestEnhancementWithMultiplePUs.java
Tue Sep 13 17:29:01 2016
@@ -52,7 +52,7 @@ public class TestEnhancementWithMultiple
             "org.apache.openjpa.enhance.UnenhancedBootstrapInstance";
         BCClass bc = assertNotPC(loader, project, className);
 
-        PCEnhancer enhancer = new PCEnhancer(conf, bc, repos, loader);
+        PCEnhancerSerp enhancer = new PCEnhancerSerp(conf, bc, repos, loader);
 
         assertEquals(PCEnhancer.ENHANCE_PC, enhancer.run());
         assertTrue(Arrays.asList(bc.getInterfaceNames()).contains(
@@ -98,8 +98,8 @@ public class TestEnhancementWithMultiple
             }
         };
 
-        PCEnhancer.run(conf, null, new PCEnhancer.Flags(), repos, writer,
-            loader);
+        PCEnhancerSerp.run(conf, null, new PCEnhancer.Flags(), repos, writer,
+                           loader);
 
         // ensure that we don't attempt to process classes listed in other PUs
         assertEquals(1, written.size());
@@ -148,7 +148,7 @@ public class TestEnhancementWithMultiple
             "org.apache.openjpa.enhance.RestrictedMetaDataRepository(excludedTypes=" +
             "org.apache.openjpa.persistence.jdbc.annotations.UnenhancedMixedAccess)");
         opts.put(PCEnhancer.class.getName() + "#bytecodeWriter", writer);
-        PCEnhancer.run(null, opts);
+        PCEnhancer.run(null, opts, null);
 
         // ensure that we do process the classes listed in the PUs
         assertTrue(written.contains(

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerEnhancementContractVersion.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerEnhancementContractVersion.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerEnhancementContractVersion.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerEnhancementContractVersion.java
Tue Sep 13 17:29:01 2016
@@ -34,17 +34,17 @@ public class TestPCEnhancerEnhancementCo
         new DummyPersistenceCapeable();
     }
     public void testCurrentLevel() {
-        assertFalse(PCEnhancer.checkEnhancementLevel(Country.class, log));
+        assertFalse(PCEnhancerSerp.checkEnhancementLevel(Country.class, log));
     }
     
     public void testDownLevel(){
-        assertTrue(PCEnhancer.checkEnhancementLevel(DummyPersistenceCapeable.class, log));
+        assertTrue(PCEnhancerSerp.checkEnhancementLevel(DummyPersistenceCapeable.class, log));
     }
     public void testContact() {
-        assertFalse(PCEnhancer.checkEnhancementLevel(null, log));
-        assertFalse(PCEnhancer.checkEnhancementLevel(Country.class, null));
+        assertFalse(PCEnhancerSerp.checkEnhancementLevel(null, log));
+        assertFalse(PCEnhancerSerp.checkEnhancementLevel(Country.class, null));
         try {
-            PCEnhancer.checkEnhancementLevel(Object.class, log);
+            PCEnhancerSerp.checkEnhancementLevel(Object.class, log);
             fail("Should have got an IllegalArgumentException exception from " +
             		"org.apache.openjpa.enhance.PCEnhancer.checkEnhancementLevel");
         } catch (java.lang.IllegalStateException ile) {

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerFindField.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerFindField.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerFindField.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/enhance/TestPCEnhancerFindField.java
Tue Sep 13 17:29:01 2016
@@ -40,7 +40,7 @@ public class TestPCEnhancerFindField
         Project proj = new Project();
         BCClass bc = proj.loadClass(getClass());
         BCMethod meth = bc.getMethods("myMethod")[0];
-        BCField field = PCEnhancer.getReturnedField(meth);
+        BCField field = PCEnhancerSerp.getReturnedField(meth);
         assertEquals("field", field.getName());
     }
 }

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/DummyPersistenceCapeable.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/DummyPersistenceCapeable.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/DummyPersistenceCapeable.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/DummyPersistenceCapeable.java
Tue Sep 13 17:29:01 2016
@@ -20,7 +20,7 @@ package org.apache.openjpa.persistence;
 
 import org.apache.openjpa.enhance.FieldConsumer;
 import org.apache.openjpa.enhance.FieldSupplier;
-import org.apache.openjpa.enhance.PCEnhancer;
+import org.apache.openjpa.enhance.PCEnhancerSerp;
 import org.apache.openjpa.enhance.PCRegistry;
 import org.apache.openjpa.enhance.PersistenceCapable;
 import org.apache.openjpa.enhance.StateManager;
@@ -47,7 +47,7 @@ public class DummyPersistenceCapeable im
     }
 
     public int pcGetEnhancementContractVersion() {
-        return PCEnhancer.ENHANCER_VERSION - 1;
+        return PCEnhancerSerp.ENHANCER_VERSION - 1;
     }
 
     public PersistenceCapable pcNewInstance(StateManager sm, boolean clear) {

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/TestNoNoArgs.java
Tue Sep 13 17:29:01 2016
@@ -20,9 +20,10 @@ package org.apache.openjpa.persistence.e
 
 import java.io.IOException;
 
+import org.apache.openjpa.enhance.PCEnhancer;
 import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
-import org.apache.openjpa.enhance.PCEnhancer;
+import org.apache.openjpa.enhance.PCEnhancerSerp;
 import org.apache.openjpa.meta.MetaDataRepository;
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
@@ -51,7 +52,7 @@ public class TestNoNoArgs
 
     public void testNoNoArgs()
         throws IOException {
-        PCEnhancer.run((OpenJPAConfiguration) conf,
+        PCEnhancerSerp.run((OpenJPAConfiguration) conf,
             new String[]{ },
             flags, repos, null, loader);
     }
@@ -61,7 +62,7 @@ public class TestNoNoArgs
         flags.addDefaultConstructor = false;
         boolean caughtException = false;
         try {
-            PCEnhancer.run((OpenJPAConfiguration) conf, new String[]{ },
+            PCEnhancerSerp.run((OpenJPAConfiguration) conf, new String[]{ },
                 flags, repos, null, loader);
         } catch (OpenJPAException e) {
             caughtException = true;
@@ -71,7 +72,7 @@ public class TestNoNoArgs
 
     public void testNo3NoArgs()
         throws IOException {
-        PCEnhancer.run((OpenJPAConfiguration) conf,
+        PCEnhancerSerp.run((OpenJPAConfiguration) conf,
             new String[]{ "persistence.enhance.common.apps.Entity1" },
             flags, repos, null, loader);
     }

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestDetachedStateManager.java
Tue Sep 13 17:29:01 2016
@@ -25,7 +25,8 @@ import java.util.Properties;
 import java.util.TreeMap;
 
 
-
+import org.apache.openjpa.enhance.PCEnhancer;
+import org.apache.openjpa.lib.conf.Configurations;
 import org.apache.openjpa.persistence.kernel.common.apps.AttachA;
 import org.apache.openjpa.persistence.kernel.common.apps.AttachB;
 import org.apache.openjpa.persistence.kernel.common.apps.AttachD;
@@ -34,7 +35,6 @@ import org.apache.openjpa.persistence.ke
 
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
-import org.apache.openjpa.enhance.PCEnhancer;
 import org.apache.openjpa.enhance.PersistenceCapable;
 import org.apache.openjpa.kernel.DetachedStateManager;
 import org.apache.openjpa.lib.util.Options;
@@ -491,9 +491,9 @@ public class TestDetachedStateManager ex
             .getIntField());
         assertEquals(new Integer(100), pc.getStringIntMap().get("b"));
 
-        pm = (OpenJPAEntityManager) factory.createEntityManager();
+        pm = factory.createEntityManager();
         startTx(pm);
-        pc = (DetachSMPC) pm.merge(pc);
+        pc = pm.merge(pc);
         assertEquals(3, pc.getIntField());
         assertSize(1, pc.getRelSet());
         assertEquals(4, ((DetachSMPC) pc.getRelSet().iterator().next())
@@ -503,8 +503,8 @@ public class TestDetachedStateManager ex
         endTx(pm);
         endEm(pm);
 
-        pm = (OpenJPAEntityManager) factory.createEntityManager();
-        pc = (DetachSMPC) pm.find(DetachSMPC.class, pcoid);
+        pm = factory.createEntityManager();
+        pc = pm.find(DetachSMPC.class, pcoid);
         assertEquals(3, pc.getIntField());
         assertSize(1, pc.getRelSet());
         assertEquals(4, ((DetachSMPC) pc.getRelSet().iterator().next())
@@ -528,9 +528,10 @@ public class TestDetachedStateManager ex
 
         Options opts = new Options();
         opts.put("jdo", "true");
-        PCEnhancer.run(conf, new String[]{
-            "org.apache.openjpa.persistence.kernel.noenhance.DetachSMPC" },
-            opts);
+        Configurations.populateConfiguration(conf, opts);
+
+        conf.getPCEnhancerInstance().enhanceFiles(new String[]{"org.apache.openjpa.persistence.kernel.noenhance.DetachSMPC"
},
+                       new PCEnhancer.Flags(), null);
     }
 
     private void assertDetachedSM(Object obj) {

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
Tue Sep 13 17:29:01 2016
@@ -1665,8 +1665,9 @@ public class EntityManagerImpl
             try {
                 return Class.forName(className);
             } catch (ClassNotFoundException e) {
-                if (PCEnhancer.isPCSubclassName(className)) {
-                    String superName = PCEnhancer.toManagedTypeName(className);
+                PCEnhancer pcEnhancer = conf.getPCEnhancerInstance();
+                if (pcEnhancer.isPCSubclassName(className)) {
+                    String superName = pcEnhancer.toManagedTypeName(className);
                     ClassMetaData[] metas = conf.getMetaDataRepositoryInstance()
                         .getMetaDatas();
                     for (int i = 0; i < metas.length; i++) {

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/QueryDefinitionImpl.java
Tue Sep 13 17:29:01 2016
@@ -48,7 +48,7 @@ public class QueryDefinitionImpl extends
 	private Predicate _where;
 	private Predicate _having;
 	
-	private static enum Visit {PROJECTION, EXPRESSION, JOINABLE};
+	private enum Visit {PROJECTION, EXPRESSION, JOINABLE}
 	
 	protected static Localizer _loc = 
 		Localizer.forPackage(QueryDefinitionImpl.class);

Modified: openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/ReservedWords.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/ReservedWords.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/ReservedWords.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/util/ReservedWords.java
Tue Sep 13 17:29:01 2016
@@ -56,7 +56,7 @@ public class ReservedWords {
             "UNKNOWN[50]", "UPDATE", "UPPER", 
             "VALUE", 
             "WHEN", "WHERE"));
-    };
+    }
     
     /**
      * Affirms if the given string matches any of the JPA reserved words in a case-insensitive
manner.

Modified: openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/jpa_tutorials.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/jpa_tutorials.xml?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/jpa_tutorials.xml (original)
+++ openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/jpa_tutorials.xml Tue Sep 13
17:29:01 2016
@@ -187,10 +187,10 @@ files listed above.
                         <para>
                         <indexterm>
                             <primary>
-                                org.apache.openjpa.enhance.PCEnhancer
+                                org.apache.openjpa.enhance.PCEnhancerSerp
                             </primary>
                         </indexterm>
-<command>org.apache.openjpa.enhance.PCEnhancer</command>:
+<command>org.apache.openjpa.enhance.PCEnhancerSerp</command>:
 Runs the OpenJPA enhancer against the specified
 classes. More information is available in <xref linkend="ref_guide_pc_enhance"/>
  of the Reference Guide.
@@ -390,7 +390,7 @@ You can use any Java compiler instead of
 Enhance the persistent classes. (Optional)
                     </para>
 <programlisting>
-java org.apache.openjpa.enhance.PCEnhancer Animal.java Dog.java
+    java org.apache.openjpa.enhance.PCEnhancerSerp Animal.java Dog.java
 </programlisting>
                     <para>
 This step runs the OpenJPA enhancer on the <filename>Animal.java</filename> and
@@ -822,7 +822,7 @@ javac Rabbit.java
 Enhance the <classname>Rabbit</classname> class. (Optional)
                     </para>
 <programlisting>
-java org.apache.openjpa.enhance.PCEnhancer Rabbit.java
+    java org.apache.openjpa.enhance.PCEnhancerSerp Rabbit.java
 </programlisting>
                 </listitem>
                 <listitem>
@@ -910,7 +910,7 @@ javac Snake.java
 Enhance the class. (Optional)
                     </para>
 <programlisting>
-java org.apache.openjpa.enhance.PCEnhancer Snake.java
+    java org.apache.openjpa.enhance.PCEnhancerSerp Snake.java
 </programlisting>
                 </listitem>
                 <listitem>
@@ -1121,8 +1121,8 @@ Compile <filename>Snake.java</filename>
 optionally enhance the classes.
                     </para>
 <programlisting>
-javac Snake.java Rabbit.java
-java org.apache.openjpa.enhance.PCEnhancer Snake.java Rabbit.java
+    javac Snake.java Rabbit.java
+    java org.apache.openjpa.enhance.PCEnhancerSerp Snake.java Rabbit.java
 </programlisting>
                 </listitem>
                 <listitem>
@@ -1323,7 +1323,7 @@ javac *.java  ejb/*.java jsp/*.java
 Enhance the Car class. (Optional)
                 </para>
 <programlisting>
-java org.apache.openjpa.enhance.PCEnhancer Car.java
+    java org.apache.openjpa.enhance.PCEnhancerSerp Car.java
 </programlisting>
                 <para>
 Run the mapping tool; make sure that your <filename> META-INF/persistence.xml

Modified: openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_integration.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_integration.xml?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_integration.xml (original)
+++ openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_integration.xml Tue
Sep 13 17:29:01 2016
@@ -228,7 +228,7 @@ The enhancer task allows you to invoke t
 the Ant build process. The task's parameters correspond exactly to the long
 versions of the command-line arguments to the 
 <link linkend="ref_guide_pc_enhance"><classname>
-org.apache.openjpa.enhance.PCEnhancer</classname></link>.
+    org.apache.openjpa.enhance.PCEnhancerSerp</classname></link>.
             </para>
             <para>
 The enhancer task accepts a nested <literal>fileset</literal> tag to specify
the

Modified: openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_pc.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_pc.xml (original)
+++ openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/ref_guide_pc.xml Tue Sep 13
17:29:01 2016
@@ -163,7 +163,7 @@ are loaded into the JVM. The following s
             <para>
 The enhancer can be invoked at build time 
 via its Java class, <classname>
-org.apache.openjpa.enhance.PCEnhancer</classname>.
+                org.apache.openjpa.enhance.PCEnhancerSerp</classname>.
             </para>
             <note>
                 <para>
@@ -176,7 +176,7 @@ You can also enhance via Ant; see
                     Using the OpenJPA Enhancer
                 </title>
 <programlisting>
-java org.apache.openjpa.enhance.PCEnhancer Magazine.java
+    java org.apache.openjpa.enhance.PCEnhancerSerp Magazine.java
 </programlisting>
             </example>
             <para>

Modified: openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/samples_guide.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/samples_guide.xml?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/samples_guide.xml (original)
+++ openjpa/branches/fb-3.0-asm/openjpa-project/src/doc/manual/samples_guide.xml Tue Sep 13
17:29:01 2016
@@ -105,8 +105,8 @@ You should then proceed to pass in the c
 enhancer: (Optional)
                 </para>
                 <para>
-<userinput>java org.apache.openjpa.enhance.PCEnhancer -p persistence.xml Machine.java
Crane.java Bulldozer.java
-Operator.java</userinput>
+<userinput>java org.apache.openjpa.enhance.PCEnhancerSerp -p persistence.xml Machine.java
Crane.java Bulldozer.java
+    Operator.java</userinput>
                 </para>
             </listitem>
             <listitem>

Modified: openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java
Tue Sep 13 17:29:01 2016
@@ -22,7 +22,7 @@ import java.util.Locale;
 
 import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
-import org.apache.openjpa.enhance.PCEnhancer.AuxiliaryEnhancer;
+import org.apache.openjpa.enhance.PCEnhancerSerp.AuxiliarySerpEnhancer;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.meta.AccessCode;
 import org.apache.openjpa.meta.ClassMetaData;
@@ -36,7 +36,7 @@ import serp.bytecode.Code;
  * FetchStatisticsAuxEnhancer adds the call back function to each persistent fields in the
persistent entity which 
  * will invoke the hit method from FetchStatsCollector whenever the field is fetched at runtime.
  */
-public class FetchStatisticsAuxEnhancer implements AuxiliaryEnhancer {
+public class FetchStatisticsAuxEnhancer implements AuxiliarySerpEnhancer {
 
     private final String IGNORE_METHODS_REGEX = "(pc(.)*GenericContext)?(pc(.)*StateManager)?"
         + "(pc(.)*DetachedState)?(pc(.)*EnhancementContractVersion)?(pc(.)*ManagedFieldCount)?(pc(.)*GetVersion)?";

Modified: openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java
URL: http://svn.apache.org/viewvc/openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java?rev=1760580&r1=1760579&r2=1760580&view=diff
==============================================================================
--- openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java
(original)
+++ openjpa/branches/fb-3.0-asm/openjpa-tools/openjpa-maven-plugin/src/main/java/org/apache/openjpa/tools/maven/AbstractOpenJpaEnhancerMojo.java
Tue Sep 13 17:29:01 2016
@@ -22,9 +22,9 @@ package org.apache.openjpa.tools.maven;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.openjpa.enhance.PCEnhancer;
 import org.codehaus.plexus.util.FileUtils;
 
-import org.apache.openjpa.enhance.PCEnhancer;
 import org.apache.openjpa.lib.util.Options;
 
 import java.io.File;
@@ -128,7 +128,7 @@ public abstract class AbstractOpenJpaEnh
             extendRealmClasspath();
         }
 
-        ok = PCEnhancer.run(args, opts);
+        ok = PCEnhancer.run(args, opts, null);
 
         if (!ok) {
             throw new MojoExecutionException("The OpenJPA Enhancer tool detected an error!");




Mime
View raw message