Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4826718
Votes 3
Synopsis REGRESSION: ClassCastException no longer reveals the runtime type
Category hotspot:compiler2
Reported Against 1.4.1
Release Fixed 1.5(tiger)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 4921296
Submit Date 04-MAR-2003
Description




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 :
 customer  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  customer .

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) 
======================================================================
Work Around
N/A
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"                 );

  xxxxx@xxxxx   2003-03-18
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang