This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Problem is mentioned in the issue #33509 Try to add some method at the end of source, create a breakpoint for that line (Shift+F8) and close file with discarding the changes. If you open the file again the breakpoint is placed at the end of file. It also affects the completion. If you add some method or field in a source, wait for 2 seconds while parser parses the changes and completion is updated. Close a file, discard changes. Reopen the file, try completion - the method or field added before is available in completion.
Second part have no relation to the first part.
Before reattaching annotation class in DocumentLine we need to check that DocumentLine position is inside of document.
Created attachment 12658 [details] Proposed fix
Reassigning to openide/editor for evaluation. We probably will not be able to fix completion related problem. Hope, that MDR will handle it ;-)
I thought it would be easier to catch possible BadLocaltionException or what, but it seems there is no such exception. Also, the #33509 don't seem to be related to this problem.
I tested it in netbeans 3.5 with patch and on trunk build. Test in nb35 + patch : I tried reproduce it and only the problem with the position of annotations (breakpoints) are fixed. The Code Completion is not updated correctly after discard changes in modified file. Test in trunk build 200401261900 : The scenario described in first comment of this issue is not reproducible. The breakpoints are added correctly into the editor and the CC remove the method (or field) after discard changes in file. But there is another problem with the same cause while opening file on specified position (double click on field, method or costructor in Explorer). This issue occur in trunk and nb35 versions. Steps to reproduce : 1) Do some changes in file ( add some rows ) 2) Close it with discard 3) Double click on a field in Explorer ( field from the same class you modified in step 1) -> The cursor should be moved to the field, but cursor is moved to another place in editor. I have search through the Issuezilla and I find issue #6266 which describes (maybe) the same problem and has been fixed in trunk today.
I cannot reproduce your problem with directed opening from explorer, so it seems fixed by the issue 6266 fix.
closed