Issue #3255: removed unnecessary string fields for patterns
This commit is contained in:
parent
ad5edc7935
commit
a963f8a21b
|
|
@ -59,15 +59,10 @@ public class TodoCommentCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "todo.match";
|
||||
|
||||
/**
|
||||
* Format of 'todo' comment.
|
||||
*/
|
||||
private String format = "TODO:";
|
||||
|
||||
/**
|
||||
* Regular expression pattern compiled from format.
|
||||
*/
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("TODO:");
|
||||
|
||||
@Override
|
||||
public boolean isCommentNodesRequired() {
|
||||
|
|
@ -80,8 +75,7 @@ public class TodoCommentCheck
|
|||
* pattern of 'todo' comment.
|
||||
*/
|
||||
public void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -104,8 +98,8 @@ public class TodoCommentCheck
|
|||
final String[] lines = ast.getText().split("\n");
|
||||
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
if (regexp.matcher(lines[i]).find()) {
|
||||
log(ast.getLineNo() + i, MSG_KEY, format);
|
||||
if (format.matcher(lines[i]).find()) {
|
||||
log(ast.getLineNo() + i, MSG_KEY, format.pattern());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,11 +108,8 @@ public class TrailingCommentCheck extends AbstractCheck {
|
|||
/** Pattern for legal trailing comment. */
|
||||
private Pattern legalComment;
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format = "^[\\s\\});]*$";
|
||||
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("^[\\s\\});]*$");
|
||||
|
||||
/**
|
||||
* Sets patter for legal trailing comments.
|
||||
|
|
@ -127,8 +124,7 @@ public class TrailingCommentCheck extends AbstractCheck {
|
|||
* @param pattern a pattern
|
||||
*/
|
||||
public final void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -180,7 +176,7 @@ public class TrailingCommentCheck extends AbstractCheck {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (!regexp.matcher(lineBefore).find()
|
||||
if (!format.matcher(lineBefore).find()
|
||||
&& !isLegalComment(comment)) {
|
||||
log(lineNo, MSG_KEY);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
|
|||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.api.FullIdent;
|
||||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
/**
|
||||
* Detects uncommented main methods. Basically detects
|
||||
|
|
@ -49,11 +48,8 @@ public class UncommentedMainCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "uncommented.main";
|
||||
|
||||
/** The pattern to exclude classes from the check. */
|
||||
private String excludedClasses = "^$";
|
||||
/** Compiled regexp to exclude classes from check. */
|
||||
private Pattern excludedClassesPattern =
|
||||
CommonUtils.createPattern(excludedClasses);
|
||||
private Pattern excludedClasses = Pattern.compile("^$");
|
||||
/** Current class name. */
|
||||
private String currentClass;
|
||||
/** Current package. */
|
||||
|
|
@ -66,8 +62,7 @@ public class UncommentedMainCheck
|
|||
* @param excludedClasses a pattern
|
||||
*/
|
||||
public void setExcludedClasses(Pattern excludedClasses) {
|
||||
this.excludedClasses = excludedClasses.pattern();
|
||||
excludedClassesPattern = excludedClasses;
|
||||
this.excludedClasses = excludedClasses;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -169,7 +164,7 @@ public class UncommentedMainCheck
|
|||
* @return true if check passed, false otherwise
|
||||
*/
|
||||
private boolean checkClassName() {
|
||||
return !excludedClassesPattern.matcher(currentClass).find();
|
||||
return !excludedClasses.matcher(currentClass).find();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -107,19 +107,15 @@ public class SuppressWarningsCheck extends AbstractCheck {
|
|||
private static final String FQ_SUPPRESS_WARNINGS =
|
||||
"java.lang." + SUPPRESS_WARNINGS;
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format = "^$|^\\s+$";
|
||||
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("^$|^\\s+$");
|
||||
|
||||
/**
|
||||
* Set the format for the specified regular expression.
|
||||
* @param pattern the new pattern
|
||||
*/
|
||||
public final void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -242,7 +238,7 @@ public class SuppressWarningsCheck extends AbstractCheck {
|
|||
*/
|
||||
private void logMatch(final int lineNo,
|
||||
final int colNum, final String warningText) {
|
||||
final Matcher matcher = regexp.matcher(warningText);
|
||||
final Matcher matcher = format.matcher(warningText);
|
||||
if (matcher.matches()) {
|
||||
log(lineNo, colNum,
|
||||
MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, warningText);
|
||||
|
|
|
|||
|
|
@ -131,11 +131,8 @@ public final class IllegalTypeCheck extends AbstractCheck {
|
|||
/** Check methods and fields with only corresponding modifiers. */
|
||||
private List<Integer> memberModifiers;
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format = "^(.*[.])?Abstract.*$";
|
||||
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("^(.*[.])?Abstract.*$");
|
||||
|
||||
/**
|
||||
* Controls whether to validate abstract class names.
|
||||
|
|
@ -154,8 +151,7 @@ public final class IllegalTypeCheck extends AbstractCheck {
|
|||
* @param pattern a pattern.
|
||||
*/
|
||||
public void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -338,7 +334,7 @@ public final class IllegalTypeCheck extends AbstractCheck {
|
|||
|| illegalClassNames.contains(shortName)
|
||||
|| validateAbstractClassNames
|
||||
&& !legalAbstractClassNames.contains(className)
|
||||
&& regexp.matcher(className).find();
|
||||
&& format.matcher(className).find();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -62,10 +62,8 @@ public final class ReturnCountCheck extends AbstractCheck {
|
|||
/** Stack of method contexts. */
|
||||
private final Deque<Context> contextStack = new ArrayDeque<>();
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format = "^equals$";
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("^equals$");
|
||||
|
||||
/** Maximum allowed number of return statements. */
|
||||
private int max = 2;
|
||||
|
|
@ -104,8 +102,7 @@ public final class ReturnCountCheck extends AbstractCheck {
|
|||
* @param pattern a pattern.
|
||||
*/
|
||||
public void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -171,7 +168,7 @@ public final class ReturnCountCheck extends AbstractCheck {
|
|||
private void visitMethodDef(DetailAST ast) {
|
||||
contextStack.push(context);
|
||||
final DetailAST methodNameAST = ast.findFirstToken(TokenTypes.IDENT);
|
||||
final boolean check = !regexp.matcher(methodNameAST.getText()).find();
|
||||
final boolean check = !format.matcher(methodNameAST.getText()).find();
|
||||
context = new Context(check);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,10 +56,8 @@ public final class MutableExceptionCheck extends AbstractCheck {
|
|||
private Pattern extendedClassNameFormat = Pattern.compile(DEFAULT_FORMAT);
|
||||
/** Should we check current class or not. */
|
||||
private boolean checking;
|
||||
/** The format string of the regexp. */
|
||||
private String format = DEFAULT_FORMAT;
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile(DEFAULT_FORMAT);
|
||||
|
||||
/**
|
||||
* Sets the format of extended class name to the specified regular expression.
|
||||
|
|
@ -74,8 +72,7 @@ public final class MutableExceptionCheck extends AbstractCheck {
|
|||
* @param pattern the new pattern
|
||||
*/
|
||||
public void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -151,7 +148,7 @@ public final class MutableExceptionCheck extends AbstractCheck {
|
|||
*/
|
||||
private boolean isNamedAsException(DetailAST ast) {
|
||||
final String className = ast.findFirstToken(TokenTypes.IDENT).getText();
|
||||
return regexp.matcher(className).find();
|
||||
return format.matcher(className).find();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -304,17 +304,13 @@ public class VisibilityModifierCheck
|
|||
PROTECTED_ACCESS_MODIFIER,
|
||||
};
|
||||
|
||||
/**
|
||||
* Pattern for public members that should be ignored. Note:
|
||||
/** Regexp for public members that should be ignored. Note:
|
||||
* Earlier versions of checkstyle used ^f[A-Z][a-zA-Z0-9]*$ as the
|
||||
* default to allow CMP for EJB 1.1 with the default settings.
|
||||
* With EJB 2.0 it is not longer necessary to have public access
|
||||
* for persistent fields.
|
||||
*/
|
||||
private String publicMemberFormat = "^serialVersionUID$";
|
||||
|
||||
/** Regexp for public members that should be ignored. */
|
||||
private Pattern publicMemberPattern = Pattern.compile(publicMemberFormat);
|
||||
private Pattern publicMemberPattern = Pattern.compile("^serialVersionUID$");
|
||||
|
||||
/** List of ignore annotations short names. */
|
||||
private final List<String> ignoreAnnotationShortNames =
|
||||
|
|
@ -374,7 +370,6 @@ public class VisibilityModifierCheck
|
|||
*/
|
||||
public void setPublicMemberPattern(Pattern pattern) {
|
||||
publicMemberPattern = pattern;
|
||||
publicMemberFormat = pattern.pattern();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -101,13 +101,9 @@ public class JavadocTypeCheck
|
|||
/** The visibility scope where Javadoc comments shouldn't be checked. **/
|
||||
private Scope excludeScope;
|
||||
/** Compiled regexp to match author tag content. **/
|
||||
private Pattern authorFormatPattern;
|
||||
private Pattern authorFormat;
|
||||
/** Compiled regexp to match version tag content. **/
|
||||
private Pattern versionFormatPattern;
|
||||
/** Regexp to match author tag content. */
|
||||
private String authorFormat;
|
||||
/** Regexp to match version tag content. */
|
||||
private String versionFormat;
|
||||
private Pattern versionFormat;
|
||||
/**
|
||||
* Controls whether to ignore errors when a method has type parameters but
|
||||
* does not have matching param tags in the javadoc. Defaults to false.
|
||||
|
|
@ -137,8 +133,7 @@ public class JavadocTypeCheck
|
|||
* @param pattern a pattern.
|
||||
*/
|
||||
public void setAuthorFormat(Pattern pattern) {
|
||||
authorFormat = pattern.pattern();
|
||||
authorFormatPattern = pattern;
|
||||
authorFormat = pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -146,8 +141,7 @@ public class JavadocTypeCheck
|
|||
* @param pattern a pattern.
|
||||
*/
|
||||
public void setVersionFormat(Pattern pattern) {
|
||||
versionFormat = pattern.pattern();
|
||||
versionFormatPattern = pattern;
|
||||
versionFormat = pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -202,9 +196,9 @@ public class JavadocTypeCheck
|
|||
if (ScopeUtils.isOuterMostType(ast)) {
|
||||
// don't check author/version for inner classes
|
||||
checkTag(lineNo, tags, JavadocTagInfo.AUTHOR.getName(),
|
||||
authorFormatPattern, authorFormat);
|
||||
authorFormat);
|
||||
checkTag(lineNo, tags, JavadocTagInfo.VERSION.getName(),
|
||||
versionFormatPattern, versionFormat);
|
||||
versionFormat);
|
||||
}
|
||||
|
||||
final List<String> typeParamNames =
|
||||
|
|
@ -272,10 +266,9 @@ public class JavadocTypeCheck
|
|||
* @param tags tags from the Javadoc comment for the type definition.
|
||||
* @param tagName the required tag name.
|
||||
* @param formatPattern regexp for the tag value.
|
||||
* @param format pattern for the tag value.
|
||||
*/
|
||||
private void checkTag(int lineNo, List<JavadocTag> tags, String tagName,
|
||||
Pattern formatPattern, String format) {
|
||||
Pattern formatPattern) {
|
||||
if (formatPattern != null) {
|
||||
int tagCount = 0;
|
||||
final String tagPrefix = "@";
|
||||
|
|
@ -284,7 +277,7 @@ public class JavadocTypeCheck
|
|||
if (tag.getTagName().equals(tagName)) {
|
||||
tagCount++;
|
||||
if (!formatPattern.matcher(tag.getFirstArg()).find()) {
|
||||
log(lineNo, MSG_TAG_FORMAT, tagPrefix + tagName, format);
|
||||
log(lineNo, MSG_TAG_FORMAT, tagPrefix + tagName, formatPattern.pattern());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,12 +87,10 @@ public class WriteTagCheck
|
|||
/** Compiled regexp to match tag. **/
|
||||
private Pattern tagRegExp;
|
||||
/** Compiled regexp to match tag content. **/
|
||||
private Pattern tagFormatRegExp;
|
||||
private Pattern tagFormat;
|
||||
|
||||
/** Regexp to match tag. */
|
||||
private String tag;
|
||||
/** Regexp to match tag content. */
|
||||
private String tagFormat;
|
||||
/** The severity level of found tag reports. */
|
||||
private SeverityLevel tagSeverityLevel = SeverityLevel.INFO;
|
||||
|
||||
|
|
@ -110,8 +108,7 @@ public class WriteTagCheck
|
|||
* @param pattern a {@code String} value
|
||||
*/
|
||||
public void setTagFormat(Pattern pattern) {
|
||||
tagFormat = pattern.pattern();
|
||||
tagFormatRegExp = pattern;
|
||||
tagFormat = pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -181,11 +178,11 @@ public class WriteTagCheck
|
|||
tagCount += 1;
|
||||
final int contentStart = matcher.start(1);
|
||||
final String content = commentValue.substring(contentStart);
|
||||
if (tagFormatRegExp == null || tagFormatRegExp.matcher(content).find()) {
|
||||
if (tagFormat == null || tagFormat.matcher(content).find()) {
|
||||
logTag(lineNo + i - comment.length, tag, content);
|
||||
}
|
||||
else {
|
||||
log(lineNo + i - comment.length, MSG_TAG_FORMAT, tag, tagFormat);
|
||||
log(lineNo + i - comment.length, MSG_TAG_FORMAT, tag, tagFormat.pattern());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,11 +61,8 @@ public final class AbstractClassNameCheck extends AbstractCheck {
|
|||
/** Whether to ignore checking the name. */
|
||||
private boolean ignoreName;
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format = "^Abstract.+$";
|
||||
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("^Abstract.+$");
|
||||
|
||||
/**
|
||||
* Whether to ignore checking for the {@code abstract} modifier.
|
||||
|
|
@ -88,8 +85,7 @@ public final class AbstractClassNameCheck extends AbstractCheck {
|
|||
* @param pattern the new pattern
|
||||
*/
|
||||
public void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -123,7 +119,7 @@ public final class AbstractClassNameCheck extends AbstractCheck {
|
|||
// if class has abstract modifier
|
||||
if (!ignoreName && !isMatchingClassName(className)) {
|
||||
log(ast.getLineNo(), ast.getColumnNo(),
|
||||
MSG_ILLEGAL_ABSTRACT_CLASS_NAME, className, format);
|
||||
MSG_ILLEGAL_ABSTRACT_CLASS_NAME, className, format.pattern());
|
||||
}
|
||||
}
|
||||
else if (!ignoreModifier && isMatchingClassName(className)) {
|
||||
|
|
@ -148,6 +144,6 @@ public final class AbstractClassNameCheck extends AbstractCheck {
|
|||
* @return true if class name matches format of abstract class names.
|
||||
*/
|
||||
private boolean isMatchingClassName(String className) {
|
||||
return regexp.matcher(className).find();
|
||||
return format.matcher(className).find();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,18 +38,15 @@ public abstract class AbstractNameCheck
|
|||
*/
|
||||
public static final String MSG_INVALID_PATTERN = "name.invalidPattern";
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format;
|
||||
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp;
|
||||
private Pattern format;
|
||||
|
||||
/**
|
||||
* Creates a new {@code AbstractNameCheck} instance.
|
||||
* @param format format to check with
|
||||
*/
|
||||
protected AbstractNameCheck(String format) {
|
||||
setFormat(CommonUtils.createPattern(format));
|
||||
this.format = CommonUtils.createPattern(format);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,20 +63,19 @@ public abstract class AbstractNameCheck
|
|||
* @param pattern the new pattern
|
||||
*/
|
||||
public final void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitToken(DetailAST ast) {
|
||||
if (mustCheckName(ast)) {
|
||||
final DetailAST nameAST = ast.findFirstToken(TokenTypes.IDENT);
|
||||
if (!regexp.matcher(nameAST.getText()).find()) {
|
||||
if (!format.matcher(nameAST.getText()).find()) {
|
||||
log(nameAST.getLineNo(),
|
||||
nameAST.getColumnNo(),
|
||||
MSG_INVALID_PATTERN,
|
||||
nameAST.getText(),
|
||||
format);
|
||||
format.pattern());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,21 +70,18 @@ public class PackageNameCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "name.invalidPattern";
|
||||
|
||||
/** The format string of the regexp. */
|
||||
/** The regexp to match against. */
|
||||
// Uppercase letters seem rather uncommon, but they're allowed in
|
||||
// http://docs.oracle.com/javase/specs/
|
||||
// second_edition/html/packages.doc.html#40169
|
||||
private String format = "^[a-z]+(\\.[a-zA-Z_][a-zA-Z0-9_]*)*$";
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format);
|
||||
private Pattern format = Pattern.compile("^[a-z]+(\\.[a-zA-Z_][a-zA-Z0-9_]*)*$");
|
||||
|
||||
/**
|
||||
* Set the format for the specified regular expression.
|
||||
* @param pattern the new pattern
|
||||
*/
|
||||
public void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = pattern;
|
||||
format = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -106,12 +103,12 @@ public class PackageNameCheck
|
|||
public void visitToken(DetailAST ast) {
|
||||
final DetailAST nameAST = ast.getLastChild().getPreviousSibling();
|
||||
final FullIdent full = FullIdent.createFullIdent(nameAST);
|
||||
if (!regexp.matcher(full.getText()).find()) {
|
||||
if (!format.matcher(full.getText()).find()) {
|
||||
log(full.getLineNo(),
|
||||
full.getColumnNo(),
|
||||
MSG_KEY,
|
||||
full.getText(),
|
||||
format);
|
||||
format.pattern());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,11 +108,8 @@ public class RegexpCheck extends AbstractCheck {
|
|||
/** Tracks number of errors. */
|
||||
private int errorCount;
|
||||
|
||||
/** The format string of the regexp. */
|
||||
private String format = "$^";
|
||||
|
||||
/** The regexp to match against. */
|
||||
private Pattern regexp = Pattern.compile(format, Pattern.MULTILINE);
|
||||
private Pattern format = Pattern.compile("$^", Pattern.MULTILINE);
|
||||
|
||||
/** The matcher. */
|
||||
private Matcher matcher;
|
||||
|
|
@ -170,8 +167,7 @@ public class RegexpCheck extends AbstractCheck {
|
|||
* @throws org.apache.commons.beanutils.ConversionException unable to parse format
|
||||
*/
|
||||
public final void setFormat(Pattern pattern) {
|
||||
format = pattern.pattern();
|
||||
regexp = CommonUtils.createPattern(format, Pattern.MULTILINE);
|
||||
format = CommonUtils.createPattern(pattern.pattern(), Pattern.MULTILINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -191,7 +187,7 @@ public class RegexpCheck extends AbstractCheck {
|
|||
|
||||
@Override
|
||||
public void beginTree(DetailAST rootAST) {
|
||||
matcher = regexp.matcher(getFileContents().getText().getFullText());
|
||||
matcher = format.matcher(getFileContents().getText().getFullText());
|
||||
matchCount = 0;
|
||||
errorCount = 0;
|
||||
findMatch();
|
||||
|
|
@ -271,7 +267,7 @@ public class RegexpCheck extends AbstractCheck {
|
|||
String msg;
|
||||
|
||||
if (message.isEmpty()) {
|
||||
msg = format;
|
||||
msg = format.pattern();
|
||||
}
|
||||
else {
|
||||
msg = message;
|
||||
|
|
|
|||
Loading…
Reference in New Issue