From 396c6fc8f9b43cfdbb7b6155c464700985483e7f Mon Sep 17 00:00:00 2001 From: dsamersoff Date: Tue, 7 Apr 2015 02:56:25 -0700 Subject: [PATCH] 8067991: [Findbugs] SA com.sun.java.swing.ui.CommonUI some methods need final protect Summary: Fixed java programmint style nit Reviewed-by: jbachorik, sspitsyn --- .../com/sun/java/swing/ui/CommonToolBar.java | 2 +- .../com/sun/java/swing/ui/CommonUI.java | 35 +++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java b/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java index b4eb95df3..d2d85c308 100644 --- a/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java +++ b/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java @@ -46,7 +46,7 @@ public abstract class CommonToolBar extends JToolBar { this.manager = manager; statusBar = status; - buttonSize = new Dimension(CommonUI.buttconPrefSize); + buttonSize = new Dimension(CommonUI.getButtconPrefSize()); buttonInsets = new Insets(0, 0, 0, 0); addComponents(); } diff --git a/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java b/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java index e6adc5020..a1c8127f4 100644 --- a/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java +++ b/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java @@ -373,20 +373,25 @@ public class CommonUI comp.setCursor(Cursor.getPredefinedCursor(0)); } - public static final int BUTTON_WIDTH = 100; - public static final int BUTTON_HEIGHT = 26; - public static final int BUTTCON_WIDTH = 28; - public static final int BUTTCON_HEIGHT = 28; - public static final int SM_BUTTON_WIDTH = 72; - public static final int SM_BUTTON_HEIGHT = 26; - public static final int LABEL_WIDTH = 100; - public static final int LABEL_HEIGHT = 20; - public static final int TEXT_WIDTH = 150; - public static final int TEXT_HEIGHT = 20; - public static Dimension buttonPrefSize = new Dimension(100, 26); - public static Dimension buttconPrefSize = new Dimension(28, 28); - public static Dimension smbuttonPrefSize = new Dimension(72, 26); - public static Dimension labelPrefSize = new Dimension(100, 20); - public static Dimension textPrefSize = new Dimension(150, 20); + public static Dimension getButtconPrefSize() + { + return buttconPrefSize; + } + + private static final int BUTTON_WIDTH = 100; + private static final int BUTTON_HEIGHT = 26; + private static final int BUTTCON_WIDTH = 28; + private static final int BUTTCON_HEIGHT = 28; + private static final int SM_BUTTON_WIDTH = 72; + private static final int SM_BUTTON_HEIGHT = 26; + private static final int LABEL_WIDTH = 100; + private static final int LABEL_HEIGHT = 20; + private static final int TEXT_WIDTH = 150; + private static final int TEXT_HEIGHT = 20; + private static final Dimension buttonPrefSize = new Dimension(100, 26); + private static final Dimension buttconPrefSize = new Dimension(28, 28); + private static final Dimension smbuttonPrefSize = new Dimension(72, 26); + private static final Dimension labelPrefSize = new Dimension(100, 20); + private static final Dimension textPrefSize = new Dimension(150, 20); } -- GitLab