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.
Build: NetBeans IDE Dev (Build 200911251400) VM: Java HotSpot(TM) 64-Bit Server VM, 16.0-b08, Java(TM) SE Runtime Environment, 1.7.0-ea-b71 OS: Linux, 2.6.27-15-generic, amd64 User Comments: GUEST: remove cast GUEST: casting GUEST: casting GUEST: Tried to move a class from one package to another (via drag-and-drop). Sometimes refactoring works, sometimes it doesn't, although it's consistant per specific file. That is, I can move class X from package A to B, but cannot move class Y from package C to D. t_yano: I used a refacturring action 'inner to outer' against inner enum class. mhuebner: clicked on "surround block with try/catch" emononen: Applied a hint suggesting casting GUEST: removing cast Stacktrace: java.lang.StringIndexOutOfBoundsException: String index out of range: -4 at java.lang.String.substring(String.java:1949) at org.netbeans.modules.java.source.save.CasualDiff.diff(CasualDiff.java:176) at org.netbeans.api.java.source.WorkingCopy.processCurrentCompilationUnit(WorkingCopy.java:444) at org.netbeans.api.java.source.WorkingCopy.getChanges(WorkingCopy.java:505) at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:662) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:129)
Created attachment 91721 [details] stacktrace
Created attachment 91733 [details] stacktrace
Created attachment 91783 [details] stacktrace
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=148981
I am not completely sure what is the root cause, but I think that the CompilationUnitTree.getLineMap is likely not correctly updated after partial reparse. I have introduced a workaround that should hopefully fix this particular exception: http://hg.netbeans.org/jet-main/rev/74966fd2ac95 I have created a new bug #178862 to keep track about the CUT.getLineMap(). The workaround might be a good 6.8 patch1 candidate.
Integrated into 'main-golden', will be available in build *200912200200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/74966fd2ac95 User: Jan Lahoda <jlahoda@netbeans.org> Log: #177660: trying to prevent a StringIndexOutOfBoundsException.
The whiteboard changed back to 68patch-candidate. The whiteboard 68patch1-candidate can be added by QA or Sustaining to issues those has been verified in the trunk already.
I was not able to reproduce. Verified in trunk.
The fix has been ported into the release68_fixes repository. http://hg.netbeans.org/release68_fixes/rev/73705aa8e9e0
V.