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 161450 - AssertionError at com.sun.tools.javac.code.Types$9.visitType
Summary: AssertionError at com.sun.tools.javac.code.Types$9.visitType
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Max Sauer
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-30 10:58 UTC by Marian Petras
Modified: 2011-01-06 14:27 UTC (History)
14 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 148534


Attachments
stacktrace (1.70 KB, text/plain)
2009-03-30 10:58 UTC, Marian Petras
Details
stacktrace (1.70 KB, text/plain)
2009-03-31 17:20 UTC, theshadow27
Details
stacktrace (1.70 KB, text/plain)
2009-03-31 23:45 UTC, theshadow27
Details
stacktrace (1.70 KB, text/plain)
2009-03-31 23:54 UTC, theshadow27
Details
threaddump (26.11 KB, text/plain)
2009-04-01 00:06 UTC, theshadow27
Details
stacktrace (1.70 KB, text/plain)
2009-04-01 02:19 UTC, peterbecker
Details
stacktrace (1.70 KB, text/plain)
2009-04-01 11:54 UTC, kawazu428
Details
stacktrace (1.70 KB, text/plain)
2009-04-01 12:55 UTC, dynamite
Details
stacktrace (1.70 KB, text/plain)
2009-04-01 18:07 UTC, Torbjorn Norbye
Details
stacktrace (1.70 KB, text/plain)
2009-04-01 23:39 UTC, Torbjorn Norbye
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2009-03-30 10:58:07 UTC
Build: NetBeans IDE Dev (Build 090328)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.26-1-amd64, amd64

User Comments:
mpetras: Compiled module - and there were some errors. So I clicked on one of the compiler error message links in the Output window to open the location with error. The file was opened at the given location but I also got the AssertionError.



Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 1 Marian Petras 2009-03-30 10:58:11 UTC
Created attachment 79042 [details]
stacktrace
Comment 2 Dusan Balek 2009-03-30 18:27:13 UTC
Are you able to reproduce the issue on your sources?
Comment 3 Marian Petras 2009-03-31 12:09:55 UTC
I currently have no compilation errors in my sources - so I cannot reproduce this bug.
Comment 4 theshadow27 2009-03-31 17:20:15 UTC
Build: NetBeans IDE Dev (Build 200903310200)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-56, Java(TM) SE Runtime Environment, 1.6.0_07-b06-146
OS: Mac OS X, 10.5.6, x86_64

User Comments: 
typed:
dir = new File(); <return key>
while editing a java file

Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 5 theshadow27 2009-03-31 17:20:28 UTC
Created attachment 79162 [details]
stacktrace
Comment 6 theshadow27 2009-03-31 23:45:26 UTC
Build: NetBeans IDE Dev (Build 200903310200)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-56, Java(TM) SE Runtime Environment, 1.6.0_07-b06-146
OS: Mac OS X, 10.5.6, x86_64

User Comments: 
Was able to reproduce exception:

1) Start a new Java Class Lib project on a blank user directory
2) Create a new Java class and create any method (I used PSVM)
3) Type "File f"
4) Hit Meta+I to import java.io.file
5) On the same line, type "= new File()"
 
The "File()" is not a typo, and there is no File constructor which takes no arguments. If I had to guess this is what triggered the exception. JSD

Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 7 theshadow27 2009-03-31 23:45:29 UTC
Created attachment 79184 [details]
stacktrace
Comment 8 theshadow27 2009-03-31 23:54:23 UTC
Build: NetBeans IDE Dev (Build 200903310200)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-56, Java(TM) SE Runtime Environment, 1.6.0_07-b06-146
OS: Mac OS X, 10.5.6, x86_64

User Comments: 
"new InetAddress()" triggered the same exception 

Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 9 theshadow27 2009-03-31 23:54:27 UTC
Created attachment 79185 [details]
stacktrace
Comment 10 theshadow27 2009-04-01 00:06:22 UTC
Created attachment 79186 [details]
threaddump
Comment 11 peterbecker 2009-04-01 02:19:29 UTC
Build: NetBeans IDE Dev (Build 200903310200)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-11-generic, i386

User Comments: 
Opening a Java file in the editor.

NetBeans seems to be very confused recently, it keeps claiming some of my classes are not there. I can't expand their name via Ctrl+Space, they get curly red lines everywhere and the open type dialog doesn't pick them up either. The Java file I tried to open belongs to one of those, so that might be related.

Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 12 peterbecker 2009-04-01 02:19:39 UTC
Created attachment 79193 [details]
stacktrace
Comment 13 kawazu428 2009-04-01 11:54:22 UTC
Build: NetBeans IDE Dev (Build 200903310200)
VM: Java HotSpot(TM) Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.28-11-generic, i386

User Comments: 
not sure... tried "fix imports"?

Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 14 kawazu428 2009-04-01 11:54:26 UTC
Created attachment 79217 [details]
stacktrace
Comment 15 dynamite 2009-04-01 12:55:31 UTC
Build: NetBeans IDE Dev (Build 200903310200)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 
            LineNumberReader reader = new LineNumberReader(new InputStreamReader(cmsServer.getInputStream(),"utf8"));
            List<String> lines = new ArrayList<
            String line = reader.readLine();
            System.out.println("LINE: "+line);

My cursor is after ArrayList<

Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 16 dynamite 2009-04-01 12:55:37 UTC
Created attachment 79220 [details]
stacktrace
Comment 17 Dusan Balek 2009-04-01 13:36:11 UTC
Reproducible.

NONE type should not be passed as argument to TypeUtilities.isCastable(...) method. Reassigning to java.hints
Comment 18 Max Sauer 2009-04-01 14:36:54 UTC
Diky Dusane, fixed + added test.
---
http://hg.netbeans.org/jet-main/rev/ed4bd9b13142
Comment 19 Exceptions Reporter 2009-04-01 14:45:36 UTC
This issue has already 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=148534
Comment 20 Torbjorn Norbye 2009-04-01 18:07:31 UTC
Build: NetBeans IDE Dev (Build 090331)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-56, Java(TM) SE Runtime Environment, 1.6.0_07-b06-146
OS: Mac OS X, 10.5.6, x86_64

User Comments: 


Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 21 Torbjorn Norbye 2009-04-01 18:07:47 UTC
Created attachment 79239 [details]
stacktrace
Comment 22 Torbjorn Norbye 2009-04-01 23:39:34 UTC
Build: NetBeans IDE Dev (Build 090401)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-56, Java(TM) SE Runtime Environment, 1.6.0_07-b06-146
OS: Mac OS X, 10.5.6, x86_64

User Comments: 


Stacktrace: 
java.lang.AssertionError
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:938)
        at com.sun.tools.javac.code.Types$9.visitType(Types.java:1101)
        at com.sun.tools.javac.code.Type.accept(Type.java:96)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3561)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:912)
        at com.sun.tools.javac.code.Types.isCastable(Types.java:894)
Comment 23 Torbjorn Norbye 2009-04-01 23:39:38 UTC
Created attachment 79251 [details]
stacktrace
Comment 24 Quality Engineering 2009-04-02 07:26:42 UTC
Integrated into 'main-golden', will be available in build *200904020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ed4bd9b13142
User: Max Sauer <msauer@netbeans.org>
Log: #161450: AE at com.sun.tools.javac.code.Types$9.visitType
Comment 25 theshadow27 2009-04-03 03:51:26 UTC
Verified no longer an issue on 200904011705 (i.e. M3). 

There is a warning however:
WARNING [org.netbeans.modules.parsing.impl.TaskProcessor]: ParserManager.parse called in AWT event thread by: 
org.netbeans.modules.editor.java.JavaCompletionItem$ClassItem.substituteText(JavaCompletionItem.java:698)

Comment 26 Max Sauer 2009-04-03 09:32:50 UTC
Thanks for verification. The mentioned warning has nothing to do with this issue.
Comment 27 asmotrich 2010-12-23 19:41:18 UTC
Just happened on the 7.0 development build 201012150001 - I just pasted some code into the Java editor from another Java source file.
Comment 28 asmotrich 2010-12-25 21:07:28 UTC
This exception is becoming quite frequent and quite annoying on the current (7.0) dev builds, I just uploaded a bunch of stack traces. Caveat - it happens when you paste a code snippet with annotations, especially annotations containing list of values: @OneToOne(cascade={CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}), and * IMPORTANT * proper import statements have not been created yet.
Comment 29 Dusan Balek 2011-01-06 14:27:22 UTC
The latest reports (those against NB 7.0 dev builds) are duplicates of another already reported issue #193492. The original bug remains fixed.