sdedic commented on a change in pull request #3213:
URL: https://github.com/apache/netbeans/pull/3213#discussion_r722989478



##########
File path: 
java/java.source.base/src/org/netbeans/modules/java/source/classpath/CacheClassPath.java
##########
@@ -81,6 +81,39 @@ private CacheClassPath (ClassPath cp, boolean translate, 
boolean scan) {
         }
     }
 
+    @Override
+    public int hashCode() {
+        int hash = 7;
+        hash = 53 * hash + Objects.hashCode(this.cp);
+        hash = 53 * hash + (this.translate ? 1 : 0);
+        hash = 53 * hash + (this.scan ? 1 : 0);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object obj) {

Review comment:
       The classpath is (sort of) used as an identity in various places. Source 
/ compile / annotation processor classpaths are stateful things that you can 
get for a file, and they are either equals() or the same instance. But the 
cache classpath is created for each ClasspathInfo although it represents the 
same cache over the same compile path. I could make the key from 
"classpath/compile" classpath, but decided to fix the inconsistency in 
CacheClassPath instead.
   
   Will isolate into a separate commit.




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to