Skip to content

Commit f515b02

Browse files
committed
Remove useless try / catch
1 parent 930c3a3 commit f515b02

File tree

1 file changed

+2
-5
lines changed
  • android-plugin/src/main/java/io/ecocode/java/checks/environment/sobriety

1 file changed

+2
-5
lines changed

android-plugin/src/main/java/io/ecocode/java/checks/environment/sobriety/TorchFreeRule.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ public String getMessage() {
4343

4444
@Override
4545
protected void checkConstantValue(Optional<Object> optionalConstantValue, Tree reportTree, Object constantValueToCheck) {
46-
try {
47-
if (optionalConstantValue.isPresent() && (optionalConstantValue.get().equals(constantValueToCheck) || ((Boolean) optionalConstantValue.get()))) {
48-
reportIssue(reportTree, getMessage());
49-
}
50-
} catch (Exception ignored) {
46+
if (optionalConstantValue.isPresent() && (optionalConstantValue.get().equals(constantValueToCheck) || ((Boolean) optionalConstantValue.get()))) {
47+
reportIssue(reportTree, getMessage());
5148
}
5249
}
5350

0 commit comments

Comments
 (0)