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 90041 - fieldElement.getType() fails to resolve generic types
Summary: fieldElement.getType() fails to resolve generic types
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-25 14:44 UTC by armalcolm
Modified: 2008-02-25 16:12 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 armalcolm 2006-11-25 14:44:46 UTC
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()
Comment 1 Jan Lahoda 2006-12-21 11:01:29 UTC
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.
Comment 2 Quality Engineering 2007-09-20 12:35:45 UTC
Reorganization of java component
Comment 3 Jan Becicka 2008-02-25 16:12:06 UTC
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.