Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6304469

REGRESSION: Incompatible to 1.4.xx

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      Java Version:1.5.0_04

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      ClassCastException with code that runs as i expected until 1.4.2_XX

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run Testcode i added

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Output:

      Java Version:1.4.2_05
      Result: 0
      ACTUAL -
      Output:

      Java Version:1.5.0_04
      Exception in thread "main" java.lang.ClassCastException: java.util.Date
              at java.sql.Timestamp.compareTo(Timestamp.java:474)
              at Testcase.main(Testcase.java:24)


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.ClassCastException: java.util.Date
              at java.sql.Timestamp.compareTo(Timestamp.java:474)
              at Testcase.main(Testcase.java:24)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Testcase {

          public static void main(String[] args) {
              System.out.println("Java Version:" + System.getProperty("java.version"));
              
              java.util.Date utilDate = new java.util.Date();
              java.sql.Timestamp sqlTimetamp = new java.sql.Timestamp(utilDate.getTime());
              java.util.Date testDate = (java.util.Date)sqlTimetamp;
              
              System.out.println("Result: " + testDate.compareTo(utilDate)); // <<< Exception
          }
          
      }
      ---------- END SOURCE ----------

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jssunw Jitender S (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: