From 68c765217397437e1c0641326c1b2cca56276651 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Thu, 28 Apr 2016 15:31:35 +0000 Subject: [PATCH 1/2] ASM #18947 - Text Workstation: QC Error if enough UGCs are listed, sending one to 2nd line Change-Id: I44ae34edbae66b55b13f572ee9250373cec785ab Former-commit-id: c2b8f0de6490546bfbc3b23541b682c766d95668 --- .../src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java index 0015f43369..75e658d755 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java @@ -64,6 +64,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil; * 15 SEP 2014 529 mgamazaychikov Create firstBulletImmediateCauseQCExclusions list and add IC to it. * 29 MAY 2015 4441 randerso Fixed QC to work with mixed case * 24 NOV 2015 DR 17501 dhuffman Added lookaheads to ugc pattern to remove the telephone number special case. + * 28 APR 2016 DR 18947 D. Friedman Fixed UGC pattern. * * * @@ -72,7 +73,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil; public class TextSegmentCheck implements IQCCheck { private static final Pattern ugcPtrn = Pattern - .compile("(^(?!\\d{3}-\\d{4}[^-]*)^(?!\\d{3}-\\d{3}-\\d{4}[^-]*)(((\\w{2}[CZ](\\d{3}-){1,}){1,})|(\\d{3}-){1,})(((\\d{2})(\\d{2})(\\d{2})-){0,1}))"); + .compile("^(?:(?:[A-Z]{2}[CZ]\\d{3}-)?(?:\\d{3}-)*)*(?:\\d{6}-)?$"); private static Map> bulletTypeMaps; static { From 9946e63f9607dceea615755b0793fc83d2ca627c Mon Sep 17 00:00:00 2001 From: David Friedman Date: Mon, 2 May 2016 14:06:07 +0000 Subject: [PATCH 2/2] ASM #18947 - Text Workstation: QC Error if enough UGCs are listed, sending one to 2nd line (additional check-in) Change-Id: Ia11f9b283a38c73b128f77b71c1d07165ef8f742 Former-commit-id: 6dfae7cdd2f000a06001928dad3ad28857769620 --- .../com/raytheon/viz/texteditor/qc/TextSegmentCheck.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java index 75e658d755..32df28ab4a 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/TextSegmentCheck.java @@ -72,6 +72,10 @@ import com.raytheon.viz.texteditor.util.VtecUtil; */ public class TextSegmentCheck implements IQCCheck { + /* + * In order to keep this pattern simple, it does not exclude empty lines. + * The empty line case must be handled separately. + */ private static final Pattern ugcPtrn = Pattern .compile("^(?:(?:[A-Z]{2}[CZ]\\d{3}-)?(?:\\d{3}-)*)*(?:\\d{6}-)?$"); @@ -192,7 +196,7 @@ public class TextSegmentCheck implements IQCCheck { } m = ugcPtrn.matcher(line); - if (m.find()) { + if (m.find() && m.start() != m.end()) { ugc += line; countUGC = true; continue;