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 34307 - endless renaming loop
Summary: endless renaming loop
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-11 12:57 UTC by David Konecny
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
variant of fix (1.24 KB, patch)
2003-09-22 13:47 UTC, vsh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2003-06-11 12:57:14 UTC
It happened to me by accident, but it is easily
reproducible:
- start NB35 release
- open a java file (eg. ColorPreview.java)
- insert some random character (eg. "a") at
*first* position on *first* line in the file 
- in explorer rename node of this java file to
some diff name
After this I'm experiencing endless renaming loop:
file is renamed, class and constructor are
renamed; rename operation is reverted; file is
renamed, ....

Issue itself is harmless: IDE can be exited, file
can be saved. Still I think it is P2 and can have
some nasty sideeffects.
Comment 1 Jan Becicka 2003-06-11 15:59:08 UTC
I can reproduce it. Should be fixed for 4.0
Comment 2 David Konecny 2003-06-11 16:24:51 UTC
On Solaris this seems to work "fine".
Comment 3 David Konecny 2003-06-11 16:28:40 UTC
Under some condition (do not know which; maybe guarded blocks) the
rename/revert cycle is enhanced with third step: add package
statement. The file then keeps growing and growing.
Comment 4 vsh 2003-09-22 13:45:39 UTC
if we create error before package declaration, parser calls
org.netbeans.modules.java.model.SourceElementImpl setPackage(...),
sets packageId to null and causes additional events, renaming of the 
file attempts to set correct package with some events and we get 
endless loop... 
Variant of fix - to not allow parser to set packageId to null
Comment 5 vsh 2003-09-22 13:47:15 UTC
Created attachment 11685 [details]
variant of fix
Comment 6 Jan Becicka 2003-09-22 13:54:28 UTC
Tomasi, can you review this patch? Thanks
Comment 7 Tomas Zezula 2003-09-22 15:16:56 UTC
The patch should be ok.
Comment 8 Jan Becicka 2003-09-23 09:15:29 UTC
In that case, we can apply it, right?
Comment 9 Antonin Nebuzelsky 2003-11-04 15:02:13 UTC
Fixed in Nevada Patch 1 and in Arrow.
Comment 10 Jan Pokorsky 2003-12-11 14:54:42 UTC
Fixed in the trunk.

/cvs/java/src/org/netbeans/modules/java/parser/SourceInfo.java
new revision: 1.8; previous revision: 1.7
Comment 11 ehucka 2004-02-19 09:24:46 UTC
Verified in 200402181900.