RFR: 8325851: Hide PassFailJFrame.Builder constructor
Alexey Ivanov
aivanov at openjdk.org
Mon Mar 11 21:23:23 UTC 2024
The `Builder` class in `PassFailJFrame` is public and has a public constructor. At the same time, a better design would be to hide all the Builder constructors and rely on the `builder()` method which returns an instance of the `Builder` class.
This PR makes the constructor of the `Builder` class private so that it's not accessible directly.
Use `PassFailJFrame.builder()` to get an instance of the builder and configure parameters of `PassFailJFrame`.
I updated all the tests which used the constructor directly by calling `new PassFailJFrame.Builder()`.
I converted a few tests to use the `testUI`, which greatly simplifies the test code. This change also removes flickering of the test UI.
-------------
Commit messages:
- Minor updates to createUI in ComboPopupBug
- Use testUI in ComboPopupBug
- Use testUI in DefaultCloseOperation and reduce the number of columns
- Use testUI in LightweightCliprect
- Remove unused EventQueue import
- Use testUI in DefaultSizeTest
- Use testUI in FrameRepackTest
- Use testUI in MultimonVImage
- Use testUI in AddRemoveMenuBar_{1..4}
- Remove unused EventQueue import
- ... and 5 more: https://git.openjdk.org/jdk/compare/0a6e64e2...91361e52
Changes: https://git.openjdk.org/jdk/pull/18206/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18206&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8325851
Stats: 242 lines in 21 files changed: 14 ins; 118 del; 110 mod
Patch: https://git.openjdk.org/jdk/pull/18206.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18206/head:pull/18206
PR: https://git.openjdk.org/jdk/pull/18206
More information about the client-libs-dev
mailing list