Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2015-05-23 18:44:35 -0400
committerIgor Fedorenko2015-05-23 18:44:35 -0400
commit1ed27012d55268d24237f9862a353c8ac02437cd (patch)
treeac758e9cab06d451ee284fb059738c336fa71cea
parent1d021079ea306dd0db4ed08bdee7c963ea981b5e (diff)
downloadm2e-core-1ed27012d55268d24237f9862a353c8ac02437cd.tar.gz
m2e-core-1ed27012d55268d24237f9862a353c8ac02437cd.tar.xz
m2e-core-1ed27012d55268d24237f9862a353c8ac02437cd.zip
426329 simplified exception handling
Change-Id: I4c9e680ec6ea24c5616ee15381de576ed72c4a3f Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java23
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java2
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties1
3 files changed, 2 insertions, 24 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
index 86c756f0..113e59ac 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/LaunchingUtils.java
@@ -11,39 +11,20 @@
package org.eclipse.m2e.internal.launch;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.osgi.util.NLS;
-
-import org.eclipse.m2e.actions.MavenLaunchConstants;
public class LaunchingUtils {
- private static Logger log = LoggerFactory.getLogger(LaunchingUtils.class);
-
/**
* Substitute any variable
*/
public static String substituteVar(String s) throws CoreException {
- if(s == null) {
- return s;
- }
- try {
+ if(s != null) {
return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(s);
- } catch(CoreException e) {
- if(e.getStatus() != null && e.getStatus().matches(IStatus.CANCEL)) {
- throw e;
- }
- log.error("Could not substitute variable {}.", s, e);
- throw new CoreException(new Status(IStatus.ERROR, MavenLaunchConstants.PLUGIN_ID, -1,
- NLS.bind(Messages.MavenLaunchUtils_error_could_not_substitute_variable, s), e));
}
+ return null;
}
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java
index ae0ab91c..1a6b6f84 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java
@@ -77,8 +77,6 @@ public class Messages extends NLS {
public static String MavenLaunchExtensionsTab_lblExtensions;
- public static String MavenLaunchUtils_error_could_not_substitute_variable;
-
public static String MavenLaunchUtils_error_no_maven_install;
public static String launchPomGroup;
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties
index d899e5c3..5e5ee0bd 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties
@@ -31,7 +31,6 @@ MavenLaunchMainTab_lblThreads=&Threads
MavenLaunchMainTab_lblUserSettings_text=User settings\:
MavenLaunchMainTab_property_dialog_edit_title=Edit Parameter
MavenLaunchMainTab_property_dialog_title=Add Parameter
-MavenLaunchUtils_error_could_not_substitute_variable=Could not substitute variable {0}
MavenLaunchUtils_error_no_maven_install=Can't find Maven installation {0}
MavenLaynchDelegate_unsupported_source_locator=Unknown or unsupported source locator {0}
launchBrowseFs=Browse File Syste&m...

Back to the top