1 package com.github.sevntu.checkstyle.checks.design;
2 import java.util.*;
3 public class InputAvoidConditionInversion
4 {
5 private boolean flag = false;
6 private boolean isDifferent(int a, int b) {
7 return ! (a == b);
8 }
9
10 private boolean isLower(int a, int b) {
11 return ! (a > b);
12 }
13
14 private boolean isLowerLimits(int a, int b) {
15 return ! ((a>=8) && (b>=5));
16 }
17
18 private void foo(int a, int b) {
19 if (! ((a>=8) && (b>=5))) {
20
21 }
22
23 while (! ((a>=8) && (b>=5))) {
24
25 }
26
27 do {
28
29 } while ((! ((a>=8) && (b>=5))));
30
31 for (int i = 0; (! ((a>=8) && (b>=5))); i++) {
32
33 }
34
35 }
36
37 private boolean fun(int a, int b) {
38 String str = "";
39 return !(a < b
40 && str.toLowerCase().contains("a")
41 || b < a
42 && !str.toLowerCase().contains("b"));
43
44
45
46
47
48
49 }
50
51 private void o() {
52 if (true) {
53 for (;;);
54 }
55 return;
56 }
57
58 private int getRandomNumber() {
59 for (int i = 0; i < 4; i++);
60 return 4;
61 }
62
63 private boolean isNotEmpty() {
64 List<String> list = new ArrayList<String>();
65 return !list.isEmpty();
66
67 }
68
69 private void testLoops() {
70 String str = "";
71
72 while (!"".concat("s").equals("ss")) {
73
74
75
76 }
77
78 for (String line = "s"; !(line.endsWith("s"));) {
79
80 line += "s";
81 }
82
83 }
84
85 private void foo1() {
86 String s = "";
87 if (!(s instanceof String)) {
88
89
90 }
91
92 boolean b = false;
93
94 if (!b) {
95
96 }
97
98 if (!(this.flag)) {
99
100
101 }
102 if (! ("s" instanceof String || this instanceof Object)) {
103
104
105 }
106 boolean a = false;
107 if (! (a && b)) {
108
109
110 }
111 }
112
113 }