cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r572130 - /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/instrument/UnitClassTransformer.java
Date Sun, 02 Sep 2007 19:48:12 GMT
Author: aadamchik
Date: Sun Sep  2 12:48:12 2007
New Revision: 572130

URL: http://svn.apache.org/viewvc?rev=572130&view=rev
Log:
adding error diagnostics to transformer

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/instrument/UnitClassTransformer.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/instrument/UnitClassTransformer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/instrument/UnitClassTransformer.java?rev=572130&r1=572129&r2=572130&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/instrument/UnitClassTransformer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/instrument/UnitClassTransformer.java
Sun Sep  2 12:48:12 2007
@@ -25,6 +25,7 @@
 
 import javax.persistence.spi.ClassTransformer;
 
+import org.apache.cayenne.jpa.JpaProviderException;
 import org.apache.cayenne.jpa.map.JpaClassDescriptor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -63,14 +64,25 @@
         }
 
         if (isManagedClass(className)) {
-            logger.warn("Will transform: " + className);
 
-            return transformer.transform(
-                    loader,
-                    className,
-                    classBeingRedefined,
-                    protectionDomain,
-                    classfileBuffer);
+            logger.info("Will transform managed class: " + className);
+
+            try {
+                return transformer.transform(
+                        loader,
+                        className,
+                        classBeingRedefined,
+                        protectionDomain,
+                        classfileBuffer);
+            }
+            catch (IllegalClassFormatException e) {
+                logger.warn("Error transforming class " + className, e);
+                throw e;
+            }
+            catch (Throwable th) {
+                logger.warn("Error transforming class " + className, th);
+                throw new JpaProviderException("Error transforming class " + className, th);
+            }
         }
         else {
             return null;



Mime
View raw message