<AWT Dev> RFR: 8272342: [TEST_BUG] java/awt/print/PrinterJob/PageDialogMarginTest.java catches all exceptions
Alexey Ivanov
aivanov at openjdk.java.net
Fri Aug 13 19:47:29 UTC 2021
On Fri, 13 Aug 2021 19:23:21 GMT, rajat mahajan <github.com+79671271+rajamah at openjdk.org> wrote:
> Removed try catch block so the test can function as expected and fail
> when it ought to, rather than passing all the time because of catch
> block catching all exceptions and Passing test even there is a failure.
Please add
Locale.setDefault(Locale.US);
as the first line in `main()`, otherwise the Page Format dialog uses millimetres instead of inches for non-US locales.
Please resolve IDE warnings:
1. Use Java style array declaration in main: `String[] args`.
2. Line 51: Casting 'null' to 'Component' is redundant.
3. Line 50: Statement lambda can be replaced with expression lambda.
Please update the copyright year.
test/jdk/java/awt/print/PrinterJob/PageDialogMarginTest.java line 58:
> 56: HashPrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
> 57: PageFormat pf;
> 58: pf = pj.pageDialog(aset);
I suggest merging these two lines:
Suggestion:
PageFormat pf = pj.pageDialog(aset);
-------------
Changes requested by aivanov (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5115
More information about the awt-dev
mailing list