Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-06-19 15:25:13 +0000
committerLars Vogel2019-06-20 17:00:38 +0000
commite9997e416c01f3c289af26d1fd24536a516192b3 (patch)
treef2746c056224617cb4b7398a5cace703a634caf4 /bundles/org.eclipse.equinox.launcher
parent597dc31fa183f3aa7dfdaf008d166cb9e8db674c (diff)
downloadrt.equinox.framework-e9997e416c01f3c289af26d1fd24536a516192b3.tar.gz
rt.equinox.framework-e9997e416c01f3c289af26d1fd24536a516192b3.tar.xz
rt.equinox.framework-e9997e416c01f3c289af26d1fd24536a516192b3.zip
Small String optimizationI20190620-1800
Useless toString call in String concatination Using String.valueOf instead of ""+ Use faster indexof('') version Use appends(string, startI,EndI) directly Change-Id: I937843410a4abc47803119e26073803fb1c1b115 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.launcher')
-rw-r--r--bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
index 71bea46d8..ee47cb76f 100644
--- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
+++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
@@ -565,7 +565,7 @@ public class Main {
if (protectBase && (System.getProperty(PROP_SHARED_CONFIG_AREA) == null)) {
System.err.println("This application is configured to run in a cascaded mode only."); //$NON-NLS-1$
- System.setProperty(PROP_EXITCODE, "" + 14); //$NON-NLS-1$
+ System.setProperty(PROP_EXITCODE, Integer.toString(14)); //$NON-NLS-1$
return;
}
// need to ensure that getInstallLocation is called at least once to initialize the value.
@@ -822,7 +822,7 @@ public class Main {
private void readFrameworkExtensions(URL base, ArrayList<URL> result) throws IOException {
String[] extensions = getArrayFromList(System.getProperty(PROP_EXTENSIONS));
- String parent = new File(base.getFile()).getParent().toString();
+ String parent = new File(base.getFile()).getParent();
ArrayList<String> extensionResults = new ArrayList<>(extensions.length);
for (int i = 0; i < extensions.length; i++) {
//Search the extension relatively to the osgi plugin
@@ -2040,7 +2040,7 @@ public class Main {
}
try {
if (debug)
- System.out.print("Configuration file:\n " + url.toString()); //$NON-NLS-1$
+ System.out.print("Configuration file:\n " + url); //$NON-NLS-1$
result = loadProperties(url);
if (debug)
System.out.println(" loaded"); //$NON-NLS-1$
@@ -2460,10 +2460,10 @@ public class Main {
private StringBuilder appendPaddedInt(int value, int pad, StringBuilder buffer) {
pad = pad - 1;
if (pad == 0)
- return buffer.append(Integer.toString(value));
+ return buffer.append(value);
int padding = (int) Math.pow(10, pad);
if (value >= padding)
- return buffer.append(Integer.toString(value));
+ return buffer.append(value);
while (padding > value && padding > 1) {
buffer.append('0');
padding = padding / 10;
@@ -2486,7 +2486,7 @@ public class Main {
URL base = buildURL(System.getProperty(PROP_CONFIG_AREA), false);
if (base == null)
return;
- logFile = new File(base.getPath(), Long.toString(System.currentTimeMillis()) + ".log"); //$NON-NLS-1$
+ logFile = new File(base.getPath(), System.currentTimeMillis() + ".log"); //$NON-NLS-1$
new File(logFile.getParent()).mkdirs();
System.setProperty(PROP_LOGFILE, logFile.getAbsolutePath());
}

Back to the top