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 101717

Summary: "-1" changed to "1" during rename refactoring
Product: java Reporter: Miloslav Metelka <mmetelka>
Component: SourceAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P1    
Version: 6.x   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Picture showing the diff and problematic behavior

Description Miloslav Metelka 2007-04-19 10:13:28 UTC
Steps (btw attached picture shows it best):
1) Open lexer module.
2) Renamed SimpleJavadocTokenId to TestJavadocTokenId.
3) In TokenSequenceListTest occurrences were renamed properly but as a side
effect "-1" became "1" on these lines.
Comment 1 Miloslav Metelka 2007-04-19 10:14:44 UTC
Created attachment 41225 [details]
Picture showing the diff and problematic behavior
Comment 2 Miloslav Metelka 2007-04-19 10:43:39 UTC
Daily build 070419.
As I think about it more, this is a bit dangerous because it may generate hidden
errors that may be hard to find. Therefore changing to P2. Feel free to downgrade.
Comment 3 Pavel Flaska 2007-04-19 11:37:44 UTC
Definitely P2, reproducible. Positions for the literal '-1' are incorrect.
Comment 4 Pavel Flaska 2007-04-19 12:04:26 UTC
Adding Dusan to cc to help with evaluation.

Write variable to source, e.g. 'int i = -10;' and look at the INT_LITERAL in
Navigator-Trees view. Just number 10 is highlighted in editor. I can make a
special condition in generator for such cases, but I'll wait for Dusan's evaluation.
Comment 5 Pavel Flaska 2007-04-23 13:29:05 UTC
Test

Checking in test/unit/src/org/netbeans/api/java/source/gen/BodyStatementTest.java;
/cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/BodyStatementTest.java,v
 <--  BodyStatementTest.java
new revision: 1.29; previous revision: 1.28
done
Comment 6 Dusan Balek 2007-04-24 10:24:29 UTC
Breaking sources => increasing priority to P1.
Comment 7 Dusan Balek 2007-04-24 10:32:36 UTC
Fixed.