gnodet commented on code in PR #1902:
URL: https://github.com/apache/maven-resolver/pull/1902#discussion_r3419474581


##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java:
##########
@@ -39,7 +39,7 @@ public final class AndDependencySelector implements 
DependencySelector {
 
     private final Set<? extends DependencySelector> selectors;
 
-    private int hashCode;
+    private volatile int hashCode;

Review Comment:
   Done — made the field `final` and computed the hashCode eagerly in each 
constructor. `hashCode()` now just returns the precomputed value.



##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java:
##########
@@ -41,7 +41,7 @@ public final class ExclusionDependencySelector implements 
DependencySelector {
     // sorted and dupe-free array, faster to iterate than LinkedHashSet
     private final Exclusion[] exclusions;
 
-    private int hashCode;
+    private volatile int hashCode;

Review Comment:
   Done — made the field `final` and computed the hashCode eagerly in each 
constructor. `hashCode()` now just returns the precomputed value.



##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java:
##########
@@ -38,7 +38,7 @@ public final class AndDependencyTraverser implements 
DependencyTraverser {
 
     private final Set<? extends DependencyTraverser> traversers;
 
-    private int hashCode;
+    private volatile int hashCode;

Review Comment:
   Done — made the field `final` and computed the hashCode eagerly in each 
constructor. `hashCode()` now just returns the precomputed value.



##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java:
##########
@@ -33,7 +33,7 @@ public class ChainedVersionFilter implements VersionFilter {
 
     private final VersionFilter[] filters;
 
-    private int hashCode;
+    private volatile int hashCode;

Review Comment:
   Done — made the field `final` and computed the hashCode eagerly in each 
constructor. `hashCode()` now just returns the precomputed value.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to