Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-06-18 18:55:01 +0000
committerAlex Blewitt2015-07-06 07:46:20 +0000
commit9ee96387c3c9b80f76fa76476f4d0fa5764f4919 (patch)
tree20a3db893b2db4503ac53222599a72ca3ef7d210 /bundles/org.eclipse.equinox.app/osgi
parentbde007b013512c536e1e8c5b616961a6a0140347 (diff)
downloadrt.equinox.bundles-9ee96387c3c9b80f76fa76476f4d0fa5764f4919.tar.gz
rt.equinox.bundles-9ee96387c3c9b80f76fa76476f4d0fa5764f4919.tar.xz
rt.equinox.bundles-9ee96387c3c9b80f76fa76476f4d0fa5764f4919.zip
Bug 470518 - Replace `new Boolean` with `Boolean.valueOf`
Using `new Boolean()` results in the creation of a new object on the heap, when the flyweight `Boolean.TRUE` and `Boolean.FALSE` are available. Java 1.4 added a `Boolean.valueOf()` which can be used in place of `new Boolean()` but which will use the existing flyweight values instead. Globally change `new Boolean(...)` to `Boolean.valueOf(...)` and replace constant valued expressions with their flyweight counterparts. Bug: 470518 Change-Id: I25742c65162e57fd553dd1284ec057cd4b333dbb Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.app/osgi')
-rw-r--r--bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java b/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java
index 601037a95..cba59d680 100644
--- a/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java
+++ b/bundles/org.eclipse.equinox.app/osgi/org/osgi/service/application/ApplicationDescriptor.java
@@ -205,7 +205,7 @@ public abstract class ApplicationDescriptor {
}
}
/* replace the container's lock with the application model's lock, that's the correct */
- props.put(APPLICATION_LOCKED, new Boolean(locked[0]));
+ props.put(APPLICATION_LOCKED, Boolean.valueOf(locked[0]));
return props;
}
@@ -551,4 +551,4 @@ public abstract class ApplicationDescriptor {
}
throw new ApplicationException(ApplicationException.APPLICATION_INVALID_STARTUP_ARGUMENT, "The value for key \"" + entry.getKey() + "\" is an invalid type \"" + clazz.getName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-} \ No newline at end of file
+}

Back to the top