Dylan Werner-Meier created TINKERPOP-2858:
---------------------------------------------

             Summary: ConcurrentModificationException in ConnectiveStrategy
                 Key: TINKERPOP-2858
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2858
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.4.6
            Reporter: Dylan Werner-Meier


I encountered a `ConcurrentModificationException` during a particularly 
difficult Gremlin query, on this specific line of code:

```

                    currentStep.getLabels().forEach(currentStep::removeLabel);

```

( 
[ConnectiveStrategy.java:98|https://github.com/apache/tinkerpop/blob/3.6-dev/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ConnectiveStrategy.java#L98]
 )

 

`currentStep.getLabels()` is a `LinkedHashSet`, and it doesn't support 
concurrent iteration and modification.

 

Proposed fix: add a `clearLabels()` method to `AbstractStep`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to