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

Harshitha Onkar honkar at openjdk.org
Mon Sep 18 17:59:41 UTC 2023


On Mon, 18 Sep 2023 10:33:24 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Following tests are open sourced as part of this PR.
>> 
>> 1. test/jdk/javax/swing/text/html/CSS/bug4174871.java
>> 2. test/jdk/javax/swing/text/html/CSS/bug4174874.java
>> 3. test/jdk/javax/swing/text/html/CSS/bug4284162.java
>> 4. test/jdk/javax/swing/text/html/CSS/bug4764897.java
>> 5. test/jdk/javax/swing/text/html/HTMLDocument/bug4209280.java
>
> 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?

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

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


More information about the client-libs-dev mailing list