Error in SonarLint 7.0.0 for IntelliJ

Environment:

  • Java: JetBrains s.r.o. 17.0.8
  • OS: Linux amd64
  • IDE: IntelliJ IDEA 2023.2.2
  • SonarLint: 7.0.0.52289
c.ij.oa.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action or Event Dispatch Thread (EDT) only (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details
Current thread: Thread[ApplicationImpl pooled thread 5,4,main] 91413420 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 1937567481
	at c.ij.oa.application.impl.ApplicationImpl.createThreadAccessException(ApplicationImpl.java:1083)
	at c.ij.oa.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1038)
	at c.ij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:132)
	at c.ij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:74)
	at c.ij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:240)
	at c.ij.oa.roots.impl.ProjectFileIndexImpl.isExcluded(ProjectFileIndexImpl.java:67)
	at o.sl.ij.analysis.LocalFileExclusions.checkProjectStructureExclusion(LocalFileExclusions.java:220)
	at o.sl.ij.analysis.LocalFileExclusions.lambda$defaultExclusionCheckers$7(LocalFileExclusions.java:211)
	at o.sl.ij.analysis.LocalFileExclusions.checkExclusionsFileByFile(LocalFileExclusions.java:187)
	at o.sl.ij.analysis.LocalFileExclusions.retainNonExcludedFilesByModules(LocalFileExclusions.java:162)
	at o.sl.ij.analysis.AnalysisTask.filterAndGetByModule(AnalysisTask.java:185)

Hi,

Welcome to the community!

The current version of SonarLint for IntelliJ is 9.0.0.75308. Can you upgrade and see if this is still replicable?

 
Thx,
Ann

I am using v9.0.0.75308 and can confirm that it is still applicable. I am testing with IntelliJ IDEA v2022.3 EAP.

1 Like

Hi @kedarjoshi,

Thanks for testing. Can you elaborate on the conditions under which you see this error, please?

 
Thx,
Ann

This happens after pressing Alt + Enter and then SonarLint: Show rule description ‘kotlin:S6516’ for the code -

object ReverseComparator : Comparator<Int>
{
	override fun compare(first: Int, second: Int): Int
	{
		return second - first
	}
}
1 Like

I am now seeing another instance of the same exception every time when SonarLint tool window is opened.

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details
Current thread: Thread[AWT-EventQueue-0,6,main] 1509514905 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:149)
	at com.intellij.util.concurrency.ThreadingAssertions.softAssertReadAccess(ThreadingAssertions.java:107)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1015)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerBase.getDocument(FileDocumentManagerBase.java:47)
	at com.intellij.openapi.editor.impl.RangeMarkerImpl.getDocument(RangeMarkerImpl.java:138)
	at com.intellij.openapi.editor.impl.RangeMarkerImpl.getDocument(RangeMarkerImpl.java:25)
	at org.sonarlint.intellij.ui.nodes.IssueNode.issueCoordinates(IssueNode.java:153)
	at org.sonarlint.intellij.ui.nodes.IssueNode.render(IssueNode.java:94)
	at org.sonarlint.intellij.ui.tree.TreeCellRenderer.customizeCellRenderer(TreeCellRenderer.java:37)
	at com.intellij.ui.ColoredTreeCellRenderer.rendererComponentInner(ColoredTreeCellRenderer.java:125)
	at com.intellij.ui.ColoredTreeCellRenderer.getTreeCellRendererComponent(ColoredTreeCellRenderer.java:57)
	at com.intellij.ui.tree.ui.DefaultTreeUI.getRenderer(DefaultTreeUI.java:191)
	at com.intellij.ui.tree.ui.DefaultTreeUI$2.getNodeDimensions(DefaultTreeUI.java:597)
	at java.desktop/javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:497)
	at com.intellij.ui.tree.ui.DefaultTreeLayoutCache.access$getNodeDimensions(DefaultTreeLayoutCache.kt:19)
	at com.intellij.ui.tree.ui.DefaultTreeLayoutCache$Node.getBounds(DefaultTreeLayoutCache.kt:485)
	at com.intellij.ui.tree.ui.DefaultTreeLayoutCache.getPreferredWidth(DefaultTreeLayoutCache.kt:148)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTreeUI.java:2210)
	at com.intellij.ui.tree.ui.DefaultTreeUI.updateCachedPreferredSize(DefaultTreeUI.java:523)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:2335)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:2318)
	at java.desktop/javax.swing.JComponent.getPreferredSize(JComponent.java:1721)
	at com.intellij.ui.treeStructure.Tree.getPreferredSize(Tree.java:866)
	at com.intellij.ui.components.JBScrollPane$Layout.layoutContainer(JBScrollPane.java:533)
	at java.desktop/java.awt.Container.layout(Container.java:1541)
	at java.desktop/java.awt.Container.doLayout(Container.java:1530)
	at java.desktop/java.awt.Container.validateTree(Container.java:1725)
	at java.desktop/java.awt.Container.lambda$validate$3(Container.java:1659)
	at java.desktop/sun.awt.SunToolkit.performWithTreeLock(SunToolkit.java:2161)
	at java.desktop/java.awt.Container.validate(Container.java:1648)
	at java.desktop/javax.swing.RepaintManager$3.run(RepaintManager.java:760)
	at java.desktop/javax.swing.RepaintManager$3.run(RepaintManager.java:758)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:757)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1908)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:687)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:588)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:588)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:71)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:353)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:353)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1006)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1006)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Hi,

Thanks for the update. So you know, I’ve flagged this for the team. They should be along soon.

 
Ann

1 Like

Hi @kedarjoshi,

I was able to reproduce this issue on the latest EAP version, and it seems that a few things were changed in the way we should access documents in the editor, in regards to this I created this ticket that should tackle this issue.

It should be part of this week’s release for SonarLint.

2 Likes