Skip to content

Commit

Permalink
Issue checkstyle#13213: Remove '//ok' from files
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding-Aliens authored and romani committed Jan 4, 2024
1 parent 887275d commit a820a89
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 66 deletions.
44 changes: 0 additions & 44 deletions config/checkstyle-input-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1366,50 +1366,6 @@
files="checks[\\/]coding[\\/]requirethis[\\/]InputRequireThisValidateOnlyOverlappingFalse.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]requirethis[\\/]InputRequireThisValidateOnlyOverlappingTrue2.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]returncount[\\/]InputReturnCountLambda4.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]simplifybooleanexpression[\\/]InputSimplifyBooleanExpression.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]simplifybooleanexpression[\\/]InputSimplifyBooleanExpression.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]simplifybooleanexpression[\\/]InputSimplifyBooleanExpression.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]simplifybooleanexpression[\\/]InputSimplifyBooleanExpression.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]simplifybooleanexpression[\\/]InputSimplifyBooleanExpression.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]superclone[\\/]InputSuperCloneMethodReference.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]superclone[\\/]InputSuperCloneWithoutWarnings.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIdentifier.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIdentifier.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIdentifier.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIdentifier.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]coding[\\/]unnecessaryparentheses[\\/]InputUnnecessaryParenthesesIfStatement2.java"/>
<suppress id="UnnecessaryOkComment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.function.Supplier;


public class InputReturnCountLambda4 { // ok
public class InputReturnCountLambda4 {

Runnable fieldWithOneReturnInLambda = () -> {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ void testTernaryExpressions() {
int c = 13;
boolean m = c > 1 ? true : false; // violation
boolean e = (a == true) // violation
? c > 1 : false; // ok
? c > 1 : false;
boolean h = false ? c > 13 : c < 21; // violation
boolean f = a == b ? false : c > 1; // ok
boolean f = a == b ? false : c > 1;
boolean q = c > 1 ? (c < 15
? false : b) // ok
? false : b)
: a != b;
boolean v = c > 0 ? true :
c < 0 ? false : true; // violation
boolean g = (c > 0 ? true : c < 0)
? false : false; // violation
Boolean value = null;
boolean temp = value != null ? value : false; // ok
boolean temp = value != null ? value : false;
temp = true ? a() : b(); // violation
int d = false ? 1 : 2; // violation
temp = a() ? true : true; // violation
temp = value != null ? value : (false); // ok
temp = value != null ? value : (false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface CheckedSupplier<R, E extends Exception> {
R get() throws E;
}

public Object clone() { // ok
public Object clone() {
CheckedSupplier<Object, CloneNotSupportedException> r = super::clone;
CheckedSupplier<Object, CloneNotSupportedException> r1 = super::getClass;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class InputSuperCloneWithoutWarnings {
@Override
protected final Object clone() throws CloneNotSupportedException { // ok
protected final Object clone() throws CloneNotSupportedException {
return new InputSuperCloneWithoutWarnings();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static boolean is(Class<?> clazz) {

public static boolean isOk(Class<?> clazz) {
return true
&& test(clazz); // ok
&& test(clazz);
}

public int square(int a, int b){
Expand All @@ -33,8 +33,8 @@ public int square(int a, int b){
}

public int square1(int a, int b){
int square = a * b; // ok
return square; // ok
int square = a * b;
return square;
}

public static boolean test(Class<?> clazz) {
Expand All @@ -48,7 +48,7 @@ public static boolean newTest(Class<?> clazz) {

public static boolean newTest1(Class<?> clazz) {
return true
&& test(clazz); // ok
&& test(clazz);
}

public static boolean newTest2(Class<?> clazz) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class InputUnnecessaryParenthesesIfStatement {
void method(String sectionName) {
if ("Content".equals(sectionName) || "Overview".equals(sectionName)
|| (!"A".equals(sectionName) // violation 'Unnecessary paren.* around expression'
&& !"AbstractClassName".equals(sectionName) // ok
&& !"AbstractClassName".equals(sectionName)
)) {
System.out.println("sd");
}
Expand All @@ -29,7 +29,7 @@ private void method() {
x = 0;
y = 0;

z = (x < y) ? x : y; // ok
z = (x < y) ? x : y;

if ((x < y) // violation 'Unnecessary parentheses around expression'
&& (x > z)) { // violation 'Unnecessary parentheses around expression'
Expand All @@ -41,7 +41,7 @@ private void method() {
return;
}

if (!(x <= y) // ok
if (!(x <= y)
|| (x >= z)) { // violation 'Unnecessary parentheses around expression'
return;
}
Expand All @@ -59,7 +59,7 @@ private void method() {
}

if ((Integer.valueOf(x) instanceof Integer) // violation 'parentheses around expression'
|| Integer.valueOf(y) instanceof Integer) { // ok
|| Integer.valueOf(y) instanceof Integer) {
return;
}
if (x == ((y<z) ? y : z) &&
Expand All @@ -72,7 +72,7 @@ private void method() {
|| (z >= 3 && x <= 7)) { // violation 'Unnecessary parentheses around expression'
return;
}
if(x>= 0 && (x<=8 || y<=11) && y>=8) { // ok
if(x>= 0 && (x<=8 || y<=11) && y>=8) {
return;
}
if((y>=11 && x<=5) // violation 'Unnecessary parentheses around expression'
Expand All @@ -82,16 +82,16 @@ private void method() {
}
private void check() {
String sectionName = "Some String";
if ("Some content".equals(sectionName) || "Some overview".equals(sectionName) // ok
if ("Some content".equals(sectionName) || "Some overview".equals(sectionName)
|| (!"A".equals(sectionName) // violation 'Unnecessary paren.* around expression'
&& !"AbstractClassName".equals(sectionName) // ok
&& !"AbstractClassName".equals(sectionName)
)) {
return;
}

if (sectionName instanceof String && "Other Overview".equals(sectionName) // ok
&& (!"AbbreviationAsWordInName".equals(sectionName) // ok
|| !"AbstractClassName".equals(sectionName) // ok
if (sectionName instanceof String && "Other Overview".equals(sectionName)
&& (!"AbbreviationAsWordInName".equals(sectionName)
|| !"AbstractClassName".equals(sectionName)
)) {
return;
}
Expand Down

0 comments on commit a820a89

Please sign in to comment.