ICU-6951 Fixed remaining compiler warnings.

X-SVN-Rev: 26120
This commit is contained in:
Yoshito Umaoka 2009-06-16 18:12:04 +00:00
parent 711d6680a9
commit 4149369dac
2 changed files with 15 additions and 13 deletions

View file

@ -5358,22 +5358,24 @@ public class TestCharset extends TestFmwk {
/* Increase code coverage for CharsetICU and CharsetProviderICU*/
public void TestCharsetICUCodeCoverage() {
CharsetProviderICU provider = new CharsetProviderICU();
if (provider.charsetForName("UTF16", null) != null) {
errln("charsetForName should have returned a null");
}
if (provider.getJavaCanonicalName(null) != null) {
if (CharsetProviderICU.getJavaCanonicalName(null) != null) {
errln("getJavaCanonicalName should have returned a null when null is given to it.");
}
try {
Charset testCharset = CharsetICU.forNameICU("bogus");
} catch (Exception ex) {
errln("UnsupportedCharsetException should be thrown for charset \"bogus\" - but got charset " + testCharset.name());
} catch (UnsupportedCharsetException ex) {
logln("UnsupportedCharsetException was thrown for CharsetICU.forNameICU(\"bogus\")");
}
Charset charset = provider.charsetForName("UTF16");
try {
((CharsetICU)charset).getUnicodeSet(null, 0);
} catch (IllegalArgumentException ex) {

View file

@ -176,20 +176,20 @@ public class TestSelection extends TestFmwk {
public void TestCharsetSelectorCodeCoverage() {
Vector emptyList = new Vector();
UnicodeSet nonEmptySet = new UnicodeSet();
nonEmptySet.add(0x0001, 0x0FFF);
CharsetSelector sel = null;
sel = new CharsetSelector(emptyList, nonEmptySet, CharsetICU.ROUNDTRIP_SET);
/* Test bogus mappingType */
try {
sel = new CharsetSelector(null, null, -1);
errln("IllegalArgumentException should have been thrown by CharsetSelector when given a bogus mappingType, but got - " + sel.toString());
} catch (IllegalArgumentException e) {
return;
logln("IllegalArgumentException was thrown by CharsetSelector with a bogus mappingType.");
}
errln("IllegalArgumentException should have been thrown by CharsetSelector when given a bogus mappingType.");
}
private String[] texts = {