1 /*
2 DescendantToken
3 limitedTokens = LITERAL_THIS, LITERAL_NULL
4 minimumDepth = (default)0
5 maximumDepth = (default)2147483647
6 minimumNumber = 3
7 maximumNumber = (default)2147483647
8 sumTokenCounts = true
9 minimumMessage = (default)null
10 maximumMessage = (default)null
11 tokens = NOT_EQUAL, EQUAL
12
13
14 */
15
16 package com.puppycrawl.tools.checkstyle.checks.descendanttoken;
17
18 public class InputDescendantTokenReturnFromFinally5 {
19 public void foo() {
20 try {
21 System.currentTimeMillis();
22 } finally {
23 return;
24 }
25 }
26
27 public void bar() {
28 try {
29 System.currentTimeMillis();
30 } finally {
31 // violation below 'Total count of 0 is less than minimum count 3 under 'EQUAL'.'
32 if (System.currentTimeMillis() == 0) {
33 return; // return from if statement
34 }
35 }
36 }
37 public void thisNull() {
38 boolean result = (this == null) || (null == this); // 2 violations
39 boolean result2 = (this != null) && (null != this); // 2 violations
40 boolean result3 = (this.getClass().getName()
41 == String.valueOf(null == System.getProperty("abc"))); // 2 violations
42 }
43 }