openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwsut...@apache.org
Subject svn commit: r1033480 - in /openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/enhance/PCClassFileTransformer.java resources/org/apache/openjpa/enhance/localizer.properties
Date Wed, 10 Nov 2010 14:13:11 GMT
Author: kwsutter
Date: Wed Nov 10 14:13:10 2010
New Revision: 1033480

URL: http://svn.apache.org/viewvc?rev=1033480&view=rev
Log:
OPENJPA-1881.  Creating a new "completion" trace message for the enhancement processing.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java
    openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java?rev=1033480&r1=1033479&r2=1033480&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java
Wed Nov 10 14:13:10 2010
@@ -113,14 +113,14 @@ public class PCClassFileTransformer
         if (className == null) {
             return null;
         }
-        // prevent re-entrant calls, which can occur if the enhanceing
+        // prevent re-entrant calls, which can occur if the enhancing
         // loader is used to also load OpenJPA libraries; this is to prevent 
         // recursive enhancement attempts for internal openjpa libraries
         if (_transforming)
             return null;
 
         _transforming = true;
-
+        
         return transform0(className, redef, bytes);
     }
 
@@ -131,7 +131,8 @@ public class PCClassFileTransformer
      */
     private byte[] transform0(String className, Class redef, byte[] bytes)
         throws IllegalClassFormatException {
-
+        
+        byte[] returnBytes = null;
         try {
             Boolean enhance = needsEnhance(className, redef, bytes);
             if (enhance != null && _log.isTraceEnabled())
@@ -149,7 +150,8 @@ public class PCClassFileTransformer
 
             if (enhancer.run() == PCEnhancer.ENHANCE_NONE)
                 return null;
-            return enhancer.getPCBytecode().toByteArray();
+            returnBytes = enhancer.getPCBytecode().toByteArray();
+            return returnBytes;
         } catch (Throwable t) {
             _log.warn(_loc.get("cft-exception-thrown", className), t);
             if (t instanceof RuntimeException)
@@ -159,6 +161,9 @@ public class PCClassFileTransformer
             throw new GeneralException(t);
         } finally {
             _transforming = false;
+            if (returnBytes != null && _log.isTraceEnabled())
+                _log.trace(_loc.get("runtime-enhance-complete", className,
+                    bytes.length, returnBytes.length));
         }
     }
 

Modified: openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties?rev=1033480&r1=1033479&r2=1033480&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties
Wed Nov 10 14:13:10 2010
@@ -25,6 +25,7 @@ bad-field: Missing field for property "{
 reflect-security: Unable to access "{0}" via reflection.  Make sure OpenJPA \
     has the "suppressAccessChecks" permission.
 needs-runtime-enhance: "{0}" requires runtime enhancement: {1}
+runtime-enhance-complete: Enhancement for "{0}" completed. Class size: [{1}/{2}]
 runtime-enhance-pcclasses: You have enabled runtime enhancement, but have not \
 	specified the set of persistent classes.  OpenJPA must look for metadata \
     for every loaded class, which might increase class load times significantly.



Mime
View raw message