You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2009/06/10 16:45:32 UTC

svn commit: r783376 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java

Author: mikedd
Date: Wed Jun 10 14:45:32 2009
New Revision: 783376

URL: http://svn.apache.org/viewvc?rev=783376&view=rev
Log:
OPENJPA-1125 committing patch from Rick Curtis. Preventing misleading enhancement message. 

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java?rev=783376&r1=783375&r2=783376&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java Wed Jun 10 14:45:32 2009
@@ -96,16 +96,17 @@
                 InstrumentationFactory.getInstrumentation(log);
             if (inst != null) {
                 premain("", inst);
-            } else {
-                // This needs to be set in this method AND in premain because
-                // there are two different paths that we can attempt to load the
-                // agent. One is when the user specifies a javaagent and the
-                // other is when we try to dynamically enhance.
-                loadAttempted = true;
-            }
+                return true;
+            } 
+            // If we successfully get the Instrumentation, we will call premain
+            // where loadAttempted will be set to true. This case is the path 
+            // where we were unable to get Instrumentation so we need to set the
+            // loadAttempted flag to true. We do this so we will only run
+            // through this code one time.
+            loadAttempted = true;
         }
 
-        return getLoadSuccessful();
+        return false;
     }
 
     public static void premain(String args, Instrumentation inst) {