diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/model/Section.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/model/Section.java index e364ec34..ac1b0dde 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/model/Section.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/model/Section.java @@ -142,18 +142,18 @@ public class Section { @ThenAction public void expandByRegEx(@Argument(ArgumentType.TYPE) String type, - @Argument(ArgumentType.REGEX) String pattern, + @Argument(ArgumentType.REGEX) String suffixPattern, @Argument(ArgumentType.BOOLEAN) boolean patternCaseInsensitive, @Argument(ArgumentType.INTEGER) int group, - @Argument(ArgumentType.REGEX) String withoutPattern) { + @Argument(ArgumentType.REGEX) String compiledValuePattern) { - Pattern compiledWithoutPattern = null; + Pattern compiledValuePat = null; - if (withoutPattern != null) { - compiledWithoutPattern = Patterns.getCompiledPattern(withoutPattern, patternCaseInsensitive); + if (compiledValuePattern != null) { + compiledValuePat = Patterns.getCompiledPattern(compiledValuePattern, patternCaseInsensitive); } - Pattern compiledPattern = Patterns.getCompiledPattern(pattern, patternCaseInsensitive); + Pattern compiledPattern = Patterns.getCompiledPattern(suffixPattern, patternCaseInsensitive); Set expanded = new HashSet<>(); for (Entity entity : entities) { @@ -162,9 +162,9 @@ public class Section { continue; } - if(withoutPattern != null) { - Matcher matcherWithout = compiledWithoutPattern.matcher(entity.getWord()); - if (matcherWithout.find()) { + if(compiledValuePattern != null) { + Matcher matcherCompiledValuePattern = compiledValuePat.matcher(entity.getWord()); + if (!matcherCompiledValuePattern.find()) { continue; } }