forked from checkstyle/checkstyle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#12443: Fix null pointer exception on config value wi…
…th trailing whitespace
- Loading branch information
Showing
5 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ycrawl/tools/checkstyle/checks/coding/illegaltype/InputIllegalTypeWhitespaceInConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
IllegalType | ||
validateAbstractClassNames = (default)false | ||
illegalClassNames = java.lang.StringBuffer,\t | ||
legalAbstractClassNames = (default) | ||
ignoredMethodNames = foo1 | ||
illegalAbstractClassNameFormat = (default)^(.*[.])?Abstract.*$ | ||
memberModifiers = (default) | ||
tokens = (default)ANNOTATION_FIELD_DEF, CLASS_DEF, INTERFACE_DEF, METHOD_CALL, METHOD_DEF, \ | ||
METHOD_REF, PARAMETER_DEF, VARIABLE_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF, \ | ||
RECORD_COMPONENT_DEF | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.checks.coding.illegaltype; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Target; | ||
import java.util.List; | ||
|
||
public class InputIllegalTypeWhitespaceInConfig { | ||
public void example(List<@MyPattern String> strings) { | ||
} | ||
|
||
@Target(ElementType.TYPE_USE) | ||
public @interface MyPattern {} | ||
} | ||
|
14 changes: 14 additions & 0 deletions
14
...wl/tools/checkstyle/checks/naming/parametername/InputParameterNameWhitespaceInConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
ParameterName | ||
format = (default)^[a-z][a-zA-Z0-9]*$ | ||
ignoreOverridden = (default)false | ||
accessModifiers = public,\t | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.naming.parametername; | ||
|
||
public class InputParameterNameWhitespaceInConfig { | ||
int method(){return 1;} | ||
} |