Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 82549 invoked from network); 6 May 2009 12:40:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 May 2009 12:40:53 -0000 Received: (qmail 98463 invoked by uid 500); 6 May 2009 12:40:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 98446 invoked by uid 500); 6 May 2009 12:40:52 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 98436 invoked by uid 99); 6 May 2009 12:40:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 12:40:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 12:40:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EC968234C044 for ; Wed, 6 May 2009 05:40:30 -0700 (PDT) Message-ID: <207685565.1241613630968.JavaMail.jira@brutus> Date: Wed, 6 May 2009 05:40:30 -0700 (PDT) From: "Jim Yu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6181) [classlib][text] SimpleDateFormatTest.test_set2DigitYearStartLjava_util_Date would fail In-Reply-To: <1002776240.1240803510876.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706396#action_12706396 ] Jim Yu commented on HARMONY-6181: --------------------------------- Thanks, Tim! I just found a minor problem here. I think it should be changed as following. Index: modules/text/src/main/java/java/text/SimpleDateFormat.java =================================================================== --- modules/text/src/main/java/java/text/SimpleDateFormat.java (revision 772171) +++ modules/text/src/main/java/java/text/SimpleDateFormat.java (working copy) @@ -266,7 +266,7 @@ * spec. */ String templateForICU = patternForICU(template); - icuFormat.applyPattern(template); + icuFormat.applyPattern(templateForICU); pattern = template; } > [classlib][text] SimpleDateFormatTest.test_set2DigitYearStartLjava_util_Date would fail > --------------------------------------------------------------------------------------- > > Key: HARMONY-6181 > URL: https://issues.apache.org/jira/browse/HARMONY-6181 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M9 > Reporter: Jim Yu > Assignee: Tim Ellison > Fix For: 5.0M10 > > Attachments: HARMONY-6181.diff, HARMONY-6181_V2.diff > > Original Estimate: 24h > Remaining Estimate: 24h > > Currently the testcase test_set2DigitYearStartLjava_util_Date of SimpleDateFormatTest would fail as below[1]. After investigation, I noticed that this failure was caused by the different interpretation for pattern "y" between ICU and RI. In ICU spec, it explicitly mentioned "ICU interprets a single 'y' differently than Java." As ICU's behavior doesn't comply with the Java spec, it results in the Harmony defect in fact. Luckily, I've got a fix by doing a trick to solve this issue. > [1] Failure trace: > junit.framework.AssertionFailedError: Incorrect year 2000 expected:<2000> but was:<2> > at junit.framework.Assert.fail(Assert.java:47) > at junit.framework.Assert.failNotEquals(Assert.java:277) > at junit.framework.Assert.assertEquals(Assert.java:64) > at junit.framework.Assert.assertEquals(Assert.java:195) > at org.apache.harmony.text.tests.java.text.SimpleDateFormatTest.test_set2DigitYearStartLjava_util_Date(SimpleDateFormatTest.java:797) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > at java.lang.reflect.Method.invoke(Method.java:258) > at junit.framework.TestCase.runTest(TestCase.java:164) > at junit.framework.TestCase.runBare(TestCase.java:130) > at junit.framework.TestResult$1.protect(TestResult.java:110) > at junit.framework.TestResult.runProtected(TestResult.java:128) > at junit.framework.TestResult.run(TestResult.java:113) > at junit.framework.TestCase.run(TestCase.java:120) > at junit.framework.TestSuite.runTest(TestSuite.java:228) > at junit.framework.TestSuite.run(TestSuite.java:223) > at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35) > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.