Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Duft2017-01-25 05:33:24 -0500
committerSarika Sinha2017-02-03 00:49:08 -0500
commit91f1da22c866d8d9763cbfbdcf7e8d7fc327be02 (patch)
tree1a51d64a7f7e048eb7d5f1c59254707ec996f03f
parentce66e496c0c70046fc07dead768965f161dd8c56 (diff)
downloadeclipse.platform.debug-91f1da22c866d8d9763cbfbdcf7e8d7fc327be02.tar.gz
eclipse.platform.debug-91f1da22c866d8d9763cbfbdcf7e8d7fc327be02.tar.xz
eclipse.platform.debug-91f1da22c866d8d9763cbfbdcf7e8d7fc327be02.zip
Bug 510990 - launch groups: validate regular expression in input field
Change-Id: Ic86cec79de82f55ca528e98ad8fb17a8d1701c32 Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java8
2 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
index 5eb723932..386d6fe44 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
@@ -131,7 +131,7 @@ GroupLaunchConfigurationSelectionDialog_14=Add one or more launch configurations
GroupLaunchConfigurationSelectionDialog_15=Edit an existing entry in the launch group
GroupLaunchConfigurationSelectionDialog_adoptText=&Adopt launch if already running
GroupLaunchConfigurationSelectionDialog_adoptTooltip=Instead of launching a new process, adds the running launch to the group.
-GroupLaunchConfigurationSelectionDialog_errorNoRegexp=Enter a regular expression to wait for
+GroupLaunchConfigurationSelectionDialog_errorNoRegexp=No or invalid regular expression
GroupLaunchConfigurationSelectionDialog_regexp=&Regular Expression:
GroupLaunchConfigurationTabGroup_0=Wait for output matching "{0}"
GroupLaunchConfigurationTabGroup_1=&Up
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
index 4e54970f6..a45644f85 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationSelectionDialog.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
+import java.util.regex.Pattern;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
@@ -400,6 +401,13 @@ class GroupLaunchConfigurationSelectionDialog extends TitleAreaDialog implements
if (action == GroupElementPostLaunchAction.OUTPUT_REGEXP) {
isValid = actionParam instanceof String && !((String) actionParam).isEmpty();
+ if (isValid) {
+ try {
+ Pattern.compile((String) actionParam);
+ } catch (Exception e) {
+ isValid = false;
+ }
+ }
setErrorMessage(isValid ? null : DebugUIMessages.GroupLaunchConfigurationSelectionDialog_errorNoRegexp);
}
}

Back to the top