mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
style: enable NeedBraces in checkstyle (#5227)
* enable style NeedBraces * style: enable NeedBraces in checkstyle --------- Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:
committed by
GitHub
parent
51fcc66345
commit
87b17e0571
@@ -18,13 +18,19 @@ public final class ValidParentheses {
|
||||
stack[head++] = c;
|
||||
break;
|
||||
case '}':
|
||||
if (head == 0 || stack[--head] != '{') return false;
|
||||
if (head == 0 || stack[--head] != '{') {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case ')':
|
||||
if (head == 0 || stack[--head] != '(') return false;
|
||||
if (head == 0 || stack[--head] != '(') {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case ']':
|
||||
if (head == 0 || stack[--head] != '[') return false;
|
||||
if (head == 0 || stack[--head] != '[') {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected character: " + c);
|
||||
|
||||
Reference in New Issue
Block a user