diff options
author | Johan Compagner | 2020-01-14 11:44:01 +0000 |
---|---|---|
committer | Johan Compagner | 2020-01-14 13:39:35 +0000 |
commit | 734456b965887a796266427e6ae969273a7be6da (patch) | |
tree | fae1a1697efb7cb2e73a73d14f905819151b1c24 | |
parent | 6a74744884e5cbdd5778040532cc1a0f6f698f7b (diff) | |
download | rt.equinox.p2-734456b965887a796266427e6ae969273a7be6da.tar.gz rt.equinox.p2-734456b965887a796266427e6ae969273a7be6da.tar.xz rt.equinox.p2-734456b965887a796266427e6ae969273a7be6da.zip |
Bug 559148 - setJVMAction can throw NPE when p2 is used directly inY20200121-0055Y20200120-2315Y20200120-0020I20200123-1800I20200123-0525I20200123-0430I20200122-1805I20200121-2225I20200121-1805I20200120-1800I20200120-0715I20200120-0530I20200120-0445I20200120-0355I20200120-0115I20200119-2330I20200119-1800I20200118-1800I20200117-1800I20200116-1800I20200116-0930I20200116-0330I20200116-0310I20200115-1800I20200114-1805
exotic packaging (eg, in Tycho)
fixed the nullpointer, dont do anything if the system property
"eclipse.commands" is not there.
So clean up of i18n strings.
Change-Id: I7493b667c625d0d34ec3aa8cea8c8fd7aadbaeaa
Signed-off-by: Johan Compagner <jcompagner@gmail.com>
3 files changed, 22 insertions, 20 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF index 7889fc06f..1c448b71f 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.touchpoint.eclipse;singleton:=true -Bundle-Version: 2.2.500.qualifier +Bundle-Version: 2.2.600.qualifier Bundle-Activator: org.eclipse.equinox.internal.p2.touchpoint.eclipse.Activator Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/pom.xml b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/pom.xml index 55afd427d..c99929b6a 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/pom.xml +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/pom.xml @@ -9,6 +9,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.p2.touchpoint.eclipse</artifactId> - <version>2.2.500-SNAPSHOT</version> + <version>2.2.600-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetJvmAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetJvmAction.java index 76612bee7..5a6b3e7cf 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetJvmAction.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetJvmAction.java @@ -71,26 +71,28 @@ public class SetJvmAction extends ProvisioningAction { private static void adjustWorkbenchSystemProperties(File jvm) { try { - // set the eclipse.vm system property so the Workbench restart will use this vm - // to restart. - final String fullPath = jvm.getCanonicalPath(); - System.setProperty("eclipse.vm", fullPath); + String eclipseCommands = System.getProperty("eclipse.commands"); //$NON-NLS-1$ + if (eclipseCommands != null) { + // set the eclipse.vm system property so the Workbench restart will use this vm + // to restart. + final String fullPath = jvm.getCanonicalPath(); + System.setProperty("eclipse.vm", fullPath); //$NON-NLS-1$ - // also adjust the -vm property in the eclipse.commands system property so that - // vm is actually used. - String property = System.getProperty("eclipse.commands"); - int index = property.indexOf("-vm"); - if (index != -1) { - final String vmWithLineFeed = "-vm\n"; - // find the next line ending after -vm line. - int index2 = property.indexOf('\n', index + vmWithLineFeed.length()); - if (index2 == -1) { - property = property.substring(0, index) + vmWithLineFeed + fullPath; - } else { - String tmp = property.substring(0, index) + vmWithLineFeed + fullPath; - property = tmp + property.substring(index2); + // also adjust the -vm property in the eclipse.commands system property so that + // vm is actually used. + int index = eclipseCommands.indexOf("-vm"); //$NON-NLS-1$ + if (index != -1) { + final String vmWithLineFeed = "-vm\n"; //$NON-NLS-1$ + // find the next line ending after -vm line. + int index2 = eclipseCommands.indexOf('\n', index + vmWithLineFeed.length()); + if (index2 == -1) { + eclipseCommands = eclipseCommands.substring(0, index) + vmWithLineFeed + fullPath; + } else { + String tmp = eclipseCommands.substring(0, index) + vmWithLineFeed + fullPath; + eclipseCommands = tmp + eclipseCommands.substring(index2); + } + System.setProperty("eclipse.commands", eclipseCommands); //$NON-NLS-1$ } - System.setProperty("eclipse.commands", property); } } catch (IOException e) { |