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 200807310201) VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12 OS: Windows XP, 5.1, x86 User Comments: Changing a boolean to a string in a map. Stacktrace: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
*** Issue 142407 has been marked as a duplicate of this issue. ***
Build: NetBeans IDE Dev (Build 200807310201) VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Windows XP, 5.1, x86 User Comments: I have: String day(int dayNo) { String msg; switch (dayNo) { case 0: msg="sun"; break; } } I cut-and-paste the case line several times to form a list. I then tried to update the index that went next to each case and got this exception. Stacktrace: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66224 [details] stacktrace
From nbusers, NetBeans Dev 200807301401 (windows 2000,sp4,jdk1.6.0_06-b02): Hi,all: I get a strange bug,the code below works fine in 6.5M1,but in NetBeans Dev 200807301401,when ever I double click the number(16,24,28,etc,) and select it,the ide report a exception.(windows 2000,sp4,jdk1.6.0_06-b02) java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [catch] at java.lang.Thread.run(Thread.java:619) code: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Administrator */ public class NewClass { public static int _c2(int c) { int k = 2; for (int i = 0; i < c; i++) { k = k * 2; } return k; } public static void main(String args[]) { System.out.println(_c2(16)); System.out.println(_c2(24)); System.out.println(_c2(28)); System.out.println(_c2(30)); System.out.println(_c2(31)); } }
This issue has already 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=84672
Build: NetBeans IDE Dev (Build 200807311401) VM: Java HotSpot(TM) Client VM, 1.5.0_13-119, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-237 OS: Mac OS X, 10.5.4, i386 User Comments: Selected text from the source editor. Stacktrace: java.lang.ClassCastException: java.lang.Integer at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
Created attachment 66364 [details] stacktrace
Build: NetBeans IDE Dev (Build 200808010201) VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66367 [details] stacktrace
Build: NetBeans IDE Dev (Build 200808010201) VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66419 [details] stacktrace
Build: NetBeans IDE Dev (Build 080801) VM: Java HotSpot(TM) Client VM, 11.0-b14, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b27 OS: Windows XP, 5.1, x86 User Comments: type public class NetCatClass { private int i=100; } add double click and select '100' Stacktrace: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:102) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66462 [details] stacktrace
I have fix bug will attach patch
Created attachment 66467 [details] PATCH
jlahoda can you review patch Thanks
Build: NetBeans IDE Dev (Build 20080801110327) VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26 OS: Windows XP, 5.1, x86 User Comments: my case: have method public void test (int n){ } test(1) - exception is thrown when integer is selected Stacktrace: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:103) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66592 [details] stacktrace
any update on patch review ?
Build: NetBeans IDE Dev (Build 200808021401) VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02 OS: Windows XP, 5.1, x86 User Comments: I typed i = 0; without putting int in front of it. section of code now reads Owasp o = Owasp(); i = 0; while(true) Stacktrace: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:103) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66604 [details] stacktrace
*** Issue 142946 has been marked as a duplicate of this issue. ***
Build: NetBeans IDE Dev (Build 200808040201) VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26 OS: SunOS, 5.11, x86 User Comments: just select some number in java editor and wait a second Stacktrace: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:103) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66614 [details] stacktrace
The patch will fix the problem IMO. There are two "formal" problems with it: -the formatting is not the usual NetBeans formatting (we use spaces after if, before '{', around '=', before 'instanceof', etc.). Also, the parenthesis around the initializer of 'lt' variable are superfluous. -there is no test for the change. Also, the maintainer of the module (the default owner of the java/hints category) should do the review, IMO.
Build: NetBeans IDE Dev (Build 200808021401) VM: Java HotSpot(TM) Client VM, 1.5.0_13-119, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-237 OS: Mac OS X, 10.5.4, i386 User Comments: Double clicked a variable name in editor window Stacktrace: java.lang.ClassCastException: java.lang.Boolean at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:103) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
Created attachment 66622 [details] stacktrace
Created attachment 66641 [details] update patch according to jlahoda comments,msauer please review updated patch
Build: NetBeans IDE Dev (Build 200808050125) VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b14 OS: Windows XP, 5.1, x86 User Comments: -have a method call where one of parameters is boolean. e.g. zavolejMiDoKlubu(test, true); -select the true by double click (word selection) -> CCE Stacktrace: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String at org.netbeans.modules.java.hints.errors.Utilities.guessName(Utilities.java:103) at org.netbeans.modules.java.hints.introduce.IntroduceHint.computeError(IntroduceHint.java:359) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:294) at org.netbeans.modules.java.hints.introduce.IntroduceHint.run(IntroduceHint.java:125) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1675) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Created attachment 66647 [details] stacktrace
Created attachment 66666 [details] stacktrace
Thanks for the patch, I've just fixed it. It is already covered by testIntroduceFieldFix9. --- http://hg.netbeans.org/main/rev/14720ccbbed7
pity that's in beta :( I'm increasing priority even if it has no sense
Reproduced on dev: private final AtomicBoolean reloading = new AtomicBoolean(fa| Product Version: NetBeans IDE Dev (Build 200808021401) Java: 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23 System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
alexlamsl: your build number suggests that your build has been build on Aug 2nd, while the bug was fixed on Aug 6th - are you sure you are using an up-to-date build?
Ignore me, my eyes are not working properly today - somehow I keep thinking that I have a 0808 build... Downloading 0811 to verify...
Verified on 200808110201.
Still reproducible on latest beta Product Version: NetBeans IDE 6.5 Beta (Build 200808111757) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b15 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
I am sorry, I just tried latest trunk, and it works without problem... Verified on Product Version: NetBeans IDE Dev (Build 200808130201)
Still happens in latest 6.5 BETA when selecting a literal integer value.
I think the fix went into dev after it got branched for beta release - I have been using the latest dev builds and have not been able to reproduce it since.
*** Issue 143928 has been marked as a duplicate of this issue. ***
*** Issue 144365 has been marked as a duplicate of this issue. ***
Shouldn't this be backported to 6.1, given the number of reports? http://statistics.netbeans.org/analytics/detail.do?id=84672
Unfortunately there is no plan to make a patch4, which would backport the fixes to 6.1.
I do not know about the error being fixed because I downloaded and installed NetBeans on 28Sep08.
myopic4141, do you mean you have reproduced the issue on the nightly build 20080928? I'm using the last few days' build and it has been working for me so far...
I do not know when this Beta version was built; but, it was the one I down loaded and ran at 04:21 29Sep08 from http://download.netbeans.org/netbeans/6.5/beta/index.html?cid=926302. If this is an earlier version, then the problem is that the beta site source is not being properly updated.
I looked up the build number. It is 200008111757
That's way before the market collapsed - and rest assured, the basis of our IDE is now stronger than ever ;-) If you want to try out the latest nightly builds, you can download it from http://bits.netbeans.org/dev/nightly/latest/
You mean NetBeans has been around since before 1929? I downloaded the latest build and there is no longer the error. Thank you.