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.
I am writing some productivity tools, amongst which is a get/set generator for class fields, and I have discovered that: fieldElement.getType() fails to resolve generic types. i.e. when interating through the fields in a class such as this: class TestClass { private float m_testFloat=0.0f; private ArrayList<String> m_testArray=new ArrayList(); } in this way: ClassElement[] classElements=sourceElement.getClasses(); for(ClassElement classElement : classElements) { FieldElement fieldElement=classElement.getField(fieldIdentifier); JOptionPane.showMessageDialog(null, fieldElement.getType().toString(), "Debug", JOptionPane.PLAIN_MESSAGE); } fieldElement.getType() correctly identified primitives and classes, but fails to resolve generics such as ArrayList<String>, instead returning java.land.Object()
Seems like a javacore problem to me. Please note that there is a new Java infrastructure in NetBeans 6.0, see: http://wiki.netbeans.org/wiki/view/NewAndNoteWorthyMilestone5 http://wiki.netbeans.org/wiki/view/Java_DevelopersGuide http://wiki.netbeans.org/wiki/view/Java_EditorUsersGuide for more information.
Reorganization of java component
This issue is not valid in current builds any more. Java support was completely redesigned in 6.0 time frame. Please use NetBeans 6.0 and later.