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 235871 - ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class
Summary: ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast t...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-12 11:45 UTC by Jan Lahoda
Modified: 2017-01-17 10:14 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 203805


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

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;

@RA(E.A)
@RA(E.B)
public class R {

}

enum E {
    A, B;
}

@Repeatable(RAC.class)
@interface RA {
    E value();
}


@interface RAC {
    RA[] value();
}




Stacktrace: 
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]
stacktrace
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]
stacktrace

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

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

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]
stacktrace

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

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
Comment 9 misterm 2015-05-14 19:35:48 UTC
Created attachment 153668 [details]
stacktrace

Typing
Comment 10 misterm 2015-05-14 19:38:48 UTC
Created attachment 153669 [details]
stacktrace

.
Comment 11 misterm 2015-05-15 05:23:49 UTC
Created attachment 153677 [details]
stacktrace

.