Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-09-07 18:44:26 +0000
committerAlex Blewitt2015-09-11 07:51:36 +0000
commit2fe3fff966fde4cedc73ca8c1df13b2fd4d605a7 (patch)
treecd5c19a1363e899af66de1bdce90920ae5fd32ce /org.eclipse.debug.core
parent368177ac20c448cd2e6d7d5f2d983c9734b14a49 (diff)
downloadeclipse.platform.debug-2fe3fff966fde4cedc73ca8c1df13b2fd4d605a7.tar.gz
eclipse.platform.debug-2fe3fff966fde4cedc73ca8c1df13b2fd4d605a7.tar.xz
eclipse.platform.debug-2fe3fff966fde4cedc73ca8c1df13b2fd4d605a7.zip
Bug 476814 - Replace new Integer() with Integer.valueOf()
Using Integer.valueOf() instead of new Integer() allows for the runtime to cache commonly instantiated values; typically, this will be for values in the range -128..127. Using valueOf is preferred for this reason. Change-Id: I1022eb4973b760b830ace5d39b76eea9353d4ca2 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java4
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java6
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java6
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java2
4 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
index be5564629..1692d6101 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -572,7 +572,7 @@ public class LaunchConfigurationInfo {
* @throws CoreException if a problem is encountered
*/
protected void setIntegerAttribute(Element element) throws CoreException {
- setAttribute(getKeyAttribute(element), new Integer(getValueAttribute(element)));
+ setAttribute(getKeyAttribute(element), Integer.valueOf(getValueAttribute(element)));
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
index 372f57c09..cbf77aabf 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -412,7 +412,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
*/
@Override
public void setAttribute(String attributeName, int value) {
- getInfo().setAttribute(attributeName, new Integer(value));
+ getInfo().setAttribute(attributeName, Integer.valueOf(value));
setDirty();
}
@@ -708,7 +708,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
IResource resource = resources[i];
if(resource != null) {
paths.add(resource.getFullPath().toPortableString());
- types.add(new Integer(resource.getType()).toString());
+ types.add(Integer.valueOf(resource.getType()).toString());
}
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
index 6368d709b..f0af97e5c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -116,7 +116,7 @@ public class LogicalStructureManager {
if (i > 0 && i < selection.length() - 1) {
String comboKey= selection.substring(0, i + 1);
String selected= selection.substring(i + 1, selection.length());
- fStructureTypeSelections.put(comboKey, new Integer(Integer.parseInt(selected)));
+ fStructureTypeSelections.put(comboKey, Integer.valueOf(Integer.parseInt(selected)));
}
}
}
@@ -208,7 +208,7 @@ public class LogicalStructureManager {
if (selected != null) {
index= fStructureTypeIds.indexOf(selected.getId());
}
- Integer integer= new Integer(index);
+ Integer integer= Integer.valueOf(index);
fStructureTypeSelections.put(combo, integer);
storeStructureTypeSelections();
storeStructureTypeIds();
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
index 5e29625a2..a463d3e63 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
@@ -279,7 +279,7 @@ public final class XMLMemento {
}
String strValue = attr.getValue();
try {
- return new Integer(strValue);
+ return Integer.valueOf(strValue);
} catch (NumberFormatException e) {
DebugPlugin
.logMessage("Memento problem - invalid integer for key: " + key //$NON-NLS-1$

Back to the top