6613529: Avoid duplicate object creation within JDK packages
Summary: avoid using constructors when unique values are not necessary
Reviewed-by: volk, igor, peterz
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Mon Apr 07 14:53:51 2008 +0400
@@ -504,7 +504,7 @@
}
// 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);
}
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java Mon Apr 07 14:53:51 2008 +0400
@@ -98,7 +98,7 @@
try {
return data.getBytes("ISO-8859-1");
} catch (UnsupportedEncodingException e) {
- return (new String("")).getBytes();
+ return "".getBytes();
}
}
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java Mon Apr 07 14:53:51 2008 +0400
@@ -328,7 +328,7 @@
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 @@
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 @@
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 @@
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 @@
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;
}
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Mon Apr 07 14:53:51 2008 +0400
@@ -336,7 +336,7 @@
// 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 @@
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 @@
}
Object[] defaults = new Object[] {
- "ArrowButton.size", new Integer(13),
+ "ArrowButton.size", Integer.valueOf(13),
"Button.defaultButtonFollowsFocus", Boolean.FALSE,
@@ -893,8 +893,8 @@
"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 @@
"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 @@
}),
- "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 @@
"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 @@
"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",
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Mon Apr 07 14:53:51 2008 +0400
@@ -851,7 +851,7 @@
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 @@
private static void initIconTypeMap() {
ICON_TYPE_MAP = new HashMap<String,Integer>();
- 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));
}
}
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Mon Apr 07 14:53:51 2008 +0400
@@ -178,7 +178,7 @@
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 @@
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()));
}
}
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java Mon Apr 07 14:53:51 2008 +0400
@@ -567,7 +567,7 @@
"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 @@
"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 @@
}),
"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 @@
"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 @@
"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 @@
"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 @@
"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"),
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java Mon Apr 07 14:53:51 2008 +0400
@@ -299,9 +299,9 @@
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 @@
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 @@
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 @@
"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 @@
}),
// DesktopIcon
- "DesktopIcon.width", new Integer(160),
+ "DesktopIcon.width", Integer.valueOf(160),
"EditorPane.font", ControlFont,
"EditorPane.background", WindowBackgroundColor,
@@ -814,9 +814,9 @@
"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 @@
"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 @@
"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 @@
"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 @@
"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 @@
"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 @@
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);
}
}
--- a/jdk/src/share/classes/java/awt/Button.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/java/awt/Button.java Mon Apr 07 14:53:51 2008 +0400
@@ -597,7 +597,7 @@
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;
}
--- a/jdk/src/share/classes/java/awt/MenuItem.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/java/awt/MenuItem.java Mon Apr 07 14:53:51 2008 +0400
@@ -847,7 +847,7 @@
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;
}
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java Mon Apr 07 14:53:51 2008 +0400
@@ -298,7 +298,7 @@
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 @@
}
nextLine = nextLine.substring(startIndex,
nextLine.length());
- line = new String(loppedLine+nextLine);
+ line = loppedLine+nextLine;
}
// Find start of key
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java Mon Apr 07 14:53:51 2008 +0400
@@ -1210,9 +1210,9 @@
* <code>BufferedImage</code>.
*/
public String toString() {
- return new String("BufferedImage@"+Integer.toHexString(hashCode())
- +": type = "+imageType
- +" "+colorModel+" "+raster);
+ return "BufferedImage@"+Integer.toHexString(hashCode())
+ +": type = "+imageType
+ +" "+colorModel+" "+raster;
}
/**
--- a/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java Mon Apr 07 14:53:51 2008 +0400
@@ -384,7 +384,7 @@
// 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 @@
// 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 @@
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,
--- a/jdk/src/share/classes/java/text/MessageFormat.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/java/text/MessageFormat.java Mon Apr 07 14:53:51 2008 +0400
@@ -1286,7 +1286,7 @@
characterIterators.add(
createAttributedCharacterIterator(
subIterator, Field.ARGUMENT,
- new Integer(argumentNumber)));
+ Integer.valueOf(argumentNumber)));
last = result.length();
}
arg = null;
@@ -1296,7 +1296,7 @@
characterIterators.add(
createAttributedCharacterIterator(
arg, Field.ARGUMENT,
- new Integer(argumentNumber)));
+ Integer.valueOf(argumentNumber)));
last = result.length();
}
}
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java Mon Apr 07 14:53:51 2008 +0400
@@ -778,8 +778,8 @@
*/
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) {
}
}
--- a/jdk/src/share/classes/javax/swing/AbstractButton.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/AbstractButton.java Mon Apr 07 14:53:51 2008 +0400
@@ -2047,14 +2047,14 @@
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 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 @@
* @return an Integer of 0.
*/
public Number getMinimumAccessibleValue() {
- return new Integer(0);
+ return Integer.valueOf(0);
}
/**
@@ -2592,7 +2592,7 @@
* @return An Integer of 1.
*/
public Number getMaximumAccessibleValue() {
- return new Integer(1);
+ return Integer.valueOf(1);
}
--- a/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java Mon Apr 07 14:53:51 2008 +0400
@@ -49,7 +49,7 @@
componentToDebug = new Hashtable();
}
if (debug > 0) {
- componentToDebug.put(component, new Integer(debug));
+ componentToDebug.put(component, Integer.valueOf(debug));
} else {
componentToDebug.remove(component);
}
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java Mon Apr 07 14:53:51 2008 +0400
@@ -1285,7 +1285,7 @@
* 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 @@
* have a value
*/
public Number getCurrentAccessibleValue() {
- return new Integer(getLayer());
+ return Integer.valueOf(getLayer());
}
/**
@@ -2116,7 +2116,7 @@
* have a minimum value
*/
public Number getMinimumAccessibleValue() {
- return new Integer(Integer.MIN_VALUE);
+ return Integer.MIN_VALUE;
}
/**
@@ -2126,7 +2126,7 @@
* have a maximum value
*/
public Number getMaximumAccessibleValue() {
- return new Integer(Integer.MAX_VALUE);
+ return Integer.MAX_VALUE;
}
} // AccessibleJInternalFrame
--- a/jdk/src/share/classes/javax/swing/JOptionPane.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JOptionPane.java Mon Apr 07 14:53:51 2008 +0400
@@ -1512,7 +1512,7 @@
iFrame.putClientProperty("JInternalFrame.frameType", "optionDialog");
iFrame.putClientProperty("JInternalFrame.messageType",
- new Integer(getMessageType()));
+ Integer.valueOf(getMessageType()));
iFrame.addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameClosing(InternalFrameEvent e) {
--- a/jdk/src/share/classes/javax/swing/JProgressBar.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JProgressBar.java Mon Apr 07 14:53:51 2008 +0400
@@ -775,9 +775,9 @@
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 @@
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 @@
* @return the current value of this object
*/
public Number getCurrentAccessibleValue() {
- return new Integer(getValue());
+ return Integer.valueOf(getValue());
}
/**
@@ -1110,7 +1110,7 @@
* @return the minimum value of this object
*/
public Number getMinimumAccessibleValue() {
- return new Integer(getMinimum());
+ return Integer.valueOf(getMinimum());
}
/**
@@ -1120,7 +1120,7 @@
*/
public Number getMaximumAccessibleValue() {
// TIGER - 4422362
- return new Integer(model.getMaximum() - model.getExtent());
+ return Integer.valueOf(model.getMaximum() - model.getExtent());
}
} // AccessibleJProgressBar
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java Mon Apr 07 14:53:51 2008 +0400
@@ -314,7 +314,7 @@
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 @@
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 @@
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 @@
* @return The current value of this object.
*/
public Number getCurrentAccessibleValue() {
- return new Integer(getValue());
+ return Integer.valueOf(getValue());
}
/**
@@ -903,7 +903,7 @@
* @return The minimum value of this object.
*/
public Number getMinimumAccessibleValue() {
- return new Integer(getMinimum());
+ return Integer.valueOf(getMinimum());
}
/**
--- a/jdk/src/share/classes/javax/swing/JSlider.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JSlider.java Mon Apr 07 14:53:51 2008 +0400
@@ -485,9 +485,9 @@
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 @@
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 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 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 @@
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 @@
* @return The current value of this object.
*/
public Number getCurrentAccessibleValue() {
- return new Integer(getValue());
+ return Integer.valueOf(getValue());
}
/**
@@ -1486,7 +1486,7 @@
* @return The minimum value of this object.
*/
public Number getMinimumAccessibleValue() {
- return new Integer(getMinimum());
+ return Integer.valueOf(getMinimum());
}
/**
@@ -1497,7 +1497,7 @@
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
}
--- a/jdk/src/share/classes/javax/swing/JSplitPane.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java Mon Apr 07 14:53:51 2008 +0400
@@ -1195,7 +1195,7 @@
* @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 @@
* @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 @@
* @return The maximum value of this object.
*/
public Number getMaximumAccessibleValue() {
- return new Integer(getUI().getMaximumDividerLocation(
+ return Integer.valueOf(getUI().getMaximumDividerLocation(
JSplitPane.this));
}
--- a/jdk/src/share/classes/javax/swing/JTabbedPane.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java Mon Apr 07 14:53:51 2008 +0400
@@ -967,7 +967,7 @@
// 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) {
--- a/jdk/src/share/classes/javax/swing/JTable.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JTable.java Mon Apr 07 14:53:51 2008 +0400
@@ -7680,7 +7680,7 @@
*/
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 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 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 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();
--- a/jdk/src/share/classes/javax/swing/JTextArea.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/JTextArea.java Mon Apr 07 14:53:51 2008 +0400
@@ -267,7 +267,7 @@
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);
}
}
--- a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java Mon Apr 07 14:53:51 2008 +0400
@@ -144,7 +144,7 @@
* <code>minimum <= value <= maximum</code>
*/
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 @@
* <code>stepSize</code> 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 @@
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);
}
}
--- a/jdk/src/share/classes/javax/swing/TablePrintable.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/TablePrintable.java Mon Apr 07 14:53:51 2008 +0400
@@ -215,7 +215,7 @@
}
// 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;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -109,7 +109,7 @@
LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
}
- LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));
+ LookAndFeel.installProperty(b, "iconTextGap", Integer.valueOf(4));
}
protected void installListeners(AbstractButton b) {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Mon Apr 07 14:53:51 2008 +0400
@@ -654,7 +654,7 @@
"javax.swing.plaf.basic.BasicIconFactory",
"getRadioButtonMenuItemIcon");
- Object menuItemAcceleratorDelimiter = new String("+");
+ Object menuItemAcceleratorDelimiter = "+";
// *** OptionPane value objects
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -146,7 +146,7 @@
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");
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -1195,10 +1195,10 @@
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 @@
if (getName() == CLOSE) {
JOptionPane optionPane = (JOptionPane)e.getSource();
- optionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION));
+ optionPane.setValue(Integer.valueOf(JOptionPane.CLOSED_OPTION));
}
}
}
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -539,7 +539,7 @@
}
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 @@
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());
}
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -178,7 +178,7 @@
dragWindow = null;
dockingSource = null;
- c.putClientProperty( FOCUSED_COMP_INDEX, new Integer( focusedCompIndex ) );
+ c.putClientProperty( FOCUSED_COMP_INDEX, Integer.valueOf( focusedCompIndex ) );
}
protected void installDefaults( )
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Mon Apr 07 14:53:51 2008 +0400
@@ -455,7 +455,7 @@
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 @@
"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 @@
"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[] {
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java Mon Apr 07 14:53:51 2008 +0400
@@ -53,7 +53,7 @@
public void setDirection(int dir) {
direction = dir;
- putClientProperty("__arrow_direction__", new Integer(dir));
+ putClientProperty("__arrow_direction__", Integer.valueOf(dir));
repaint();
}
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -96,7 +96,7 @@
}
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();
}
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java Mon Apr 07 14:53:51 2008 +0400
@@ -127,7 +127,7 @@
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);
--- a/jdk/src/share/classes/javax/swing/table/TableColumn.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/table/TableColumn.java Mon Apr 07 14:53:51 2008 +0400
@@ -281,7 +281,7 @@
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));
}
}
--- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java Mon Apr 07 14:53:51 2008 +0400
@@ -351,7 +351,7 @@
* 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 @@
*/
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 );
}
--- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java Mon Apr 07 14:53:51 2008 +0400
@@ -173,23 +173,24 @@
*/
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;
--- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java Mon Apr 07 14:53:51 2008 +0400
@@ -89,7 +89,7 @@
*/
public PlainDocument(Content c) {
super(c);
- putProperty(tabSizeAttribute, new Integer(8));
+ putProperty(tabSizeAttribute, Integer.valueOf(8));
defaultRoot = createDefaultRoot();
}
--- a/jdk/src/share/classes/javax/swing/text/Segment.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/Segment.java Mon Apr 07 14:53:51 2008 +0400
@@ -118,7 +118,7 @@
if (array != null) {
return new String(array, offset, count);
}
- return new String();
+ return "";
}
// --- CharacterIterator methods -------------------------------------
--- a/jdk/src/share/classes/javax/swing/text/StyleConstants.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/StyleConstants.java Mon Apr 07 14:53:51 2008 +0400
@@ -296,7 +296,7 @@
* @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 @@
* @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 @@
* @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));
}
/**
--- a/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java Mon Apr 07 14:53:51 2008 +0400
@@ -1970,7 +1970,7 @@
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 @@
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 @@
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 @@
}
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 {
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java Mon Apr 07 14:53:51 2008 +0400
@@ -1099,7 +1099,7 @@
*/
static String colorToHex(Color color) {
- String colorstr = new String("#");
+ String colorstr = "#";
// Red
String str = Integer.toHexString(color.getRed());
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Mon Apr 07 14:53:51 2008 +0400
@@ -1899,8 +1899,8 @@
// 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()));
}
}
}
--- a/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java Mon Apr 07 14:53:51 2008 +0400
@@ -132,7 +132,7 @@
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 @@
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 @@
}
public static String type2name(int tp) {
- return (String)attributeTypes.get(new Integer(tp));
+ return (String)attributeTypes.get(Integer.valueOf(tp));
}
}
--- a/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java Mon Apr 07 14:53:51 2008 +0400
@@ -113,7 +113,7 @@
* <code>ch</code> character
*/
public Entity getEntity(int ch) {
- return (Entity)entityHash.get(new Integer(ch));
+ return (Entity)entityHash.get(Integer.valueOf(ch));
}
/**
@@ -178,7 +178,7 @@
switch (type & ~GENERAL) {
case CDATA:
case SDATA:
- entityHash.put(new Integer(data[0]), ent);
+ entityHash.put(Integer.valueOf(data[0]), ent);
break;
}
}
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java Mon Apr 07 14:53:51 2008 +0400
@@ -162,10 +162,10 @@
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) {
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java Mon Apr 07 14:53:51 2008 +0400
@@ -110,15 +110,15 @@
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));
}
/**
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java Mon Apr 07 14:53:51 2008 +0400
@@ -1842,7 +1842,7 @@
String elemStr = getString(0);
if (elemStr.equals("image")) {
- elemStr = new String("img");
+ elemStr = "img";
}
/* determine if this element is part of the dtd. */
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java Mon Apr 07 14:53:51 2008 +0400
@@ -281,7 +281,7 @@
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 @@
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 @@
Number swingValue;
if (scale == 1f)
- swingValue = new Integer(parameter);
+ swingValue = Integer.valueOf(parameter);
else
swingValue = new Float(parameter / scale);
target.addAttribute(swingName, swingValue);
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java Mon Apr 07 14:53:51 2008 +0400
@@ -83,11 +83,7 @@
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 @@
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 @@
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 @@
{
writeControlWord("pard");
- currentAttributes.addAttribute(StyleConstants.Alignment, Zero);
+ currentAttributes.addAttribute(StyleConstants.Alignment, Integer.valueOf(0));
int wordIndex;
int wordCount = RTFAttributes.attributes.length;
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Mon Apr 07 14:53:51 2008 +0400
@@ -157,8 +157,8 @@
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));
}
/**
--- a/jdk/src/share/classes/sun/applet/AppletPanel.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java Mon Apr 07 14:53:51 2008 +0400
@@ -285,7 +285,7 @@
//System.out.println("SEND0= " + id);
queue = new Queue();
}
- Integer eventId = new Integer(id);
+ Integer eventId = Integer.valueOf(id);
queue.enqueue(eventId);
notifyAll();
}
--- a/jdk/src/share/classes/sun/applet/AppletViewer.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java Mon Apr 07 14:53:51 2008 +0400
@@ -587,9 +587,9 @@
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)));
}
/**
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java Mon Apr 07 14:53:51 2008 +0400
@@ -1956,7 +1956,7 @@
/*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<String, Short>();
filenames = new HashMap<Short, Short>();
--- a/jdk/src/share/classes/sun/awt/im/InputContext.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/awt/im/InputContext.java Mon Apr 07 14:53:51 2008 +0400
@@ -556,7 +556,7 @@
}
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 @@
if (perInputMethodState == null) {
perInputMethodState = new HashMap(5);
}
- perInputMethodState.put(requester, new Boolean(enable));
+ perInputMethodState.put(requester, Boolean.valueOf(enable));
return;
}
--- a/jdk/src/share/classes/sun/font/FileFontStrike.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/font/FileFontStrike.java Mon Apr 07 14:53:51 2008 +0400
@@ -657,7 +657,7 @@
* 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<Integer, Point2D.Float> glyphMetricsMap = null;
if (glyphMetricsMapRef != null) {
@@ -724,7 +724,7 @@
boundsMap = new ConcurrentHashMap<Integer, Rectangle2D.Float>();
}
- Integer key = new Integer(glyphCode);
+ Integer key = Integer.valueOf(glyphCode);
Rectangle2D.Float bounds = boundsMap.get(key);
if (bounds == null) {
--- a/jdk/src/share/classes/sun/font/FontManager.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/font/FontManager.java Mon Apr 07 14:53:51 2008 +0400
@@ -2124,7 +2124,7 @@
private static void addLCIDMapEntry(Map<String, Short> map,
String key, short value) {
- map.put(key, new Short(value));
+ map.put(key, Short.valueOf(value));
}
private static synchronized void createLCIDMap() {
--- a/jdk/src/share/classes/sun/font/FontResolver.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/font/FontResolver.java Mon Apr 07 14:53:51 2008 +0400
@@ -117,7 +117,7 @@
Font2D font2D = FontManager.getFont2D(font);
if (font2D.hasSupplementaryChars()) {
fonts.add(font);
- indices.add(new Integer(i));
+ indices.add(Integer.valueOf(i));
}
}
--- a/jdk/src/share/classes/sun/font/PhysicalStrike.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/font/PhysicalStrike.java Mon Apr 07 14:53:51 2008 +0400
@@ -114,7 +114,7 @@
*/
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) {
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java Mon Apr 07 14:53:51 2008 +0400
@@ -1374,7 +1374,7 @@
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:
--- a/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java Mon Apr 07 14:53:51 2008 +0400
@@ -408,7 +408,7 @@
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();
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java Mon Apr 07 14:53:51 2008 +0400
@@ -1536,16 +1536,16 @@
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 @@
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;
--- a/jdk/src/share/classes/sun/print/RasterPrinterJob.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java Mon Apr 07 14:53:51 2008 +0400
@@ -245,7 +245,7 @@
/**
* The name of the job being printed.
*/
- private String mDocName = new String("Java Printing");
+ private String mDocName = "Java Printing";
/**
--- a/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java Mon Apr 07 14:53:51 2008 +0400
@@ -116,7 +116,7 @@
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);
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java Mon Apr 07 14:53:51 2008 +0400
@@ -317,7 +317,7 @@
protected final void removeEmbedderRegistryEntry(long embedder) {
synchronized (this) {
- embedderRegistry.remove(new Long(embedder));
+ embedderRegistry.remove(Long.valueOf(embedder));
}
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Mon Apr 07 14:53:51 2008 +0400
@@ -329,7 +329,7 @@
embedderProtocols = Collections.unmodifiableList(embedderProtocols);
- Long lToplevel = new Long(embedder);
+ Long lToplevel = Long.valueOf(embedder);
boolean isXEmbedServer = false;
synchronized (this) {
EmbeddedDropSiteEntry entry =
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java Mon Apr 07 14:53:51 2008 +0400
@@ -383,11 +383,11 @@
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);
--- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java Mon Apr 07 14:53:51 2008 +0400
@@ -908,7 +908,7 @@
* 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("\\*", ".*");
--- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java Mon Apr 07 14:53:51 2008 +0400
@@ -458,16 +458,16 @@
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 +
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java Mon Apr 07 14:53:51 2008 +0400
@@ -421,7 +421,7 @@
{
return new SunVolatileImage(target,
target.getWidth(), target.getHeight(),
- new Long(backBuffer));
+ Long.valueOf(backBuffer));
}
/**
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java Mon Apr 07 14:53:51 2008 +0400
@@ -164,7 +164,7 @@
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 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 @@
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),
--- a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java Mon Apr 07 14:53:51 2008 +0400
@@ -867,39 +867,38 @@
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;
--- a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java Mon Apr 07 14:53:51 2008 +0400
@@ -568,7 +568,7 @@
byte[] headerBytes = null, trailerBytes = null;
try {
- headerBytes = new String(header).getBytes(ENCODING);
+ headerBytes = header.toString().getBytes(ENCODING);
trailerBytes = htmlSuffix.getBytes(ENCODING);
} catch (UnsupportedEncodingException cannotHappen) {
}
--- a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java Mon Apr 07 14:53:51 2008 +0400
@@ -488,7 +488,7 @@
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
--- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java Mon Apr 07 14:53:51 2008 +0400
@@ -123,7 +123,7 @@
public void setTitle(String title) {
// allow a null title to pass as an empty string.
if (title == null) {
- title = new String("");
+ title = "";
}
_setTitle(title);
}
--- a/jdk/src/windows/classes/sun/print/Win32PrintService.java Fri Apr 04 20:32:59 2008 +0400
+++ b/jdk/src/windows/classes/sun/print/Win32PrintService.java Mon Apr 07 14:53:51 2008 +0400
@@ -348,7 +348,7 @@
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 @@
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 @@
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 @@
// 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<mediaSizes.length) {
return mediaSizes[index].getMediaSizeName();