Skip to content

Commit

Permalink
Enable ErrorProne TraditionalSwitchExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Oct 2, 2024
1 parent a8f9783 commit 91ad77f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,10 @@ private QualifiedName qualifyName(QualifiedName table)
{
List<String> tableParts = table.getParts();
return switch (tableParts.size()) {
case 1:
yield QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), defaultSchema.orElseThrow(this::unsetDefaultExceptionSupplier), tableParts.getFirst());
case 2:
yield QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), tableParts.getFirst(), tableParts.get(1));
case 3:
default:
yield QualifiedName.of(tableParts.getFirst(), tableParts.get(1), tableParts.get(2));
case 1 -> QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), defaultSchema.orElseThrow(this::unsetDefaultExceptionSupplier), tableParts.getFirst());
case 2 -> QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), tableParts.getFirst(), tableParts.get(1));
case 3 -> QualifiedName.of(tableParts.getFirst(), tableParts.get(1), tableParts.get(2));
default -> throw new RequestParsingException("Unexpected table name: " + table.getParts());
};
}

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
-Xep:JavaTimeDefaultTimeZone:ERROR \
-Xep:MissingOverride:ERROR \
-Xep:StringCaseLocaleUsage:ERROR \
-Xep:TraditionalSwitchExpression:ERROR \
-Xep:UnnecessaryParentheses:ERROR \
-Xep:UnusedMethod:ERROR \
-Xep:UnusedVariable:ERROR</arg>
Expand Down

0 comments on commit 91ad77f

Please sign in to comment.