6979537: closed/javax/swing/JSplitPane/UnitTest/UnitTest.java fails
authoralexp
Mon, 07 Feb 2011 21:34:31 +0300
changeset 8148 ff3d90bb0503
parent 8147 b295bba545d3
child 8149 768769e3cddd
6979537: closed/javax/swing/JSplitPane/UnitTest/UnitTest.java fails Reviewed-by: rupashka
jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java	Mon Feb 07 21:15:51 2011 +0300
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java	Mon Feb 07 21:34:31 2011 +0300
@@ -342,12 +342,10 @@
 
         setOrientation(splitPane.getOrientation());
 
-        // This plus 2 here is to provide backwards consistancy. Previously,
-        // the old size did not include the 2 pixel border around the divider,
-        // it now does.
-        Integer dividerSize = (Integer)UIManager.get("SplitPane.dividerSize");
-        if (divider == null) dividerSize = 10;
-        LookAndFeel.installProperty(splitPane, "dividerSize", dividerSize);
+        // note: don't rename this temp variable to dividerSize
+        // since it will conflict with "this.dividerSize" field
+        Integer temp = (Integer)UIManager.get("SplitPane.dividerSize");
+        LookAndFeel.installProperty(splitPane, "dividerSize", temp == null? 10: temp);
 
         divider.setDividerSize(splitPane.getDividerSize());
         dividerSize = divider.getDividerSize();