JDK-6396111 : api/java_sql/Timestamp/descriptions.html#ValueOf[Timestamp0020] test fails due to wrong exception
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.sql
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-09
  • Updated: 2012-03-23
  • Resolved: 2006-03-15
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.
JDK 6
6Resolved
Related Reports
Duplicate :  
Description
JCK            : JCK6.0 b19
J2SE           : FAIL - *SINCE* mustang b74
Platform[s]    : FAIL - all
switch/Mode    : FAIL - default

Negative test api/java_sql/Timestamp/descriptions.html#ValueOf[Timestamp0020] fails since mustang b74 because Timestamp throws ArrayOutOfBoundsException instead of IllegalArgumentException.

Steps to reproduce:

compile and run the following code. It returns different messages on mustang b73 and b74.

import java.sql.*;

public class ValueOfTests {
    public static void main(String argv[]) {
      try { 
        Timestamp t = Timestamp.valueOf("1996-10-10 12:30:40:50");  
        System.out.println("Test failed, valueOf() = " + t);
      }
      catch (IllegalArgumentException e) 
      { 
        System.out.println( "OKAY" );
      }
      catch (Exception e) 
      { 
        e.printStackTrace();
      }
    }
}