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 92127 - Broken 'Implement all abstract methods' hint
Summary: Broken 'Implement all abstract methods' hint
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-09 15:34 UTC by Jan Pokorsky
Modified: 2007-02-01 14:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
StringIndexOutOfBoundsException (2.42 KB, text/plain)
2007-01-09 15:37 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2007-01-09 15:34:22 UTC
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.
Comment 1 Jan Pokorsky 2007-01-09 15:37:10 UTC
Created attachment 37188 [details]
StringIndexOutOfBoundsException
Comment 2 Pavel Flaska 2007-01-12 15:18:26 UTC
Reproducible.
Comment 3 Pavel Flaska 2007-01-18 12:27:43 UTC
I looks like some syntetic element causing this. (Something with position 0).
Comment 4 Jan Pokorsky 2007-01-18 12:40:51 UTC
Hmm
Comment 5 Pavel Flaska 2007-02-01 10:41:01 UTC
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.
Comment 6 Pavel Flaska 2007-02-01 14:30:49 UTC
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