Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 122900 - Exception if pausing input on an incomplete line
Exception if pausing input on an incomplete line
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Compiler
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Dusan Balek
issues@java
61fixes1-fixed
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-27 21:25 UTC by twolf2919
Modified: 2008-06-04 08:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
screenshot of exception and source code in background (259.81 KB, image/png)
2007-11-27 21:32 UTC, twolf2919
Details
sample java class to reproduce error (588 bytes, text/plain)
2008-04-18 14:09 UTC, twolf2919
Details
messages.log file when running 04/19 dev build (36.18 KB, text/plain)
2008-04-21 16:07 UTC, twolf2919
Details

Note You need to log in before you can comment on or make changes to this bug.
Description twolf2919 2007-11-27 21:25:25 UTC
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)
Comment 1 twolf2919 2007-11-27 21:32:57 UTC
Created attachment 53573 [details]
screenshot of exception and source code in background
Comment 2 Peter Pis 2007-12-03 15:27:02 UTC
Reassigning to "java" for evaluation.
Comment 3 Jan Lahoda 2007-12-04 09:20:23 UTC
Unfortunately without a reproducible case, it is very unlikely to be fixable.
Comment 4 Jiri Prox 2008-04-11 00:53:57 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 5 pribyl 2008-04-18 12:54:24 UTC
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
Comment 6 twolf2919 2008-04-18 14:08:02 UTC
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 :-)
Comment 7 twolf2919 2008-04-18 14:09:24 UTC
Created attachment 60410 [details]
sample java class to reproduce error
Comment 8 pribyl 2008-04-18 15:41:24 UTC
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? 
Comment 9 twolf2919 2008-04-18 15:51:25 UTC
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?
Comment 10 Dusan Balek 2008-04-21 09:29:37 UTC
Have you tried to reproduce the issue in the current dev build? Thanks.
Comment 11 twolf2919 2008-04-21 16:05:23 UTC
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
Comment 12 twolf2919 2008-04-21 16:07:35 UTC
Created attachment 60500 [details]
messages.log file when running 04/19 dev build
Comment 13 Dusan Balek 2008-04-22 10:44:47 UTC
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
Comment 14 twolf2919 2008-04-22 14:06:58 UTC
stupid question: is this going to be in 6.1?
Comment 15 Jiri Prox 2008-04-23 08:12:55 UTC
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/)
Comment 16 twolf2919 2008-04-23 14:06:33 UTC
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?)
Comment 17 Jiri Prox 2008-04-23 14:41:09 UTC
Thanks for verification. The plan is to release patch 1 on May 23rd

Comment 18 pgebauer 2008-04-29 12:20:13 UTC
The fix has been ported into the release61_fixes branch:

http://hg.netbeans.org/release61_fixes/rev/e7dd8f4031c7


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo