On Mon, 31 May 2021 23:57:09 GMT, Mandy Chung <mch...@openjdk.org> wrote:

>> Aleksei Voitylov has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   address review comments
>
> test/jdk/java/lang/ClassLoader/loadLibraryDeadlock/TestLoadLibraryDeadlock.java
>  line 165:
> 
>> 163: 
>> 164:         runCommandInTestClassPath("rm", "-f", "*.jar")
>> 165:                 .shouldHaveExitValue(0);
> 
> You can use `jdk.test.lib.util.FileUtils` to delete a directory or a given 
> path.

Fixed.

> test/jdk/java/lang/ClassLoader/loadLibraryUnload/LoadLibraryUnload.java line 
> 83:
> 
>> 81:                 this.object = fromClass.newInstance();
>> 82:                 this.method = fromClass.getDeclaredMethod("loadLibrary");
>> 83:             } catch (Exception error) {
> 
> Nit: `s/Exception/ReflectiveOperationException/` as ROE is the specific 
> checked exception you want to catch here.

Fixed.

> test/jdk/java/lang/ClassLoader/loadLibraryUnload/LoadLibraryUnload.java line 
> 84:
> 
>> 82:                 this.method = fromClass.getDeclaredMethod("loadLibrary");
>> 83:             } catch (Exception error) {
>> 84:                 throw new Error(error);
> 
> Error is fine.  Most tests throw `RuntimeException` that can be another 
> choice.

Yes, used RuntimeException.

> test/jdk/java/lang/ClassLoader/loadLibraryUnload/LoadLibraryUnload.java line 
> 92:
> 
>> 90:             try {
>> 91:                 method.invoke(object);
>> 92:             } catch (Exception error) {
> 
> Same here to catch the `ReflectiveOperationException`.

Same here.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3976

Reply via email to