United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4826718 : REGRESSION: ClassCastException no longer reveals the runtime type

Details
Type:
Bug
Submit Date:
2003-03-04
Status:
Resolved
Updated Date:
2003-04-09
Project Name:
JDK
Resolved Date:
2003-04-09
Component:
hotspot
OS:
windows_2000
Sub-Component:
compiler
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.1
Fixed Versions:
5.0 (tiger)

Related Reports
Relates:

Sub Tasks

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


                                     
2004-06-14
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
                                     
2003-03-18



Hardware and Software, Engineered to Work Together