Error in SonarLint for IntelliJ: java.util.ConcurrentModificationException

Environment:

  • Java: JetBrains s.r.o. 17.0.8
  • OS: Mac OS X x86_64
  • IDE: PhpStorm 2023.2.2
  • SonarLint: 9.1.0.75538
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1631)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.filter(IssueTreeModelBuilder.java:203)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.setFileIssues(IssueTreeModelBuilder.java:143)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.updateModel(IssueTreeModelBuilder.java:114)
	at o.sl.ij.ui.CurrentFilePanel.populateSubTree(CurrentFilePanel.java:166)
	at o.sl.ij.ui.CurrentFilePanel.update(CurrentFilePanel.java:157)
	at o.sl.ij.actions.SonarLintToolWindow.lambda$updateCurrentFileTab$6(SonarLintToolWindow.java:259)
	at o.sl.ij.actions.SonarLintToolWindow.updateTab(SonarLintToolWindow.java:139)
	at o.sl.ij.actions.SonarLintToolWindow.updateCurrentFileTab(SonarLintToolWindow.java:259)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateCurrentFileTab(OnTheFlyFindingsHolder.kt:94)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateViewsWithNewFindings$lambda$1$lambda$0(OnTheFlyFindingsHolder.kt:62)
1 Like

Environment:

  • Java: JetBrains s.r.o. 17.0.8
  • OS: Windows 11 amd64
  • IDE: IntelliJ IDEA 2023.2.2
  • SonarLint: 9.1.0.75538
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1631)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.filter(IssueTreeModelBuilder.java:203)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.setFileIssues(IssueTreeModelBuilder.java:143)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.updateModel(IssueTreeModelBuilder.java:114)
	at o.sl.ij.ui.CurrentFilePanel.populateSubTree(CurrentFilePanel.java:166)
	at o.sl.ij.ui.CurrentFilePanel.update(CurrentFilePanel.java:157)
	at o.sl.ij.actions.SonarLintToolWindow.lambda$updateCurrentFileTab$6(SonarLintToolWindow.java:259)
	at o.sl.ij.actions.SonarLintToolWindow.updateTab(SonarLintToolWindow.java:139)
	at o.sl.ij.actions.SonarLintToolWindow.updateCurrentFileTab(SonarLintToolWindow.java:259)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateCurrentFileTab(OnTheFlyFindingsHolder.kt:94)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateViewsWithNewFindings$lambda$1$lambda$0(OnTheFlyFindingsHolder.kt:62)

Hi all,

Welcome to the community and thanks for these reports!

I’ve combined them because they seem remarkably similar to me. Could you share the conditions under which you get this error?

 
Thx,
Ann

1 Like

Hi Ann, thanks for responding.

In my case, I’ve noticed that the issue arises only when I delete a line while refactoring the code. Also, it feels a little bit like the SonarLint is interfering with GitHub Copilot… But I’m not sure enough.

1 Like

Hi all,
I have no idea in which context this occurred.
Maybe just after a SonarLint plug-in update (along with Copilot?) in PhpStorm.
I am also using GitHub Copilot that was in version 1.3.0.
Let you know if I can reproduce it.
Nicolas

1 Like

Thank you both for the information,

@algophren you mentioned that the issue arises only when you delete a line while refactoring.
Do you have a simple code example that this occurs?

I just reproduced it without doing something special.
I was looking to the MR report in sonaqube, and then suppressing a function parameter in the function definition and in its call in the same PHP file, in PHPStorm.
And the error appears in the seconds.

1 Like

Hello,

I have created this ticket for the issue

Environment:

  • Java: JetBrains s.r.o. 17.0.8
  • OS: Windows 11 amd64
  • IDE: PhpStorm 2023.2.2
  • SonarLint: 9.1.0.75538
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1631)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.filter(IssueTreeModelBuilder.java:203)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.setFileIssues(IssueTreeModelBuilder.java:143)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.updateModel(IssueTreeModelBuilder.java:114)
	at o.sl.ij.ui.CurrentFilePanel.populateSubTree(CurrentFilePanel.java:166)
	at o.sl.ij.ui.CurrentFilePanel.update(CurrentFilePanel.java:157)
	at o.sl.ij.actions.SonarLintToolWindow.lambda$updateCurrentFileTab$6(SonarLintToolWindow.java:259)
	at o.sl.ij.actions.SonarLintToolWindow.updateTab(SonarLintToolWindow.java:139)
	at o.sl.ij.actions.SonarLintToolWindow.updateCurrentFileTab(SonarLintToolWindow.java:259)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateCurrentFileTab(OnTheFlyFindingsHolder.kt:94)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateViewsWithNewFindings$lambda$1$lambda$0(OnTheFlyFindingsHolder.kt:62)

Environment:

  • Java: JetBrains s.r.o. 17.0.8.1
  • OS: Windows 11 amd64
  • IDE: IntelliJ IDEA 2023.2.3
  • SonarLint: 9.1.0.75538
java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1631)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.filter(IssueTreeModelBuilder.java:203)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.setFileIssues(IssueTreeModelBuilder.java:143)
	at o.sl.ij.ui.tree.IssueTreeModelBuilder.updateModel(IssueTreeModelBuilder.java:114)
	at o.sl.ij.ui.CurrentFilePanel.populateSubTree(CurrentFilePanel.java:166)
	at o.sl.ij.ui.CurrentFilePanel.update(CurrentFilePanel.java:157)
	at o.sl.ij.actions.SonarLintToolWindow.lambda$updateCurrentFileTab$6(SonarLintToolWindow.java:259)
	at o.sl.ij.actions.SonarLintToolWindow.updateTab(SonarLintToolWindow.java:139)
	at o.sl.ij.actions.SonarLintToolWindow.updateCurrentFileTab(SonarLintToolWindow.java:259)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateCurrentFileTab(OnTheFlyFindingsHolder.kt:94)
	at o.sl.ij.analysis.OnTheFlyFindingsHolder.updateViewsWithNewFindings$lambda$1$lambda$0(OnTheFlyFindingsHolder.kt:62)

Hi, to give an update, we identified the issue, and the fix will be part of the next 10.0 release happening later this month, on the 31st of October.

Thank you for your reports! :sonarlint:

1 Like