ForbidWildcardAsReturnType: disabled

When used with org.immutables:value, this check will kill the
Checkstyle process by throwing a NullPointerException.
This commit is contained in:
Paul Campbell 2017-04-02 14:17:57 +01:00
parent 63c0db9c8d
commit 42985446a0
3 changed files with 6 additions and 16 deletions

View file

@ -133,7 +133,7 @@ Rule|Level|Source|Enabled|Suppressable
[ForbidInstantiation](#forbidinstantiation)|unspecified|sevntu|| [ForbidInstantiation](#forbidinstantiation)|unspecified|sevntu||
[ForbidReturnInFinallyBlock](#forbidreturninfinallyblock)|complexity|sevntu|Yes| [ForbidReturnInFinallyBlock](#forbidreturninfinallyblock)|complexity|sevntu|Yes|
[ForbidThrowAnonymousExceptions](#forbidthrowanonymousexceptions)|tweaks|sevntu|| [ForbidThrowAnonymousExceptions](#forbidthrowanonymousexceptions)|tweaks|sevntu||
[ForbidWildcardAsReturnType](#forbidwildcardasreturntype)|complexity|sevntu|Yes| [ForbidWildcardAsReturnType](#forbidwildcardasreturntype)|complexity|sevntu||
[GenericWhitespace](#genericwhitespace)|layout|checkstyle|Yes| [GenericWhitespace](#genericwhitespace)|layout|checkstyle|Yes|
[Header](#header)|layout|checkstyle|Yes| [Header](#header)|layout|checkstyle|Yes|
[HiddenField](#hiddenfield)|tweaks|checkstyle|Yes| [HiddenField](#hiddenfield)|tweaks|checkstyle|Yes|
@ -2333,19 +2333,6 @@ try {
return true; // invalid return true; // invalid
} }
```` ````
#### [ForbidWildcardAsReturnType](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html)
Prevents declaring a method from returning a wildcard type as its return value.
Valid:
````
<E> List<E> getList() {}
````
Invalid:
````
<E> List<? extends E> getList() {}
````
#### [LogicConditionNeedOptimization](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/LogicConditionNeedOptimizationCheck.html) #### [LogicConditionNeedOptimization](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/LogicConditionNeedOptimizationCheck.html)
Prevent the placement of variables or fields after methods in an expression. Prevent the placement of variables or fields after methods in an expression.
@ -2670,6 +2657,9 @@ Generic rule; doesn't embody a 'quality' check.
As the sevntu check are considered experimental not all those that are not enabled are listed here. Only where they are disabled due to a conflict with my 'style' or there is another irreconcilable difference that prevents them from being enabled, will they be documented to prevent repeated investigations. As the sevntu check are considered experimental not all those that are not enabled are listed here. Only where they are disabled due to a conflict with my 'style' or there is another irreconcilable difference that prevents them from being enabled, will they be documented to prevent repeated investigations.
#### [ForbidWildcardAsReturnType](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html)
Causes `NullPointerException` when used with `@Value.Immutables` from `org.immutables:value`
#### [AvoidConditionInversion](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/AvoidConditionInversionCheck.html) #### [AvoidConditionInversion](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/AvoidConditionInversionCheck.html)
Should already be covered by [SimplifyBooleanExpression](simplifybooleanexpression). Should already be covered by [SimplifyBooleanExpression](simplifybooleanexpression).

View file

@ -1056,9 +1056,10 @@ rules:
name: ForbidWildcardAsReturnType name: ForbidWildcardAsReturnType
parent: TREEWALKER parent: TREEWALKER
level: COMPLEXITY level: COMPLEXITY
enabled: true enabled: false
source: SEVNTU source: SEVNTU
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html
reason: Causes `NullPointerException` when used with `@Value.Immutables` from `org.immutables:value`
- -
name: LogicConditionNeedOptimization name: LogicConditionNeedOptimization
parent: TREEWALKER parent: TREEWALKER

View file

@ -210,7 +210,6 @@
<module name="EnumValueName"/> <module name="EnumValueName"/>
<module name="ForbidCCommentsInMethods"/> <module name="ForbidCCommentsInMethods"/>
<module name="ForbidReturnInFinallyBlock"/> <module name="ForbidReturnInFinallyBlock"/>
<module name="ForbidWildcardAsReturnType"/>
<module name="LogicConditionNeedOptimization"/> <module name="LogicConditionNeedOptimization"/>
<module name="MapIterationInForEachLoop"/> <module name="MapIterationInForEachLoop"/>
<module name="NameConventionForJunit4TestClasses"/> <module name="NameConventionForJunit4TestClasses"/>