| Summary: | [hovering] NPE in JavaSourceHover.getBracketHoverInfo | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> | ||||||
| Component: | Text | Assignee: | Deepak Azad <deepakazad> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r | ||||||
| Version: | 3.8 | Flags: | daniel_megert:
review-
markus.kell.r: review+ deepakazad: review+ |
||||||
| Target Milestone: | 3.8 RC2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Dani Megert
Happens when the hover is about to be computed and the editor gets closed in-between. Set bpt on IDocument document= textViewer.getDocument(); Created attachment 216189 [details]
fix
I guess the solution is to add a null check.
Comment on attachment 216189 [details]
fix
This just fixes the 1. instance of the problem. Next NPE to come when the matcher is reached.
Created attachment 216195 [details]
Fix
This fixes all the holes. The patch is not minimal as it also cleans up the code a little bit, but the changes are straightforward.
(In reply to comment #4) > Created attachment 216195 [details] [diff] > Fix Looks good, and I didn't find any more holes. +1 for RC2 or RC3. Just one potential memory problem: If the editor is closed right before "display.syncExec(..)", topLine ends up being -1, and in the end we copy all lines in front of the "}", just to throw them away later. I would add this just after "int topLine= topIndex[0];": if (topLine == -1) return null; Looks good to me as well. Released to master and integration including the change from comment 5 http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=48bbac49f9ea2da88cbe94a5f025e1edd2f5c38c . Verified in I20120524-2300. |