openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1207647 - in /openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/enhance/PCEnhancer.java resources/org/apache/openjpa/enhance/localizer.properties
Date Mon, 28 Nov 2011 22:01:51 GMT
Author: curtisr7
Date: Mon Nov 28 22:01:50 2011
New Revision: 1207647

URL: http://svn.apache.org/viewvc?rev=1207647&view=rev
Log:
OPENJPA-2047: Make persistence-aware message less verbose. Patch contributed by Jacob Nowosatka.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.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/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=1207647&r1=1207646&r2=1207647&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Mon Nov 28 22:01:50 2011
@@ -566,9 +566,6 @@ public class PCEnhancer { 
                 runAuxiliaryEnhancers();
                 return ENHANCE_PC;
             }
-
-            if (_log.isWarnEnabled())
-                _log.warn(_loc.get("pers-aware", type, loader));
             return ENHANCE_AWARE;
         } catch (OpenJPAException ke) {
             throw ke;
@@ -4729,6 +4726,8 @@ public class PCEnhancer { 
         Project project = new Project();
         BCClass bc;
         PCEnhancer enhancer;
+        Collection persAwareClasses = new HashSet();
+        
         int status;
         for (Iterator itr = classes.iterator(); itr.hasNext();) {
             Object o = itr.next();
@@ -4752,13 +4751,16 @@ public class PCEnhancer { 
                 if (log.isTraceEnabled())
                     log.trace(_loc.get("enhance-interface"));
             } else if (status == ENHANCE_AWARE) {
-                if (log.isTraceEnabled())
-                    log.trace(_loc.get("enhance-aware"));
+                persAwareClasses.add(o);
                 enhancer.record();
-            } else
+            } else {
                 enhancer.record();
+            }
             project.clear();
         }
+        if(log.isInfoEnabled() && !persAwareClasses.isEmpty()){
+        	log.info(_loc.get("pers-aware-classes", persAwareClasses.size(), persAwareClasses));
+        }
         return true;
     }
 

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=1207647&r1=1207646&r2=1207647&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
Mon Nov 28 22:01:50 2011
@@ -56,12 +56,13 @@ enhance-and-subclass-no-redef-start: Cre
 redefine-types: Redefining {0} using Java 5 type redefinition.
 retransform-types: Redefining {0} using Java 6 type retransformation.
 pc-type: Type "{0}" loaded by {1} is already persistence capable; skipping.
-pers-aware: Type "{0}" loaded by {1} has no metadata; enhancing as persistence aware. \
-	If you intended for "{0}" to be persistence-capable, then this means that \
-	OpenJPA could not find any metadata for "{0}". This can happen if the \
-	directory containing your metadata is not in your CLASSPATH, or if your \
-	metadata files are not named properly. See the documentation on metadata \
-	placement for more information.
+pers-aware-classes: No metadata was found for {0} classes; they have been enhanced \
+	as persistence-aware. If you intended for any of these classes to be \
+	persistence-capable, then this means that OpenJPA could not find any metadata \
+	for those classes. This can happen if the directory containing your metadata \
+	is not in your CLASSPATH, or if your metadata files are not named properly. \
+	See the documentation on metadata placement for more information. \
+	Persistence-aware classes: {1}
 enhance-running: Enhancer running on type "{0}".
 enhance-aware: The class does not have metadata - enhanced as persistence-aware.
 enhance-norun: The class is already persistence capable - no enhancement \



Mime
View raw message