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 - "-1" changed to "1" during rename refactoring
Summary: "-1" changed to "1" during rename refactoring
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC All
: P1 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-19 10:13 UTC by Miloslav Metelka
Modified: 2007-04-24 10:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Picture showing the diff and problematic behavior (102.30 KB, image/png)
2007-04-19 10:14 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
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.