Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException from FliteredIndentsHighlightingPass.java #3955

Closed
devoncarew opened this issue Oct 10, 2019 · 6 comments
Closed
Milestone

Comments

@devoncarew
Copy link
Member

We're seeing many reports of issues like this one:

java.lang.IndexOutOfBoundsException: Wrong offset: 8160. Should be in range: [0, 7872]

com.intellij.openapi.editor.impl.LineSet.findLineIndex(), LineSet.java:172
com.intellij.openapi.editor.impl.DocumentImpl.getLineNumber(), DocumentImpl.java:1008
io.flutter.editor.FliteredIndentsHighlightingPass.getGuideLineRange(), FliteredIndentsHighlightingPass.java:202
io.flutter.editor.FliteredIndentsHighlightingPass.onWidgetIndentsChanged(), FliteredIndentsHighlightingPass.java:252
io.flutter.editor.WidgetIndentsHighlightingPass.updateHitTester(), WidgetIndentsHighlightingPass.java:559
io.flutter.editor.WidgetIndentsHighlightingPass.setOutline(), WidgetIndentsHighlightingPass.java:547
io.flutter.editor.WidgetIndentsHighlightingPass.run(), WidgetIndentsHighlightingPass.java:522
io.flutter.editor.WidgetIndentsHighlightingPassFactory.runWidgetIndentsPass(), WidgetIndentsHighlightingPassFactory.java:299
io.flutter.editor.WidgetIndentsHighlightingPassFactory.lambda$null$1(), WidgetIndentsHighlightingPassFactory.java:196
com.intellij.openapi.application.TransactionGuardImpl$2.run(), TransactionGuardImpl.java:315
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(), LaterInvocator.java:435
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(), LaterInvocator.java:419
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(), LaterInvocator.java:403
java.awt.event.InvocationEvent.dispatch(), InvocationEvent.java:311
java.awt.EventQueue.dispatchEventImpl(), EventQueue.java:762
java.awt.EventQueue.access$500(), EventQueue.java:98
java.awt.EventQueue$3.run(), EventQueue.java:715
java.awt.EventQueue$3.run(), EventQueue.java:709
java.security.AccessController.doPrivileged(), AccessController.java:-2
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(), ProtectionDomain.java:80
java.awt.EventQueue.dispatchEvent(), EventQueue.java:732
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(), IdeEventQueue.java:755
com.intellij.ide.IdeEventQueue._dispatchEvent(), IdeEventQueue.java:704
com.intellij.ide.IdeEventQueue.dispatchEvent(), IdeEventQueue.java:391
java.awt.EventDispatchThread.pumpOneEventForFilters(), EventDispatchThread.java:201
java.awt.EventDispatchThread.pumpEventsForFilter(), EventDispatchThread.java:116
java.awt.EventDispatchThread.pumpEventsForHierarchy(), EventDispatchThread.java:105
java.awt.EventDispatchThread.pumpEvents(), EventDispatchThread.java:101
java.awt.EventDispatchThread.pumpEvents(), EventDispatchThread.java:93
java.awt.EventDispatchThread.run(), EventDispatchThread.java:82
@devoncarew devoncarew added this to the On Deck milestone Oct 10, 2019
@devoncarew
Copy link
Member Author

@jacob314, for some reason FliteredIndentsHighlightingPass.getGuideLineRange() is throwing IndexOutOfBoundsExceptions. The offset we're passing into getLineNumber() is past the end of the number of chars in the doc (and not just a fencepost error).

The line numbers here don't seem to map up well the the actual source code, which is odd, since these reports are recent, and FliteredIndentsHighlightingPass.java hasn't been edited in a while.

@jacob314
Copy link
Contributor

Do you have a link to any of the other recent reports?
That report looks like is from an old version of the plugin.
The getLineNumber call is now at line 206 instead of 202 and the lines before line 206 include checks to try to prevent this exact error in the case of a bogus highlighter that goes off the end of the document.

@devoncarew
Copy link
Member Author

It is possible it's from an older plugin, but they'd have to be pretty out of date. It looks like you added those check May 2, so likely shipped in the June release.

@devoncarew
Copy link
Member Author

The plugin would have to be like 5 months old.

@devoncarew
Copy link
Member Author

I think we'll:

  • warn users internally if their plugin is super old
  • update our dashboards to filter out exceptions from older plugin versions

@jacob314
Copy link
Contributor

Great ideas! I've added a couple more suggestions for warning users about old plugins and filed
#3961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants