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 61434 - Code completion doesn't display correct return type
Summary: Code completion doesn't display correct return type
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-26 23:37 UTC by vbrabant
Modified: 2007-09-26 09:14 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 vbrabant 2005-07-26 23:37:18 UTC
I created a new class.
In the body of the main method I fill

Integer myNumber = 10;
String className = myNumber.getC| and ask for code completion.
NetBeans propose getClass() Class<Object> and it displays in the javadoc the
following:
public final native Class<Object> getClass();

But it's not correct.

the getClass() method for a Integer is in fact returning a Class<? extends Integer>.
And the javadoc of the getClass member would display
public final native Class<Integer> getClass();
or at least 
public final native Class<? extends Object> getClass();

Also, if I write
Integer.cl| , the code completion propose

class     Class

I think it would be
class     Class<Integer>

just my 2 cents.
Comment 1 Dusan Balek 2005-10-27 18:19:12 UTC
ParameterizedType with Class as definition and Object as parameter is returned
from MDR as return type of getClass(). I have no idea how to get wildcards from
it. Reassigning to javacore for evaluation.
Comment 2 Tomas Hurka 2005-11-02 10:09:12 UTC
Fixed in trunk.
Checking in ParameterizedTypeImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ParameterizedTypeImpl.java,v
 <--  ParameterizedTypeImpl.java
new revision: 1.26; previous revision: 1.25
done
Comment 3 Quality Engineering 2007-09-20 12:02:20 UTC
Reorganization of java component