Error in SonarLint for IntelliJ - after opening a class file

Environment:

  • Java: JetBrains s.r.o. 11.0.12
  • OS: Linux amd64
  • IDE: IntelliJ IDEA 2021.2.3
  • SonarLint: 6.3.1.40498
java.lang.IndexOutOfBoundsException: Wrong offset: 52431. Should be in range: [0, 52303]
	at c.ij.oa.editor.impl.LineSet.findLineIndex(LineSet.java:166)
	at c.ij.oa.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:1005)
	at o.sl.ij.ui.nodes.IssueNode.issueCoordinates(IssueNode.java:110)
	at o.sl.ij.ui.nodes.IssueNode.render(IssueNode.java:63)
	at o.sl.ij.ui.tree.TreeCellRenderer.customizeCellRenderer(TreeCellRenderer.java:37)
	at c.ij.ui.ColoredTreeCellRenderer.rendererComponentInner(ColoredTreeCellRenderer.java:122)
	at c.ij.ui.ColoredTreeCellRenderer.getTreeCellRendererComponent(ColoredTreeCellRenderer.java:54)
	at c.ij.ui.tree.ui.DefaultTreeUI.getRenderer(DefaultTreeUI.java:172)
	at c.ij.ui.tree.ui.DefaultTreeUI$2.getNodeDimensions(DefaultTreeUI.java:458)
	at java.desktop/javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:493)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1344)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1465)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1272)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(VariableHeightLayoutCache.java:967)
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableHeightLayoutCache.java:181)

The SonarLint Automatically trigger Analysis is set off. The error happened just after opening a class from the find by class name search dialog.

Hello, welcome to the community! And thanks for your report.

I did not manage to reproduce this issue, could you please provide a bit more context about what was happening in the IDE when this occurred?

Since “Automatically trigger analysis” is off, I assume that you are using explicit manual scans that populate SonarLint’s “Report” tab; we might have a bug there caused by the dis-synchronization between the source code that was analyzed and the one open in the editor.