You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/01/23 16:52:50 UTC

svn commit: r902429 - /maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckThreadSafetyMojo.java

Author: bentmann
Date: Sat Jan 23 15:52:50 2010
New Revision: 902429

URL: http://svn.apache.org/viewvc?rev=902429&view=rev
Log:
o Refactored code

Modified:
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckThreadSafetyMojo.java

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckThreadSafetyMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckThreadSafetyMojo.java?rev=902429&r1=902428&r2=902429&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckThreadSafetyMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-active-collection/src/main/java/org/apache/maven/plugin/coreit/CheckThreadSafetyMojo.java Sat Jan 23 15:52:50 2010
@@ -86,6 +86,9 @@
 
         getLog().info( "[MAVEN-CORE-IT-LOG] Testing concurrent component access" );
 
+        ClassLoader pluginRealm = getClass().getClassLoader();
+        ClassLoader coreRealm = MojoExecutionException.class.getClassLoader();
+
         final Map map = componentMap;
         final List list = componentList;
         final List go = new Vector();
@@ -95,8 +98,7 @@
         for ( int i = 0; i < threads.length; i++ )
         {
             // NOTE: The threads need to use different realms to trigger changes of the collections
-            final ClassLoader cl =
-                ( i % 2 ) == 0 ? getClass().getClassLoader() : MojoExecutionException.class.getClassLoader();
+            final ClassLoader cl = ( i % 2 ) == 0 ? pluginRealm : coreRealm;
             threads[i] = new Thread()
             {
                 private final ClassLoader tccl = cl;