8049893: Replace uses of 'new Integer()' with appropriate alternative across client classes
Reviewed-by: prr, pchelko
Contributed-by: otaviojava@java.net
--- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java Mon Jul 14 09:48:26 2014 -0700
@@ -126,18 +126,18 @@
new IIOMetadataNode(nativeMetadataFormatName);
addChildNode(root, "BMPVersion", bmpVersion);
- addChildNode(root, "Width", new Integer(width));
- addChildNode(root, "Height", new Integer(height));
+ addChildNode(root, "Width", width);
+ addChildNode(root, "Height", height);
addChildNode(root, "BitsPerPixel", new Short(bitsPerPixel));
- addChildNode(root, "Compression", new Integer(compression));
- addChildNode(root, "ImageSize", new Integer(imageSize));
+ addChildNode(root, "Compression", compression);
+ addChildNode(root, "ImageSize", imageSize);
IIOMetadataNode node = addChildNode(root, "PixelsPerMeter", null);
- addChildNode(node, "X", new Integer(xPixelsPerMeter));
- addChildNode(node, "Y", new Integer(yPixelsPerMeter));
+ addChildNode(node, "X", xPixelsPerMeter);
+ addChildNode(node, "Y", yPixelsPerMeter);
- addChildNode(root, "ColorsUsed", new Integer(colorsUsed));
- addChildNode(root, "ColorsImportant", new Integer(colorsImportant));
+ addChildNode(root, "ColorsUsed", colorsUsed);
+ addChildNode(root, "ColorsImportant", colorsImportant);
int version = 0;
for (int i = 0; i < bmpVersion.length(); i++)
@@ -146,19 +146,19 @@
if (version >= 4) {
node = addChildNode(root, "Mask", null);
- addChildNode(node, "Red", new Integer(redMask));
- addChildNode(node, "Green", new Integer(greenMask));
- addChildNode(node, "Blue", new Integer(blueMask));
- addChildNode(node, "Alpha", new Integer(alphaMask));
+ addChildNode(node, "Red", redMask);
+ addChildNode(node, "Green", greenMask);
+ addChildNode(node, "Blue", blueMask);
+ addChildNode(node, "Alpha", alphaMask);
- addChildNode(root, "ColorSpaceType", new Integer(colorSpace));
+ addChildNode(root, "ColorSpaceType", colorSpace);
node = addChildNode(root, "CIEXYZEndPoints", null);
addXYZPoints(node, "Red", redX, redY, redZ);
addXYZPoints(node, "Green", greenX, greenY, greenZ);
addXYZPoints(node, "Blue", blueX, blueY, blueZ);
- node = addChildNode(root, "Intent", new Integer(intent));
+ node = addChildNode(root, "Intent", intent);
}
// Palette
--- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java Mon Jul 14 09:48:26 2014 -0700
@@ -2323,7 +2323,7 @@
SOSMarkerSegment sos = (SOSMarkerSegment) seg;
SOSMarkerSegment.ScanComponentSpec [] specs = sos.componentSpecs;
for (int i = 0; i < specs.length; i++) {
- Integer id = new Integer(specs[i].componentSelector);
+ Integer id = specs[i].componentSelector;
if (!ids.contains(id)) {
ids.add(id);
}
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java Mon Jul 14 09:48:26 2014 -0700
@@ -639,7 +639,7 @@
metadata.zTXt_keyword.add(keyword);
int method = stream.readUnsignedByte();
- metadata.zTXt_compressionMethod.add(new Integer(method));
+ metadata.zTXt_compressionMethod.add(method);
byte[] b = new byte[chunkLength - keyword.length() - 2];
stream.readFully(b);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java Mon Jul 14 09:48:26 2014 -0700
@@ -1647,7 +1647,7 @@
int compressionMethod =
getEnumeratedAttribute(zTXt_node, "compressionMethod",
zTXt_compressionMethodNames);
- zTXt_compressionMethod.add(new Integer(compressionMethod));
+ zTXt_compressionMethod.add(compressionMethod);
String text = getAttribute(zTXt_node, "text");
zTXt_text.add(text);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java Mon Jul 14 09:48:26 2014 -0700
@@ -75,9 +75,9 @@
IIOMetadataNode root =
new IIOMetadataNode(nativeMetadataFormatName);
- addChildNode(root, "WBMPType", new Integer(wbmpType));
- addChildNode(root, "Width", new Integer(width));
- addChildNode(root, "Height", new Integer(height));
+ addChildNode(root, "WBMPType", wbmpType);
+ addChildNode(root, "Width", width);
+ addChildNode(root, "Height", height);
return root;
}
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Mon Jul 14 09:48:26 2014 -0700
@@ -812,12 +812,12 @@
"OptionPane.setButtonMargin", Boolean.FALSE,
"OptionPane.sameSizeButtons", Boolean.TRUE,
- "OptionPane.buttonOrientation", new Integer(SwingConstants.RIGHT),
+ "OptionPane.buttonOrientation", SwingConstants.RIGHT,
"OptionPane.minimumSize", new DimensionUIResource(262, 90),
- "OptionPane.buttonPadding", new Integer(10),
+ "OptionPane.buttonPadding", 10,
"OptionPane.windowBindings", new Object[] {
"ESCAPE", "close" },
- "OptionPane.buttonClickThreshhold", new Integer(500),
+ "OptionPane.buttonClickThreshhold", 500,
"OptionPane.isYesLast", Boolean.TRUE,
"OptionPane.font", new FontLazyValue(Region.OPTION_PANE),
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java Mon Jul 14 09:48:26 2014 -0700
@@ -567,7 +567,7 @@
"ProgressBar.selectionForeground", table.get("control"),
"ProgressBar.selectionBackground", table.get("controlText"),
"ProgressBar.border", loweredBevelBorder,
- "ProgressBar.cellLength", new Integer(6),
+ "ProgressBar.cellLength", 6,
"ProgressBar.cellSpacing", Integer.valueOf(0),
// Buttons
@@ -582,7 +582,7 @@
"released SPACE", "released"
}),
- "CheckBox.textIconGap", new Integer(8),
+ "CheckBox.textIconGap", 8,
"CheckBox.margin", new InsetsUIResource(4, 2, 4, 2),
"CheckBox.icon", checkBoxIcon,
"CheckBox.focus", table.get("activeCaptionBorder"),
@@ -593,7 +593,7 @@
}),
"RadioButton.margin", new InsetsUIResource(4, 2, 4, 2),
- "RadioButton.textIconGap", new Integer(8),
+ "RadioButton.textIconGap", 8,
"RadioButton.background", table.get("control"),
"RadioButton.foreground", table.get("controlText"),
"RadioButton.icon", radioButtonIcon,
@@ -627,10 +627,10 @@
"Menu.selectionBackground", menuItemPressedBackground,
"Menu.checkIcon", menuItemCheckIcon,
"Menu.arrowIcon", menuArrowIcon,
- "Menu.menuPopupOffsetX", new Integer(0),
- "Menu.menuPopupOffsetY", new Integer(0),
- "Menu.submenuPopupOffsetX", new Integer(-2),
- "Menu.submenuPopupOffsetY", new Integer(3),
+ "Menu.menuPopupOffsetX", 0,
+ "Menu.menuPopupOffsetY", 0,
+ "Menu.submenuPopupOffsetX", -2,
+ "Menu.submenuPopupOffsetY", 3,
"Menu.shortcutKeys", new int[]{
SwingUtilities2.getSystemMnemonicKeyMask(),
KeyEvent.META_MASK
@@ -938,7 +938,7 @@
"Tree.collapsedIcon", treeCollapsedIcon,
"Tree.editorBorder", focusBorder,
"Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"),
- "Tree.rowHeight", new Integer(18),
+ "Tree.rowHeight", 18,
"Tree.drawsFocusBorderAroundIcon", Boolean.TRUE,
"Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
"COPY", "copy",
--- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java Mon Jul 14 09:48:26 2014 -0700
@@ -370,7 +370,7 @@
* the specified parameter.
*/
public ParameterBlock add(int i) {
- return add(new Integer(i));
+ return add(i);
}
/**
@@ -489,7 +489,7 @@
* the specified parameter.
*/
public ParameterBlock set(int i, int index) {
- return set(new Integer(i), index);
+ return set(i, index);
}
/**
--- a/jdk/src/share/classes/java/beans/EventHandler.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/java/beans/EventHandler.java Mon Jul 14 09:48:26 2014 -0700
@@ -437,7 +437,7 @@
if (method.getDeclaringClass() == Object.class) {
// Handle the Object public methods.
if (methodName.equals("hashCode")) {
- return new Integer(System.identityHashCode(proxy));
+ return System.identityHashCode(proxy);
} else if (methodName.equals("equals")) {
return (proxy == arguments[0] ? Boolean.TRUE : Boolean.FALSE);
} else if (methodName.equals("toString")) {
--- a/jdk/src/share/classes/java/beans/MetaData.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/java/beans/MetaData.java Mon Jul 14 09:48:26 2014 -0700
@@ -123,13 +123,13 @@
Class<?> oldClass = oldInstance.getClass();
return new Expression(oldInstance, Array.class, "newInstance",
new Object[]{oldClass.getComponentType(),
- new Integer(Array.getLength(oldInstance))});
+ Array.getLength(oldInstance)});
}
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
int n = Array.getLength(oldInstance);
for (int i = 0; i < n; i++) {
- Object index = new Integer(i);
+ Object index = i;
// Expression oldGetExp = new Expression(Array.class, "get", new Object[]{oldInstance, index});
// Expression newGetExp = new Expression(Array.class, "get", new Object[]{newInstance, index});
Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
@@ -635,7 +635,7 @@
newSize = 0;
}
for (int i = 0; i < newSize; i++) {
- Object index = new Integer(i);
+ Object index = i;
Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
Expression newGetExp = new Expression(newInstance, "get", new Object[]{index});
@@ -892,7 +892,7 @@
protected Expression instantiate(Object oldInstance, Encoder out) {
java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance;
return new Expression(oldInstance, m.getClass(), "new",
- new Object[]{new Integer(m.getKey()), Boolean.valueOf(m.usesShiftModifier())});
+ new Object[]{m.getKey(), Boolean.valueOf(m.usesShiftModifier())});
}
}
--- a/jdk/src/share/classes/java/beans/NameGenerator.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/java/beans/NameGenerator.java Mon Jul 14 09:48:26 2014 -0700
@@ -107,7 +107,7 @@
Integer size = nameToCount.get(className);
int instanceNumber = (size == null) ? 0 : (size).intValue() + 1;
- nameToCount.put(className, new Integer(instanceNumber));
+ nameToCount.put(className, instanceNumber);
result = className + instanceNumber;
valueToName.put(instance, result);
--- a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java Mon Jul 14 09:48:26 2014 -0700
@@ -170,7 +170,7 @@
while (iter.hasNext()) {
DigraphNode<E> node = iter.next();
int inDegree = node.getInDegree();
- inDegrees.put(node, new Integer(inDegree));
+ inDegrees.put(node, inDegree);
// Add nodes with zero in-degree to the zero list
if (inDegree == 0) {
@@ -191,7 +191,7 @@
while (outNodes.hasNext()) {
DigraphNode<E> node = outNodes.next();
int inDegree = inDegrees.get(node).intValue() - 1;
- inDegrees.put(node, new Integer(inDegree));
+ inDegrees.put(node, inDegree);
// If the in-degree has fallen to 0, place the node on the list
if (inDegree == 0) {
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java Mon Jul 14 09:48:26 2014 -0700
@@ -914,7 +914,7 @@
MidiFileWriter writer = providers.get(i);
int[] types = writer.getMidiFileTypes();
for (int j = 0; j < types.length; j++ ) {
- allTypes.add(new Integer(types[j]));
+ allTypes.add(types[j]);
}
}
int resultTypes[] = new int[allTypes.size()];
@@ -968,7 +968,7 @@
MidiFileWriter writer = providers.get(i);
int[] types = writer.getMidiFileTypes(sequence);
for (int j = 0; j < types.length; j++ ) {
- allTypes.add(new Integer(types[j]));
+ allTypes.add(types[j]);
}
}
int resultTypes[] = new int[allTypes.size()];
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java Mon Jul 14 09:48:26 2014 -0700
@@ -2107,7 +2107,7 @@
if (n == null) {
return false;
}
- setLayer(new Integer(n.intValue()));
+ setLayer(Integer.valueOf(n.intValue()));
return true;
}
--- a/jdk/src/share/classes/javax/swing/JLayeredPane.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java Mon Jul 14 09:48:26 2014 -0700
@@ -159,15 +159,15 @@
public class JLayeredPane extends JComponent implements Accessible {
/// Watch the values in getObjectForLayer()
/** Convenience object defining the Default layer. Equivalent to new Integer(0).*/
- public final static Integer DEFAULT_LAYER = new Integer(0);
+ public final static Integer DEFAULT_LAYER = 0;
/** Convenience object defining the Palette layer. Equivalent to new Integer(100).*/
- public final static Integer PALETTE_LAYER = new Integer(100);
+ public final static Integer PALETTE_LAYER = 100;
/** Convenience object defining the Modal layer. Equivalent to new Integer(200).*/
- public final static Integer MODAL_LAYER = new Integer(200);
+ public final static Integer MODAL_LAYER = 200;
/** Convenience object defining the Popup layer. Equivalent to new Integer(300).*/
- public final static Integer POPUP_LAYER = new Integer(300);
+ public final static Integer POPUP_LAYER = 300;
/** Convenience object defining the Drag layer. Equivalent to new Integer(400).*/
- public final static Integer DRAG_LAYER = new Integer(400);
+ public final static Integer DRAG_LAYER = 400;
/** Convenience object defining the Frame Content layer.
* This layer is normally only use to position the contentPane and menuBar
* components of JFrame.
@@ -294,10 +294,7 @@
*/
public static void putLayer(JComponent c, int layer) {
/// MAKE SURE THIS AND setLayer(Component c, int layer, int position) are SYNCED
- Integer layerObj;
-
- layerObj = new Integer(layer);
- c.putClientProperty(LAYER_PROPERTY, layerObj);
+ c.putClientProperty(LAYER_PROPERTY, layer);
}
/** Gets the layer property for a JComponent, it
@@ -609,27 +606,20 @@
* @return an Integer object for that layer
*/
protected Integer getObjectForLayer(int layer) {
- Integer layerObj;
switch(layer) {
case 0:
- layerObj = DEFAULT_LAYER;
- break;
+ return DEFAULT_LAYER;
case 100:
- layerObj = PALETTE_LAYER;
- break;
+ return PALETTE_LAYER;
case 200:
- layerObj = MODAL_LAYER;
- break;
+ return MODAL_LAYER;
case 300:
- layerObj = POPUP_LAYER;
- break;
+ return POPUP_LAYER;
case 400:
- layerObj = DRAG_LAYER;
- break;
+ return DRAG_LAYER;
default:
- layerObj = new Integer(layer);
+ return layer;
}
- return layerObj;
}
/**
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java Mon Jul 14 09:48:26 2014 -0700
@@ -341,7 +341,7 @@
if (accessibleContext != null) {
accessibleContext.firePropertyChange(
AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
- oldValue, new Integer(model.getValue()));
+ oldValue, model.getValue());
}
}
@@ -952,7 +952,7 @@
*/
public Number getMaximumAccessibleValue() {
// TIGER - 4422362
- return new Integer(model.getMaximum() - model.getExtent());
+ return model.getMaximum() - model.getExtent();
}
} // AccessibleJScrollBar
--- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java Mon Jul 14 09:48:26 2014 -0700
@@ -645,7 +645,7 @@
int i = 1;
while (newFolder.exists() && i < 100) {
newFolder = createFileObject(containingDir, MessageFormat.format(
- newFolderNextString, new Integer(i)));
+ newFolderNextString, i));
i++;
}
@@ -754,7 +754,7 @@
int i = 2;
while (newFolder.exists() && i < 100) {
newFolder = createFileObject(containingDir, MessageFormat.format(
- newFolderNextString, new Integer(i)));
+ newFolderNextString, i));
i++;
}
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Mon Jul 14 09:48:26 2014 -0700
@@ -455,7 +455,7 @@
initResourceBundle(table);
// *** Shared Integers
- Integer fiveHundred = new Integer(500);
+ Integer fiveHundred = 500;
// *** Shared Longs
Long oneThousand = 1000L;
@@ -673,7 +673,6 @@
Object editorMargin = threeInsets;
Object caretBlinkRate = fiveHundred;
- Integer four = new Integer(4);
Object[] allAuditoryCues = new Object[] {
"CheckBoxMenuItem.commandSound",
@@ -714,7 +713,7 @@
"Button.highlight", controlLtHighlight,
"Button.border", buttonBorder,
"Button.margin", new InsetsUIResource(2, 14, 2, 14),
- "Button.textIconGap", four,
+ "Button.textIconGap", 4,
"Button.textShiftOffset", zero,
"Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
"SPACE", "pressed",
@@ -732,7 +731,7 @@
"ToggleButton.highlight", controlLtHighlight,
"ToggleButton.border", buttonToggleBorder,
"ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
- "ToggleButton.textIconGap", four,
+ "ToggleButton.textIconGap", 4,
"ToggleButton.textShiftOffset", zero,
"ToggleButton.focusInputMap",
new UIDefaults.LazyInputMap(new Object[] {
@@ -749,7 +748,7 @@
"RadioButton.highlight", controlLtHighlight,
"RadioButton.border", radioButtonBorder,
"RadioButton.margin", twoInsets,
- "RadioButton.textIconGap", four,
+ "RadioButton.textIconGap", 4,
"RadioButton.textShiftOffset", zero,
"RadioButton.icon", radioButtonIcon,
"RadioButton.focusInputMap",
@@ -764,7 +763,7 @@
"CheckBox.foreground", controlText,
"CheckBox.border", radioButtonBorder,
"CheckBox.margin", twoInsets,
- "CheckBox.textIconGap", four,
+ "CheckBox.textIconGap", 4,
"CheckBox.textShiftOffset", zero,
"CheckBox.icon", checkBoxIcon,
"CheckBox.focusInputMap",
@@ -1087,10 +1086,10 @@
"Menu.margin", twoInsets,
"Menu.checkIcon", menuItemCheckIcon,
"Menu.arrowIcon", menuArrowIcon,
- "Menu.menuPopupOffsetX", new Integer(0),
- "Menu.menuPopupOffsetY", new Integer(0),
- "Menu.submenuPopupOffsetX", new Integer(0),
- "Menu.submenuPopupOffsetY", new Integer(0),
+ "Menu.menuPopupOffsetX", 0,
+ "Menu.menuPopupOffsetY", 0,
+ "Menu.submenuPopupOffsetX", 0,
+ "Menu.submenuPopupOffsetY", 0,
"Menu.shortcutKeys", new int[]{
SwingUtilities2.getSystemMnemonicKeyMask()
},
@@ -1188,10 +1187,10 @@
"ProgressBar.selectionForeground", control,
"ProgressBar.selectionBackground", textHighlight,
"ProgressBar.border", progressBarBorder,
- "ProgressBar.cellLength", new Integer(1),
+ "ProgressBar.cellLength", 1,
"ProgressBar.cellSpacing", zero,
- "ProgressBar.repaintInterval", new Integer(50),
- "ProgressBar.cycleTime", new Integer(3000),
+ "ProgressBar.repaintInterval", 50,
+ "ProgressBar.cycleTime", 3000,
"ProgressBar.horizontalSize", new DimensionUIResource(146, 12),
"ProgressBar.verticalSize", new DimensionUIResource(12, 146),
@@ -1236,7 +1235,7 @@
"LEFT", "positiveUnitIncrement",
"KP_LEFT", "positiveUnitIncrement",
}),
- "ScrollBar.width", new Integer(16),
+ "ScrollBar.width", 16,
"ScrollPane.font", dialogPlain12,
"ScrollPane.background", control,
@@ -1332,7 +1331,7 @@
"SplitPane.shadow", controlShadow,
"SplitPane.darkShadow", controlDkShadow,
"SplitPane.border", splitPaneBorder,
- "SplitPane.dividerSize", new Integer(7),
+ "SplitPane.dividerSize", 7,
"SplitPaneDivider.border", splitPaneDividerBorder,
"SplitPaneDivider.draggingColor", darkGray,
"SplitPane.ancestorInputMap",
@@ -1363,7 +1362,7 @@
"TabbedPane.darkShadow", controlDkShadow,
"TabbedPane.selected", null,
"TabbedPane.focus", controlText,
- "TabbedPane.textIconGap", four,
+ "TabbedPane.textIconGap", 4,
// Causes tabs to be painted on top of the content area border.
// The amount of overlap is then controlled by tabAreaInsets.bottom,
@@ -1377,7 +1376,7 @@
"TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
"TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
"TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
- "TabbedPane.tabRunOverlay", new Integer(2),
+ "TabbedPane.tabRunOverlay", 2,
"TabbedPane.tabsOpaque", Boolean.TRUE,
"TabbedPane.contentOpaque", Boolean.TRUE,
"TabbedPane.focusInputMap",
@@ -1737,9 +1736,9 @@
"Tree.selectionBorderColor", black,
"Tree.dropLineColor", controlShadow,
"Tree.editorBorder", blackLineBorder,
- "Tree.leftChildIndent", new Integer(7),
- "Tree.rightChildIndent", new Integer(13),
- "Tree.rowHeight", new Integer(16),
+ "Tree.leftChildIndent", 7,
+ "Tree.rightChildIndent", 13,
+ "Tree.rowHeight", 16,
"Tree.scrollsOnExpand", Boolean.TRUE,
"Tree.openIcon", SwingUtilities2.makeIcon(getClass(),
BasicLookAndFeel.class,
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Mon Jul 14 09:48:26 2014 -0700
@@ -633,7 +633,7 @@
LazyValue toolBarBorder = t -> new MetalBorders.ToolBarBorder();
LazyValue progressBarBorder = t ->
- new BorderUIResource.LineBorderUIResource(controlDarkShadow, new Integer(1));
+ new BorderUIResource.LineBorderUIResource(controlDarkShadow, 1);
LazyValue toolTipBorder = t ->
new BorderUIResource.LineBorderUIResource(primaryControlDarkShadow);
@@ -851,8 +851,8 @@
"Slider.foreground", primaryControlShadow,
"Slider.focus", focusColor,
"Slider.focusInsets", zeroInsets,
- "Slider.trackWidth", new Integer( 7 ),
- "Slider.majorTickLength", new Integer( 6 ),
+ "Slider.trackWidth", 7 ,
+ "Slider.majorTickLength", 6 ,
"Slider.horizontalThumbIcon",(LazyValue) t -> MetalIconFactory.getHorizontalSliderThumbIcon(),
"Slider.verticalThumbIcon",(LazyValue) t -> MetalIconFactory.getVerticalSliderThumbIcon(),
"Slider.focusInputMap",
@@ -914,7 +914,7 @@
new MetalBorders.OptionDialogBorder(),
"InternalFrame.paletteBorder",(LazyValue) t ->
new MetalBorders.PaletteBorder(),
- "InternalFrame.paletteTitleHeight", new Integer(11),
+ "InternalFrame.paletteTitleHeight", 11,
"InternalFrame.paletteCloseIcon",(LazyValue) t ->
new MetalIconFactory.PaletteCloseIcon(),
"InternalFrame.closeIcon",
@@ -1067,7 +1067,7 @@
"ScrollBar.thumb", primaryControlShadow,
"ScrollBar.thumbShadow", primaryControlDarkShadow,
"ScrollBar.thumbHighlight", primaryControl,
- "ScrollBar.width", new Integer( 17 ),
+ "ScrollBar.width", 17 ,
"ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
"ScrollBar.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
@@ -1238,8 +1238,8 @@
"Menu.borderPainted", Boolean.TRUE,
"Menu.menuPopupOffsetX", zero,
"Menu.menuPopupOffsetY", zero,
- "Menu.submenuPopupOffsetX", new Integer(-4),
- "Menu.submenuPopupOffsetY", new Integer(-3),
+ "Menu.submenuPopupOffsetX", -4,
+ "Menu.submenuPopupOffsetY", -3,
"Menu.font", menuTextValue,
"Menu.selectionForeground", menuSelectedForeground,
"Menu.selectionBackground", menuSelectedBackground,
@@ -1354,7 +1354,7 @@
// SplitPane
- "SplitPane.dividerSize", new Integer(10),
+ "SplitPane.dividerSize", 10,
"SplitPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[] {
"UP", "negativeIncrement",
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java Mon Jul 14 09:48:26 2014 -0700
@@ -764,7 +764,7 @@
break;
case 4: // integer
try {
- value = new Integer(Integer.parseInt(aValue));
+ value = Integer.valueOf(aValue);
} catch (NumberFormatException nfe) {
throw new SAXException(property + " invalid value");
}
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java Mon Jul 14 09:48:26 2014 -0700
@@ -2556,7 +2556,7 @@
if (caretPos != dot) {
// the caret moved
firePropertyChange(ACCESSIBLE_CARET_PROPERTY,
- new Integer(caretPos), new Integer(dot));
+ caretPos, dot);
caretPos = dot;
try {
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java Mon Jul 14 09:48:26 2014 -0700
@@ -1934,13 +1934,13 @@
return Boolean.FALSE;
} else if (key == StyleConstants.Alignment) {
if (svalue.equals("right")) {
- return new Integer(StyleConstants.ALIGN_RIGHT);
+ return StyleConstants.ALIGN_RIGHT;
} else if (svalue.equals("center")) {
- return new Integer(StyleConstants.ALIGN_CENTER);
+ return StyleConstants.ALIGN_CENTER;
} else if (svalue.equals("justify")) {
- return new Integer(StyleConstants.ALIGN_JUSTIFIED);
+ return StyleConstants.ALIGN_JUSTIFIED;
}
- return new Integer(StyleConstants.ALIGN_LEFT);
+ return StyleConstants.ALIGN_LEFT;
} else if (key == StyleConstants.StrikeThrough) {
if (svalue.indexOf("line-through") >= 0) {
return Boolean.TRUE;
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java Mon Jul 14 09:48:26 2014 -0700
@@ -623,7 +623,7 @@
* @param n the number of tokens to buffer
*/
public void setTokenThreshold(int n) {
- putProperty(TokenThreshold, new Integer(n));
+ putProperty(TokenThreshold, n);
}
/**
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java Mon Jul 14 09:48:26 2014 -0700
@@ -165,14 +165,14 @@
foregroundColor = StyleConstants.getForeground(a);
if (foregroundColor != null &&
colorTable.get(foregroundColor) == null) {
- colorTable.put(foregroundColor, new Integer(colorCount));
+ colorTable.put(foregroundColor, colorCount);
colorCount ++;
}
backgroundColor = a.getAttribute(StyleConstants.Background);
if (backgroundColor != null &&
colorTable.get(backgroundColor) == null) {
- colorTable.put(backgroundColor, new Integer(colorCount));
+ colorTable.put(backgroundColor, colorCount);
colorCount ++;
}
@@ -183,7 +183,7 @@
if (fontName != null &&
fontTable.get(fontName) == null) {
- fontTable.put(fontName, new Integer(fontCount));
+ fontTable.put(fontName, fontCount);
fontCount ++;
}
}
@@ -200,7 +200,7 @@
Integer aNum = styleTable.get(a);
if (aNum == null) {
styleCount = styleCount + 1;
- aNum = new Integer(styleCount);
+ aNum = styleCount;
styleTable.put(a, aNum);
}
}
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java Mon Jul 14 09:48:26 2014 -0700
@@ -1322,7 +1322,7 @@
return SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
fractionalMetricsHint);
case SunHints.INTKEY_AATEXT_LCD_CONTRAST:
- return new Integer(lcdTextContrast);
+ return lcdTextContrast;
case SunHints.INTKEY_INTERPOLATION:
switch (interpolationHint) {
case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
--- a/jdk/src/share/classes/sun/print/ServiceDialog.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/sun/print/ServiceDialog.java Mon Jul 14 09:48:26 2014 -0700
@@ -1017,8 +1017,8 @@
format.setParseIntegerOnly(true);
format.setDecimalSeparatorAlwaysShown(false);
NumberFormatter nf = new NumberFormatter(format);
- nf.setMinimum(new Integer(1));
- nf.setMaximum(new Integer(Integer.MAX_VALUE));
+ nf.setMinimum(1);
+ nf.setMaximum(Integer.MAX_VALUE);
nf.setAllowsInvalid(true);
nf.setCommitsOnValidEdit(true);
tfRangeFrom = new JFormattedTextField(nf);
@@ -1110,12 +1110,12 @@
if (min < 1) {
min = 1;
- tfRangeFrom.setValue(new Integer(1));
+ tfRangeFrom.setValue(1);
}
if (max < min) {
max = min;
- tfRangeTo.setValue(new Integer(min));
+ tfRangeTo.setValue(min);
}
PageRanges pr = new PageRanges(min, max);
@@ -1165,8 +1165,8 @@
} else { // RANGE
rbPages.setSelected(true);
}
- tfRangeFrom.setValue(new Integer(min));
- tfRangeTo.setValue(new Integer(max));
+ tfRangeFrom.setValue(min);
+ tfRangeTo.setValue(max);
rbAll.setEnabled(prSupported);
rbPages.setEnabled(prSupported);
setupRangeWidgets();
@@ -1274,14 +1274,14 @@
min = 1;
max = Integer.MAX_VALUE;
}
- snModel.setMinimum(new Integer(min));
- snModel.setMaximum(new Integer(max));
+ snModel.setMinimum(min);
+ snModel.setMaximum(max);
int value = cp.getValue();
if ((value < min) || (value > max)) {
value = min;
}
- snModel.setValue(new Integer(value));
+ snModel.setValue(value);
// setup Collate checkbox
if (psCurrent.isAttributeCategorySupported(scCategory)) {
@@ -2762,7 +2762,7 @@
if ((value < 1) || (value > 100)) {
value = 1;
}
- snModel.setValue(new Integer(value));
+ snModel.setValue(value);
lblPriority.setEnabled(jpSupported);
spinPriority.setEnabled(jpSupported);
--- a/jdk/src/share/classes/sun/swing/PrintingStatus.java Mon Jul 14 09:16:00 2014 -0700
+++ b/jdk/src/share/classes/sun/swing/PrintingStatus.java Mon Jul 14 09:48:26 2014 -0700
@@ -295,7 +295,7 @@
private void updateStatusOnEDT(int pageIndex) {
assert SwingUtilities.isEventDispatchThread();
Object[] pageNumber = new Object[]{
- new Integer(pageIndex + 1)};
+ pageIndex + 1};
statusLabel.setText(statusFormat.format(pageNumber));
}
}