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 57215 - Wrong generics translation
Summary: Wrong generics translation
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Matula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-30 17:02 UTC by Jan Pokorsky
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch to fix the type parameters substitution. (2.11 KB, patch)
2005-03-31 15:05 UTC, Martin Matula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2005-03-30 17:02:26 UTC
Have an interface

 interface I<T extends Runnable> {
   void m(I p);
 }

and a class
 
 class C implements I {
 }

If you traverse from the class C to method I.m using JMI the type of the
parameter p is resolved to java.lang.Object which is wrong. The correct one
should be java.lang.Runnable according to generics specification.
Comment 1 Martin Matula 2005-03-31 15:04:03 UTC
I have a patch for this issue (will attach). However I am not sure if I should
commit it since something seems to hold hard reference to the ParameterizedType
which prevents its garbage collection. As a result if you change the bounds of
the type parameter in the interface, javacore still returns the
ParameterizedType with the original type parameters substitutions (old bounds).
I need to investigate more why this is the case.
Comment 2 Martin Matula 2005-03-31 15:05:00 UTC
Created attachment 21268 [details]
Proposed patch to fix the type parameters substitution.
Comment 3 Martin Matula 2005-08-24 13:02:27 UTC
Fixed.

Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/ParameterizedTypeImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ParameterizedTypeImpl.java,v
 <--  ParameterizedTypeImpl.java
new revision: 1.24; previous revision: 1.23
done
Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/TypeParameterImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/TypeParameterImpl.java,v
 <--  TypeParameterImpl.java
new revision: 1.25; previous revision: 1.24
done
Comment 4 Quality Engineering 2007-09-20 12:50:24 UTC
Reorganization of java component