RFR: 8316388: Opensource five Swing component related regression tests [v3]

Alexey Ivanov aivanov at openjdk.org
Thu Mar 14 09:38:38 UTC 2024


On Wed, 13 Mar 2024 20:51:18 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> test/jdk/javax/swing/JEditorPane/bug4694598.java line 74:
>> 
>>> 72:         String html = "<HTML> <BODY>" +
>>> 73:                 "<FRAMESET cols=\"100%\">" +
>>> 74:                 "<FRAME src=\"" + frameContentUrl + "\">" +
>> 
>> Suggestion:
>> 
>>                 "<FRAME src="" + frameContentFile.toUri()+ "">" +
>> 
>> Isn't it enough? Alternatively, `"file:/" + frameContentFile.toAbsolutePath()` produces the same result as `frameContentFile.toUri().toURL()`.
>> 
>> Another option is to convert the `Path` to `URL` in the `main` method before calling `setupGUI` and remove try-catch blocks.
>
> Again, i do not mind the try/catch block and using URI instead of URL gives different result and i am not sure the original bug would be reproducible with URI which will make it a strange case of the regression test.

Okay.

Without the try-catch blocks, the code is simpler… Ensuring the updated test still reproduces the original issue is always a good thing to do, but running the updated with an old version of Java often requires modifying the source code again.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18259#discussion_r1524534991


More information about the client-libs-dev mailing list