Jiri Danek created ARTEMIS-1411:
-----------------------------------

             Summary: 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


 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   }



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

Reply via email to