JDK-5004321 : Object.getClass() should return erased class type
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2004-02-26
  • Updated: 2017-05-16
  • Resolved: 2004-04-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b48Fixed
Related Reports
Relates :  
Description
See http://forum.java.sun.com/thread.jsp?forum=316&thread=496028

The following program fragment fails to compile

    void f(List<Integer> li, List<String> ls) {
        if (li.getClass() == ls.getClass())
	    ;
    }

because the intersection of Class<List<Integer>> and Class<List<String>> is
empty.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b48 tiger-beta2
2004-06-14

PUBLIC COMMENTS ...
2004-06-10

EVALUATION To address this we should relax the rules for getClass, so that on an expression e of static type X, e.getClass() returns a value of type Class<? extends erasure(X)> ###@###.### 2004-02-26 Awaiting CCC approval. ###@###.### 2004-02-27 ###@###.### 2004-03-09
2004-02-26