Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2014-09-08 17:48:49 -0400
committerMarc-Andre Laperle2014-09-10 01:15:43 -0400
commitfeac3225b58cf1a855d098f77f193f94c121fb63 (patch)
tree40cb49f8a8757a9f036771e535d96486e2497f57
parent91e3162dd71ede52f759df2ecde930830f07e718 (diff)
downloadorg.eclipse.linuxtools-feac3225b58cf1a855d098f77f193f94c121fb63.tar.gz
org.eclipse.linuxtools-feac3225b58cf1a855d098f77f193f94c121fb63.tar.xz
org.eclipse.linuxtools-feac3225b58cf1a855d098f77f193f94c121fb63.zip
tmf: Catch ParseSyntaxException in custom text parser wizard
Change-Id: I1ac66cacbc5d1d26ff06dbbe4920d31702cf3704 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/33081 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Reviewed-on: https://git.eclipse.org/r/33139 Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java
index 0dbe43dc7a..44a9414302 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java
@@ -723,14 +723,22 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
List<InputLine> nextInputs = currentInput.getNextInputs(countMap);
if (nextInputs.size() == 0 || nextInputs.get(nextInputs.size() - 1).getMinCount() == 0) {
for (InputLine input : definition.inputs) {
- matcher = input.getPattern().matcher(log);
+ try {
+ matcher = input.getPattern().matcher(log);
+ } catch (PatternSyntaxException e) {
+ continue;
+ }
if (matcher.matches()) {
continue event;
}
}
}
for (InputLine input : nextInputs) {
- matcher = input.getPattern().matcher(log);
+ try {
+ matcher = input.getPattern().matcher(log);
+ } catch (PatternSyntaxException e) {
+ continue;
+ }
if (matcher.matches()) {
inputText.setStyleRange(new StyleRange(rawPos, length,
COLOR_BLACK, COLOR_LIGHT_YELLOW, SWT.ITALIC));
@@ -776,8 +784,12 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
}
}
if (!processed && currentInput != null) {
- matcher = currentInput.getPattern().matcher(log);
- if (matcher.matches()) {
+ matcher = null;
+ try {
+ matcher = currentInput.getPattern().matcher(log);
+ } catch (PatternSyntaxException e) {
+ }
+ if (matcher != null && matcher.matches()) {
inputText.setStyleRange(new StyleRange(rawPos, length,
COLOR_BLACK, COLOR_LIGHT_YELLOW, SWT.ITALIC));
updatePreviewLine(currentInput, matcher, data, rawPos, rootLineMatches);

Back to the top