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 70701 - RuntimeException is thrown for some annotations
Summary: RuntimeException is thrown for some annotations
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-21 15:41 UTC by Petr Blaha
Modified: 2007-09-26 09:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (1.65 KB, text/plain)
2005-12-21 15:42 UTC, Petr Blaha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2005-12-21 15:41:23 UTC
[build 20051208]
For some annotations the java.lang.RuntimeException: Unexpected type of ASTree:
86 is thrown. User can't continue in editing the file with this annotation. I
was able to reproduce the issue for case:
@TableGenerator(name="ORDER_GEN",table=@Table("XXX"))

It seems that annotation @Table is problem.
Comment 1 Petr Blaha 2005-12-21 15:42:10 UTC
Created attachment 28012 [details]
stack trace
Comment 2 Petr Blaha 2006-01-16 16:48:09 UTC
move from temp component
Comment 3 Martin Adamek 2006-01-20 10:06:17 UTC
Fixed by merge from release50 branch.
Comment 4 Petr Blaha 2006-01-20 13:20:16 UTC
Stll reproducible for case:
@MessageDriven(
        activationConfig={ 
        @ActivationConfigProperty(propertyName="destinationType",
        propertyValue="javax.jms.Queue") })
Comment 5 Petr Blaha 2006-01-24 08:44:36 UTC
I'm able to reproduce the issue in J2SE project and NetBeans 5.0.
Comment 6 Milan Kubec 2006-01-24 13:27:00 UTC
Please provide complete testcase. I'm not able to reproduce with provided
annotation only on FCS build.
Comment 7 Petr Blaha 2006-01-24 13:49:15 UTC
Steps to reproduce:
1) create new Java project
2) add javaee.jar on project's classpath
3) add new class in project
4) implements MessageListener intf
5) implement onMessage method
6) paste mentioned annotation above public class ...
7) Fix import, press Alt+Shift+F 
Comment 8 Milan Kubec 2006-01-24 13:53:42 UTC
Thanks for the info. One small question - where do I get the javaee.jar?
Comment 9 Jan Becicka 2006-01-24 14:12:56 UTC
And one more question, why is this issue P1?
Comment 10 Milan Kubec 2006-01-24 15:08:46 UTC
Lowering priority, it's not stopper for 5.0 release. Must be fixed for next release.
Comment 11 Petr Blaha 2006-01-24 15:13:01 UTC
I think that the issue isn't a stopper for NetBeans 5.0 but should be resolved
in NetBeans 5.5 Preview release. The issues blocks a user to create MDB beans
and we would like to show these types of EJB in comming release.
Comment 12 Petr Jiricka 2006-01-24 15:40:53 UTC
This is a P1 for the NB 5.5 Preview release. Thanks.
Comment 13 Jan Becicka 2006-01-26 12:45:14 UTC
This issue is similar to issue 65285, which was already fixed. Unfortunately
this test case is still valid.
Comment 14 Tomas Hurka 2006-01-27 11:49:17 UTC
The exception is caused by very special combination. Annotation must have initialization of 
ArrayInitialization type and this ArrayInitialization must contain another Annotation. Something like this:

@A ( d={ @C() , @D() } )
Comment 15 Andrei Badea 2006-01-27 16:43:10 UTC
Right. Note that this is used quite often in the Java Persistence API. Another
example:

@SecondaryTables({
    @SecondaryTable(name="TBL1"), 
    @SecondaryTable(name="TBL2")
})
class ...
Comment 16 Tomas Hurka 2006-01-31 09:30:31 UTC
Fixed in trunk.
Checking in ArrayInitializationImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
ArrayInitializationImpl.java,v  <--  ArrayInitializationImpl.java
new revision: 1.6; previous revision: 1.5
done
Checking in MetadataElement.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/MetadataElement.java,v  
<--  MetadataElement.java
new revision: 1.71; previous revision: 1.70
done
Comment 17 Petr Blaha 2006-01-31 13:25:10 UTC
Issue verified in continual build 20060131-1055. Please, commit the fix in
javaee5 branch.
Comment 19 Petr Blaha 2006-02-17 12:17:17 UTC
build 200602072300
Comment 20 Quality Engineering 2007-09-20 10:18:53 UTC
Reorganization of java component