JDK-8007546 : ClassCastException on JSR308 tests
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-02-05
  • Updated: 2013-10-23
  • Resolved: 2013-06-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b98Fixed
Description
Several tests on JSR308 fail with compiler error:

An exception has occurred in the compiler (1.8.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.ClassCastException: com.sun.tools.javac.code.Type$AnnotatedType cannot be cast to com.sun.tools.javac.code.Type$ArrayType
	at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3028)
	at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1863)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:601)
	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:619)
	at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:1079)
	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:828)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:601)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:646)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:662)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1116)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:884)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:601)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:646)
	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1019)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:771)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:601)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:646)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4066)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3975)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3909)
	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:3883)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1254)
	at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:907)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:866)
	at com.sun.tools.javac.main.Main.compile(Main.java:506)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:129)
	at com.sun.jck.lib.CompilerAPICommand.doCompile(CompilerAPICommand.java:362)
	at com.sun.jck.lib.SharedCompilerAPICmd.doCompile(SharedCompilerAPICmd.java:89)
	at com.sun.jck.lib.SharedCompilerAPICmd.run(SharedCompilerAPICmd.java:69)
	at javasoft.sqe.jckutils.lib.GenLangSigFileCommand.generate(GenLangSigFileCommand.java:99)
	at javasoft.sqe.jckutils.lib.GenLangBaseCommand.run(GenLangBaseCommand.java:89)
	at com.sun.javatest.agent.Agent$Task.executeCommand(Agent.java:839)
	at com.sun.javatest.agent.Agent$Task.execute(Agent.java:783)
	at com.sun.javatest.agent.Agent$Task.handleRequest(Agent.java:645)
	at com.sun.javatest.agent.Agent.handleRequestsUntilClosed(Agent.java:416)
	at com.sun.javatest.agent.Agent.access$000(Agent.java:60)
	at com.sun.javatest.agent.Agent$1.run(Agent.java:282)
	at java.lang.Thread.run(Thread.java:722)


The list of the tests:
lang/ANNOT/annot107/annot10701m803
lang/ANNOT/annot107/annot10701m815
lang/ANNOT/annot107/annot10701m826
lang/ANNOT/annot107/annot10701m837
lang/ANNOT/annot107/annot10701m872
lang/ANNOT/annot107/annot10701m883
lang/ANNOT/annot107/annot10701m895
lang/ANNOT/annot107/annot10701m906
lang/ANNOT/annot107/annot10701m917
lang/ANNOT/annot107/annot10701m928
lang/ANNOT/annot107/annot10701m931
lang/ANNOT/annot107/annot10701m975
lang/ANNOT/annot107/annot10701m986
lang/ANNOT/annot107/annot10701m997
Comments
The latest results at http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=307728.JDK8-LANGTOOLS-NIGHTLY-1
23-10-2013

I have a working fix, currently running regression tests.
10-06-2013

As Joel currently OOO, and I have a fix for https://jbs.oracle.com/bugs/browse/JDK-8015993, which I strongly suspect to be a duplicate of this one, I'm reassigning this bug to myself.
10-06-2013

Joel, can you look at this.
12-03-2013

These tests will be in the soon to be promoted JCK build 18. Until the promotion, the tests can be fun from here: /java//re/jck/8/nightly/binaries/latest/JCK-compiler-8
14-02-2013

I don't see any lang/ANNOT/annot107 tests in the current jck testbase: ls J:/re/jck/8/promoted/latest/binaries/JCK-compiler-8/tests/lang/ANNOT/ ./ annot011/ annot023/ annot035/ annot047/ annot123/ annot135/ ../ annot012/ annot024/ annot036/ annot049/ annot124/ annot136/ annot001/ annot013/ annot025/ annot037/ annot050/ annot125/ annot137/ annot002/ annot014/ annot026/ annot038/ annot052/ annot126/ annot138/ annot003/ annot015/ annot027/ annot039/ annot055/ annot127/ annot139/ annot004/ annot016/ annot028/ annot040/ annot060/ annot128/ annot140/ annot005/ annot017/ annot029/ annot041/ annot061/ annot129/ index.html annot006/ annot018/ annot030/ annot042/ annot062/ annot130/ annot007/ annot019/ annot031/ annot043/ annot110/ annot131/ annot008/ annot020/ annot032/ annot044/ annot120/ annot132/ annot009/ annot021/ annot033/ annot045/ annot121/ annot133/ annot010/ annot022/ annot034/ annot046/ annot122/ annot134/ Where are they?
05-02-2013