JDK-4250683 : kestrel I fails: api/java_text/SimpleDateFormat/index.html#Format, #Parse
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-06-30
  • Updated: 1999-09-02
  • Resolved: 1999-09-02
Related Reports
Duplicate :  
Description
 tao.zhang@eng 1999-06-29

In order to reproduce this bug, please run the attached shell script file. 
Please keep this file for future reference.
Test case can be found in:
/net/tapas/export1/testexec/JCK-122a/tests/api/java_text/SimpleDateFormat
JDK version: Kestrel I
JCK version: 1.2.2

Test:api/java_text/SimpleDateFormat/index.html#Format
api/java_text/SimpleDateFormat/index.html#Parse

Output from the jtr file:
#Test Results
#Wed Jun 23 17:12:26 PDT 1999
description=file:/net/tapas/export1/testexec/JCK-122a/tests/api/java_text/SimpleDateFormat/index.html#Parse
testsuite=/net/tapas/export1/testexec/JCK-122a/tests
execStatus=Failed. tests: 28; passed: 27; failed: 1; first test case failure: SimpleDateFormat0122
end=Wed Jun 23 17:12:26 PDT 1999
work=/export0/results/13i/i3pupkin122anative/api/java_text/SimpleDateFormat
executeClass=javasoft.sqe.tests.api.java.text.SimpleDateFormat.ParseTests
status=Failed. tests: 28; passed: 27; failed: 1; first test case failure: SimpleDateFormat0122
keywords=positive runtime text
start=Wed Jun 23 17:12:21 PDT 1999
title=SimpleDateFormat Parse method tests
javatestVersion=JT_2.0_zn
id=Parse
file=/net/tapas/export1/testexec/JCK-122a/tests/api/java_text/SimpleDateFormat/index.html
sections=testExecute testExecute
environment=jck-runtime-solaris
source=ParseTests.java

test: api/java_text/SimpleDateFormat/index.html#Parse
script: javasoft.sqe.javatest.lib.JCKScript -runtime
Executing test class...
command: javasoft.sqe.javatest.lib.ExecJCKTestOtherJVMCmd CLASSPATH=/export0/results/13i/i3pupkin122anative/classes:/net/tapas/export1/testexec/JCK-122a/tests/../classes:/net/tapas/export1/testexec/JCK-122a/javatest.jar:/net/tapas/export0/jdk13i/solaris/lib/tools.jar:/net/tapas/export0/jdk13i/solaris/jre/lib/rt.jar:/net/tapas/export0/jdk13i/solaris/jre/lib/i18n.jar DISPLAY=pupkin:0.0 HOME=/home/smitha LD_LIBRARY_PATH=/net/tapas/export1/testexec/JCK-122a/tests/../lib:/net/tapas/export1/testexec/JCK-122a/tests/../lib_solaris: /net/tapas/export0/jdk13i/solaris/bin/java -native -Xfuture javasoft.sqe.tests.api.java.text.SimpleDateFormat.ParseTests
----------ref:testExecute(8/256)----------
method parse(String, ParsePosition) should set MILLISECOND field to 1
  it sets this field to 100
  String:  "1"
  pattern: "S"
method parse(String, ParsePosition) should set MILLISECOND field to 2
  it sets this field to 200
  String:  "2"
  pattern: "S"
----------log:testExecute(29/1119)----------
SimpleDateFormat0105: Passed. OKAY
SimpleDateFormat0106: Passed. OKAY
SimpleDateFormat0107: Passed. OKAY
SimpleDateFormat0108: Passed. OKAY
SimpleDateFormat0109: Passed. OKAY
SimpleDateFormat0110: Passed. OKAY
SimpleDateFormat0111: Passed. OKAY
SimpleDateFormat0112: Passed. OKAY
SimpleDateFormat0113: Passed. OKAY
SimpleDateFormat0114: Passed. OKAY
SimpleDateFormat0115: Passed. OKAY
SimpleDateFormat0116: Passed. OKAY
SimpleDateFormat0117: Passed. OKAY
SimpleDateFormat0118: Passed. OKAY
SimpleDateFormat0119: Passed. OKAY
SimpleDateFormat0120: Passed. OKAY
SimpleDateFormat0121: Passed. OKAY
SimpleDateFormat0122: Failed. public Date parse(String text, ParsePosition pp)
SimpleDateFormat0123: Passed. OKAY
SimpleDateFormat0124: Passed. OKAY
SimpleDateFormat0125: Passed. OKAY
SimpleDateFormat0126: Passed. OKAY
SimpleDateFormat0127: Passed. OKAY
SimpleDateFormat0128: Passed. OKAY
SimpleDateFormat0129: Passed. OKAY
SimpleDateFormat0130: Passed. OKAY
SimpleDateFormat0131: Passed. OKAY
SimpleDateFormat0132: Passed. OKAY
STATUS:Failed. tests: 28; passed: 27; failed: 1; first test case failure: SimpleDateFormat0122
command result: Failed. tests: 28; passed: 27; failed: 1; first test case failure: SimpleDateFormat0122
test result: Failed. tests: 28; passed: 27; failed: 1; first test case failure: SimpleDateFormat0122

Comments
WORK AROUND
11-06-2004

SUGGESTED FIX
11-06-2004

PUBLIC COMMENTS
10-06-2004

EVALUATION There are two problems with the formatting of milliseconds. The first occurs when there is a single "S" in the format string. The SimpleDateFormat.format() method returns only one of the digits when it should return a minimum of one digit but should use as many as are required to fully represent the number of milliseconds as per the spec. The second problem occurs when there are 4 "S"s in the format string and there are only 3 digits required to represent the number of milliseconds. If the time is 890 milliseconds then the formatted time should be "0890" but the SimpleDateFormat.format() method is returning "9800". The zero padding should be leading and not trailing. stuart.gill@eng 1999-07-14 This is same one as #4253490. Any difference? Closing as dup. koushi.takahashi@japan 1999-09-02
14-07-1999