RFR: JDK-8315876 Open source several Swing CSS related tests

Alexey Ivanov aivanov at openjdk.org
Mon Sep 18 18:06:41 UTC 2023


On Mon, 18 Sep 2023 17:56:28 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> test/jdk/javax/swing/text/html/HTMLDocument/bug4209280.java line 41:
>> 
>>> 39:             JFrame jFrame = new JFrame("Unknown HTML tag Test");
>>> 40:             String html = "<html><bold>Foo</bold></html>";
>>> 41:             JLabel label = new JLabel(html);
>> 
>> I wonder if the test could be headless. I presume the exception is thrown when HTML is parsed. Does it happen in constructor? Does it happen when the label is added to a container?
>> 
>> Is it enough to create the label?
>
> I believe the original issue occurred when invalid html tags were set in the constructor -`new JLabel(html)` [JDK-4245889](https://bugs.openjdk.org/browse/JDK-4245889).
> 
> For making it headless I think it is probably sufficient to just create the label with invalid html tag then?

I think so.

You can also run the test in jdk1.2.0 or jdk1.2.2 to ensure it still reproduces the problem and then confirm jdk1.3.0 doesn't reproduce it. Without `invokeAndWait` and the lambda expression, it should compile fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15769#discussion_r1329102964


More information about the client-libs-dev mailing list