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

Summary: ClassCastException: com.sun.tools.javac.code.Attribute$Error cannot be cast to com.sun.tools.javac.code.Attribute$Class
Product: java Reporter: Jan Lahoda <jlahoda>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal CC: akrasny, arittner, BleStaR, jiriprox, lhochet, misterm, pragalathan, puce, skygo
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 203805
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

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

.