RED-3061: Logic for value matcher for initials expansion rule is inverted

This commit is contained in:
aoezyetimoglu 2021-12-14 12:25:21 +01:00
parent 1b9251b0a2
commit 1ccf0ab493

View File

@ -187,12 +187,12 @@ public class Section {
public void expandByRegEx(@Argument(ArgumentType.TYPE) String type, @Argument(ArgumentType.REGEX) String suffixPattern,
@Argument(ArgumentType.BOOLEAN) boolean patternCaseInsensitive,
@Argument(ArgumentType.INTEGER) int group,
@Argument(ArgumentType.REGEX) String compiledValuePattern) {
@Argument(ArgumentType.REGEX) String valuePattern) {
Pattern compiledWithoutPattern = null;
Pattern compiledValuePattern = null;
if (compiledValuePattern != null) {
compiledWithoutPattern = Patterns.getCompiledPattern(compiledValuePattern, patternCaseInsensitive);
if (valuePattern != null) {
compiledValuePattern = Patterns.getCompiledPattern(valuePattern, patternCaseInsensitive);
}
Pattern compiledPattern = Patterns.getCompiledPattern(suffixPattern, patternCaseInsensitive);
@ -204,9 +204,9 @@ public class Section {
continue;
}
if (compiledValuePattern != null) {
Matcher matcherCompiledValuePattern = compiledWithoutPattern.matcher(entity.getWord());
if (!matcherCompiledValuePattern.matches()) {
if (valuePattern != null) {
Matcher valueMatcher = compiledValuePattern.matcher(entity.getWord());
if (!valueMatcher.matches()) {
continue;
}
}