You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Jiri Danek (JIRA)" <ji...@apache.org> on 2017/09/13 08:36:00 UTC

[jira] [Closed] (ARTEMIS-1411) Coverity: Using invalid iterator in ProcessBuilder.java

     [ https://issues.apache.org/jira/browse/ARTEMIS-1411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jiri Danek closed ARTEMIS-1411.
-------------------------------
    Resolution: Not A Bug

The documentation for ConcurrentHashMap states this explicitly. These concurrent collections never throw ConcurrentModificationException and can be modified concurrently. https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/package-summary.html#Weakly. False positive.

> Coverity: Using invalid iterator in ProcessBuilder.java
> -------------------------------------------------------
>
>                 Key: ARTEMIS-1411
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1411
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.4.0
>            Reporter: Jiri Danek
>            Priority: Minor
>
> {noformat}
>  48   public static void cleanupProcess() {
>    	1. enhanced_for: Starting an iteration on org.apache.activemq.artemis.cli.process.ProcessBuilder.processes.
>    	2. Iterating over another element of org.apache.activemq.artemis.cli.process.ProcessBuilder.processes.
>    	
> CID 1409570 (#1 of 1): Using invalid iterator (INVALIDATE_ITERATOR)
> 5. invalid_loop: Attempting to obtain another element from org.apache.activemq.artemis.cli.process.ProcessBuilder.processes after it's been modified.
>  49      for (Process p : processes) {
>  50         //         if (!p.isAlive())
>  51         {
>    	3. modify_iterable: Call to remove modifies Iterable org.apache.activemq.artemis.cli.process.ProcessBuilder.processes which invalidates the iterator for the loop on that Iterable. [Note: The source code implementation of the function has been overridden by a builtin model.]
>  52            processes.remove(p);
>  53         }
>    	4. Jumping back to the beginning of the loop.
>  54      }
>  55   }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)