On Wed, 26 May 2021 16:03:02 GMT, Alexander Zuev <kiz...@openjdk.org> wrote:
>> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 67: >> >>> 65: if (!gotException) { >>> 66: throw new RuntimeException("Negative size icon should throw >>> invalid argument exception"); >>> 67: } >> >> A suggestion: throw the exception inside try-block and ignore the expected >> exception, then `gotException` can be dropped. >> Suggestion: >> >> try { >> fsv.getSystemIcon(new File("."), -1, 16); >> throw new RuntimeException("Negative size icon should throw >> invalid argument exception"); >> } catch (IllegalArgumentException iae) { >> // expected >> } >> >> >> Shall the test also exercise 0 as an invalid parameter? Shall the test also >> pass an invalid height? > > Fixed. I do not think such detailed testing is required. After all it is not a full spec conformance test. ------------- PR: https://git.openjdk.java.net/jdk/pull/2875