mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-11 06:04:27 +08:00
style: enable MissingSwitchDefault
in checkstyle (#5179)
* Update directory * Update directory * Update directory * Update directory * add switch default --------- Co-authored-by: BamaCharanChhandogi <BamaCharanChhandogi@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
9eaa2bb756
commit
37c2a96fe2
@ -44,6 +44,9 @@ public final class Main {
|
||||
In.close();
|
||||
return;
|
||||
}
|
||||
default: {
|
||||
throw new IllegalArgumentException("Unexpected value: " + choice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,9 @@ public final class MainCuckooHashing {
|
||||
h.reHashTableIncreasesTableSize();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
throw new IllegalArgumentException("Unexpected value: " + choice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,9 @@ public final class Sort012D {
|
||||
h--;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
throw new IllegalArgumentException("Unexpected value: " + a[mid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("the Sorted array is ");
|
||||
|
@ -31,6 +31,8 @@ public final class DNFSort {
|
||||
high--;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected value: " + a[mid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ public final class PostfixToInfix {
|
||||
case '*':
|
||||
case '^':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isValidPostfixExpression(String postfix) {
|
||||
|
@ -26,6 +26,8 @@ public final class ValidParentheses {
|
||||
case ']':
|
||||
if (head == 0 || stack[--head] != '[') return false;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected character: " + c);
|
||||
}
|
||||
}
|
||||
return head == 0;
|
||||
|
Reference in New Issue
Block a user