You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Dmitry Irlyanov (JIRA)" <ji...@apache.org> on 2007/07/24 14:03:31 UTC
[jira] Commented: (HARMONY-4524) [classlib][swing] BasicSplitPaneUI
throws NPE if vertical split pane was not fully initialized
[ https://issues.apache.org/jira/browse/HARMONY-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514945 ]
Dmitry Irlyanov commented on HARMONY-4524:
------------------------------------------
Proposed fix attached.
The problem is in JSplitPane(JSplitPane.VERTICAL_SPLIT) calls JSplitPane(JSplitPane.VERTICAL_SPLIT, false, null, null) constructor, but LayoutManager calls laft and right components methods (they are nulls) to adjust layout.
After the fix the test result is compatible with RI
> [classlib][swing] BasicSplitPaneUI throws NPE if vertical split pane was not fully initialized
> ----------------------------------------------------------------------------------------------
>
> Key: HARMONY-4524
> URL: https://issues.apache.org/jira/browse/HARMONY-4524
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Alexey Petrenko
> Assignee: Alexey Petrenko
> Attachments: H4524-BasicSplitPaneUI.patch
>
>
> === testcase ===
> import javax.swing.JFrame;
> import javax.swing.JSplitPane;
> public class Harmony4524Test {
> public static void main(String argv[]) {
> JFrame frame = new JFrame("SplitPaneTest");
> JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
>
> frame.add(split);
> frame.setVisible(true);
> }
> }
> === testcase ===
> === stacktrace ===
> java.lang.NullPointerException
> at javax.swing.plaf.basic.BasicSplitPaneUI$BasicHorizontalLayoutManager.layoutContainer(BasicSplitPaneUI.java:125)
> at java.awt.Container.layout(Container.java:891)
> at java.awt.Container.doLayout(Container.java:532)
> at java.awt.Container.validate(Container.java:1174)
> at java.awt.Container.validateTree(Container.java:1189)
> at java.awt.Container.validate(Container.java:1175)
> at java.awt.Container.validateTree(Container.java:1189)
> at java.awt.Container.validate(Container.java:1175)
> at java.awt.Container.validateTree(Container.java:1189)
> at java.awt.Container.validate(Container.java:1175)
> at java.awt.Container.validateTree(Container.java:1189)
> at java.awt.Container.validate(Container.java:1175)
> at java.awt.Component.show(Component.java:3087)
> at java.awt.Window.show(Window.java:547)
> at java.awt.Component.show(Component.java:3102)
> at java.awt.Component.setVisible(Component.java:3075)
> at Harmony4524Test.main(Harmony4524Test.java:9)
> === stacktrace ===
> To see this stack trace please apply the following patch:
> === exception patch ===
> Index: modules/awt/src/main/java/common/java/awt/Container.java
> ===================================================================
> --- modules/awt/src/main/java/common/java/awt/Container.java (revision 558941)
> +++ modules/awt/src/main/java/common/java/awt/Container.java (working copy)
> @@ -1189,6 +1189,8 @@
> c.validate();
> }
> }
> + } catch (Exception e) {
> + e.printStackTrace();
> } finally {
> toolkit.unlockAWT();
> }
> === exception patch ===
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.