ICU-6549 Fix Java 1.3/1.4 build and test issues. Fix some JavaDoc warnings.

X-SVN-Rev: 24638
This commit is contained in:
Yoshito Umaoka 2008-09-24 22:25:52 +00:00
parent 0b4eb7caac
commit a017433ed5
11 changed files with 63 additions and 24 deletions

View file

@ -17,6 +17,7 @@ src/com/ibm/icu/text/DateFormat.java
src/com/ibm/icu/text/DateTimePatternGenerator.java
src/com/ibm/icu/text/DecimalFormat.java
src/com/ibm/icu/text/DigitList.java
src/com/ibm/icu/text/IndexCharacters.java
src/com/ibm/icu/text/MessageFormat.java
src/com/ibm/icu/text/NumberFormat.java
src/com/ibm/icu/text/RuleBasedCollator.java
@ -31,8 +32,11 @@ src/com/ibm/icu/util/UResourceBundle.java
src/com/ibm/icu/dev/test/bidi/TestAll.java
src/com/ibm/icu/dev/test/bidi/TestCompatibility.java
src/com/ibm/icu/dev/test/bigdec/DiagBigDecimal.java
src/com/ibm/icu/dev/test/calendar/CalendarRegression.java
src/com/ibm/icu/dev/test/calendar/CompatibilityTest.java
src/com/ibm/icu/dev/test/charsetdet/TestCharsetDetector.java
src/com/ibm/icu/dev/test/cldr/TestCLDRVsICU.java
src/com/ibm/icu/dev/test/collator/IndexCharactersTest.java
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
@ -52,6 +56,7 @@ src/com/ibm/icu/dev/test/TestDataModule.java
src/com/ibm/icu/dev/test/TestFmwk.java
src/com/ibm/icu/dev/test/TestUtil.java
src/com/ibm/icu/dev/test/timezone/TimeZoneAliasTest.java
src/com/ibm/icu/dev/test/timezone/TimeZoneBoundaryTest.java
src/com/ibm/icu/dev/test/timezone/TimeZoneRegression.java
src/com/ibm/icu/dev/test/translit/UnicodeMapTest.java
src/com/ibm/icu/dev/test/util/BagFormatter.java

View file

@ -1,3 +1,4 @@
//##header J2SE15
/**
*******************************************************************************
* Copyright (C) 2000-2008, International Business Machines Corporation and *
@ -815,6 +816,13 @@ public class CalendarRegression extends com.ibm.icu.dev.test.TestFmwk {
if (!cal.getTime().equals(epoch))
errln("Fail: after clear() expect " + epoch + ", got " + cal.getTime());
//#if defined(FOUNDATION10) || defined(J2SE13)
//## // This test case does not work well with JRE1.3 with
//## // the timezone update for US 2007 rule. Java 1.3 only
//## // supports single DST rule for all years. March 15
//## // was not in DST before, but with the new rule, it is
//## // in DST.
//#else
cal.setTime(d11);
cal.clear( Calendar.MONTH );
logln(cal.getTime().toString());
@ -822,6 +830,7 @@ public class CalendarRegression extends com.ibm.icu.dev.test.TestFmwk {
errln("Fail: " + d11 + " clear(MONTH) => expect " +
dM + ", got " + cal.getTime());
}
//#endif
}
public void Test4114578() {

View file

@ -1,3 +1,4 @@
//##header J2SE15
/**
*******************************************************************************
* Copyright (C) 2000-2008, International Business Machines Corporation and *
@ -338,6 +339,13 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
logln(" Got: " + cal.getTime() + " Expected: " + tempcal.getTime());
}
//#if defined(FOUNDATION10) || defined(J2SE13)
//## // This test case does not work well with JRE1.3 with
//## // the timezone update for US 2007 rule. Java 1.3 only
//## // supports single DST rule for all years. April 2, 1985
//## // was actually not in DST, but with the new rule, the date
//## // is in DST (which is actually wrong).
//#else
cal.clear();
cal.set(1985, 3, 2, 11, 49);
tempcal.clear();
@ -346,6 +354,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
errln("FAIL: Calendar.set(5 args) failed");
logln(" Got: " + cal.getTime() + " Expected: " + tempcal.getTime());
}
//#endif
cal.clear();
cal.set(1995, 9, 12, 1, 39, 55);

View file

@ -1,3 +1,6 @@
//##header J2SE15
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
/*
*******************************************************************************
* Copyright (C) 2008, International Business Machines Corporation and *
@ -78,3 +81,4 @@ public class IndexCharactersTest extends TestFmwk {
}
}
}
//#endif

View file

@ -1100,7 +1100,8 @@ public class FormatTests
formats[i] = getCannedDecimalFormat("#,##0.###", uloc);
}
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
if (formats[0] != null) {
// Ticket#6449
// Once formatToCharacterIterator is called, NumberFormat.Field
@ -1113,7 +1114,7 @@ public class FormatTests
AttributedCharacterIterator aci = formats[0].formatToCharacterIterator(new Double(12.345D));
if (aci == null) {} // NOP - for resolving 'Unused local variable' warning.
}
//#endif
return formats;
}
}

View file

@ -1,6 +1,7 @@
//##header J2SE15
/**
*******************************************************************************
* Copyright (C) 2000-2005, International Business Machines Corporation and *
* Copyright (C) 2000-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -430,6 +431,12 @@ public class TimeZoneBoundaryTest extends TestFmwk
TimeZone.setDefault(save);
}
//#if defined(FOUNDATION10) || defined(J2SE13)
//## // This test case does not work well with JRE1.3 with
//## // the timezone update for US 2007 rule. Java 1.3 only
//## // supports single DST rule for all years. Thus, the
//## // new rule is also applied to year 1997 incorrectly.
//#else
if (true)
{
// This only works in PST/PDT
@ -441,6 +448,7 @@ public class TimeZoneBoundaryTest extends TestFmwk
tempcal.set(1997, 6, 1);
findDaylightBoundaryUsingDate(tempcal.getTime(), "PDT", PST_1997_END);
}
//#endif
// if (true)
// {

View file

@ -1439,7 +1439,7 @@ public class TimeZoneTest extends TestFmwk
int dstSavings = jdkCal.get(java.util.Calendar.DST_OFFSET);
int[] offsets = new int[2];
icuCaracas.getOffset(jdkCal.getTimeInMillis(), false, offsets);
icuCaracas.getOffset(jdkCal.getTime().getTime()/*jdkCal.getTimeInMillis()*/, false, offsets);
boolean isTimeZoneSynchronized = true;

View file

@ -4487,7 +4487,7 @@ public class DecimalFormat extends NumberFormat {
return parseBigDecimal;
}
//#if defined(FOUNDATION10)
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
private void writeObject(ObjectOutputStream stream) throws IOException {
// Doug, do we need this anymore?

View file

@ -1,3 +1,6 @@
//##header J2SE15
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
/*
*******************************************************************************
* Copyright (C) 2008, Google Inc, International Business Machines Corporation
@ -58,7 +61,8 @@ import com.ibm.icu.impl.CollectionUtilities.MultiComparator;
* </ul>
*
* @author markdavis
* @draft
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
//TODO(markdavis) return an additional character that is the "least greater" character than
//the last character.
@ -79,7 +83,8 @@ public class IndexCharacters {
/**
* Create the index object.
* @param locale
* @draft
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
public IndexCharacters(ULocale locale) {
this.locale = locale;
@ -168,13 +173,11 @@ public class IndexCharacters {
indexCharacters = Collections.unmodifiableSet(indexCharacters);
}
/**
/*
* Return the string with interspersed CGJs. Input must have more than 2 codepoints.
* @param item
* @return
*/
private String separated(String item) {
StringBuilder result = new StringBuilder();
StringBuffer result = new StringBuffer();
// add a CGJ except within surrogates
char last = item.charAt(0);
result.append(last);
@ -191,8 +194,9 @@ public class IndexCharacters {
/**
* Get the index characters.
* @return
* @draft
* @return A collection including the index characters
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
public Collection getIndexCharacters() {
return indexCharacters;
@ -200,8 +204,9 @@ public class IndexCharacters {
/**
* Get the locale
* @return
* @draft
* @return The locale.
* @draft ICU 4.2
* @provisional This API might change or be removed in a future release.
*/
public ULocale getLocale() {
return locale;
@ -210,8 +215,7 @@ public class IndexCharacters {
/**
* As the index is built, items may be discarded from the exemplars.
* This contains some of the discards, and is intended for debugging.
* @return
* @draft
* @internal
*/
public Map getAlreadyIn() {
return alreadyIn;
@ -220,8 +224,7 @@ public class IndexCharacters {
/**
* As the index is built, items may be discarded from the exemplars.
* This contains some of the discards, and is intended for debugging.
* @return
* @draft
* @internal
*/
public List getNoDistinctSorting() {
return noDistinctSorting;
@ -230,14 +233,13 @@ public class IndexCharacters {
/**
* As the index is built, items may be discarded from the exemplars.
* This contains some of the discards, and is intended for debugging.
* @return
* @draft
* @internal
*/
public List getNotAlphabetic() {
return notAlphabetic;
}
/**
/*
* Comparator that returns "better" items first, where shorter NFKD is better,
* and otherwise NFKD binary order is better, and otherwise binary order is better.
*/
@ -269,3 +271,4 @@ public class IndexCharacters {
}
}
}
//#endif

View file

@ -175,7 +175,7 @@ import com.ibm.icu.util.ULocale;
* "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64"
* would be interpreted as May 4, 1964.
* During parsing, only strings consisting of exactly two digits, as defined by
* {@link UCharacter#isDigit(char)}, will be parsed into the default
* {@link com.ibm.icu.lang.UCharacter#isDigit(int)}, will be parsed into the default
* century.
* Any other numeric string, such as a one digit string, a three or more digit
* string, or a two digit string that isn't all digits (for example, "-1"), is

View file

@ -246,7 +246,7 @@ public class TimeUnitFormat extends MeasureFormat {
/**
* Parse a TimeUnitAmount.
* @see java.text.Format#parse(java.lang.String, java.text.FieldPosition)
* @see java.text.Format#parseObject(java.lang.String, java.text.ParsePosition)
* @draft ICU 4.0
* @provisional This API might change or be removed in a future release.
*/