claude-code - 💡(How to fix) Fix [BUG] Bounds check (Intellij plugin) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48509Fetched 2026-04-16 06:58:12
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

Error Message

Your plugin for Intellij throws an exception. How can we fix that? java.lang.IndexOutOfBoundsException: Wrong offset: 3313104. Should be in range: [0, 392356]
at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:167)
at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:1050)
at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$0(DiagnosticTools.kt:124)
at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$1(DiagnosticTools.kt:118)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.lambda$processHighlights$0(DaemonCodeAnalyzerEx.java:83)
at com.intellij.openapi.editor.impl.MarkupModelImpl.processRangeHighlightersOverlappingWith(MarkupModelImpl.java:285)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:76)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:62)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:49)
at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished(DiagnosticTools.kt:112)
at com.intellij.codeInsight.daemon.DaemonCodeAnalyzer$DaemonListener.daemonFinished(DaemonCodeAnalyzer.java:98)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:818)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:762)
at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:583)
at com.intellij.util.messages.impl.MessagePublisher.publish$intellij_platform_core(MessageBusImpl.kt:554)
at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:531)
at jdk.proxy2/jdk.proxy2.$Proxy91.daemonFinished(Unknown Source)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$MyDaemonProgressIndicator.onStop(DaemonCodeAnalyzerImpl.java:1649)
at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.stop(DaemonProgressIndicator.java:39)
at com.intellij.codeInsight.daemon.impl.PassExecutorService.lambda$applyInformationToEditorsLater$3(PassExecutorService.java:554)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:240)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:26)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:202)
at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)
at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.doRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:666)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runPreventiveWriteIntentReadAction(NestedLocksThreadingSupport.kt:640)
at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteIntentReadAction(NestedLocksThreadingSupport.kt:633)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:1022)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:574)
at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)
at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)
at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:595)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)
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)

Fix Action

Fix / Workaround

Your plugin for Intellij throws an exception. How can we fix that? java.lang.IndexOutOfBoundsException: Wrong offset: 3313104. Should be in range: [0, 392356]                                                                                                                                         
      at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:167)                                                                                                                                                                                                                        
      at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:1050)                                                                                                                                                                                                             
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$0(DiagnosticTools.kt:124)                                                                                                                                                                              
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$1(DiagnosticTools.kt:118)                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.lambda$processHighlights$0(DaemonCodeAnalyzerEx.java:83)                                                                                                                                                                              
      at com.intellij.openapi.editor.impl.MarkupModelImpl.processRangeHighlightersOverlappingWith(MarkupModelImpl.java:285)                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:76)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:62)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:49)                                                                                                                                                                                       
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished(DiagnosticTools.kt:112)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.DaemonCodeAnalyzer$DaemonListener.daemonFinished(DaemonCodeAnalyzer.java:98)                                                                                                                                                                                    
      at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:818)                                                                                                                                                                                                            
      at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:762)                                                                                                                                                                                                          
      at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:583)                                                                                                                                                                                                     
      at com.intellij.util.messages.impl.MessagePublisher.publish$intellij_platform_core(MessageBusImpl.kt:554)                                                                                                                                                                                          
      at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:531)                                                                                                                                                                                                                  
      at jdk.proxy2/jdk.proxy2.$Proxy91.daemonFinished(Unknown Source)                                                                                                                                                                                                                                   
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$MyDaemonProgressIndicator.onStop(DaemonCodeAnalyzerImpl.java:1649)                                                                                                                                                                  
      at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.stop(DaemonProgressIndicator.java:39)                                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.PassExecutorService.lambda$applyInformationToEditorsLater$3(PassExecutorService.java:554)                                                                                                                                                                  
      at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:240)                                                                                                                                                                                      
      at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:26)                                                                                                                                                                                                  
      at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:202)                                                                                                                                                                                                      
      at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)                                                                                                                                                                                                   
      at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)                                                                                                                                                                                                   
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.doRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:666)                                                                                                                                                                   
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runPreventiveWriteIntentReadAction(NestedLocksThreadingSupport.kt:640)                                                                                                                                                           
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteIntentReadAction(NestedLocksThreadingSupport.kt:633)                                                                                                                                                                     
      at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:1022)                                                                                                                                                                          
      at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:574)                                                                                                                                                                                                           
      at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)                                                                                                                                                                                                       
      at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)                                                                                                                                                                                                       
      at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)                                                                                                                                                                                                                
      at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)                                                                                                                                                                                                                
      at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)                                                                                                                                                                                                                      
      at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)                                                                                                                                                                                                              
      at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)                                                                                                                                                                                                                   
      at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)                                                                                                                                                                                                                  
      at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)                                                                                                                                                                                                                         
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)                                                                                                                                                                                                                                     
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)                                                                                                                                                                                                                                     
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)                                                                                                                                                                                                                
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)                                                                                                                                                                               
      at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)                                                                                                                                                                                                                             
      at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:595)                                                                                                                                                                                                                       
      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)                                                                                                                                                                                                                             
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)                                                                                                                                                                                       
      at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)                                                                                                                                                                                         
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)                                                                                                                                                                                                
      at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)                                                                                                                                                                                                                 
      at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)                                                                                                                                                                                            
      at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)                                                                                                                                                                                                                          
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)                                                                                                                                                                                                                    
      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)                                                                                                                                                                                                                              
      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)

Code Example

Your plugin for Intellij throws an exception. How can we fix that? java.lang.IndexOutOfBoundsException: Wrong offset: 3313104. Should be in range: [0, 392356]                                                                                                                                         
      at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:167)                                                                                                                                                                                                                        
      at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:1050)                                                                                                                                                                                                             
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$0(DiagnosticTools.kt:124)                                                                                                                                                                              
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$1(DiagnosticTools.kt:118)                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.lambda$processHighlights$0(DaemonCodeAnalyzerEx.java:83)                                                                                                                                                                              
      at com.intellij.openapi.editor.impl.MarkupModelImpl.processRangeHighlightersOverlappingWith(MarkupModelImpl.java:285)                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:76)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:62)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:49)                                                                                                                                                                                       
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished(DiagnosticTools.kt:112)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.DaemonCodeAnalyzer$DaemonListener.daemonFinished(DaemonCodeAnalyzer.java:98)                                                                                                                                                                                    
      at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:818)                                                                                                                                                                                                            
      at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:762)                                                                                                                                                                                                          
      at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:583)                                                                                                                                                                                                     
      at com.intellij.util.messages.impl.MessagePublisher.publish$intellij_platform_core(MessageBusImpl.kt:554)                                                                                                                                                                                          
      at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:531)                                                                                                                                                                                                                  
      at jdk.proxy2/jdk.proxy2.$Proxy91.daemonFinished(Unknown Source)                                                                                                                                                                                                                                   
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$MyDaemonProgressIndicator.onStop(DaemonCodeAnalyzerImpl.java:1649)                                                                                                                                                                  
      at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.stop(DaemonProgressIndicator.java:39)                                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.PassExecutorService.lambda$applyInformationToEditorsLater$3(PassExecutorService.java:554)                                                                                                                                                                  
      at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:240)                                                                                                                                                                                      
      at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:26)                                                                                                                                                                                                  
      at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:202)                                                                                                                                                                                                      
      at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)                                                                                                                                                                                                   
      at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)                                                                                                                                                                                                   
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.doRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:666)                                                                                                                                                                   
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runPreventiveWriteIntentReadAction(NestedLocksThreadingSupport.kt:640)                                                                                                                                                           
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteIntentReadAction(NestedLocksThreadingSupport.kt:633)                                                                                                                                                                     
      at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:1022)                                                                                                                                                                          
      at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:574)                                                                                                                                                                                                           
      at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)                                                                                                                                                                                                       
      at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)                                                                                                                                                                                                       
      at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)                                                                                                                                                                                                                
      at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)                                                                                                                                                                                                                
      at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)                                                                                                                                                                                                                      
      at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)                                                                                                                                                                                                              
      at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)                                                                                                                                                                                                                   
      at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)                                                                                                                                                                                                                  
      at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)                                                                                                                                                                                                                         
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)                                                                                                                                                                                                                                     
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)                                                                                                                                                                                                                                     
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)                                                                                                                                                                                                                
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)                                                                                                                                                                               
      at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)                                                                                                                                                                                                                             
      at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:595)                                                                                                                                                                                                                       
      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)                                                                                                                                                                                                                             
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)                                                                                                                                                                                       
      at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)                                                                                                                                                                                         
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)                                                                                                                                                                                                
      at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)                                                                                                                                                                                                                 
      at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)                                                                                                                                                                                            
      at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)                                                                                                                                                                                                                          
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)                                                                                                                                                                                                                    
      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)                                                                                                                                                                                                                              
      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)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Version: 2.1.109 (Claude Code) Source: Claude itself ... Proper fix (for Anthropic to address)

The plugin needs a bounds check in DiagnosticTools.kt before calling getLineNumber:
val docLen = document.textLength
if (highlight.startOffset in 0 until docLen) {
val line = document.getLineNumber(highlight.startOffset) // ...
}

What Should Happen?

No exception when it runs

Error Messages/Logs

Your plugin for Intellij throws an exception. How can we fix that? java.lang.IndexOutOfBoundsException: Wrong offset: 3313104. Should be in range: [0, 392356]                                                                                                                                         
      at com.intellij.openapi.editor.impl.LineSet.findLineIndex(LineSet.java:167)                                                                                                                                                                                                                        
      at com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(DocumentImpl.java:1050)                                                                                                                                                                                                             
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$0(DiagnosticTools.kt:124)                                                                                                                                                                              
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished$lambda$1(DiagnosticTools.kt:118)                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.lambda$processHighlights$0(DaemonCodeAnalyzerEx.java:83)                                                                                                                                                                              
      at com.intellij.openapi.editor.impl.MarkupModelImpl.processRangeHighlightersOverlappingWith(MarkupModelImpl.java:285)                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:76)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:62)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx.processHighlights(DaemonCodeAnalyzerEx.java:49)                                                                                                                                                                                       
      at com.anthropic.code.plugin.mcp.tools.DiagnosticTools$addTools$1$1$1.daemonFinished(DiagnosticTools.kt:112)                                                                                                                                                                                       
      at com.intellij.codeInsight.daemon.DaemonCodeAnalyzer$DaemonListener.daemonFinished(DaemonCodeAnalyzer.java:98)                                                                                                                                                                                    
      at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:818)                                                                                                                                                                                                            
      at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:762)                                                                                                                                                                                                          
      at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:583)                                                                                                                                                                                                     
      at com.intellij.util.messages.impl.MessagePublisher.publish$intellij_platform_core(MessageBusImpl.kt:554)                                                                                                                                                                                          
      at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:531)                                                                                                                                                                                                                  
      at jdk.proxy2/jdk.proxy2.$Proxy91.daemonFinished(Unknown Source)                                                                                                                                                                                                                                   
      at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$MyDaemonProgressIndicator.onStop(DaemonCodeAnalyzerImpl.java:1649)                                                                                                                                                                  
      at com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator.stop(DaemonProgressIndicator.java:39)                                                                                                                                                                                              
      at com.intellij.codeInsight.daemon.impl.PassExecutorService.lambda$applyInformationToEditorsLater$3(PassExecutorService.java:554)                                                                                                                                                                  
      at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:240)                                                                                                                                                                                      
      at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:26)                                                                                                                                                                                                  
      at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:202)                                                                                                                                                                                                      
      at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)                                                                                                                                                                                                   
      at com.intellij.openapi.application.impl.AppImplKt$runnableUnitFunction$1.invoke(appImpl.kt:104)                                                                                                                                                                                                   
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.doRunWriteIntentReadAction(NestedLocksThreadingSupport.kt:666)                                                                                                                                                                   
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runPreventiveWriteIntentReadAction(NestedLocksThreadingSupport.kt:640)                                                                                                                                                           
      at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.runWriteIntentReadAction(NestedLocksThreadingSupport.kt:633)                                                                                                                                                                     
      at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:1022)                                                                                                                                                                          
      at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:574)                                                                                                                                                                                                           
      at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)                                                                                                                                                                                                       
      at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)                                                                                                                                                                                                       
      at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)                                                                                                                                                                                                                
      at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)                                                                                                                                                                                                                
      at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)                                                                                                                                                                                                                      
      at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)                                                                                                                                                                                                              
      at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)                                                                                                                                                                                                                   
      at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)                                                                                                                                                                                                                  
      at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)                                                                                                                                                                                                                         
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)                                                                                                                                                                                                                                     
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)                                                                                                                                                                                                                                     
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)                                                                                                                                                                                                                
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)                                                                                                                                                                               
      at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)                                                                                                                                                                                                                             
      at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:595)                                                                                                                                                                                                                       
      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)                                                                                                                                                                                                                             
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)                                                                                                                                                                                       
      at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)                                                                                                                                                                                         
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)                                                                                                                                                                                                
      at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)                                                                                                                                                                                                                 
      at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)                                                                                                                                                                                            
      at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)                                                                                                                                                                                                                          
      at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)                                                                                                                                                                                                                    
      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)                                                                                                                                                                                                                              
      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)

Steps to Reproduce

The exception is in DiagnosticTools.kt:124. The daemon finishes analyzing the file, then calls document.getLineNumber(3313104) — but the document only has 392,356 bytes at that point. The offset is ~8× larger than the current document size.

The cause: you opened unified_runner_output.log in the IDE. The backend is actively writing to it. The sequence is:

  1. IntelliJ daemon runs on the file when it is ~3.3 MB
  2. The log file keeps growing (or IntelliJ reloads it mid-flight, or truncation happened)
  3. By the time the daemon calls getLineNumber(highlight.startOffset) the document has been replaced with a smaller version (392 KB)
  4. The stale offset is now out of range → IndexOutOfBoundsException

This is a real bug in the plugin (no bounds check before getLineNumber), but you can work around it immediately:

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.109

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

No response

extent analysis

TL;DR

Add a bounds check in DiagnosticTools.kt before calling getLineNumber to prevent IndexOutOfBoundsException.

Guidance

  • Verify that the highlight.startOffset is within the valid range of the document's text length before calling document.getLineNumber.
  • Check if the document has been modified or replaced with a smaller version after the daemon has finished analyzing the file.
  • Consider adding a check to ensure that the document's size has not changed significantly since the daemon started analyzing it.
  • Review the sequence of events that leads to the exception, including the growth or truncation of the log file, to identify potential workarounds.

Example

val docLen = document.textLength
if (highlight.startOffset in 0 until docLen) {
    val line = document.getLineNumber(highlight.startOffset)
    // ...
}

Notes

The provided workaround suggests adding a bounds check, but it may not be sufficient to handle all cases, such as when the document is modified or replaced during analysis. Further investigation and testing may be necessary to ensure the fix is robust.

Recommendation

Apply the suggested workaround by adding a bounds check in DiagnosticTools.kt to prevent IndexOutOfBoundsException, as this is a known issue in the current version of the plugin.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING