Error in SonarLint for IntelliJ - after opening a class file


  • Java: JetBrains s.r.o. 11.0.12
  • OS: Linux amd64
  • IDE: IntelliJ IDEA 2021.2.3
  • SonarLint:
java.lang.IndexOutOfBoundsException: Wrong offset: 52431. Should be in range: [0, 52303]
	at c.ij.oa.editor.impl.LineSet.findLineIndex(
	at c.ij.oa.editor.impl.DocumentImpl.getLineNumber(
	at c.ij.ui.ColoredTreeCellRenderer.rendererComponentInner(
	at c.ij.ui.ColoredTreeCellRenderer.getTreeCellRendererComponent(
	at c.ij.ui.tree.ui.DefaultTreeUI.getRenderer(
	at c.ij.ui.tree.ui.DefaultTreeUI$2.getNodeDimensions(
	at java.desktop/javax.swing.tree.AbstractLayoutCache.getNodeDimensions(
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(
	at java.desktop/javax.swing.tree.VariableHeightLayoutCache.setExpandedState(

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.