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 49385 - java.lang.ClassCastException using annotation
Summary: java.lang.ClassCastException using annotation
Status: RESOLVED DUPLICATE of bug 46580
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-22 06:46 UTC by pzgyuanf
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pzgyuanf 2004-09-22 06:46:20 UTC
NetBeans beta1(build 200408191352)
OS: windowss 2000 x86
jdk: 1.5.0-beta2


this sample from Brett McLaughlin's article:
Annotations in Tiger
---------------------------
package test;

public class Test {
  @TODO(
    
    item="Figure out the amount of interest per
month",
    assignedTo="Brett McLaughlin",
    dateAssigned="08/04/2004"
   )
  public void calculateInterest(float amount,
float rate) {
    // Need to finish this method later
  }
  
  /**
   * Annotation type to indicate a task still
needs to be
   *   completed.
   */
  @interface TODO {
    public enum Severity { CRITICAL, IMPORTANT,
TRIVIAL, DOCUMENTATION };

    Severity severity() default Severity.IMPORTANT;
    String item();
    String assignedTo();
    String dateAssigned();
  }  
}
----------------------
as input the source or modify it,
many times throw:
Annotation: Exception occurred in Request Processor
java.lang.ClassCastException:
org.netbeans.modules.javacore.parser.NameRef
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:555)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:351)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:407)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:351)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:437)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:319)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:287)
	at
org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:264)
	at
org.netbeans.modules.javacore.parser.MDRParser.enterMembers(MDRParser.java:206)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directUpdate(ResourceImpl.java:539)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:464)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.updateFromDataObject(ResourceImpl.java:374)
	at
org.netbeans.modules.javacore.ExclusiveMutex.parseIfNeeded(ExclusiveMutex.java:214)
	at
org.netbeans.modules.javacore.ExclusiveMutex.enter(ExclusiveMutex.java:133)
	at
org.netbeans.mdr.NBMDRepositoryImpl.beginTrans(NBMDRepositoryImpl.java:232)
	at
org.netbeans.modules.java.JavaEditor$2.run(JavaEditor.java:225)
	at org.openide.util.Task.run(Task.java:136)
	at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686)
Comment 1 Tomas Hurka 2004-09-22 09:43:17 UTC

*** This issue has been marked as a duplicate of 46580 ***
Comment 2 Quality Engineering 2007-09-20 12:01:24 UTC
Reorganization of java component