Skip to content

Commit 0ca08e4

Browse files
author
duke
committed
Added webrev for jdk/9388
1 parent d0e7d23 commit 0ca08e4

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

jdk/9388/00/commits.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"commit":{"message":"Fix"},"files":[{"filename":"test\/jdk\/javax\/swing\/JOptionPane\/TestOptionPaneStackOverflow.java"}],"sha":"9376b0ff26216c36cf9464725e5e139403cdd93e"},{"commit":{"message":"8224267: JOptionPane message string with 5000+ newlines produces StackOverflowError"},"files":[{"filename":"test\/jdk\/javax\/swing\/JOptionPane\/TestOptionPaneStackOverflow.java"}],"sha":"31733b7829645d54eeff6b7ce0a58cecf91da727"},{"commit":{"message":"8224267: JOptionPane message string with 5000+ newlines produces StackOverflowError"},"files":[{"filename":"test\/jdk\/javax\/swing\/JOptionPane\/TestOptionPaneStackOverflow.java"}],"sha":"e355e00863814b82e585f26614a3a14961425765"},{"commit":{"message":"8224267: JOptionPane message string with 5000+ newlines produces StackOverflowError"},"files":[{"filename":"src\/java.desktop\/share\/classes\/javax\/swing\/plaf\/basic\/BasicOptionPaneUI.java"},{"filename":"test\/jdk\/javax\/swing\/JOptionPane\/TestOptionPaneStackOverflow.java"}],"sha":"53d9b0cd68736b1b176b0bd0920656c61a04de1c"}]

jdk/9388/00/comparison.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"files":[{"patch":"@@ -458,9 +458,12 @@\n- \/\/ break up newlines\n- if (nl == 0) {\n- @SuppressWarnings(\"serial\") \/\/ anonymous class\n- JPanel breakPanel = new JPanel() {\n- public Dimension getPreferredSize() {\n- Font f = getFont();\n-\n- if (f != null) {\n- return new Dimension(1, f.getSize() + 2);\n+ try {\n+ \/\/ break up newlines\n+ if (nl == 0) {\n+ @SuppressWarnings(\"serial\") \/\/ anonymous class\n+ JPanel breakPanel = new JPanel() {\n+ public Dimension getPreferredSize() {\n+ Font f = getFont();\n+\n+ if (f != null) {\n+ return new Dimension(1, f.getSize() + 2);\n+ }\n+ return new Dimension(0, 0);\n@@ -468,9 +471,12 @@\n- return new Dimension(0, 0);\n- }\n- };\n- breakPanel.setName(\"OptionPane.break\");\n- addMessageComponents(container, cons, breakPanel, maxll,\n- true);\n- } else {\n- addMessageComponents(container, cons, s.substring(0, nl),\n- maxll, false);\n+ };\n+ breakPanel.setName(\"OptionPane.break\");\n+ addMessageComponents(container, cons, breakPanel, maxll,\n+ true);\n+ } else {\n+ addMessageComponents(container, cons, s.substring(0, nl),\n+ maxll, false);\n+ }\n+ addMessageComponents(container, cons, s.substring(nl + nll), maxll,\n+ false);\n+ } catch (StackOverflowError e) {\n+ return;\n@@ -478,3 +484,0 @@\n- addMessageComponents(container, cons, s.substring(nl + nll), maxll,\n- false);\n-\n","filename":"src\/java.desktop\/share\/classes\/javax\/swing\/plaf\/basic\/BasicOptionPaneUI.java","additions":24,"deletions":21,"binary":false,"changes":45,"status":"modified"},{"patch":"@@ -0,0 +1,59 @@\n+\/*\n+ * Copyright (c) 2022, Oracle and\/or its affiliates. All rights reserved.\n+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n+ *\n+ * This code is free software; you can redistribute it and\/or modify it\n+ * under the terms of the GNU General Public License version 2 only, as\n+ * published by the Free Software Foundation.\n+ *\n+ * This code is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n+ * version 2 for more details (a copy is included in the LICENSE file that\n+ * accompanied this code).\n+ *\n+ * You should have received a copy of the GNU General Public License version\n+ * 2 along with this work; if not, write to the Free Software Foundation,\n+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n+ *\n+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n+ * or visit www.oracle.com if you need additional information or have any\n+ * questions.\n+ *\/\n+\n+\/* @test\n+ @bug 8224267\n+ @key headful\n+ @summary Verifies if StackOverflowError is not thrown for multiple newlines\n+ @run main TestOptionPaneStackOverflow\n+ *\/\n+\n+import javax.swing.JDialog;\n+import javax.swing.JFrame;\n+import javax.swing.JOptionPane;\n+import javax.swing.SwingUtilities;\n+\n+public class TestOptionPaneStackOverflow\n+{\n+ static JFrame frame;\n+\n+ public static void main(String[] argv) throws Exception\n+ {\n+ try {\n+ String message = java.nio.CharBuffer.allocate(5000).toString().\n+ replace('\\0','\\n');\n+ SwingUtilities.invokeAndWait(() -> {\n+ frame = new JFrame();\n+ JOptionPane optionPane = new JOptionPane();\n+ optionPane.createDialog(frame, null);\n+ optionPane.setMessage(message);\n+ });\n+ } finally {\n+ SwingUtilities.invokeAndWait(() -> {\n+ if (frame != null) {\n+ frame.dispose();\n+ }\n+ });\n+ }\n+ }\n+}\n","filename":"test\/jdk\/javax\/swing\/JOptionPane\/TestOptionPaneStackOverflow.java","additions":59,"deletions":0,"binary":false,"changes":59,"status":"added"}]}

jdk/9388/00/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"head":{"repo":{"full_name":"prsadhuk\/jdk","html_url":"https:\/\/github.com\/prsadhuk\/jdk"},"sha":"9376b0ff26216c36cf9464725e5e139403cdd93e"},"created_at":"2022-07-06T06:17:56.075703797Z","base":{"repo":{"full_name":"openjdk\/jdk","html_url":"https:\/\/git.openjdk.org\/jdk"},"sha":"5b583e4792b1d59891495a4a050fcdd4d38dfee1"}}

0 commit comments

Comments
 (0)