Skip to content

Commit 2fba7fa

Browse files
committed
fix(parser): add default case to the ColumnsTransformer type switch
Satisfies the PMD exhaustive-switch rule (Codacy '1 new issue') and fails loudly if a future ColumnsTransformerType constant is added without updating appendTo; unreachable for the current APPLY/EXCEPT/REPLACE constants, so behavior is unchanged. Same pattern as JsonFunction's Unhandled JsonOnResponseBehavior guard. Signed-off-by: 付典 <fudianchn@gmail.com>
1 parent 6f1ae6d commit 2fba7fa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/net/sf/jsqlparser/expression/ColumnsTransformer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public StringBuilder appendTo(StringBuilder builder) {
8484
case REPLACE:
8585
builder.append("REPLACE(").append(Select.getStringList(replaceItems)).append(")");
8686
break;
87+
default:
88+
throw new IllegalStateException("Unhandled ColumnsTransformerType: " + type);
8789
}
8890
return builder;
8991
}

0 commit comments

Comments
 (0)