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.
Issue 46107 has been fixed, but now this has come up. I will be attaching the source file that cannot be opened as well as the stack trace.
Created attachment 16459 [details] Source file that cannot be opened
Created attachment 16460 [details] stack trace
I did a little more investigation and found that the problem is the attributes with a default value set to an enum. The parser is not handling this case.
Yes, problematic part is annotation attribute with default value like this one: SessionBeanType beanType() default SessionBeanType.STATELESS; This is correctly recognized as AStreeTypes.ANNOTATION_ATTRIBUTE_DECLARATION, but getText() for that ASTree returns "SessionBeanType beanType() default", so the last token is wrong and subtree at index 3 should have type AStreeTypes.DEFAULT_VALUE but now it returns MULTI_PART_ID.
Fixed incorrect token range for annotation attributes with default values.
Created attachment 16922 [details] Java code that is causing exception
Created attachment 16923 [details] stack trace
This is still not working correctly. I have tried the latest Q build (15 August I think) and the 17 August daily build. I have attached the problem file and the stack trace again.
I tried to dump the attached source code with DumpXMLTree and it seems that the description provided by Tomas still applies (the default value is not represented using DEFAULT_VALUE tree type). To make the testing easier, attached is a simple ant script and dtd that validates the dumped XML documents. Just place it into the same dir as the dumped XML files and run ant. Currently it fails for the file provided by David.
Created attachment 16925 [details] DTD that validates tree dumps
Created attachment 16926 [details] ant script that validates AST dumps
Finally nailed this: I was storing the default tree directly in the annotation tree, but needed to wrap it first in a DEFAULT_VALUE tree. Martin's validation test now passes.
Well, this is still not fixed for me either by 4.0 beta 1 or the August 23 daily build.
Please attach the other sources in mil.army.logsa.elfs.annotations.ejb, at least those so that the example can compile outside of your system, as I cannot verify the attached example without them. When you do so, please also reassign this issue back to me. Thanks for your help.
Created attachment 17127 [details] Project displaying problem
Thomas, I have attached the NB 4 project. I get the ClassCastException when I open up EjbSessionBean.java for editing. Thanks for taking a look at this again.
This is no longer caused by a bug in gjast. These exceptions are caused by a bug in MDRParser - a switch branch for handling DEFAULT_VALUE tree types is missing.
The bug is now fixed. However, I found out that finding usages in default values does not work currently due to another bug in nodes. I will file a separate issue for that. Checking in src/org/netbeans/modules/javacore/parser/MDRParser.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/MDRParser.java,v <-- MDRParser.java new revision: 1.45; previous revision: 1.44 done
The bug causing find usages to not work in annotation attribute default value has been filed as issue 47923.
*** Issue 49385 has been marked as a duplicate of this issue. ***
Verified in 4.2 (200507110943)
Reorganization of java component