RFR: 8315594: Open source few headless Swing misc tests

Andrey Turbanov aturbanov at openjdk.org
Wed Sep 6 09:15:44 UTC 2023


On Wed, 6 Sep 2023 06:05:59 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Few closed swing tests are open sourced

test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java line 39:

> 37:     public static void main(String[] args) throws Exception {
> 38:         SwingUtilities.invokeAndWait(() -> {
> 39:             final JTextPane textpane = new JTextPane ();

Suggestion:

            final JTextPane textpane = new JTextPane();

test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java line 40:

> 38:         SwingUtilities.invokeAndWait(() -> {
> 39:             final JTextPane textpane = new JTextPane ();
> 40:             textpane.setContentType ("text/html");

Suggestion:

            textpane.setContentType("text/html");

test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java line 41:

> 39:             final JTextPane textpane = new JTextPane ();
> 40:             textpane.setContentType ("text/html");
> 41:             final EditorKit kit = textpane.getEditorKit ();

Suggestion:

            final EditorKit kit = textpane.getEditorKit();

test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java line 49:

> 47:                 kit.write(out, textpane.getDocument(), 0,
> 48:                           textpane.getDocument().getLength());
> 49:                 out.close ();

Suggestion:

                out.close();

test/jdk/javax/swing/text/html/HTMLEditorKit/bug4267840.java line 52:

> 50:             } catch (Exception e) {}
> 51:             try {
> 52:                 if (file.length() < 6 ) {  // simply can't be

Suggestion:

                if (file.length() < 6) {  // simply can't be

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15577#discussion_r1316989038
PR Review Comment: https://git.openjdk.org/jdk/pull/15577#discussion_r1316989404
PR Review Comment: https://git.openjdk.org/jdk/pull/15577#discussion_r1316989243
PR Review Comment: https://git.openjdk.org/jdk/pull/15577#discussion_r1316987297
PR Review Comment: https://git.openjdk.org/jdk/pull/15577#discussion_r1316987478


More information about the client-libs-dev mailing list