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 64877 - CCE on annotation.getType() when annotation is not resolved
Summary: CCE on annotation.getType() when annotation is not resolved
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-22 10:15 UTC by Martin Adamek
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 Martin Adamek 2005-09-22 10:15:41 UTC
I have MDRPreChangeListener where I try to catch all events on annotations.
After adding @Stateless annotation (without fixing import) to Java class I call
((Annotation) ((AttributeEvent) event).getNewElement())getType() and I receive
following exception:
java.lang.ClassCastException: org.netbeans.jmi.javamodel.ParameterizedType$Impl
        at
org.netbeans.modules.javacore.jmiimpl.javamodel.AnnotationImpl.getType(AnnotationImpl.java:106)
        at org.netbeans.jmi.javamodel.Annotation$Impl.getType(Unknown Source)
        at
org.netbeans.modules.j2ee.dd.api.common.NNListenerManager.annotationsAdded(NNListenerManager.java:180)
        at
org.netbeans.modules.j2ee.dd.api.common.NNListenerManager.access$300(NNListenerManager.java:50)
        at
org.netbeans.modules.j2ee.dd.api.common.NNListenerManager$AnnotationsMDRPreChangeListener.change(NNListenerManager.java:231)
[catch] at
org.netbeans.mdr.util.EventNotifier$EventsDelivery.run(EventNotifier.java:270)
        at java.lang.Thread.run(Thread.java:595)
When import is fixed everything works fine;
Comment 1 Tomas Hurka 2005-09-22 10:24:39 UTC
Fixed in trunk.
Checking in javamodel/AnnotationImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/AnnotationImpl.java,v  
<--  AnnotationImpl.java
new revision: 1.21; previous revision: 1.20
done
Comment 2 Max Sauer 2007-02-14 17:24:33 UTC
This has become obsolete with interduction of Retouche. Marking as Verified.
---
NetBeans IDE Dev (Build 070214)
1.6.0; Java HotSpot(TM) Server VM 1.6.0-b105
Linux version 2.6.12-1.1390_FC4smp running on i386
en_US (nb); UTF-8
Comment 3 Quality Engineering 2007-09-20 09:57:34 UTC
Reorganization of java component