You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/09/13 06:52:00 UTC

[GitHub] [netbeans] sdedic commented on a change in pull request #3163: Return a copy instead of cached array

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



##########
File path: ide/api.java.classpath/src/org/netbeans/api/java/classpath/ClassPath.java
##########
@@ -241,7 +241,7 @@ public ClassPathImplementation getClassPathImpl(ClassPath cp) {
         long current;
         synchronized (this) {
             if (rootsCache != null) {
-                return this.rootsCache;
+                return Arrays.copyOf(rootsCache, rootsCache.length);

Review comment:
       Good point; recommitted as 3fc65de. Thanks.




-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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