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.
This bug was originally marked as duplicate of bug 169352, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE Dev (Build 201005170932) VM: Java HotSpot(TM) Server VM, 16.2-b04, Java(TM) SE Runtime Environment, 1.6.0_19-b04 OS: Linux User Comments: fsoares: Editing a file in the java editor GUEST: Mouse to select that code then throw this error. The code is:throw new UnsupportedOperationException("Not supported yet."); mgoe: Editing source code. GUEST: navigating among classes CTRL+mouse click GUEST: Editing a java file GUEST: not sure tboudreau: Occurred after I deleted a file called ClassicAppletX, copied a file called ExtendedAppletX and refactor-pasted it as ClassicAppletX1 (note the 1), then renamed it to ClassicAppletX petermount: Selecting a block to copy, accidentially holding down shift whilst selecting mgoe: Editing source code Stacktrace: java.lang.IllegalArgumentException: TreePathHandle [/home/mgoe/pv.HEAD/gen/java/platform/Test/src/de/bruker/mri/test/TestManager.java] was not created from /home/mgoe/pv.HEAD/gen/java/platform/Test/src/de/bruker/mri/test/TestManager.java mine: id=MasterFileObject[/home/mgoe/pv.HEAD/gen/java/platform/Test/src/de/bruker/mri/test/TestManager.java@bfa08b:1467fd,valid=true], url=file:/home/mgoe/pv.HEAD/gen/java/platform/Test/src/de/bruker/mri/test/TestManager.java remote: id=MasterFileObject[/home/mgoe/pv.HEAD/gen/java/platform/Test/src/de/bruker/mri/test/TestManager.java@308924:e75f86,valid=true], url=file:/home/mgoe/pv.HEAD/gen/java/platform/Test/src/de/bruker/mri/test/TestManager.java at org.netbeans.api.java.source.TreePathHandle$TreeDelegate.resolve(TreePathHandle.java:421) at org.netbeans.api.java.source.TreePathHandle.resolve(TreePathHandle.java:151) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeIntroduceMethod(IntroduceHint.java:494) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:465) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:320) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:144)
Created attachment 99493 [details] stacktrace
Duplicate FileObjects.
Created attachment 99726 [details] stacktrace Refactor/renamed Sha1StreamWrapper to SHA1StreamWrapper on Mac OS case-preserving-but-insensitive filesystem. Java infrastructure is returning handles created for Sha1StreamWrapper which is not the same FileObject.
This happens on Mac OS (filesystem is case-preserving but case-insensitive), if you rename a class to the same name with different case. I just reproduced it by renaming a class called Sha1StreamWrapper to SHA1StreamWrapper. This results in two FileObjects, but the Java parsing infrastructure returns TreePathHandles for the old Sha1StreamWrapper which is not the same FileObject.
I'll add that the default filesystem on OSX preserves case but is case insensitive, however OSX does have an option for the filesystem to be case sensitive. Just a warning for those who can't reproduce this bug because they are using the latter.
*** This bug has been marked as a duplicate of bug 184854 ***