[
https://issues.apache.org/jira/browse/TINKERPOP-2858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dylan Werner-Meier updated TINKERPOP-2858:
------------------------------------------
Description:
I encountered a "ConcurrentModificationException" during a particularly
difficult Gremlin query, on this specific line of code:
{code:java}
currentStep.getLabels().forEach(currentStep::removeLabel);
{code}
(
[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".
was:
I encountered a `ConcurrentModificationException` during a particularly
difficult Gremlin query, on this specific line of code:
{code:java}
currentStep.getLabels().forEach(currentStep::removeLabel);
{code}
(
[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".
> 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
> Priority: Minor
>
> I encountered a "ConcurrentModificationException" during a particularly
> difficult Gremlin query, on this specific line of code:
> {code:java}
> currentStep.getLabels().forEach(currentStep::removeLabel);
> {code}
> (
> [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)