Java.Lang.IllegalArgumentException And java.sql.Date.valueOf() Method

(Doc ID 1335215.1)

Last updated on FEBRUARY 27, 2017

Applies to:

Oracle JRockit - Version R28.1.3 and later
Information in this document applies to any platform.

Symptoms


The following code works fine with JDK jrockit-R28.0.1 version and below:

import java.util.Locale;
public class TestDate {

public static void main(String[] args) {
System.out.println("Locale: " + Locale.getDefault());
System.out.println("Parsed: " +
java.sql.Date.valueOf("1999-20-01"));
}
}


However, this fails with the following error when running with the JDK jrockit-R28.1.3 version:

Exception in thread "Main Thread" java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:139)
at TestDate.main(TestDate.java:15)

Changes

Changes from version to version effect the code to work

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms