Bug 235871 - ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class
ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast t...
Status: NEW
Product: java
Classification: Unclassified
Component: Compiler
All All
: P3 (vote)
Assigned To: Dusan Balek
Depends on:
  Show dependency treegraph
Reported: 2013-09-12 11:45 UTC by Jan Lahoda
Modified: 2015-04-21 10:50 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT

stacktrace (1.85 KB, text/plain)
2013-09-12 11:45 UTC, Jan Lahoda
stacktrace (2.96 KB, text/plain)
2014-02-07 10:40 UTC, Jiri Prox
stacktrace (1.91 KB, text/plain)
2014-03-14 15:52 UTC, skygo
stacktrace (1.83 KB, text/plain)
2014-08-19 17:13 UTC, Andrew Krasny
stacktrace (3.06 KB, text/plain)
2014-08-20 15:58 UTC, arittner
stacktrace (1.86 KB, text/plain)
2015-04-21 10:50 UTC, Exceptions Reporter

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2013-09-12 11:45:12 UTC
Build: NetBeans IDE Dev (Build 20130828-814a27f8b811)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_11-b21
OS: Linux

User Comments:
jlahoda: R.java in the default package:
package use;

import java.lang.annotation.Repeatable;

public class R {


enum E {
    A, B;

@interface RA {
    E value();

@interface RAC {
    RA[] value();

java.lang.ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class
   at com.sun.tools.javac.comp.Check.validateRepeatable(Check.java:2750)
   at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4437)
   at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4378)
   at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4312)
   at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4286)
   at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1288)
Comment 1 Jan Lahoda 2013-09-12 11:45:14 UTC
Created attachment 139979 [details]
Comment 2 Jan Lahoda 2013-09-12 11:48:15 UTC
And I had another copy of the file in the "use" package - first happened to me when I was tried to move the file from the use package into the default package.
Comment 3 Jiri Prox 2014-02-07 10:40:30 UTC
Created attachment 144902 [details]

Using code completion
Comment 4 skygo 2014-03-14 15:52:20 UTC
Created attachment 146028 [details]

Editing annotation @interface that use 
Comment 5 Andrew Krasny 2014-08-19 17:13:51 UTC
Created attachment 148772 [details]

Editing file
Comment 6 Exceptions Reporter 2014-08-19 17:13:58 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=203805
Comment 7 arittner 2014-08-20 15:58:51 UTC
Created attachment 148798 [details]

Adding a @Repeatable Annotation, Codecompletion in @Repeatable (|)
Comment 8 Exceptions Reporter 2015-04-21 10:50:00 UTC
Created attachment 153285 [details]

I created annotation which uses @Repeatable (using the tutorial - http://softwarecave.org/2014/05/20/repeating-annotations-in-java-8/ ) and then this error happend not allowing me to try this class.

If you want more info write me on petriczekk@gmail.com

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