Skip to content

Commit

Permalink
Widen acceptable exception type for code path that currently throws I…
Browse files Browse the repository at this point in the history
…llegalCharsetException

PiperOrigin-RevId: 378646642
  • Loading branch information
nick-someone authored and Google Java Core Libraries committed Jun 10, 2021
1 parent a2e84d7 commit a95717c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import com.google.common.testing.NullPointerTester;
import java.lang.reflect.Field;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import junit.framework.TestCase;
Expand Down Expand Up @@ -537,7 +536,7 @@ public void testGetCharset_illegalCharset() {
try {
mediaType.charset();
fail();
} catch (IllegalCharsetNameException expected) {
} catch (IllegalArgumentException expected) {
}
}

Expand Down
3 changes: 1 addition & 2 deletions guava-tests/test/com/google/common/net/MediaTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import com.google.common.testing.NullPointerTester;
import java.lang.reflect.Field;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import junit.framework.TestCase;
Expand Down Expand Up @@ -537,7 +536,7 @@ public void testGetCharset_illegalCharset() {
try {
mediaType.charset();
fail();
} catch (IllegalCharsetNameException expected) {
} catch (IllegalArgumentException expected) {
}
}

Expand Down

0 comments on commit a95717c

Please sign in to comment.