JDK-4826718 : REGRESSION: ClassCastException no longer reveals the runtime type
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-03-04
  • Updated: 2003-04-09
  • Resolved: 2003-04-09
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 tigerFixed
Related Reports
Relates :  
Description

Name: nt126004			Date: 03/03/2003


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
Since J2SE 1.4.1 the ClassCastException no longer reveals the runtime type of the casted object.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Cast an Integer to a String
2. Have a look at the StackTrace

EXPECTED VERSUS ACTUAL BEHAVIOR :
java.lang.ClassCastException: java.lang.Integer
java.lang.ClassCastException

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class Test {
    public static void main(String[] args) {
		Object i = new Integer(0);
        String s = (String)i;
    }
}
---------- END SOURCE ----------

Release Regression From : 1.4
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 181924) 
======================================================================

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

EVALUATION Regression was caused by large code changes to implement new fast subtyping mechanism. It's easy to fix. I have also fixed the corresponding case of array store check violations (ArrayStoreExceptions). Note: If this fix is ever back-ported to the 1.4 line, omit the following one line change: - Interpreter::_throw_ArrayStoreException_entry = generate_exception_handler("java/lang/ArrayStoreException" , NULL ); + Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException" ); ###@###.### 2003-03-18
18-03-2003