aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1707745 - /aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/weaving/impl/JPAWeavingHook.java
Date Fri, 09 Oct 2015 14:56:00 GMT
Author: cschneider
Date: Fri Oct  9 14:55:59 2015
New Revision: 1707745

URL: http://svn.apache.org/viewvc?rev=1707745&view=rev
Log:
Improved error reporting

Modified:
    aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/weaving/impl/JPAWeavingHook.java

Modified: aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/weaving/impl/JPAWeavingHook.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/weaving/impl/JPAWeavingHook.java?rev=1707745&r1=1707744&r2=1707745&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/weaving/impl/JPAWeavingHook.java
(original)
+++ aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/weaving/impl/JPAWeavingHook.java
Fri Oct  9 14:55:59 2015
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
 
+import javax.persistence.Entity;
 import javax.persistence.spi.ClassTransformer;
 
 import org.osgi.framework.Bundle;
@@ -59,19 +60,16 @@ public class JPAWeavingHook implements W
         Bundle bundle = wiring.getBundle();
         ClassLoader cl = wiring.getClassLoader();
         Collection<ClassTransformer> transformersToTry = getTransformers(bundle);
-        if (transformersToTry.size() == 0 && wovenClass.getClassName().endsWith("Car"))
{
-            LOGGER.error("Loading " + wovenClass.getClassName() + " before transformer is
present");
-            //for (StackTraceElement el : Thread.currentThread().getStackTrace()) {
-//                LOGGER.info(el.toString());
-//            }
-        }
         for (ClassTransformer transformer : transformersToTry) {
-
             if (transformClass(wovenClass, cl, transformer)) {
                 LOGGER.info("Weaving " + wovenClass.getClassName() + " using " + transformer.getClass().getName());
                 break;
             };
         }
+        Class<?> dClass = wovenClass.getDefinedClass();
+        if (transformersToTry.size() == 0 && dClass != null && dClass.getAnnotation(Entity.class)
!= null) {
+            LOGGER.warn("Loading " + wovenClass.getClassName() + " before transformer is
present");
+        }
     }
 
     @SuppressWarnings("unchecked")



Mime
View raw message