[jdk11u-dev] RFR: 8367348: Enhance PassFailJFrame to support links in HTML
David Sladký
duke at openjdk.org
Mon Feb 9 21:46:05 UTC 2026
Backport of [JDK-8367348](https://bugs.openjdk.org/browse/JDK-8367348) - Enhance PassFailJFrame to support links in HTML. Tests become more interactive if users can click links in the instructions and handle them with their own HyperlinkListener.
This backport is in follow up to the backport of [JDK-8213781](https://bugs.openjdk.org/browse/JDK-8213781) ([this PR](https://github.com/openjdk/jdk11u-dev/pull/3118)).
There are two differences compared to the corresponding [backport to jdk17](https://github.com/openjdk/jdk17u-dev/pull/4106/changes)
- [The change to comment block](https://github.com/openjdk/jdk17u-dev/commit/9e1a6bef2ac7f0c7615d153672a296847f09240a#diff-b1cbfd9042cb693b23dbead14bb6dfec13f738252c978551a983826453586410L101) was omitted because the comment block differ quite a bit between current jdk11 and jdk17 versions, hence it is not clear if and where this change should be integrated.
- [This if](https://github.com/openjdk/jdk17u-dev/commit/9e1a6bef2ac7f0c7615d153672a296847f09240a#diff-b1cbfd9042cb693b23dbead14bb6dfec13f738252c978551a983826453586410R651) uses pattern matching for `instanceof`, which is a feature that is not supported by jdk11, hence I edited this to be jdk11 compatible.
// version in jdk17
if (hyperlinkListener != null && text instanceof JEditorPane ep) {
ep.addHyperlinkListener(hyperlinkListener);
}
// version in this backport
if (hyperlinkListener != null && text instanceof JEditorPane) {
((JEditorPane) text).addHyperlinkListener(hyperlinkListener);
}
### Tests
Testing was done on Fedora 43.
#### Tier 1 - PASSES
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
jtreg:test/hotspot/jtreg:tier1 1497 1497 0 0
jtreg:test/jdk:tier1 1900 1900 0 0
jtreg:test/langtools:tier1 3940 3940 0 0
jtreg:test/nashorn:tier1 0 0 0 0
jtreg:test/jaxp:tier1 0 0 0 0
==============================
TEST SUCCESS
#### GTest - PASSES
==============================
Test summary
==============================
TEST TOTAL PASS FAIL ERROR
gtest:all/server 504 504 0 0
==============================
TEST SUCCESS
#### GHA - PASSES
`macos-x64 hs/tier1 serviceability` is failing, but this seems to be common over other unrelated PRs too -> not relevant to this backport.
#### Bonus tests - PASSES
I identified following interactive tests that are affected by this backport that seems to be behaving the same way before and after this backport:
- `test/jdk/java/awt/font/TextLayout/ArabicBox.java`
- `test/jdk/java/awt/font/TextLayout/TestJustification.java`
- `test/jdk/java/awt/Frame/ALTTABIconBeingErased/ALTTABIconBeingErased.java`
- `test/jdk/java/awt/Frame/DefaultSizeTest.java`
- `test/jdk/java/awt/Frame/GetBoundsResizeTest.java`
- `test/jdk/java/awt/geom/HitTest/PathHitTest.java`
- `test/jdk/java/awt/Icon/IconChangingTest/IconChangingTest.java`
- `test/jdk/java/awt/Icon/IconShowingTest/IconShowingTest.java`
- `test/jdk/java/awt/Icon/IconTransparencyTest/IconTransparencyTest.java`
- `test/jdk/java/awt/Icon/SetLargeIconTest/SetLargeIconTest.java`
- `test/jdk/java/awt/LightweightComponent/LightweightCliprect.java`
- `test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java`
- `test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java`
- `test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java`
- `test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java`
- `test/jdk/java/awt/PopupMenu/TruncatedPopupMenuTest.java`
- `test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java`
- `test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java`
- `test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java`
- `test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java`
- `test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java`
- `test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java`
- `test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java`
- `test/jdk/javax/swing/JComboBox/JComboBoxActionEvent.java`
- `test/jdk/javax/swing/JComboBox/JComboBoxBorderTest.java`
- `test/jdk/javax/swing/JFrame/bug4419914.java`
- `test/jdk/javax/swing/JFrame/DefaultCloseOperation.java`
- `test/jdk/javax/swing/JMenuItem/TestRadioAndCheckMenuItemWithIcon.java`
- `test/jdk/javax/swing/JRadioButton/bug4380543.java`
- `test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java`
- `test/jdk/javax/swing/JToolBar/bug4203039.java`
- `test/jdk/javax/swing/MultiMonitor/MultimonVImage.java`
- `test/jdk/javax/swing/ProgressMonitor/ProgressTest.java`
- `test/jdk/javax/swing/text/bug4148489.java`
- `test/jdk/javax/swing/text/html/StyleSheet/bug4803145.java`
- `test/jdk/javax/swing/text/PaintTest.java`
- `test/jdk/sun/awt/PaletteTester.java`
---
### Bonus info
This PR may not be the best place to mention this, but since I have no idea where other place to bring this up:
While trying to run the interactive tests mentioned above I find out that few of them are unable to compile, since they make use of `"""` for string block, which is a feature that is not supported by jdk11. The tests that this applies to:
- `GetBoundsResizeTest.java`
- `AddRemoveMenuBarTest_1.java`
- `AddRemoveMenuBarTest_2.java`
- `AddRemoveMenuBarTest_3.java`
- `AddRemoveMenuBarTest_4.java`
Out of curiosity I searched the jdk11 repo and found one more test that also uses `"""`:
- `test/jdk/sun/awt/PaletteTester.java`
Looking into other tests from above that also failed:
- `JComboBoxBorderTest.java` -> seems to be macos specific test that is being executed on Linux too, because it misses corresponding annotation to be run only on mac.
- `TestJustification.java` also seems to be failing on Linux, but in `test/jdk/ProblemList.txt` it is mention only as mac specific.
-------------
Commit messages:
- backport 9e1a6bef2ac7f0c7615d153672a296847f09240a
Changes: https://git.openjdk.org/jdk11u-dev/pull/3147/files
Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=3147&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8367348
Stats: 21 lines in 1 file changed: 20 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk11u-dev/pull/3147.diff
Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/3147/head:pull/3147
PR: https://git.openjdk.org/jdk11u-dev/pull/3147
More information about the jdk-updates-dev
mailing list