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/03/30 12:31:09 UTC

[GitHub] [netbeans] entlicher opened a new pull request #2842: NETBEANS-5511: Remove items via the iterator.

entlicher opened a new pull request #2842:
URL: https://github.com/apache/netbeans/pull/2842


   Explicit removal of items during iteration is causing `ConcurrentModificationException`.
   We use `Iterator.remove()` 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.

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


[GitHub] [netbeans] entlicher commented on a change in pull request #2842: [NETBEANS-5511] Remove items via the iterator.

Posted by GitBox <gi...@apache.org>.
entlicher commented on a change in pull request #2842:
URL: https://github.com/apache/netbeans/pull/2842#discussion_r604068255



##########
File path: platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/FeatureUpdateElementImpl.java
##########
@@ -496,7 +496,7 @@ private void initializeAgent() {
                     }
                     Module m = Utilities.toModule(cnb, null);
                     if (m != null && ! m.getProblems().isEmpty()) {
-                        dependenciesToModulesOrFeatures.remove(depSpec);
+                        it.remove();

Review comment:
       You're right, we need to break here. Calling remove for the second time would throw `IllegalStateException`.




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

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


[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #2842: [NETBEANS-5511] Remove items via the iterator.

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on a change in pull request #2842:
URL: https://github.com/apache/netbeans/pull/2842#discussion_r604061809



##########
File path: platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/FeatureUpdateElementImpl.java
##########
@@ -496,7 +496,7 @@ private void initializeAgent() {
                     }
                     Module m = Utilities.toModule(cnb, null);
                     if (m != null && ! m.getProblems().isEmpty()) {
-                        dependenciesToModulesOrFeatures.remove(depSpec);
+                        it.remove();

Review comment:
       I ran against the same wall yesterday and came to the same conclusion. As this is a double nested loop, I think it would be good to either terminate the inner loop with a break or the continue the outer loop with a label. Else we could hit the remove a second time and enter undefined territory.




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

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


[GitHub] [netbeans] entlicher merged pull request #2842: [NETBEANS-5511] Remove items via the iterator.

Posted by GitBox <gi...@apache.org>.
entlicher merged pull request #2842:
URL: https://github.com/apache/netbeans/pull/2842


   


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

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


[GitHub] [netbeans] entlicher commented on a change in pull request #2842: [NETBEANS-5511] Remove items via the iterator.

Posted by GitBox <gi...@apache.org>.
entlicher commented on a change in pull request #2842:
URL: https://github.com/apache/netbeans/pull/2842#discussion_r604082897



##########
File path: platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/FeatureUpdateElementImpl.java
##########
@@ -496,7 +496,7 @@ private void initializeAgent() {
                     }
                     Module m = Utilities.toModule(cnb, null);
                     if (m != null && ! m.getProblems().isEmpty()) {
-                        dependenciesToModulesOrFeatures.remove(depSpec);
+                        it.remove();

Review comment:
       break added.




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

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