ctubbsii commented on code in PR #102:
URL: https://github.com/apache/accumulo-access/pull/102#discussion_r2908746557
##########
modules/core/src/test/java/org/apache/accumulo/access/tests/AccessEvaluatorTest.java:
##########
@@ -156,9 +155,8 @@ private static void runTestCases(Access accumuloAccess,
TestDataSet testSet,
() -> accumuloAccess.newExpression(expression), expression);
assertThrows(InvalidAccessExpressionException.class,
() -> accumuloAccess.newParsedExpression(expression),
expression);
- break;
- default:
- throw new IllegalArgumentException();
+ }
+ default -> throw new IllegalArgumentException();
Review Comment:
In playing with this, I learned that exhaustiveness is only enforced for
expressions, like when you assign the result of a switch statement to a
variable or return it. However, if our switch statements are not exhaustive
over enums, then spotbugs will catch it, so I think it's fine to remove these
if they are exhaustive, even though that isn't necessarily enforced by the
compiler.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]