1
2
3
4
5
6
7
8
9
10 package com.puppycrawl.tools.checkstyle.checks.coding.requirethis;
11
12 public class InputRequireThisExpressions {
13 String id;
14 int length;
15 boolean b;
16
17 public void method(int[] arr) {
18 Object plus = "" + id;
19 Object minus = 1 - length;
20 Object multi = 1 * length;
21 Object div = 1 / length;
22 Object mod = 1 % length;
23 Object lt = 1 < length;
24 Object gt = 1 > length;
25 Object le = 1 <= length;
26 Object ge = 1 >= length;
27 Object equal = false == b;
28 Object notEqual = false != b;
29 Object sl = 1 << length;
30 Object sr = 1 >> length;
31 Object bsr = 1 >>> length;
32 Object and = 1 & length;
33 Object xor = 1 ^ length;
34 Object bor = 1 | length;
35 Object lor = false || b;
36 Object land = false && b;
37 }
38
39 public void methodThis(int[] arr) {
40 Object plus = "" + this.id;
41 Object minus = 1 - this.length;
42 Object multi = 1 * this.length;
43 Object div = 1 / this.length;
44 Object mod = 1 % this.length;
45 Object lt = 1 < this.length;
46 Object gt = 1 > this.length;
47 Object le = 1 <= this.length;
48 Object ge = 1 >= this.length;
49 Object equal = false == this.b;
50 Object notEqual = false != this.b;
51 Object sl = 1 << this.length;
52 Object sr = 1 >> this.length;
53 Object bsr = 1 >>> this.length;
54 Object and = 1 & this.length;
55 Object xor = 1 ^ this.length;
56 Object bor = 1 | this.length;
57 Object lor = false || this.b;
58 Object land = false && this.b;
59
60 Object fields = arr.length + this.length;
61 }
62 }