diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java index b41450257a0..ae2bcb56a20 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java @@ -504,7 +504,7 @@ public class GIFImageReader extends ImageReader { } // Found position of metadata for image 0 - imageStartPosition.add(new Long(stream.getStreamPosition())); + imageStartPosition.add(Long.valueOf(stream.getStreamPosition())); } catch (IOException e) { throw new IIOException("I/O error reading header!", e); } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java index 66d647f6856..58d819f11ea 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java @@ -98,7 +98,7 @@ class GIFWritableImageMetadata extends GIFImageMetadata { try { return data.getBytes("ISO-8859-1"); } catch (UnsupportedEncodingException e) { - return (new String("")).getBytes(); + return "".getBytes(); } } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java index f5b671e7cd4..ba1c8da7958 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java @@ -328,7 +328,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements setHSB(hue, saturation, brightness); if (update) { settingColor = true; - hueSpinner.setValue(new Integer((int)(hue * 360))); + hueSpinner.setValue(Integer.valueOf((int)(hue * 360))); settingColor = false; } } @@ -376,8 +376,8 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements setHSB(hue, s, b); if (update) { settingColor = true; - saturationSpinner.setValue(new Integer((int)(s * 255))); - valueSpinner.setValue(new Integer((int)(b * 255))); + saturationSpinner.setValue(Integer.valueOf((int)(s * 255))); + valueSpinner.setValue(Integer.valueOf((int)(b * 255))); settingColor = false; } } @@ -391,9 +391,9 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements setColor(color, false, true, true); settingColor = true; - hueSpinner.setValue(new Integer((int)(hue * 360))); - saturationSpinner.setValue(new Integer((int)(saturation * 255))); - valueSpinner.setValue(new Integer((int)(brightness * 255))); + hueSpinner.setValue(Integer.valueOf((int)(hue * 360))); + saturationSpinner.setValue(Integer.valueOf((int)(saturation * 255))); + valueSpinner.setValue(Integer.valueOf((int)(brightness * 255))); settingColor = false; } @@ -409,9 +409,9 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements setColor(color, false, false, true); settingColor = true; - redSpinner.setValue(new Integer(color.getRed())); - greenSpinner.setValue(new Integer(color.getGreen())); - blueSpinner.setValue(new Integer(color.getBlue())); + redSpinner.setValue(Integer.valueOf(color.getRed())); + greenSpinner.setValue(Integer.valueOf(color.getGreen())); + blueSpinner.setValue(Integer.valueOf(color.getBlue())); settingColor = false; } @@ -454,13 +454,13 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements colorNameTF.setText("#" + hexString.substring(1)); if (updateSpinners) { - redSpinner.setValue(new Integer(color.getRed())); - greenSpinner.setValue(new Integer(color.getGreen())); - blueSpinner.setValue(new Integer(color.getBlue())); + redSpinner.setValue(Integer.valueOf(color.getRed())); + greenSpinner.setValue(Integer.valueOf(color.getGreen())); + blueSpinner.setValue(Integer.valueOf(color.getBlue())); - hueSpinner.setValue(new Integer((int)(hue * 360))); - saturationSpinner.setValue(new Integer((int)(saturation * 255))); - valueSpinner.setValue(new Integer((int)(brightness * 255))); + hueSpinner.setValue(Integer.valueOf((int)(hue * 360))); + saturationSpinner.setValue(Integer.valueOf((int)(saturation * 255))); + valueSpinner.setValue(Integer.valueOf((int)(brightness * 255))); } settingColor = false; } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index b4f435798a1..3c565604174 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -336,7 +336,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { // populate the table with the values from basic. super.initComponentDefaults(table); - Integer zero = new Integer(0); + Integer zero = Integer.valueOf(0); Object zeroBorder = new sun.swing.SwingLazyValue( "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new Object[] {zero, zero, zero, zero}); @@ -371,7 +371,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { int vProgWidth = 22 - (progXThickness * 2); int vProgHeight = 80 - (progYThickness * 2); - Integer caretBlinkRate = new Integer(500); + Integer caretBlinkRate = Integer.valueOf(500); Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0); Double defaultCaretAspectRatio = new Double(0.025); @@ -540,7 +540,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { } Object[] defaults = new Object[] { - "ArrowButton.size", new Integer(13), + "ArrowButton.size", Integer.valueOf(13), "Button.defaultButtonFollowsFocus", Boolean.FALSE, @@ -893,8 +893,8 @@ public class GTKLookAndFeel extends SynthLookAndFeel { "ScrollBar.squareButtons", Boolean.FALSE, - "ScrollBar.thumbHeight", new Integer(14), - "ScrollBar.width", new Integer(16), + "ScrollBar.thumbHeight", Integer.valueOf(14), + "ScrollBar.width", Integer.valueOf(16), "ScrollBar.minimumThumbSize", new Dimension(8, 8), "ScrollBar.maximumThumbSize", new Dimension(4096, 4096), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, @@ -954,12 +954,12 @@ public class GTKLookAndFeel extends SynthLookAndFeel { "Separator.insets", zeroInsets, - "Separator.thickness", new Integer(2), + "Separator.thickness", Integer.valueOf(2), "Slider.paintValue", Boolean.TRUE, - "Slider.thumbWidth", new Integer(30), - "Slider.thumbHeight", new Integer(14), + "Slider.thumbWidth", Integer.valueOf(30), + "Slider.thumbHeight", Integer.valueOf(14), "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "RIGHT", "positiveUnitIncrement", @@ -1013,9 +1013,9 @@ public class GTKLookAndFeel extends SynthLookAndFeel { }), - "SplitPane.size", new Integer(7), - "SplitPane.oneTouchOffset", new Integer(2), - "SplitPane.oneTouchButtonSize", new Integer(5), + "SplitPane.size", Integer.valueOf(7), + "SplitPane.oneTouchOffset", Integer.valueOf(2), + "SplitPane.oneTouchButtonSize", Integer.valueOf(5), "SplitPane.supportsOneTouchButtons", Boolean.FALSE, @@ -1223,13 +1223,13 @@ public class GTKLookAndFeel extends SynthLookAndFeel { "ToolTip.font", new FontLazyValue(Region.TOOL_TIP), - "Tree.padding", new Integer(4), + "Tree.padding", Integer.valueOf(4), "Tree.background", tableBg, "Tree.drawHorizontalLines", Boolean.FALSE, "Tree.drawVerticalLines", Boolean.FALSE, - "Tree.rowHeight", new Integer(-1), + "Tree.rowHeight", Integer.valueOf(-1), "Tree.scrollsOnExpand", Boolean.FALSE, - "Tree.expanderSize", new Integer(10), + "Tree.expanderSize", Integer.valueOf(10), "Tree.repaintWholeRow", Boolean.TRUE, "Tree.closedIcon", null, "Tree.leafIcon", null, @@ -1240,8 +1240,8 @@ public class GTKLookAndFeel extends SynthLookAndFeel { "Tree.collapsedIcon", new GTKStyle.GTKLazyValue( "com.sun.java.swing.plaf.gtk.GTKIconFactory", "getTreeCollapsedIcon"), - "Tree.leftChildIndent", new Integer(2), - "Tree.rightChildIndent", new Integer(12), + "Tree.leftChildIndent", Integer.valueOf(2), + "Tree.rightChildIndent", Integer.valueOf(12), "Tree.scrollsHorizontallyAndVertically", Boolean.FALSE, "Tree.drawsFocusBorder", Boolean.TRUE, "Tree.focusInputMap", diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java index 0d008907248..4f6e42c784c 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java @@ -851,7 +851,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { int focusLineWidth = getClassSpecificIntValue(context, "focus-line-width", 0); if (value == null && focusLineWidth > 0) { - value = new Integer(16 + 2 * focusLineWidth); + value = Integer.valueOf(16 + 2 * focusLineWidth); } } return value; @@ -975,12 +975,12 @@ class GTKStyle extends SynthStyle implements GTKConstants { private static void initIconTypeMap() { ICON_TYPE_MAP = new HashMap(); - ICON_TYPE_MAP.put("gtk-menu", new Integer(1)); - ICON_TYPE_MAP.put("gtk-small-toolbar", new Integer(2)); - ICON_TYPE_MAP.put("gtk-large-toolbar", new Integer(3)); - ICON_TYPE_MAP.put("gtk-button", new Integer(4)); - ICON_TYPE_MAP.put("gtk-dnd", new Integer(5)); - ICON_TYPE_MAP.put("gtk-dialog", new Integer(6)); + ICON_TYPE_MAP.put("gtk-menu", Integer.valueOf(1)); + ICON_TYPE_MAP.put("gtk-small-toolbar", Integer.valueOf(2)); + ICON_TYPE_MAP.put("gtk-large-toolbar", Integer.valueOf(3)); + ICON_TYPE_MAP.put("gtk-button", Integer.valueOf(4)); + ICON_TYPE_MAP.put("gtk-dnd", Integer.valueOf(5)); + ICON_TYPE_MAP.put("gtk-dialog", Integer.valueOf(6)); } } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java index 274ac510c0b..e6117989134 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java @@ -178,7 +178,7 @@ class Metacity implements SynthConstants { name = child.getNodeName(); Object value = null; if ("distance".equals(name)) { - value = new Integer(getIntAttr(child, "value", 0)); + value = Integer.valueOf(getIntAttr(child, "value", 0)); } else if ("border".equals(name)) { value = new Insets(getIntAttr(child, "top", 0), getIntAttr(child, "left", 0), @@ -808,7 +808,7 @@ class Metacity implements SynthConstants { protected void setFrameGeometry(JComponent titlePane, Map gm) { this.frameGeometry = gm; if (getInt("top_height") == 0 && titlePane != null) { - gm.put("top_height", new Integer(titlePane.getHeight())); + gm.put("top_height", Integer.valueOf(titlePane.getHeight())); } } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java index 63994ff6732..995d195c34f 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java @@ -567,7 +567,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "ProgressBar.selectionBackground", table.get("controlText"), "ProgressBar.border", loweredBevelBorder, "ProgressBar.cellLength", new Integer(6), - "ProgressBar.cellSpacing", new Integer(0), + "ProgressBar.cellSpacing", Integer.valueOf(0), // Buttons "Button.margin", new InsetsUIResource(2, 4, 2, 4), @@ -859,7 +859,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "SplitPane.background", table.get("control"), "SplitPane.highlight", table.get("controlHighlight"), "SplitPane.shadow", table.get("controlShadow"), - "SplitPane.dividerSize", new Integer(20), + "SplitPane.dividerSize", Integer.valueOf(20), "SplitPane.activeThumb", table.get("activeCaptionBorder"), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { @@ -1160,7 +1160,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel }), "TextField.caretForeground", black, - "TextField.caretBlinkRate", new Integer(500), + "TextField.caretBlinkRate", Integer.valueOf(500), "TextField.inactiveForeground", table.get("textInactiveText"), "TextField.selectionBackground", table.get("textHighlight"), "TextField.selectionForeground", table.get("textHighlightText"), @@ -1171,7 +1171,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "TextField.focusInputMap", fieldInputMap, "PasswordField.caretForeground", black, - "PasswordField.caretBlinkRate", new Integer(500), + "PasswordField.caretBlinkRate", Integer.valueOf(500), "PasswordField.inactiveForeground", table.get("textInactiveText"), "PasswordField.selectionBackground", table.get("textHighlight"), "PasswordField.selectionForeground", table.get("textHighlightText"), @@ -1182,7 +1182,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "PasswordField.focusInputMap", passwordInputMap, "TextArea.caretForeground", black, - "TextArea.caretBlinkRate", new Integer(500), + "TextArea.caretBlinkRate", Integer.valueOf(500), "TextArea.inactiveForeground", table.get("textInactiveText"), "TextArea.selectionBackground", table.get("textHighlight"), "TextArea.selectionForeground", table.get("textHighlightText"), @@ -1193,7 +1193,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "TextArea.focusInputMap", multilineInputMap, "TextPane.caretForeground", black, - "TextPane.caretBlinkRate", new Integer(500), + "TextPane.caretBlinkRate", Integer.valueOf(500), "TextPane.inactiveForeground", table.get("textInactiveText"), "TextPane.selectionBackground", lightGray, "TextPane.selectionForeground", table.get("textHighlightText"), @@ -1204,7 +1204,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "TextPane.focusInputMap", multilineInputMap, "EditorPane.caretForeground", red, - "EditorPane.caretBlinkRate", new Integer(500), + "EditorPane.caretBlinkRate", Integer.valueOf(500), "EditorPane.inactiveForeground", table.get("textInactiveText"), "EditorPane.selectionBackground", lightGray, "EditorPane.selectionForeground", table.get("textHighlightText"), diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 3977b4d1de6..9af41fc39c8 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -299,9 +299,9 @@ public class WindowsLookAndFeel extends BasicLookAndFeel initResourceBundle(table); // *** Shared Fonts - Integer twelve = new Integer(12); - Integer fontPlain = new Integer(Font.PLAIN); - Integer fontBold = new Integer(Font.BOLD); + Integer twelve = Integer.valueOf(12); + Integer fontPlain = Integer.valueOf(Font.PLAIN); + Integer fontBold = Integer.valueOf(Font.BOLD); Object dialogPlain12 = new SwingLazyValue( "javax.swing.plaf.FontUIResource", @@ -522,19 +522,19 @@ public class WindowsLookAndFeel extends BasicLookAndFeel toolkit); Object WindowBorderWidth = new DesktopProperty( "win.frame.sizingBorderWidth", - new Integer(1), + Integer.valueOf(1), toolkit); Object TitlePaneHeight = new DesktopProperty( "win.frame.captionHeight", - new Integer(18), + Integer.valueOf(18), toolkit); Object TitleButtonWidth = new DesktopProperty( "win.frame.captionButtonWidth", - new Integer(16), + Integer.valueOf(16), toolkit); Object TitleButtonHeight = new DesktopProperty( "win.frame.captionButtonHeight", - new Integer(16), + Integer.valueOf(16), toolkit); Object InactiveTextColor = new DesktopProperty( "win.text.grayedTextColor", @@ -567,7 +567,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel Object IconFont = ControlFont; Object scrollBarWidth = new DesktopProperty("win.scrollbar.width", - new Integer(16), toolkit); + Integer.valueOf(16), toolkit); Object menuBarHeight = new DesktopProperty("win.menu.height", null, toolkit); @@ -673,12 +673,12 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "Button.disabledForeground", InactiveTextColor, "Button.disabledShadow", ControlHighlightColor, "Button.focus", black, - "Button.dashedRectGapX", new XPValue(new Integer(3), new Integer(5)), - "Button.dashedRectGapY", new XPValue(new Integer(3), new Integer(4)), - "Button.dashedRectGapWidth", new XPValue(new Integer(6), new Integer(10)), - "Button.dashedRectGapHeight", new XPValue(new Integer(6), new Integer(8)), - "Button.textShiftOffset", new XPValue(new Integer(0), - new Integer(1)), + "Button.dashedRectGapX", new XPValue(Integer.valueOf(3), Integer.valueOf(5)), + "Button.dashedRectGapY", new XPValue(Integer.valueOf(3), Integer.valueOf(4)), + "Button.dashedRectGapWidth", new XPValue(Integer.valueOf(6), Integer.valueOf(10)), + "Button.dashedRectGapHeight", new XPValue(Integer.valueOf(6), Integer.valueOf(8)), + "Button.textShiftOffset", new XPValue(Integer.valueOf(0), + Integer.valueOf(1)), // W2K keyboard navigation hidding. "Button.showMnemonics", showMnemonics, "Button.focusInputMap", @@ -780,7 +780,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel }), // DesktopIcon - "DesktopIcon.width", new Integer(160), + "DesktopIcon.width", Integer.valueOf(160), "EditorPane.font", ControlFont, "EditorPane.background", WindowBackgroundColor, @@ -814,9 +814,9 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "icons/NewFolder.gif"), "FileChooser.useSystemExtensionHiding", Boolean.TRUE, - "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I), - "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N), - "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T), + "FileChooser.lookInLabelMnemonic", Integer.valueOf(KeyEvent.VK_I), + "FileChooser.fileNameLabelMnemonic", Integer.valueOf(KeyEvent.VK_N), + "FileChooser.filesOfTypeLabelMnemonic", Integer.valueOf(KeyEvent.VK_T), "FileChooser.usesSingleFilePane", Boolean.TRUE, "FileChooser.noPlacesBar", new DesktopProperty("win.comdlg.noPlacesBar", Boolean.FALSE, toolkit), @@ -1021,10 +1021,10 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "Menu.selectionBackground", SelectionBackgroundColor, "Menu.acceleratorForeground", MenuTextColor, "Menu.acceleratorSelectionForeground", SelectionTextColor, - "Menu.menuPopupOffsetX", new Integer(0), - "Menu.menuPopupOffsetY", new Integer(0), - "Menu.submenuPopupOffsetX", new Integer(-4), - "Menu.submenuPopupOffsetY", new Integer(-3), + "Menu.menuPopupOffsetX", Integer.valueOf(0), + "Menu.menuPopupOffsetY", Integer.valueOf(0), + "Menu.submenuPopupOffsetX", Integer.valueOf(-4), + "Menu.submenuPopupOffsetY", Integer.valueOf(-3), "Menu.crossMenuMnemonic", Boolean.FALSE, "Menu.preserveTopLevelSelection", Boolean.TRUE, @@ -1184,8 +1184,8 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "ProgressBar.highlight", ControlHighlightColor, "ProgressBar.selectionForeground", ControlBackgroundColor, "ProgressBar.selectionBackground", SelectionBackgroundColor, - "ProgressBar.cellLength", new Integer(7), - "ProgressBar.cellSpacing", new Integer(2), + "ProgressBar.cellLength", Integer.valueOf(7), + "ProgressBar.cellSpacing", Integer.valueOf(2), "ProgressBar.indeterminateInsets", new Insets(3, 3, 3, 3), // *** RootPane. @@ -1292,7 +1292,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "SplitPane.highlight", ControlHighlightColor, "SplitPane.shadow", ControlShadowColor, "SplitPane.darkShadow", ControlDarkShadowColor, - "SplitPane.dividerSize", new Integer(5), + "SplitPane.dividerSize", Integer.valueOf(5), "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "UP", "negativeIncrement", @@ -1496,7 +1496,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "ToggleButton.light", ControlLightColor, "ToggleButton.highlight", ControlHighlightColor, "ToggleButton.focus", ControlTextColor, - "ToggleButton.textShiftOffset", new Integer(1), + "ToggleButton.textShiftOffset", Integer.valueOf(1), "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "SPACE", "pressed", @@ -1548,8 +1548,8 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "Tree.background", WindowBackgroundColor, "Tree.foreground", WindowTextColor, "Tree.hash", gray, - "Tree.leftChildIndent", new Integer(8), - "Tree.rightChildIndent", new Integer(11), + "Tree.leftChildIndent", Integer.valueOf(8), + "Tree.rightChildIndent", Integer.valueOf(11), "Tree.textForeground", WindowTextColor, "Tree.textBackground", WindowBackgroundColor, "Tree.selectionForeground", SelectionTextColor, @@ -2488,18 +2488,18 @@ public class WindowsLookAndFeel extends BasicLookAndFeel private int direction; XPDLUValue(int xpdlu, int classicdlu, int direction) { - super(new Integer(xpdlu), new Integer(classicdlu)); + super(Integer.valueOf(xpdlu), Integer.valueOf(classicdlu)); this.direction = direction; } public Object getXPValue(UIDefaults table) { int px = dluToPixels(((Integer)xpValue).intValue(), direction); - return new Integer(px); + return Integer.valueOf(px); } public Object getClassicValue(UIDefaults table) { int px = dluToPixels(((Integer)classicValue).intValue(), direction); - return new Integer(px); + return Integer.valueOf(px); } } diff --git a/jdk/src/share/classes/java/awt/Button.java b/jdk/src/share/classes/java/awt/Button.java index 46d0d072424..fcb33ddecc2 100644 --- a/jdk/src/share/classes/java/awt/Button.java +++ b/jdk/src/share/classes/java/awt/Button.java @@ -597,7 +597,7 @@ public class Button extends Component implements Accessible { public String getAccessibleActionDescription(int i) { if (i == 0) { // [[[PENDING: WDW -- need to provide a localized string]]] - return new String("click"); + return "click"; } else { return null; } diff --git a/jdk/src/share/classes/java/awt/MenuItem.java b/jdk/src/share/classes/java/awt/MenuItem.java index 899cab485ee..54756b8f488 100644 --- a/jdk/src/share/classes/java/awt/MenuItem.java +++ b/jdk/src/share/classes/java/awt/MenuItem.java @@ -847,7 +847,7 @@ public class MenuItem extends MenuComponent implements Accessible { public String getAccessibleActionDescription(int i) { if (i == 0) { // [[[PENDING: WDW -- need to provide a localized string]]] - return new String("click"); + return "click"; } else { return null; } diff --git a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java index 77eb2bcec61..57936eb6045 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java +++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java @@ -298,7 +298,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { while (continueLine(line)) { String nextLine = in.readLine(); if (nextLine == null) { - nextLine = new String(""); + nextLine = ""; } String loppedLine = line.substring(0, line.length() - 1); @@ -313,7 +313,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } nextLine = nextLine.substring(startIndex, nextLine.length()); - line = new String(loppedLine+nextLine); + line = loppedLine+nextLine; } // Find start of key diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java index 763fc31df69..e5b77bec510 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImage.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java @@ -1210,9 +1210,9 @@ public class BufferedImage extends java.awt.Image * BufferedImage. */ public String toString() { - return new String("BufferedImage@"+Integer.toHexString(hashCode()) - +": type = "+imageType - +" "+colorModel+" "+raster); + return "BufferedImage@"+Integer.toHexString(hashCode()) + +": type = "+imageType + +" "+colorModel+" "+raster; } /** diff --git a/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java b/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java index 4a598155496..dac78aeda4b 100644 --- a/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java +++ b/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java @@ -384,7 +384,7 @@ class DictionaryBasedBreakIterator extends RuleBasedBreakIterator { // on the last character of a legal word. Push that position onto // the possible-break-positions stack if (dictionary.getNextState(state, 0) == -1) { - possibleBreakPositions.push(new Integer(text.getIndex())); + possibleBreakPositions.push(Integer.valueOf(text.getIndex())); } // look up the new state to transition to in the dictionary @@ -395,7 +395,7 @@ class DictionaryBasedBreakIterator extends RuleBasedBreakIterator { // and we've successfully traversed the whole range. Drop out // of the loop. if (state == -1) { - currentBreakPositions.push(new Integer(text.getIndex())); + currentBreakPositions.push(Integer.valueOf(text.getIndex())); break; } @@ -496,7 +496,7 @@ class DictionaryBasedBreakIterator extends RuleBasedBreakIterator { if (!currentBreakPositions.isEmpty()) { currentBreakPositions.pop(); } - currentBreakPositions.push(new Integer(endPos)); + currentBreakPositions.push(Integer.valueOf(endPos)); // create a regular array to hold the break positions and copy // the break positions from the stack to the array (in addition, diff --git a/jdk/src/share/classes/java/text/MessageFormat.java b/jdk/src/share/classes/java/text/MessageFormat.java index b16fefe646e..7f3db05402b 100644 --- a/jdk/src/share/classes/java/text/MessageFormat.java +++ b/jdk/src/share/classes/java/text/MessageFormat.java @@ -1286,7 +1286,7 @@ public class MessageFormat extends Format { characterIterators.add( createAttributedCharacterIterator( subIterator, Field.ARGUMENT, - new Integer(argumentNumber))); + Integer.valueOf(argumentNumber))); last = result.length(); } arg = null; @@ -1296,7 +1296,7 @@ public class MessageFormat extends Format { characterIterators.add( createAttributedCharacterIterator( arg, Field.ARGUMENT, - new Integer(argumentNumber))); + Integer.valueOf(argumentNumber))); last = result.length(); } } diff --git a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java index b6a146c3dfd..a43578f8c66 100644 --- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java +++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java @@ -778,8 +778,8 @@ public abstract class ImageInputStreamImpl implements ImageInputStream { */ public void mark() { try { - markByteStack.push(new Long(getStreamPosition())); - markBitStack.push(new Integer(getBitOffset())); + markByteStack.push(Long.valueOf(getStreamPosition())); + markBitStack.push(Integer.valueOf(getBitOffset())); } catch (IOException e) { } } diff --git a/jdk/src/share/classes/javax/swing/AbstractButton.java b/jdk/src/share/classes/javax/swing/AbstractButton.java index b4d4ae1e29a..6522cef8315 100644 --- a/jdk/src/share/classes/javax/swing/AbstractButton.java +++ b/jdk/src/share/classes/javax/swing/AbstractButton.java @@ -2047,14 +2047,14 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl null, AccessibleState.SELECTED); accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - new Integer(0), new Integer(1)); + Integer.valueOf(0), Integer.valueOf(1)); } else { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.SELECTED, null); accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - new Integer(1), new Integer(0)); + Integer.valueOf(1), Integer.valueOf(0)); } } } @@ -2552,9 +2552,9 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl */ public Number getCurrentAccessibleValue() { if (isSelected()) { - return new Integer(1); + return Integer.valueOf(1); } else { - return new Integer(0); + return Integer.valueOf(0); } } @@ -2583,7 +2583,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * @return an Integer of 0. */ public Number getMinimumAccessibleValue() { - return new Integer(0); + return Integer.valueOf(0); } /** @@ -2592,7 +2592,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * @return An Integer of 1. */ public Number getMaximumAccessibleValue() { - return new Integer(1); + return Integer.valueOf(1); } diff --git a/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java b/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java index 72bf9445bd0..635be42475e 100644 --- a/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java +++ b/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java @@ -49,7 +49,7 @@ class DebugGraphicsInfo { componentToDebug = new Hashtable(); } if (debug > 0) { - componentToDebug.put(component, new Integer(debug)); + componentToDebug.put(component, Integer.valueOf(debug)); } else { componentToDebug.remove(component); } diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java index cc8480fc455..67d39b0cbb7 100644 --- a/jdk/src/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java @@ -1285,7 +1285,7 @@ public class JInternalFrame extends JComponent implements * description: Specifies what desktop layer is used. */ public void setLayer(int layer) { - this.setLayer(new Integer(layer)); + this.setLayer(Integer.valueOf(layer)); } /** @@ -2092,7 +2092,7 @@ public class JInternalFrame extends JComponent implements * have a value */ public Number getCurrentAccessibleValue() { - return new Integer(getLayer()); + return Integer.valueOf(getLayer()); } /** @@ -2116,7 +2116,7 @@ public class JInternalFrame extends JComponent implements * have a minimum value */ public Number getMinimumAccessibleValue() { - return new Integer(Integer.MIN_VALUE); + return Integer.MIN_VALUE; } /** @@ -2126,7 +2126,7 @@ public class JInternalFrame extends JComponent implements * have a maximum value */ public Number getMaximumAccessibleValue() { - return new Integer(Integer.MAX_VALUE); + return Integer.MAX_VALUE; } } // AccessibleJInternalFrame diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index 0591f3dface..130d9f666a0 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -1512,7 +1512,7 @@ public class JOptionPane extends JComponent implements Accessible iFrame.putClientProperty("JInternalFrame.frameType", "optionDialog"); iFrame.putClientProperty("JInternalFrame.messageType", - new Integer(getMessageType())); + Integer.valueOf(getMessageType())); iFrame.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent e) { diff --git a/jdk/src/share/classes/javax/swing/JProgressBar.java b/jdk/src/share/classes/javax/swing/JProgressBar.java index 337f5b118ef..68a6322c39a 100644 --- a/jdk/src/share/classes/javax/swing/JProgressBar.java +++ b/jdk/src/share/classes/javax/swing/JProgressBar.java @@ -775,9 +775,9 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, (oldModel== null - ? null : new Integer(oldModel.getValue())), + ? null : Integer.valueOf(oldModel.getValue())), (newModel== null - ? null : new Integer(newModel.getValue()))); + ? null : Integer.valueOf(newModel.getValue()))); } if (model != null) { @@ -850,8 +850,8 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib if (accessibleContext != null) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - new Integer(oldValue), - new Integer(brm.getValue())); + Integer.valueOf(oldValue), + Integer.valueOf(brm.getValue())); } } @@ -1087,7 +1087,7 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib * @return the current value of this object */ public Number getCurrentAccessibleValue() { - return new Integer(getValue()); + return Integer.valueOf(getValue()); } /** @@ -1110,7 +1110,7 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib * @return the minimum value of this object */ public Number getMinimumAccessibleValue() { - return new Integer(getMinimum()); + return Integer.valueOf(getMinimum()); } /** @@ -1120,7 +1120,7 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib */ public Number getMaximumAccessibleValue() { // TIGER - 4422362 - return new Integer(model.getMaximum() - model.getExtent()); + return Integer.valueOf(model.getMaximum() - model.getExtent()); } } // AccessibleJProgressBar diff --git a/jdk/src/share/classes/javax/swing/JScrollBar.java b/jdk/src/share/classes/javax/swing/JScrollBar.java index 0b646ac90b2..2136fe62975 100644 --- a/jdk/src/share/classes/javax/swing/JScrollBar.java +++ b/jdk/src/share/classes/javax/swing/JScrollBar.java @@ -314,7 +314,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible BoundedRangeModel oldModel = model; if (model != null) { model.removeChangeListener(fwdAdjustmentEvents); - oldValue = new Integer(model.getValue()); + oldValue = Integer.valueOf(model.getValue()); } model = newModel; if (model != null) { @@ -465,8 +465,8 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible if (accessibleContext != null) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - new Integer(oldValue), - new Integer(m.getValue())); + Integer.valueOf(oldValue), + Integer.valueOf(m.getValue())); } } @@ -611,8 +611,8 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible if (accessibleContext != null) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - new Integer(oldValue), - new Integer(m.getValue())); + Integer.valueOf(oldValue), + Integer.valueOf(m.getValue())); } } @@ -880,7 +880,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible * @return The current value of this object. */ public Number getCurrentAccessibleValue() { - return new Integer(getValue()); + return Integer.valueOf(getValue()); } /** @@ -903,7 +903,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible * @return The minimum value of this object. */ public Number getMinimumAccessibleValue() { - return new Integer(getMinimum()); + return Integer.valueOf(getMinimum()); } /** diff --git a/jdk/src/share/classes/javax/swing/JSlider.java b/jdk/src/share/classes/javax/swing/JSlider.java index 7a9c4439f24..e1a7909b073 100644 --- a/jdk/src/share/classes/javax/swing/JSlider.java +++ b/jdk/src/share/classes/javax/swing/JSlider.java @@ -485,9 +485,9 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, (oldModel == null - ? null : new Integer(oldModel.getValue())), + ? null : Integer.valueOf(oldModel.getValue())), (newModel == null - ? null : new Integer(newModel.getValue()))); + ? null : Integer.valueOf(newModel.getValue()))); } } @@ -538,8 +538,8 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { if (accessibleContext != null) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, - new Integer(oldValue), - new Integer(m.getValue())); + Integer.valueOf(oldValue), + Integer.valueOf(m.getValue())); } } @@ -581,7 +581,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { public void setMinimum(int minimum) { int oldMin = getModel().getMinimum(); getModel().setMinimum(minimum); - firePropertyChange( "minimum", new Integer( oldMin ), new Integer( minimum ) ); + firePropertyChange( "minimum", Integer.valueOf( oldMin ), Integer.valueOf( minimum ) ); } @@ -622,7 +622,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { public void setMaximum(int maximum) { int oldMax = getModel().getMaximum(); getModel().setMaximum(maximum); - firePropertyChange( "maximum", new Integer( oldMax ), new Integer( maximum ) ); + firePropertyChange( "maximum", Integer.valueOf( oldMax ), Integer.valueOf( maximum ) ); } @@ -989,7 +989,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { void createLabels() { for ( int labelIndex = start; labelIndex <= getMaximum(); labelIndex += increment ) { - put( new Integer( labelIndex ), new LabelUIResource( ""+labelIndex, JLabel.CENTER ) ); + put( Integer.valueOf( labelIndex ), new LabelUIResource( ""+labelIndex, JLabel.CENTER ) ); } } } @@ -1463,7 +1463,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { * @return The current value of this object. */ public Number getCurrentAccessibleValue() { - return new Integer(getValue()); + return Integer.valueOf(getValue()); } /** @@ -1486,7 +1486,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { * @return The minimum value of this object. */ public Number getMinimumAccessibleValue() { - return new Integer(getMinimum()); + return Integer.valueOf(getMinimum()); } /** @@ -1497,7 +1497,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { public Number getMaximumAccessibleValue() { // TIGER - 4422362 BoundedRangeModel model = JSlider.this.getModel(); - return new Integer(model.getMaximum() - model.getExtent()); + return Integer.valueOf(model.getMaximum() - model.getExtent()); } } // AccessibleJSlider } diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java index 22465c4805a..d96a7ee7445 100644 --- a/jdk/src/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/share/classes/javax/swing/JSplitPane.java @@ -1195,7 +1195,7 @@ public class JSplitPane extends JComponent implements Accessible * @return a localized String describing the value of this object */ public Number getCurrentAccessibleValue() { - return new Integer(getDividerLocation()); + return Integer.valueOf(getDividerLocation()); } @@ -1220,7 +1220,7 @@ public class JSplitPane extends JComponent implements Accessible * @return The minimum value of this object. */ public Number getMinimumAccessibleValue() { - return new Integer(getUI().getMinimumDividerLocation( + return Integer.valueOf(getUI().getMinimumDividerLocation( JSplitPane.this)); } @@ -1231,7 +1231,7 @@ public class JSplitPane extends JComponent implements Accessible * @return The maximum value of this object. */ public Number getMaximumAccessibleValue() { - return new Integer(getUI().getMaximumDividerLocation( + return Integer.valueOf(getUI().getMaximumDividerLocation( JSplitPane.this)); } diff --git a/jdk/src/share/classes/javax/swing/JTabbedPane.java b/jdk/src/share/classes/javax/swing/JTabbedPane.java index defffc711a4..fb058ccaed7 100644 --- a/jdk/src/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java @@ -967,7 +967,7 @@ public class JTabbedPane extends JComponent // currently no IndexPropertyChangeEvent. Once // IndexPropertyChangeEvents have been added this code should be // modified to use it. - putClientProperty("__index_to_remove__", new Integer(index)); + putClientProperty("__index_to_remove__", Integer.valueOf(index)); /* if the selected tab is after the removal */ if (selected > index) { diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index 562208939c9..62485a1c925 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -7680,7 +7680,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable */ public Accessible getAccessibleRowDescription(int r) { if (r < 0 || r >= getAccessibleRowCount()) { - throw new IllegalArgumentException(new Integer(r).toString()); + throw new IllegalArgumentException(Integer.toString(r)); } if (rowDescription == null) { return null; @@ -7698,7 +7698,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable */ public void setAccessibleRowDescription(int r, Accessible a) { if (r < 0 || r >= getAccessibleRowCount()) { - throw new IllegalArgumentException(new Integer(r).toString()); + throw new IllegalArgumentException(Integer.toString(r)); } if (rowDescription == null) { int numRows = getAccessibleRowCount(); @@ -7716,7 +7716,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable */ public Accessible getAccessibleColumnDescription(int c) { if (c < 0 || c >= getAccessibleColumnCount()) { - throw new IllegalArgumentException(new Integer(c).toString()); + throw new IllegalArgumentException(Integer.toString(c)); } if (columnDescription == null) { return null; @@ -7734,7 +7734,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable */ public void setAccessibleColumnDescription(int c, Accessible a) { if (c < 0 || c >= getAccessibleColumnCount()) { - throw new IllegalArgumentException(new Integer(c).toString()); + throw new IllegalArgumentException(Integer.toString(c)); } if (columnDescription == null) { int numColumns = getAccessibleColumnCount(); diff --git a/jdk/src/share/classes/javax/swing/JTextArea.java b/jdk/src/share/classes/javax/swing/JTextArea.java index 8f53daf2aca..18e3b45c35b 100644 --- a/jdk/src/share/classes/javax/swing/JTextArea.java +++ b/jdk/src/share/classes/javax/swing/JTextArea.java @@ -267,7 +267,7 @@ public class JTextArea extends JTextComponent { Document doc = getDocument(); if (doc != null) { int old = getTabSize(); - doc.putProperty(PlainDocument.tabSizeAttribute, new Integer(size)); + doc.putProperty(PlainDocument.tabSizeAttribute, Integer.valueOf(size)); firePropertyChange("tabSize", old, size); } } diff --git a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java index e9b89b68ecf..fb8521b16f4 100644 --- a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java +++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java @@ -144,7 +144,7 @@ public class SpinnerNumberModel extends AbstractSpinnerModel implements Serializ * minimum <= value <= maximum */ public SpinnerNumberModel(int value, int minimum, int maximum, int stepSize) { - this(new Integer(value), new Integer(minimum), new Integer(maximum), new Integer(stepSize)); + this(Integer.valueOf(value), Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize)); } @@ -171,7 +171,7 @@ public class SpinnerNumberModel extends AbstractSpinnerModel implements Serializ * stepSize equal to one, and an initial value of zero. */ public SpinnerNumberModel() { - this(new Integer(0), null, null, new Integer(1)); + this(Integer.valueOf(0), null, null, Integer.valueOf(1)); } @@ -333,16 +333,16 @@ public class SpinnerNumberModel extends AbstractSpinnerModel implements Serializ long v = value.longValue() + (stepSize.longValue() * (long)dir); if (value instanceof Long) { - newValue = new Long(v); + newValue = Long.valueOf(v); } else if (value instanceof Integer) { - newValue = new Integer((int)v); + newValue = Integer.valueOf((int)v); } else if (value instanceof Short) { - newValue = new Short((short)v); + newValue = Short.valueOf((short)v); } else { - newValue = new Byte((byte)v); + newValue = Byte.valueOf((byte)v); } } diff --git a/jdk/src/share/classes/javax/swing/TablePrintable.java b/jdk/src/share/classes/javax/swing/TablePrintable.java index ffef3054735..864b550b3c8 100644 --- a/jdk/src/share/classes/javax/swing/TablePrintable.java +++ b/jdk/src/share/classes/javax/swing/TablePrintable.java @@ -215,7 +215,7 @@ class TablePrintable implements Printable { } // to pass the page number when formatting the header and footer text - Object[] pageNumber = new Object[]{new Integer(pageIndex + 1)}; + Object[] pageNumber = new Object[]{Integer.valueOf(pageIndex + 1)}; // fetch the formatted header text, if any String headerText = null; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java index fd3d84b2833..d6ad0643c1e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java @@ -109,7 +109,7 @@ public class BasicButtonUI extends ButtonUI{ LookAndFeel.installProperty(b, "rolloverEnabled", rollover); } - LookAndFeel.installProperty(b, "iconTextGap", new Integer(4)); + LookAndFeel.installProperty(b, "iconTextGap", Integer.valueOf(4)); } protected void installListeners(AbstractButton b) { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java index 77f46be88c1..87ade48cd78 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java @@ -654,7 +654,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab "javax.swing.plaf.basic.BasicIconFactory", "getRadioButtonMenuItemIcon"); - Object menuItemAcceleratorDelimiter = new String("+"); + Object menuItemAcceleratorDelimiter = "+"; // *** OptionPane value objects diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java index afe007aeb78..c56a1b49d39 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -146,7 +146,7 @@ public class BasicMenuItemUI extends MenuItemUI menuItem.setMargin(UIManager.getInsets(prefix + ".margin")); } - LookAndFeel.installProperty(menuItem, "iconTextGap", new Integer(4)); + LookAndFeel.installProperty(menuItem, "iconTextGap", Integer.valueOf(4)); defaultTextIconGap = menuItem.getIconTextGap(); LookAndFeel.installBorder(menuItem, prefix + ".border"); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 86e458f3162..5ad6c2b92df 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -1195,10 +1195,10 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (options == null) { if (optionType == JOptionPane.OK_CANCEL_OPTION && buttonIndex == 1) { - optionPane.setValue(new Integer(2)); + optionPane.setValue(Integer.valueOf(2)); } else { - optionPane.setValue(new Integer(buttonIndex)); + optionPane.setValue(Integer.valueOf(buttonIndex)); } } else { optionPane.setValue(options[buttonIndex]); @@ -1393,7 +1393,7 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (getName() == CLOSE) { JOptionPane optionPane = (JOptionPane)e.getSource(); - optionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION)); + optionPane.setValue(Integer.valueOf(JOptionPane.CLOSED_OPTION)); } } } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java index 3afdc74d16e..2d0873cfcd2 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java @@ -539,7 +539,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { } mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK), "setSelectedIndex"); - mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index)); + mnemonicToIndexMap.put(Integer.valueOf(mnemonic), Integer.valueOf(index)); } /** @@ -2231,7 +2231,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { mnemonic -= ('a' - 'A'); } Integer index = (Integer)ui.mnemonicToIndexMap. - get(new Integer(mnemonic)); + get(Integer.valueOf(mnemonic)); if (index != null && pane.isEnabledAt(index.intValue())) { pane.setSelectedIndex(index.intValue()); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java index c2dff6035c4..e039d1b425b 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java @@ -178,7 +178,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants dragWindow = null; dockingSource = null; - c.putClientProperty( FOCUSED_COMP_INDEX, new Integer( focusedCompIndex ) ); + c.putClientProperty( FOCUSED_COMP_INDEX, Integer.valueOf( focusedCompIndex ) ); } protected void installDefaults( ) diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index af0405f5774..d1f7c05935d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -455,7 +455,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0); - Integer zero = new Integer(0); + Integer zero = Integer.valueOf(0); Object textFieldBorder = new SwingLazyValue("javax.swing.plaf.metal.MetalBorders", @@ -904,7 +904,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "ProgressBar.selectionBackground", primaryControlDarkShadow, "ProgressBar.border", progressBarBorder, "ProgressBar.cellSpacing", zero, - "ProgressBar.cellLength", new Integer(1), + "ProgressBar.cellLength", Integer.valueOf(1), // Combo Box "ComboBox.background", control, @@ -971,7 +971,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "DesktopIcon.font", controlTextValue, "DesktopIcon.foreground", controlTextColor, "DesktopIcon.background", control, - "DesktopIcon.width", new Integer(160), + "DesktopIcon.width", Integer.valueOf(160), "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java index 51cc619a41b..dd703d0b517 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java @@ -53,7 +53,7 @@ class SynthArrowButton extends JButton implements SwingConstants, UIResource { public void setDirection(int dir) { direction = dir; - putClientProperty("__arrow_direction__", new Integer(dir)); + putClientProperty("__arrow_direction__", Integer.valueOf(dir)); repaint(); } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java index 88e15c6bcf9..e41fead8add 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java @@ -96,7 +96,7 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements } taskBar.setBackground(desktop.getBackground()); desktop.add(taskBar, - new Integer(JLayeredPane.PALETTE_LAYER.intValue() + 1)); + Integer.valueOf(JLayeredPane.PALETTE_LAYER.intValue() + 1)); if (desktop.isShowing()) { taskBar.adjustSize(); } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java index 84c84de4912..ddbc7ae7e69 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java @@ -127,7 +127,7 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements if (style != oldStyle) { Object value = style.get(context, "SplitPane.size"); if (value == null) { - value = new Integer(6); + value = Integer.valueOf(6); } LookAndFeel.installProperty(splitPane, "dividerSize", value); diff --git a/jdk/src/share/classes/javax/swing/table/TableColumn.java b/jdk/src/share/classes/javax/swing/table/TableColumn.java index dddcdc3312d..890b855c746 100644 --- a/jdk/src/share/classes/javax/swing/table/TableColumn.java +++ b/jdk/src/share/classes/javax/swing/table/TableColumn.java @@ -281,7 +281,7 @@ public class TableColumn extends Object implements Serializable { private void firePropertyChange(String propertyName, int oldValue, int newValue) { if (oldValue != newValue) { - firePropertyChange(propertyName, new Integer(oldValue), new Integer(newValue)); + firePropertyChange(propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue)); } } diff --git a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java index d9ca3f387dc..406350a9b10 100644 --- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java +++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java @@ -351,7 +351,7 @@ public abstract class AbstractDocument implements Document, Serializable { * loaded asynchronously */ public void setAsynchronousLoadPriority(int p) { - Integer loadPriority = (p >= 0) ? new Integer(p) : null; + Integer loadPriority = (p >= 0) ? Integer.valueOf(p) : null; putProperty(AbstractDocument.AsyncLoadPriority, loadPriority); } @@ -2675,7 +2675,7 @@ public abstract class AbstractDocument implements Document, Serializable { */ BidiElement(Element parent, int start, int end, int level) { super(parent, new SimpleAttributeSet(), start, end); - addAttribute(StyleConstants.BidiLevel, new Integer(level)); + addAttribute(StyleConstants.BidiLevel, Integer.valueOf(level)); //System.out.println("BidiElement: start = " + start // + " end = " + end + " level = " + level ); } diff --git a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java index c9c47193825..76e3a24029e 100644 --- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java @@ -173,23 +173,24 @@ public class NumberFormatter extends InternationalFormatter { */ private Object convertValueToValueClass(Object value, Class valueClass) { if (valueClass != null && (value instanceof Number)) { + Number numberValue = (Number)value; if (valueClass == Integer.class) { - return new Integer(((Number)value).intValue()); + return Integer.valueOf(numberValue.intValue()); } else if (valueClass == Long.class) { - return new Long(((Number)value).longValue()); + return Long.valueOf(numberValue.longValue()); } else if (valueClass == Float.class) { - return new Float(((Number)value).floatValue()); + return Float.valueOf(numberValue.floatValue()); } else if (valueClass == Double.class) { - return new Double(((Number)value).doubleValue()); + return Double.valueOf(numberValue.doubleValue()); } else if (valueClass == Byte.class) { - return new Byte(((Number)value).byteValue()); + return Byte.valueOf(numberValue.byteValue()); } else if (valueClass == Short.class) { - return new Short(((Number)value).shortValue()); + return Short.valueOf(numberValue.shortValue()); } } return value; diff --git a/jdk/src/share/classes/javax/swing/text/PlainDocument.java b/jdk/src/share/classes/javax/swing/text/PlainDocument.java index 85ea6c8d262..2a3b6dbea92 100644 --- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java +++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java @@ -89,7 +89,7 @@ public class PlainDocument extends AbstractDocument { */ public PlainDocument(Content c) { super(c); - putProperty(tabSizeAttribute, new Integer(8)); + putProperty(tabSizeAttribute, Integer.valueOf(8)); defaultRoot = createDefaultRoot(); } diff --git a/jdk/src/share/classes/javax/swing/text/Segment.java b/jdk/src/share/classes/javax/swing/text/Segment.java index 0186c900d4e..55d17a9a5cd 100644 --- a/jdk/src/share/classes/javax/swing/text/Segment.java +++ b/jdk/src/share/classes/javax/swing/text/Segment.java @@ -118,7 +118,7 @@ public class Segment implements Cloneable, CharacterIterator, CharSequence { if (array != null) { return new String(array, offset, count); } - return new String(); + return ""; } // --- CharacterIterator methods ------------------------------------- diff --git a/jdk/src/share/classes/javax/swing/text/StyleConstants.java b/jdk/src/share/classes/javax/swing/text/StyleConstants.java index fa59a783f5d..aaefef88f50 100644 --- a/jdk/src/share/classes/javax/swing/text/StyleConstants.java +++ b/jdk/src/share/classes/javax/swing/text/StyleConstants.java @@ -296,7 +296,7 @@ public class StyleConstants { * @param o the bidi level value */ public static void setBidiLevel(MutableAttributeSet a, int o) { - a.addAttribute(BidiLevel, new Integer(o)); + a.addAttribute(BidiLevel, Integer.valueOf(o)); } /** @@ -386,7 +386,7 @@ public class StyleConstants { * @param s the font size */ public static void setFontSize(MutableAttributeSet a, int s) { - a.addAttribute(FontSize, new Integer(s)); + a.addAttribute(FontSize, Integer.valueOf(s)); } /** @@ -753,7 +753,7 @@ public class StyleConstants { * @param align the alignment value */ public static void setAlignment(MutableAttributeSet a, int align) { - a.addAttribute(Alignment, new Integer(align)); + a.addAttribute(Alignment, Integer.valueOf(align)); } /** diff --git a/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java b/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java index a4680179c38..d0643bf342c 100644 --- a/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java +++ b/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java @@ -1970,7 +1970,7 @@ class AccessibleHTML implements Accessible { for (int i = 0; i < nRows; i++) { if (isAccessibleRowSelected(i)) { - vec.addElement(new Integer(i)); + vec.addElement(Integer.valueOf(i)); } } int retval[] = new int[vec.size()]; @@ -1995,7 +1995,7 @@ class AccessibleHTML implements Accessible { for (int i = 0; i < nColumns; i++) { if (isAccessibleColumnSelected(i)) { - vec.addElement(new Integer(i)); + vec.addElement(Integer.valueOf(i)); } } int retval[] = new int[vec.size()]; @@ -2139,7 +2139,7 @@ class AccessibleHTML implements Accessible { private int columnCount = 0; public void addHeader(TableCellElementInfo cellInfo, int rowNumber) { - Integer rowInteger = new Integer(rowNumber); + Integer rowInteger = Integer.valueOf(rowNumber); ArrayList list = (ArrayList)headers.get(rowInteger); if (list == null) { list = new ArrayList(); @@ -2201,7 +2201,7 @@ class AccessibleHTML implements Accessible { } private TableCellElementInfo getElementInfoAt(int r, int c) { - ArrayList list = (ArrayList)headers.get(new Integer(r)); + ArrayList list = (ArrayList)headers.get(Integer.valueOf(r)); if (list != null) { return (TableCellElementInfo)list.get(c); } else { diff --git a/jdk/src/share/classes/javax/swing/text/html/CSS.java b/jdk/src/share/classes/javax/swing/text/html/CSS.java index 40b5977e07a..56cb0fcb26c 100644 --- a/jdk/src/share/classes/javax/swing/text/html/CSS.java +++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java @@ -1099,7 +1099,7 @@ public class CSS implements Serializable { */ static String colorToHex(Color color) { - String colorstr = new String("#"); + String colorstr = "#"; // Red String str = Integer.toHexString(color.getRed()); diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java index 980817d964a..1f5d498f812 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java @@ -1899,8 +1899,8 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { // assistive technologies listening for such events. comp.getAccessibleContext().firePropertyChange( AccessibleContext.ACCESSIBLE_HYPERTEXT_OFFSET, - new Integer(kit.prevHypertextOffset), - new Integer(e.getDot())); + Integer.valueOf(kit.prevHypertextOffset), + Integer.valueOf(e.getDot())); } } } diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java b/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java index a2d48603da7..3eb1cdb3d90 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java @@ -132,7 +132,7 @@ class AttributeList implements DTDConstants, Serializable { static Hashtable attributeTypes = new Hashtable(); static void defineAttributeType(String nm, int val) { - Integer num = new Integer(val); + Integer num = Integer.valueOf(val); attributeTypes.put(nm, num); attributeTypes.put(num, nm); } @@ -154,11 +154,11 @@ class AttributeList implements DTDConstants, Serializable { defineAttributeType("NUTOKEN", NUTOKEN); defineAttributeType("NUTOKENS", NUTOKENS); - attributeTypes.put("fixed", new Integer(FIXED)); - attributeTypes.put("required", new Integer(REQUIRED)); - attributeTypes.put("current", new Integer(CURRENT)); - attributeTypes.put("conref", new Integer(CONREF)); - attributeTypes.put("implied", new Integer(IMPLIED)); + attributeTypes.put("fixed", Integer.valueOf(FIXED)); + attributeTypes.put("required", Integer.valueOf(REQUIRED)); + attributeTypes.put("current", Integer.valueOf(CURRENT)); + attributeTypes.put("conref", Integer.valueOf(CONREF)); + attributeTypes.put("implied", Integer.valueOf(IMPLIED)); } public static int name2type(String nm) { @@ -167,6 +167,6 @@ class AttributeList implements DTDConstants, Serializable { } public static String type2name(int tp) { - return (String)attributeTypes.get(new Integer(tp)); + return (String)attributeTypes.get(Integer.valueOf(tp)); } } diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java b/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java index 3fd48f16b20..9ee714371cb 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java @@ -113,7 +113,7 @@ class DTD implements DTDConstants { * ch character */ public Entity getEntity(int ch) { - return (Entity)entityHash.get(new Integer(ch)); + return (Entity)entityHash.get(Integer.valueOf(ch)); } /** @@ -178,7 +178,7 @@ class DTD implements DTDConstants { switch (type & ~GENERAL) { case CDATA: case SDATA: - entityHash.put(new Integer(data[0]), ent); + entityHash.put(Integer.valueOf(data[0]), ent); break; } } diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java index 54b68618d50..7807b430632 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java @@ -162,10 +162,10 @@ class Element implements DTDConstants, Serializable { static Hashtable contentTypes = new Hashtable(); static { - contentTypes.put("CDATA", new Integer(CDATA)); - contentTypes.put("RCDATA", new Integer(RCDATA)); - contentTypes.put("EMPTY", new Integer(EMPTY)); - contentTypes.put("ANY", new Integer(ANY)); + contentTypes.put("CDATA", Integer.valueOf(CDATA)); + contentTypes.put("RCDATA", Integer.valueOf(RCDATA)); + contentTypes.put("EMPTY", Integer.valueOf(EMPTY)); + contentTypes.put("ANY", Integer.valueOf(ANY)); } public static int name2type(String nm) { diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java b/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java index f4a5cb9a73c..01e56125ae8 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java @@ -110,15 +110,15 @@ class Entity implements DTDConstants { static Hashtable entityTypes = new Hashtable(); static { - entityTypes.put("PUBLIC", new Integer(PUBLIC)); - entityTypes.put("CDATA", new Integer(CDATA)); - entityTypes.put("SDATA", new Integer(SDATA)); - entityTypes.put("PI", new Integer(PI)); - entityTypes.put("STARTTAG", new Integer(STARTTAG)); - entityTypes.put("ENDTAG", new Integer(ENDTAG)); - entityTypes.put("MS", new Integer(MS)); - entityTypes.put("MD", new Integer(MD)); - entityTypes.put("SYSTEM", new Integer(SYSTEM)); + entityTypes.put("PUBLIC", Integer.valueOf(PUBLIC)); + entityTypes.put("CDATA", Integer.valueOf(CDATA)); + entityTypes.put("SDATA", Integer.valueOf(SDATA)); + entityTypes.put("PI", Integer.valueOf(PI)); + entityTypes.put("STARTTAG", Integer.valueOf(STARTTAG)); + entityTypes.put("ENDTAG", Integer.valueOf(ENDTAG)); + entityTypes.put("MS", Integer.valueOf(MS)); + entityTypes.put("MD", Integer.valueOf(MD)); + entityTypes.put("SYSTEM", Integer.valueOf(SYSTEM)); } /** diff --git a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java index 24ba58fffb3..7be7bf5ebf8 100644 --- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java +++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java @@ -1842,7 +1842,7 @@ class Parser implements DTDConstants { String elemStr = getString(0); if (elemStr.equals("image")) { - elemStr = new String("img"); + elemStr = "img"; } /* determine if this element is part of the dtd. */ diff --git a/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java b/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java index 2bf54b31b94..fb1b95e9307 100644 --- a/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java +++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java @@ -281,7 +281,7 @@ class RTFAttributes public AssertiveAttribute(int d, Object s, String r, int v) { super(d, s, r); - swingValue = new Integer(v); + swingValue = Integer.valueOf(v); } public boolean set(MutableAttributeSet target) @@ -343,7 +343,7 @@ class RTFAttributes public NumericAttribute(int d, Object s, String r, int ds, int dr) { - this(d, s, r, new Integer(ds), dr, 1f); + this(d, s, r, Integer.valueOf(ds), dr, 1f); } public NumericAttribute(int d, Object s, @@ -377,7 +377,7 @@ class RTFAttributes Number swingValue; if (scale == 1f) - swingValue = new Integer(parameter); + swingValue = Integer.valueOf(parameter); else swingValue = new Float(parameter / scale); target.addAttribute(swingName, swingValue); diff --git a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java index 0c7a92f911d..201ba5364ad 100644 --- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java +++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java @@ -83,11 +83,7 @@ class RTFGenerator extends Object static public final String defaultFontFamily = "Helvetica"; /* constants so we can avoid allocating objects in inner loops */ - /* these should all be final, but javac seems to be a bit buggy */ - static protected Integer One, Zero; - static protected Boolean False; - static protected Float ZeroPointZero; - static private Object MagicToken; + final static private Object MagicToken; /* An array of character-keyword pairs. This could be done as a dictionary (and lookup would be quicker), but that @@ -98,11 +94,7 @@ class RTFGenerator extends Object static protected CharacterKeywordPair[] textKeywords; static { - One = new Integer(1); - Zero = new Integer(0); - False = Boolean.valueOf(false); MagicToken = new Object(); - ZeroPointZero = new Float(0); Dictionary textKeywordDictionary = RTFReader.textKeywords; Enumeration keys = textKeywordDictionary.keys(); @@ -142,7 +134,7 @@ static public void writeDocument(Document d, OutputStream to) public RTFGenerator(OutputStream to) { colorTable = new Hashtable(); - colorTable.put(defaultRTFColor, new Integer(0)); + colorTable.put(defaultRTFColor, Integer.valueOf(0)); colorCount = 1; fontTable = new Hashtable(); @@ -693,7 +685,7 @@ protected void resetParagraphAttributes(MutableAttributeSet currentAttributes) { writeControlWord("pard"); - currentAttributes.addAttribute(StyleConstants.Alignment, Zero); + currentAttributes.addAttribute(StyleConstants.Alignment, Integer.valueOf(0)); int wordIndex; int wordCount = RTFAttributes.attributes.length; diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java index 8ca40d8beab..cbf9ead8c37 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java @@ -157,8 +157,8 @@ public class DefaultTreeSelectionModel extends Object implements Cloneable, Seri selectionMode = TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION; if(oldMode != selectionMode && changeSupport != null) changeSupport.firePropertyChange(SELECTION_MODE_PROPERTY, - new Integer(oldMode), - new Integer(selectionMode)); + Integer.valueOf(oldMode), + Integer.valueOf(selectionMode)); } /** diff --git a/jdk/src/share/classes/sun/applet/AppletPanel.java b/jdk/src/share/classes/sun/applet/AppletPanel.java index fe4c356fe03..e02428b146b 100644 --- a/jdk/src/share/classes/sun/applet/AppletPanel.java +++ b/jdk/src/share/classes/sun/applet/AppletPanel.java @@ -285,7 +285,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { //System.out.println("SEND0= " + id); queue = new Queue(); } - Integer eventId = new Integer(id); + Integer eventId = Integer.valueOf(id); queue.enqueue(eventId); notifyAll(); } diff --git a/jdk/src/share/classes/sun/applet/AppletViewer.java b/jdk/src/share/classes/sun/applet/AppletViewer.java index 5170b0258a1..69bd80e261c 100644 --- a/jdk/src/share/classes/sun/applet/AppletViewer.java +++ b/jdk/src/share/classes/sun/applet/AppletViewer.java @@ -587,9 +587,9 @@ public class AppletViewer extends Frame implements AppletContext, Dimension d = panel.size(); Insets in = panel.insets(); panel.atts.put("width", - new Integer(d.width - (in.left + in.right)).toString()); + Integer.toString(d.width - (in.left + in.right))); panel.atts.put("height", - new Integer(d.height - (in.top + in.bottom)).toString()); + Integer.toString(d.height - (in.top + in.bottom))); } /** diff --git a/jdk/src/share/classes/sun/awt/FontConfiguration.java b/jdk/src/share/classes/sun/awt/FontConfiguration.java index 9a1effd39a8..a6b94870b3f 100644 --- a/jdk/src/share/classes/sun/awt/FontConfiguration.java +++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java @@ -1956,7 +1956,7 @@ public abstract class FontConfiguration { /*Init these tables to allow componentFontNameID, fontfileNameIDs to start from "1". */ - componentFontNameIDs.put("", new Short((short)0)); + componentFontNameIDs.put("", Short.valueOf((short)0)); fontfileNameIDs = new HashMap(); filenames = new HashMap(); diff --git a/jdk/src/share/classes/sun/awt/im/InputContext.java b/jdk/src/share/classes/sun/awt/im/InputContext.java index 5cb7e26705d..1ef31f1ded4 100644 --- a/jdk/src/share/classes/sun/awt/im/InputContext.java +++ b/jdk/src/share/classes/sun/awt/im/InputContext.java @@ -556,7 +556,7 @@ public class InputContext extends java.awt.im.InputContext } usedInputMethods.put(inputMethodLocator.deriveLocator(null), inputMethod); perInputMethodState.put(inputMethod, - new Boolean(clientWindowNotificationEnabled)); + Boolean.valueOf(clientWindowNotificationEnabled)); enableClientWindowNotification(inputMethod, false); if (this == inputMethodWindowContext) { inputMethod.hideWindows(); @@ -921,7 +921,7 @@ public class InputContext extends java.awt.im.InputContext if (perInputMethodState == null) { perInputMethodState = new HashMap(5); } - perInputMethodState.put(requester, new Boolean(enable)); + perInputMethodState.put(requester, Boolean.valueOf(enable)); return; } diff --git a/jdk/src/share/classes/sun/font/FileFontStrike.java b/jdk/src/share/classes/sun/font/FileFontStrike.java index edc9e67b6cb..76616d8ce39 100644 --- a/jdk/src/share/classes/sun/font/FileFontStrike.java +++ b/jdk/src/share/classes/sun/font/FileFontStrike.java @@ -657,7 +657,7 @@ public class FileFontStrike extends PhysicalStrike { * we first obtain this information, then the image, and never * will access this value again. */ - Integer key = new Integer(glyphCode); + Integer key = Integer.valueOf(glyphCode); Point2D.Float value = null; ConcurrentHashMap glyphMetricsMap = null; if (glyphMetricsMapRef != null) { @@ -724,7 +724,7 @@ public class FileFontStrike extends PhysicalStrike { boundsMap = new ConcurrentHashMap(); } - Integer key = new Integer(glyphCode); + Integer key = Integer.valueOf(glyphCode); Rectangle2D.Float bounds = boundsMap.get(key); if (bounds == null) { diff --git a/jdk/src/share/classes/sun/font/FontManager.java b/jdk/src/share/classes/sun/font/FontManager.java index 820c72728d3..d7fddd16d2b 100644 --- a/jdk/src/share/classes/sun/font/FontManager.java +++ b/jdk/src/share/classes/sun/font/FontManager.java @@ -2124,7 +2124,7 @@ public final class FontManager { private static void addLCIDMapEntry(Map map, String key, short value) { - map.put(key, new Short(value)); + map.put(key, Short.valueOf(value)); } private static synchronized void createLCIDMap() { diff --git a/jdk/src/share/classes/sun/font/FontResolver.java b/jdk/src/share/classes/sun/font/FontResolver.java index 5d130236e77..938fe3cade5 100644 --- a/jdk/src/share/classes/sun/font/FontResolver.java +++ b/jdk/src/share/classes/sun/font/FontResolver.java @@ -117,7 +117,7 @@ public final class FontResolver { Font2D font2D = FontManager.getFont2D(font); if (font2D.hasSupplementaryChars()) { fonts.add(font); - indices.add(new Integer(i)); + indices.add(Integer.valueOf(i)); } } diff --git a/jdk/src/share/classes/sun/font/PhysicalStrike.java b/jdk/src/share/classes/sun/font/PhysicalStrike.java index 31d8ff66281..b6f326bef53 100644 --- a/jdk/src/share/classes/sun/font/PhysicalStrike.java +++ b/jdk/src/share/classes/sun/font/PhysicalStrike.java @@ -114,7 +114,7 @@ public abstract class PhysicalStrike extends FontStrike { */ Point2D.Float getGlyphPoint(int glyphCode, int ptNumber) { Point2D.Float gp = null; - Integer ptKey = new Integer(glyphCode<<16|ptNumber); + Integer ptKey = Integer.valueOf(glyphCode<<16|ptNumber); if (glyphPointMapCache == null) { synchronized (this) { if (glyphPointMapCache == null) { diff --git a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java index 887f4c91e97..018fad4b9bf 100644 --- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java +++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java @@ -1374,7 +1374,7 @@ public final class SunGraphics2D SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS, fractionalMetricsHint)); model.put(SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST, - new Integer(lcdTextContrast)); + Integer.valueOf(lcdTextContrast)); Object value; switch (interpolationHint) { case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR: diff --git a/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java b/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java index c89d95a6a70..fc56cd9c77c 100644 --- a/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java +++ b/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java @@ -408,7 +408,7 @@ public final class SurfaceType { if (unusedUID > 255) { throw new InternalError("surface type id overflow"); } - i = new Integer(unusedUID++); + i = Integer.valueOf(unusedUID++); surfaceUIDMap.put(desc, i); } return i.intValue(); diff --git a/jdk/src/share/classes/sun/print/PSPrinterJob.java b/jdk/src/share/classes/sun/print/PSPrinterJob.java index 0b519599d13..5c2a9a5f216 100644 --- a/jdk/src/share/classes/sun/print/PSPrinterJob.java +++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java @@ -1536,16 +1536,16 @@ public class PSPrinterJob extends RasterPrinterJob { execCmd = new String[ncomps]; execCmd[n++] = "/usr/bin/lpr"; if ((pFlags & PRINTER) != 0) { - execCmd[n++] = new String("-P" + printer); + execCmd[n++] = "-P" + printer; } if ((pFlags & BANNER) != 0) { - execCmd[n++] = new String("-J" + banner); + execCmd[n++] = "-J" + banner; } if ((pFlags & COPIES) != 0) { - execCmd[n++] = new String("-#" + new Integer(copies).toString()); + execCmd[n++] = "-#" + copies; } if ((pFlags & NOSHEET) != 0) { - execCmd[n++] = new String("-h"); + execCmd[n++] = "-h"; } if ((pFlags & OPTIONS) != 0) { execCmd[n++] = new String(options); @@ -1556,19 +1556,19 @@ public class PSPrinterJob extends RasterPrinterJob { execCmd[n++] = "/usr/bin/lp"; execCmd[n++] = "-c"; // make a copy of the spool file if ((pFlags & PRINTER) != 0) { - execCmd[n++] = new String("-d" + printer); + execCmd[n++] = "-d" + printer; } if ((pFlags & BANNER) != 0) { - execCmd[n++] = new String("-t" + banner); + execCmd[n++] = "-t" + banner; } if ((pFlags & COPIES) != 0) { - execCmd[n++] = new String("-n" + new Integer(copies).toString()); + execCmd[n++] = "-n" + copies; } if ((pFlags & NOSHEET) != 0) { - execCmd[n++] = new String("-o nobanner"); + execCmd[n++] = "-o nobanner"; } if ((pFlags & OPTIONS) != 0) { - execCmd[n++] = new String("-o" + options); + execCmd[n++] = "-o" + options; } } execCmd[n++] = spoolFile; diff --git a/jdk/src/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/share/classes/sun/print/RasterPrinterJob.java index 9e2d2ffcfb5..1c0c0a8a2f4 100644 --- a/jdk/src/share/classes/sun/print/RasterPrinterJob.java +++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java @@ -245,7 +245,7 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * The name of the job being printed. */ - private String mDocName = new String("Java Printing"); + private String mDocName = "Java Printing"; /** diff --git a/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java b/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java index e6039722316..3b3cc4d24b9 100644 --- a/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java +++ b/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java @@ -116,7 +116,7 @@ public final class VersionInfo throw new IllegalArgumentException(INVALID_VERSION_NUMBER_); } int version = getInt(major, minor, milli, micro); - Integer key = new Integer(version); + Integer key = Integer.valueOf(version); Object result = MAP_.get(key); if (result == null) { result = new VersionInfo(version); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java index bc6bacb2417..658b7cbf3d5 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java @@ -317,7 +317,7 @@ abstract class XDropTargetProtocol { protected final void removeEmbedderRegistryEntry(long embedder) { synchronized (this) { - embedderRegistry.remove(new Long(embedder)); + embedderRegistry.remove(Long.valueOf(embedder)); } } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java index eecad17af89..2d05578dd04 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java @@ -329,7 +329,7 @@ final class XDropTargetRegistry { embedderProtocols = Collections.unmodifiableList(embedderProtocols); - Long lToplevel = new Long(embedder); + Long lToplevel = Long.valueOf(embedder); boolean isXEmbedServer = false; synchronized (this) { EmbeddedDropSiteEntry entry = diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java index a5ce2df7404..28fd3c2246a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java @@ -383,11 +383,11 @@ public class XEmbedServerTester implements XEventDispatcher { try { XCreateWindowParams params = new XCreateWindowParams(new Object[] { - XBaseWindow.PARENT_WINDOW, new Long(reparent?XToolkit.getDefaultRootWindow():parent), + XBaseWindow.PARENT_WINDOW, Long.valueOf(reparent?XToolkit.getDefaultRootWindow():parent), XBaseWindow.BOUNDS, initialBounds, XBaseWindow.EMBEDDED, Boolean.TRUE, XBaseWindow.VISIBLE, Boolean.valueOf(mapped == XEmbedHelper.XEMBED_MAPPED), - XBaseWindow.EVENT_MASK, new Long(VisibilityChangeMask | StructureNotifyMask | + XBaseWindow.EVENT_MASK, Long.valueOf(VisibilityChangeMask | StructureNotifyMask | SubstructureNotifyMask | KeyPressMask)}); window = new XBaseWindow(params); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java index d3baad68ed3..4e06328b9ae 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java @@ -908,7 +908,7 @@ class FileDialogFilter implements FilenameFilter { * Converts the filter into the form which is acceptable by Java's regexps */ private String convert(String filter) { - String regex = new String("^" + filter + "$"); + String regex = "^" + filter + "$"; regex = regex.replaceAll("\\.", "\\\\."); regex = regex.replaceAll("\\?", "."); regex = regex.replaceAll("\\*", ".*"); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java index 14316beed91..8a2d21b7ccd 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java @@ -458,16 +458,16 @@ abstract class XScrollbar { String type; switch (id) { case MouseEvent.MOUSE_PRESSED: - type = new String("press"); + type = "press"; break; case MouseEvent.MOUSE_RELEASED: - type = new String("release"); + type = "release"; break; case MouseEvent.MOUSE_DRAGGED: - type = new String("drag"); + type = "drag"; break; default: - type = new String("other"); + type = "other"; } log.finer("Mouse " + type + " event in scroll bar " + this + "x = " + x + ", y = " + y + diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java index 897142223da..78fd9db279b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java @@ -421,7 +421,7 @@ public class X11GraphicsConfig extends GraphicsConfiguration { return new SunVolatileImage(target, target.getWidth(), target.getHeight(), - new Long(backBuffer)); + Long.valueOf(backBuffer)); } /** diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java index 755e77aa860..bdb178e8918 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java @@ -164,7 +164,7 @@ public class X11GraphicsDevice if (ret[i] == null) { boolean doubleBuffer = (dbeSupported && - doubleBufferVisuals.contains(new Integer(visNum))); + doubleBufferVisuals.contains(Integer.valueOf(visNum))); ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth, getConfigColormap(i, screen), doubleBuffer); @@ -199,7 +199,7 @@ public class X11GraphicsDevice public static native boolean isDBESupported(); // Callback for adding a new double buffer visual into our set private void addDoubleBufferVisual(int visNum) { - doubleBufferVisuals.add(new Integer(visNum)); + doubleBufferVisuals.add(Integer.valueOf(visNum)); } // Enumerates all visuals that support double buffering private native void getDoubleBufferVisuals(int screen); @@ -239,7 +239,7 @@ public class X11GraphicsDevice doubleBufferVisuals = new HashSet(); getDoubleBufferVisuals(screen); doubleBuffer = - doubleBufferVisuals.contains(new Integer(visNum)); + doubleBufferVisuals.contains(Integer.valueOf(visNum)); } defaultConfig = X11GraphicsConfig.getConfig(this, visNum, depth, getConfigColormap(0, screen), diff --git a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java index b3ab80a6f92..ad86ee2545c 100644 --- a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java +++ b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java @@ -867,39 +867,38 @@ public class UnixPrintJob implements CancelablePrintJob { execCmd[n++] = "/usr/bin/lp"; execCmd[n++] = "-c"; // make a copy of the spool file if ((pFlags & PRINTER) != 0) { - execCmd[n++] = new String("-d" + printer); + execCmd[n++] = "-d" + printer; } if ((pFlags & BANNER) != 0) { String quoteChar = "\""; - execCmd[n++] = new String("-t " + quoteChar+banner+quoteChar); + execCmd[n++] = "-t " + quoteChar+banner+quoteChar; } if ((pFlags & COPIES) != 0) { - execCmd[n++] = new String("-n " + - new Integer(copies).toString()); + execCmd[n++] = "-n " + copies; } if ((pFlags & NOSHEET) != 0) { - execCmd[n++] = new String("-o nobanner"); + execCmd[n++] = "-o nobanner"; } if ((pFlags & OPTIONS) != 0) { - execCmd[n++] = new String("-o " + options); + execCmd[n++] = "-o " + options; } } else { execCmd = new String[ncomps]; execCmd[n++] = "/usr/bin/lpr"; if ((pFlags & PRINTER) != 0) { - execCmd[n++] = new String("-P" + printer); + execCmd[n++] = "-P" + printer; } if ((pFlags & BANNER) != 0) { - execCmd[n++] = new String("-J " + banner); + execCmd[n++] = "-J " + banner; } if ((pFlags & COPIES) != 0) { - execCmd[n++] = new String("-#" + new Integer(copies).toString()); + execCmd[n++] = "-#" + copies; } if ((pFlags & NOSHEET) != 0) { - execCmd[n++] = new String("-h"); + execCmd[n++] = "-h"; } if ((pFlags & OPTIONS) != 0) { - execCmd[n++] = new String("-o" + options); + execCmd[n++] = "-o" + options; } } execCmd[n++] = spoolFile; diff --git a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java index fbab9e602ab..7e9429d4512 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java @@ -568,7 +568,7 @@ class HTMLCodec extends InputStream { byte[] headerBytes = null, trailerBytes = null; try { - headerBytes = new String(header).getBytes(ENCODING); + headerBytes = header.toString().getBytes(ENCODING); trailerBytes = htmlSuffix.getBytes(ENCODING); } catch (UnsupportedEncodingException cannotHappen) { } diff --git a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java index 1c3600ffb66..494ce4c0f45 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java +++ b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java @@ -488,7 +488,7 @@ public class WInputMethod extends InputMethodAdapter attrStr.addAttribute(Attribute.INPUT_METHOD_SEGMENT, new Annotation(null), 0, text.length()); attrStr.addAttribute(Attribute.READING, - new Annotation(new String("")), 0, text.length()); + new Annotation(""), 0, text.length()); } // set Hilight Information diff --git a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java index 070c67dd15e..2db3e8829ac 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -123,7 +123,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer { public void setTitle(String title) { // allow a null title to pass as an empty string. if (title == null) { - title = new String(""); + title = ""; } _setTitle(title); } diff --git a/jdk/src/windows/classes/sun/print/Win32PrintService.java b/jdk/src/windows/classes/sun/print/Win32PrintService.java index ea5771b3ad2..f0f05267ae6 100644 --- a/jdk/src/windows/classes/sun/print/Win32PrintService.java +++ b/jdk/src/windows/classes/sun/print/Win32PrintService.java @@ -348,7 +348,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, idList = new ArrayList(); for (int i=0; i < media.length; i++) { - idList.add(new Integer(media[i])); + idList.add(Integer.valueOf(media[i])); } mediaSizes = getMediaSizes(idList, media); @@ -517,7 +517,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, if ((wid <= 0) || (ht <= 0)) { //Remove corresponding ID from list if (nMedia == media.length) { - Integer remObj = new Integer(media[i]); + Integer remObj = Integer.valueOf(media[i]); idList.remove(idList.indexOf(remObj)); } continue; @@ -539,7 +539,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, msList.add(ms); } catch(IllegalArgumentException e) { if (nMedia == media.length) { - Integer remObj = new Integer(media[i]); + Integer remObj = Integer.valueOf(media[i]); idList.remove(idList.indexOf(remObj)); } } @@ -984,7 +984,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, // cannot be null but to be safe, add a check if ((idList != null) && (mediaSizes != null) && (idList.size() == mediaSizes.length)) { - Integer defIdObj = new Integer(defPaper); + Integer defIdObj = Integer.valueOf(defPaper); int index = idList.indexOf(defIdObj); if (index>=0 && index