From 7855175c22a7fffb5012626b6da1c0501242f14c Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Fri, 16 Jan 2009 05:18:40 +0000 Subject: [PATCH] ICU-6134 Old Java compatibility support. NumberFormat.Field is not available on Java 1.3 environment. X-SVN-Rev: 25263 --- icu4j/preprocessor.txt | 1 + .../test/format/IntlTestDecimalFormatAPI.java | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/icu4j/preprocessor.txt b/icu4j/preprocessor.txt index fe316e6ae3b..847b2de3022 100644 --- a/icu4j/preprocessor.txt +++ b/icu4j/preprocessor.txt @@ -41,6 +41,7 @@ src/com/ibm/icu/dev/test/collator/RandomCollator.java src/com/ibm/icu/dev/test/duration/ICUDurationTest.java src/com/ibm/icu/dev/test/format/BigNumberFormatTest.java src/com/ibm/icu/dev/test/format/DateFormatTest.java +src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPIC.java src/com/ibm/icu/dev/test/format/IntlTestNumberFormatAPI.java src/com/ibm/icu/dev/test/format/NumberFormatRegressionTest.java diff --git a/icu4j/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java b/icu4j/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java index 52fcc500fb6..1a1a987951a 100644 --- a/icu4j/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java +++ b/icu4j/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java @@ -1,6 +1,7 @@ +//##header J2SE15 /***************************************************************************************** * - * Copyright (C) 1996-2008, International Business Machines + * Copyright (C) 1996-2009, International Business Machines * Corporation and others. All Rights Reserved. **/ @@ -265,25 +266,27 @@ public class IntlTestDecimalFormatAPI extends com.ibm.icu.dev.test.TestFmwk } } - public void testJB6134() - { - DecimalFormat decfmt = new DecimalFormat(); - StringBuffer buf = new StringBuffer(); +//#if defined(FOUNDATION10) || defined(J2SE13) +//#else + public void testJB6134() + { + DecimalFormat decfmt = new DecimalFormat(); + StringBuffer buf = new StringBuffer(); - FieldPosition fposByInt = new FieldPosition(NumberFormat.INTEGER_FIELD); - decfmt.format(123, buf, fposByInt); + FieldPosition fposByInt = new FieldPosition(NumberFormat.INTEGER_FIELD); + decfmt.format(123, buf, fposByInt); - buf.setLength(0); - FieldPosition fposByField = new FieldPosition(NumberFormat.Field.INTEGER); - decfmt.format(123, buf, fposByField); - - if (fposByInt.getEndIndex() != fposByField.getEndIndex()) - { - errln("ERROR: End index for integer field - fposByInt:" + fposByInt.getEndIndex() + - " / fposByField: " + fposByField.getEndIndex()); - } - } + buf.setLength(0); + FieldPosition fposByField = new FieldPosition(NumberFormat.Field.INTEGER); + decfmt.format(123, buf, fposByField); + if (fposByInt.getEndIndex() != fposByField.getEndIndex()) + { + errln("ERROR: End index for integer field - fposByInt:" + fposByInt.getEndIndex() + + " / fposByField: " + fposByField.getEndIndex()); + } + } +//#endif }