Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-09-07 14:44:26 -0400
committerAlex Blewitt2015-09-11 03:51:36 -0400
commit2fe3fff966fde4cedc73ca8c1df13b2fd4d605a7 (patch)
treecd5c19a1363e899af66de1bdce90920ae5fd32ce /org.eclipse.ui.console
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.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java4
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java4
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java6
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java4
4 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
index b6da2a383..a29105d3a 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.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
@@ -232,7 +232,7 @@ public class IOConsoleInputStream extends InputStream {
if (newFontStyle != fontStyle) {
int old = fontStyle;
fontStyle = newFontStyle;
- console.firePropertyChange(this, IConsoleConstants.P_FONT_STYLE, new Integer(old), new Integer(fontStyle));
+ console.firePropertyChange(this, IConsoleConstants.P_FONT_STYLE, Integer.valueOf(old), Integer.valueOf(fontStyle));
}
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java
index 125c5f26d..267937c9b 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.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
@@ -100,7 +100,7 @@ public class IOConsoleOutputStream extends OutputStream {
if (newFontStyle != fontStyle) {
int old = fontStyle;
fontStyle = newFontStyle;
- console.firePropertyChange(this, IConsoleConstants.P_FONT_STYLE, new Integer(old), new Integer(fontStyle));
+ console.firePropertyChange(this, IConsoleConstants.P_FONT_STYLE, Integer.valueOf(old), Integer.valueOf(fontStyle));
}
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java
index aaae641eb..49cfc55a7 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.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
@@ -172,7 +172,7 @@ public abstract class TextConsole extends AbstractConsole {
int old = fConsoleWidth;
fConsoleWidth = width;
- firePropertyChange(this, IConsoleConstants.P_CONSOLE_WIDTH, new Integer(old), new Integer(fConsoleWidth));
+ firePropertyChange(this, IConsoleConstants.P_CONSOLE_WIDTH, Integer.valueOf(old), Integer.valueOf(fConsoleWidth));
}
}
@@ -188,7 +188,7 @@ public abstract class TextConsole extends AbstractConsole {
ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() {
@Override
public void run() {
- firePropertyChange(TextConsole.this, IConsoleConstants.P_TAB_SIZE, new Integer(oldTabWidth), new Integer(fTabWidth));
+ firePropertyChange(TextConsole.this, IConsoleConstants.P_TAB_SIZE, Integer.valueOf(oldTabWidth), Integer.valueOf(fTabWidth));
}
});
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java
index 020ae3b98..87315b44f 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.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
@@ -105,7 +105,7 @@ public class TextViewerGotoLineAction extends TextViewerAction {
fLastLine= document.getLineOfOffset(document.getLength()) + 1;
int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1;
String title= ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1;
- String message= MessageFormat.format(ConsoleMessages.TextViewerGotoLineAction_Enter_line_number__8, new Object[] {new Integer(fLastLine)});
+ String message= MessageFormat.format(ConsoleMessages.TextViewerGotoLineAction_Enter_line_number__8, new Object[] {Integer.valueOf(fLastLine)});
String value= Integer.toString(startLine);
Shell activeShell= fTextViewer.getTextWidget().getShell();
InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator());

Back to the top