Skip to content

Commit a95717c

Browse files
nick-someoneGoogle Java Core Libraries
authored andcommitted
Widen acceptable exception type for code path that currently throws IllegalCharsetException
PiperOrigin-RevId: 378646642
1 parent a2e84d7 commit a95717c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

android/guava-tests/test/com/google/common/net/MediaTypeTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import com.google.common.testing.NullPointerTester;
4747
import java.lang.reflect.Field;
4848
import java.nio.charset.Charset;
49-
import java.nio.charset.IllegalCharsetNameException;
5049
import java.nio.charset.UnsupportedCharsetException;
5150
import java.util.Arrays;
5251
import junit.framework.TestCase;
@@ -537,7 +536,7 @@ public void testGetCharset_illegalCharset() {
537536
try {
538537
mediaType.charset();
539538
fail();
540-
} catch (IllegalCharsetNameException expected) {
539+
} catch (IllegalArgumentException expected) {
541540
}
542541
}
543542

guava-tests/test/com/google/common/net/MediaTypeTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import com.google.common.testing.NullPointerTester;
4747
import java.lang.reflect.Field;
4848
import java.nio.charset.Charset;
49-
import java.nio.charset.IllegalCharsetNameException;
5049
import java.nio.charset.UnsupportedCharsetException;
5150
import java.util.Arrays;
5251
import junit.framework.TestCase;
@@ -537,7 +536,7 @@ public void testGetCharset_illegalCharset() {
537536
try {
538537
mediaType.charset();
539538
fail();
540-
} catch (IllegalCharsetNameException expected) {
539+
} catch (IllegalArgumentException expected) {
541540
}
542541
}
543542

0 commit comments

Comments
 (0)