Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2017-08-21 13:01:31 -0400
committerThomas Watson2017-08-21 13:01:31 -0400
commite47a6cbd20d91e10988d4432e449d6ed4663f320 (patch)
treebe2dfae2df33e4ffa280bb462cf099258d89b1cc /bundles
parent32a0676fe839baab0c166853a4101c244a3c1a11 (diff)
downloadrt.equinox.framework-e47a6cbd20d91e10988d4432e449d6ed4663f320.tar.gz
rt.equinox.framework-e47a6cbd20d91e10988d4432e449d6ed4663f320.tar.xz
rt.equinox.framework-e47a6cbd20d91e10988d4432e449d6ed4663f320.zip
Bug 518740 - The Equinox Framework does not start on ARM using OracleI20170822-2000I20170821-2000
Embedded JRE Additional changes from code review: - ensure streams are closed properly - update regex used to avoid extra trim operation. Change-Id: I927eed5d66cff74fd8f494d32554248e9710e95e Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java9
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java7
2 files changed, 11 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java
index 7ff03f26e..5129c9f41 100755
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java
@@ -2690,6 +2690,8 @@ public class SystemBundleTests extends AbstractBundleTests {
doTestJavaProfile("1.7", "JavaSE-1.7", null);
doTestJavaProfile("1.8", "JavaSE/compact3-1.8", "compact3");
doTestJavaProfile("1.8", "JavaSE/compact3-1.8", "\"compact3\"");
+ doTestJavaProfile("1.8", "JavaSE/compact3-1.8", " \"compact3\" ");
+ doTestJavaProfile("1.8", "JavaSE/compact3-1.8", " compact3 ");
doTestJavaProfile("1.8", "JavaSE-1.8", "\"compact4\"");
doTestJavaProfile("9", "JavaSE/compact3-1.8", "compact3");
doTestJavaProfile("9", "JavaSE/compact3-1.8", "\"compact3\"");
@@ -2706,7 +2708,12 @@ public class SystemBundleTests extends AbstractBundleTests {
release.getParentFile().mkdirs();
Properties props = new Properties();
props.put("JAVA_PROFILE", releaseName);
- props.store(new FileOutputStream(release), null);
+ FileOutputStream propStream = new FileOutputStream(release);
+ try {
+ props.store(propStream, null);
+ } finally {
+ propStream.close();
+ }
System.setProperty("java.home", release.getParentFile().getAbsolutePath());
}
System.setProperty("java.specification.version", javaSpecVersion);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
index e4f518ca6..d891eff5d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
@@ -1432,13 +1432,12 @@ public class Storage {
File release = new File(javaHome, "release"); //$NON-NLS-1$
if (release.exists()) {
Properties releaseProps = new Properties();
- try {
- releaseProps.load(new FileInputStream(release));
+ try (InputStream releaseStream = new FileInputStream(release)) {
+ releaseProps.load(releaseStream);
String releaseName = releaseProps.getProperty("JAVA_PROFILE"); //$NON-NLS-1$
if (releaseName != null) {
// make sure to remove extra quotes
- releaseName = releaseName.trim();
- releaseName = releaseName.replaceAll("^\"|\"$", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ releaseName = releaseName.replaceAll("^\\s*\"?|\"?\\s*$", ""); //$NON-NLS-1$ //$NON-NLS-2$
embeddedProfileName = "_" + releaseName + "-"; //$NON-NLS-1$ //$NON-NLS-2$
}
} catch (IOException e) {

Back to the top