Skip to content

Commit

Permalink
Issue #5900: renamed format property to illegalAbstractClassNameFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach authored and romani committed Feb 22, 2019
1 parent 817febb commit 96483bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Expand Up @@ -41,7 +41,7 @@
*
* <p>Check has following properties:
*
* <p><b>format</b> - Pattern for illegal class names.
* <p><b>illegalAbstractClassNameFormat</b> - Pattern for illegal abstract class names.
*
* <p><b>legalAbstractClassNames</b> - Abstract classes that may be used as types.
*
Expand Down Expand Up @@ -130,7 +130,7 @@ public final class IllegalTypeCheck extends AbstractCheck {
private List<Integer> memberModifiers;

/** The regexp to match against. */
private Pattern format = Pattern.compile("^(.*[.])?Abstract.*$");
private Pattern illegalAbstractClassNameFormat = Pattern.compile("^(.*[.])?Abstract.*$");

/**
* Controls whether to validate abstract class names.
Expand All @@ -147,8 +147,8 @@ public IllegalTypeCheck() {
* Set the format for the specified regular expression.
* @param pattern a pattern.
*/
public void setFormat(Pattern pattern) {
format = pattern;
public void setIllegalAbstractClassNameFormat(Pattern pattern) {
illegalAbstractClassNameFormat = pattern;
}

/**
Expand Down Expand Up @@ -460,7 +460,7 @@ private boolean isMatchingClassName(String className) {
|| illegalShortClassNames.contains(shortName)
|| validateAbstractClassNames
&& !legalAbstractClassNames.contains(className)
&& format.matcher(className).find();
&& illegalAbstractClassNameFormat.matcher(className).find();
}

/**
Expand Down
Expand Up @@ -93,7 +93,7 @@ public void testIgnoreMethodNames() throws Exception {
@Test
public void testFormat() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(IllegalTypeCheck.class);
checkConfig.addAttribute("format", "^$");
checkConfig.addAttribute("illegalAbstractClassNameFormat", "^$");

final String[] expected = {
"16:13: " + getCheckMessage(MSG_KEY, "java.util.TreeSet"),
Expand Down
4 changes: 2 additions & 2 deletions src/xdocs/config_coding.xml
Expand Up @@ -2109,8 +2109,8 @@ class SomeClass
<td>3.2</td>
</tr>
<tr>
<td>format</td>
<td>Pattern for illegal class names.</td>
<td>illegalAbstractClassNameFormat</td>
<td>Pattern for illegal abstract class names.</td>
<td><a href="property_types.html#regexp">Regular Expression</a></td>
<td><code>"^(.*[.])?Abstract.*$"</code></td>
<td>3.2</td>
Expand Down

0 comments on commit 96483bd

Please sign in to comment.