cstamas commented on code in PR #1902:
URL: https://github.com/apache/maven-resolver/pull/1902#discussion_r3373190948
##########
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:
The `hashCode()` is not concurrency safe here, so I'd make this `final`
instead and modify `hashCode()` to just return the `final int hashCode` instead.
##########
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:
The `hashCode()` is not concurrency safe here, so I'd make this `final`
instead and modify `hashCode()` to just return the `final int hashCode` instead.
--
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]