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.
jdk 1.6, nb dev build 070109 After performing 'Implement all abstract methods' hint on the following line new Runnable() {}; I get java.lang.StringIndexOutOfBoundsException: String index out of range: -2956 at java.lang.String.substring(String.java:1938) at org.netbeans.modules.java.source.save.CasualDiff.diffClassDef(CasualDiff.java:324) The source file where it occurred was org.netbeans.api.java.source.JavaSource in DataObjectListener/handleInvalidDataObject.
Created attachment 37188 [details] StringIndexOutOfBoundsException
Reproducible.
I looks like some syntetic element causing this. (Something with position 0).
Hmm
Semicolons are root cause of the problems. They are represented as a initializer class member with non-defined position. Have to filter them out during diffing.
Checking in src/org/netbeans/modules/java/source/save/CasualDiff.java; /cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v <-- CasualDiff.java new revision: 1.56; previous revision: 1.55 done Checking in src/org/netbeans/modules/java/source/save/PositionEstimator.java; /cvs/java/source/src/org/netbeans/modules/java/source/save/PositionEstimator.java,v <-- PositionEstimator.java new revision: 1.6; previous revision: 1.5 done