Bug 274885 - [ajdoc] Enumeration class with an inner class causing ajdoc failure.
Summary: [ajdoc] Enumeration class with an inner class causing ajdoc failure.
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: AJDoc (show other bugs)
Version: 1.6.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-04 15:24 EDT by Arturo Salazar CLA
Modified: 2013-06-24 11:07 EDT (History)
1 user (show)

See Also:


Attachments
Test FIle (503 bytes, text/plain)
2009-05-04 15:27 EDT, Arturo Salazar CLA
no flags Details
Fix: Not the best but it works (1.88 KB, patch)
2009-05-07 15:48 EDT, Arturo Salazar CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arturo Salazar CLA 2009-05-04 15:24:22 EDT
Build ID: M20090211-1700

Steps To Reproduce:
1. Create an Enumeration class with any amount of enumarations, and then declare an inner class.
enum A{
  B;
  class C{}
}

2. run ajdoc on the Enumeration  class.

More information:
I noticed the problem lies in the stub file generator's lack of knowledge of Java 5.0s enum class type. Enumeration classes require the first decelerations in its class to be the enumeration fields. When the stub file generator tries to generate this class it puts the inner class as the first declaration followed by the enumeration fields.  This is a clear syntax error for an enumeration class and javadoc reports it as such.
I've gone ahead and attached a test case with a bit more of the new functionality of enum classes to test ajdocs full understanding of the enum class type.
I'll be looking into the problem a bit more but a question that came up is, where would ajdoc handle the enum type?  The AsmHierarchyBuilder class seems to be where these cases are handled but i'm not clear on how it interprets an enum deceleration.
Comment 1 Arturo Salazar CLA 2009-05-04 15:27:04 EDT
Created attachment 134296 [details]
Test FIle

For some reason it failed to attach the test file to my initial post.
Comment 2 Arturo Salazar CLA 2009-05-04 15:35:16 EDT
Just realized i put the wrong ajdoc version. it should be 1.6.4
Comment 3 Arturo Salazar CLA 2009-05-07 15:48:22 EDT
Created attachment 134865 [details]
Fix: Not the best but it works

I found a fix for it which is to sort the IProgramElements making sure any objects that are type enumeration get put to the top of the list.  unfortunately the only place i could find to sort is in processMembers method right before it traverses the list of members.
I don't like the location of the sort but because of the way visiting works in AsmHierarcyBuilder I can't really find a better spot to do the sort.
Comment 4 Andrew Clement CLA 2013-06-24 11:07:18 EDT
unsetting the target field which is currently set for something already released