JDK-6255169 : (reflect) ParameterizedType.getRawType should return Class not Type
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2005-04-14
  • Updated: 2020-07-28
  • Resolved: 2011-08-16
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

A DESCRIPTION OF THE PROBLEM :
The new ParameterizedType interface defines the getRawType method to return the type representing the raw type of the parameterized type. The type of a raw type must be a Class object, so the method should have a return type of Class<?> not Type.

  To use this method you have cast the return value to Class.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Always cast the return value to Class
###@###.### 2005-04-14 09:39:02 GMT

Comments
EVALUATION Regardless of whether or not the return type of ParameterizedType.getRawType should have been Class<?> rather than Type initially, it is somewhat impractical to make that change now due to source and binary compatability concerns. Closing as will not fix.
16-08-2011