1
2
3
4
5
6
7
8
9
10
11
12
13
14 package com.puppycrawl.tools.checkstyle.checks.coding.unnecessaryparentheses;
15
16 import java.io.BufferedReader;
17 import java.io.IOException;
18
19 public class InputUnnecessaryParenthesesIdentifier {
20 public static boolean is(Class<?> clazz) {
21 return true
22 && (test(clazz));
23 }
24
25 public static boolean isOk(Class<?> clazz) {
26 return true
27 && test(clazz);
28 }
29
30 public int square(int a, int b){
31 int square = (a * b);
32 return (square);
33 }
34
35 public int square1(int a, int b){
36 int square = a * b;
37 return square;
38 }
39
40 public static boolean test(Class<?> clazz) {
41 return true;
42 }
43
44 public static boolean newTest(Class<?> clazz) {
45 return true
46 && test((clazz));
47 }
48
49 public static boolean newTest1(Class<?> clazz) {
50 return true
51 && test(clazz);
52 }
53
54 public static boolean newTest2(Class<?> clazz) {
55 return true
56 && ((test(
57 (clazz))));
58 }
59
60 public String getMarkerNumber() {
61 String markerNumber = "someText";
62 return markerNumber;
63 }
64
65 public boolean m3() {
66 return true;
67 }
68
69 public void testIF() {
70 int a = 9;
71 int b = 10;
72 if (a > b) {
73 System.out.println("a is greater then b");
74 }
75 else if ((b < a) && (
76 (8>9) ||
77 (!m3()))) {
78 System.out.println();
79 }
80 }
81
82 final double get1(int i) { return (double)(get(i)); }
83
84
85 private Object get(int i) {
86 return null;
87 }
88
89 public String isComment(String str) {
90 return "str";
91 }
92
93 void method() throws IOException {
94 String line = null;
95 System.out.println(" line: null="
96 + false
97 + " empty="
98 + (line.equals(""))
99 + " comment="
100 + (isComment(line)));
101
102 BufferedReader reader = null;
103 line = reader.readLine();
104 }
105 }