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.
I'm getting the following exception when I simply stop typing for a couple seconds, leaving the current line in an incomplete state. If I dismiss the exception dialog and don't do anything, I don't see any further errors. If I add/remove a character and pause again, the same exception pops up. This is happening on 6.0RC2 on a Fedora5 Linux box running JDK 1.6.02. I previously reported a similar error and when Jiri asked me to send the source code in which it happened, I first tried to reproduce it in that file and couldn't. I'm afraid that once I exit the IDE, I will not be able to reproduce either. I'm including an image of the IDE with the exception and the highlighted code in hopes that it will be enough to find the bug. java.lang.ClassCastException: com.sun.tools.javac.comp.Resolve$ResolveError cannot be cast to com.sun.tools.javac.code.Symbol$ClassSymbol at com.sun.tools.javac.comp.Attr$IdentAttributer.visitMemberSelect(Attr.java:287) at com.sun.tools.javac.comp.Attr$IdentAttributer.visitMemberSelect(Attr.java:276) at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1662) at com.sun.tools.javac.comp.Attr.attribIdent(Attr.java:272) at com.sun.tools.javac.main.JavaCompiler.resolveIdent(JavaCompiler.java:594) at com.sun.tools.javac.model.JavacElements.nameToSymbol(JavacElements.java:209) at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:156) at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:63) at org.netbeans.modules.java.editor.imports.ComputeImports.computeCandidates(ComputeImports.java:138) at org.netbeans.modules.java.editor.imports.ComputeImports.computeCandidates(ComputeImports.java:103) at org.netbeans.modules.java.hints.errors.ImportClass.getCandidateFQNs(ImportClass.java:240) at org.netbeans.modules.java.hints.errors.ImportClass.run(ImportClass.java:143) at org.netbeans.modules.java.hints.infrastructure.CreatorBasedLazyFixList.compute(CreatorBasedLazyFixList.java:145) at org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.run(LazyHintComputation.java:111) at org.netbeans.modules.java.hints.infrastructure.LazyHintComputation.run(LazyHintComputation.java:57) at org.netbeans.api.java.source.JavaSource$CompilationJob.run(JavaSource.java:1551) 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)
Created attachment 53573 [details] screenshot of exception and source code in background
Reassigning to "java" for evaluation.
Unfortunately without a reproducible case, it is very unlikely to be fixable.
moving opened issues from TM <= 6.1 to TM=Dev
I am closing this as we don't have enough information. Twolf, please reopen if you still experience difficulties with that and provide some additional info (stack trace, steps to follow etc.) Thanks a lot
Pribyl, I'm re-opening because it's still a problem - annoying one at that. I spent a couple minutes and can reproduce it easily in my environment (which is now 6.01 with the latest updates on Ubuntu 7.10 with JDK 1.6 update 3). I'm attaching a small source file, NewClass.java. It has a single method with a switch statement in it. It compiles just fine. Now, in the editor, simply double-click the variable columnIndexIn on line 13 (the case statement) and change that to some letter, say, 'p'. The syntax highlighter will put red squigglies under it - and then the Exception occurs. Every time. At least in my project :-)
Created attachment 60410 [details] sample java class to reproduce error
Thank you for the prompt reply. I just tested your java file on several op. systems and NB builds, still with no luck. It works normally for me. I tested on: 1, WinXP - 6.1 RC2 (Build 200804170002), jdk 1.6.10 2, Ubuntu 8.04 - 6.1 RC2 (Build 200804170002), jdk 1.6.05 3, Ubuntu 8.04 - 6.0.1 (Build 200801291616), jdk 1.6.05 Thats really weird. In the very first post you wrote that this happened already on 6.0RC2, Fedora, 1.6.02 JDK, so completely different configuration than now and still the same error, right?
I think it was an identical error - at least they both started with "Resolve$ResolveError cannot be cast to com.sun.tools.javac.code.Symbol$ClassSymbol. Now, I should add that I wrote the sample class while I was in a *huge* project (3800 files) - which is the same condition under which I filed the original bug. When I have a few moments this afternoon, I can try to create a totally new project with just this one file in it and see if the error still occurs. Is there any other way I can help debug this?
Have you tried to reproduce the issue in the current dev build? Thanks.
dbalek, I just installed the 04/19 dev build and it still does the same thing. I'm attaching the messages.log, just in case that is of some help. tom
Created attachment 60500 [details] messages.log file when running 04/19 dev build
Fixed. changeset 0e2cc572dacb in main/nb-javac details: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=0e2cc572dacb changeset aad4c789c843 in main details: http://hg.netbeans.org/main?cmd=changeset;node=aad4c789c843
stupid question: is this going to be in 6.1?
Unfortunately the 6.1 is already prepared for release and no fixes are done in it now. But this would be good candidate for patch. Can you please verify the fix is ok in current dev build? If yes, will we be able to include it in patch. Thanks (the current dev build can be downloaded at http://bits.netbeans.org/dev/nightly/latest/)
Verified - works in 04/23 dev build. Thanks a bunch for fixing it. tom (am I supposed to mark issue as closed since I opened it?)
Thanks for verification. The plan is to release patch 1 on May 23rd
The fix has been ported into the release61_fixes branch: http://hg.netbeans.org/release61_fixes/rev/e7dd8f4031c7