maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r908650 - in /maven/maven-3/trunk: maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java
Date Wed, 10 Feb 2010 19:52:42 GMT
Author: krosenvold
Date: Wed Feb 10 19:52:07 2010
New Revision: 908650

URL: http://svn.apache.org/viewvc?rev=908650&view=rev
Log:
 Fixed safe publication issue in DefaultArtifact, re-changed CopyOnWriteArraySet to unmodifiableSet

Verified the existence of unsafe publication regarding file and resolved attributes in DefaultArtifact.


Revised earlier change to strengthen intended focus on immutability of HashSet 

Modified:
    maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java

Modified: maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java?rev=908650&r1=908649&r2=908650&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
(original)
+++ maven/maven-3/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
Wed Feb 10 19:52:07 2010
@@ -55,7 +55,7 @@
 
     private String scope;
 
-    private File file;
+    private volatile File file;
 
     private ArtifactRepository repository;
 
@@ -71,7 +71,7 @@
 
     private VersionRange versionRange;
 
-    private boolean resolved;
+    private volatile boolean resolved;
 
     private boolean release;
 

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java?rev=908650&r1=908649&r2=908650&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java
Wed Feb 10 19:52:07 2010
@@ -20,6 +20,7 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -50,7 +51,7 @@
 
     static
     {
-        List<String> artifacts = new ArrayList<String>();
+        Set<String> artifacts = new HashSet<String>();
 
         artifacts.add( "classworlds" );
         artifacts.add( "plexus-classworlds" );
@@ -87,7 +88,7 @@
          * wagon from their plugin realm.
          */
 
-        DEFAULT_EXCLUSIONS = new CopyOnWriteArraySet<String>( artifacts);
+        DEFAULT_EXCLUSIONS = Collections.unmodifiableSet( artifacts);
     }
 
     protected Set<String> excludedArtifacts = new HashSet<String>( DEFAULT_EXCLUSIONS
);



Mime
View raw message