diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/coding/InputReturnFromFinallyCheck.java b/src/testinputs/com/puppycrawl/tools/checkstyle/coding/InputReturnFromFinallyCheck.java index 36687534a..27e2b3a49 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/coding/InputReturnFromFinallyCheck.java +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/coding/InputReturnFromFinallyCheck.java @@ -21,5 +21,6 @@ public class InputReturnFromFinallyCheck { public void thisNull() { boolean result = (this == null) || (null == this); boolean result2 = (this != null) && (null != this); + boolean result3 = (this.getClass().getName() == String.valueOf(null == System.getProperty("abc"))); } } diff --git a/src/tests/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java b/src/tests/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java index b68079631..ab8da13fe 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java @@ -263,6 +263,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport checkConfig.addAttribute("tokens", "NOT_EQUAL,EQUAL"); checkConfig.addAttribute("limitedTokens", "LITERAL_THIS,LITERAL_NULL"); checkConfig.addAttribute("maximumNumber", "1"); + checkConfig.addAttribute("maximumDepth", "1"); checkConfig.addAttribute("maximumMessage", "this cannot be null."); checkConfig.addAttribute("sumTokenCounts", "true"); @@ -285,6 +286,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport checkConfig.addAttribute("tokens", "NOT_EQUAL,EQUAL"); checkConfig.addAttribute("limitedTokens", "LITERAL_THIS,LITERAL_NULL"); checkConfig.addAttribute("maximumNumber", "1"); + checkConfig.addAttribute("maximumDepth", "1"); checkConfig.addAttribute("sumTokenCounts", "true"); String[] expected = { diff --git a/src/xdocs/config_misc.xml b/src/xdocs/config_misc.xml index 462a05234..9bdd0b005 100755 --- a/src/xdocs/config_misc.xml +++ b/src/xdocs/config_misc.xml @@ -645,6 +645,15 @@ messages.properties: Key 'ok' missing.
+ Comparing this with null (i.e. this == + null and this != null): +
+String literal equality check:
Switch with no default:
++ Assert statement may have side effects (formatted for browser + display): +
++ Initialiser in for performs no setup (use while instead?): +
++ Condition in for performs no check: +
++ Switch within switch: +
+Return from within a catch or finally block:
+Try within catch or finally block:
+Too many cases within a switch:
+Too many local variables within a method:
+Too many returns from within a method:
+Too many fields within an interface:
+Limit the number of exceptions a method can throw:
+Limit the number of expressions in a method:
+Disallow empty statements:
+Too many fields within a class:
+Notes: