On Thu, 14 May 2026 17:54:14 GMT, Mahendra Chhipa <[email protected]> wrote:

> Breakdown one test tomultiple test each for one method.
> 
> 
> 
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

These comments are only suggestions; feel free to ignore them if you don't 
think they are helpful.

test/jdk/sun/net/www/protocol/file/DirPermissionDenied.java line 58:

> 56:     public void connectTest() {
> 57:         assertThrows(IOException.class, ()-> {URLConnection uc = 
> url.openConnection();
> 58:         uc.connect();});

Might be better to move `url.openConnection()` out of the `assertThrows` to 
ensure that it not unexpectedly throws an exception?

test/jdk/sun/net/www/protocol/file/DirPermissionDenied.java line 64:

> 62:     public void getInputStreamTest() {
> 63:         assertThrows(IOException.class, ()-> {URLConnection uc = 
> url.openConnection();
> 64:             uc.getInputStream();});

Same as above, move `url.openConnection()` outside of `assertThrows`?

test/jdk/sun/net/www/protocol/file/DirPermissionDenied.java line 70:

> 68:     public void getContentLengthLongTest() {
> 69:         assertDoesNotThrow(() -> {URLConnection uc = url.openConnection();
> 70:         uc.getContentLengthLong();});

For better readability, place the statements on separate lines?

Suggestion:

        assertDoesNotThrow(() -> {
            URLConnection uc = url.openConnection();
            uc.getContentLengthLong();
        });

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

PR Review: https://git.openjdk.org/jdk/pull/31163#pullrequestreview-4293820526
PR Review Comment: https://git.openjdk.org/jdk/pull/31163#discussion_r3244596400
PR Review Comment: https://git.openjdk.org/jdk/pull/31163#discussion_r3244598483
PR Review Comment: https://git.openjdk.org/jdk/pull/31163#discussion_r3244603294

Reply via email to