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.

Bug 37301 - Discarding a modified source causes inconsistency problems during next opening
Summary: Discarding a modified source causes inconsistency problems during next opening
Status: VERIFIED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks: 33509
  Show dependency tree
 
Reported: 2003-11-18 13:59 UTC by Martin Roskanin
Modified: 2008-12-22 20:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed fix (2.70 KB, patch)
2003-12-22 17:54 UTC, capSS
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Roskanin 2003-11-18 13:59:56 UTC
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.
Comment 1 capSS 2003-12-15 14:00:36 UTC
Second part have no relation to the first part.
Comment 2 capSS 2003-12-22 17:52:22 UTC
Before reattaching annotation class in DocumentLine we need to
check that DocumentLine position is inside of document.
Comment 3 capSS 2003-12-22 17:54:24 UTC
Created attachment 12658 [details]
Proposed fix
Comment 4 Martin Roskanin 2004-01-23 13:50:37 UTC
Reassigning to openide/editor for evaluation.

We probably will not be able to fix completion related problem. Hope,
that MDR will handle it ;-)
Comment 5 Petr Nejedly 2004-01-26 10:28:35 UTC
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.
Comment 6 pfelenda 2004-01-27 16:57:14 UTC
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.
Comment 7 Petr Nejedly 2004-02-05 13:11:46 UTC
I cannot reproduce your problem with directed opening from explorer,
so it seems fixed by the issue 6266 fix.
Comment 8 Marian Mirilovic 2005-07-15 07:43:12 UTC
closed