nssalian commented on code in PR #17357:
URL: https://github.com/apache/iceberg/pull/17357#discussion_r3647291157
##########
AGENTS.md:
##########
@@ -94,6 +94,7 @@ The `api/` module has the strongest stability guarantees —
breaking changes ar
- Comments and Javadocs should describe the current behavior or contract, not
how it changed over time.
- `} else {` on same line. Minimize variable scope. `try-with-resources` for
all `AutoCloseable`.
- Prefer method references over lambdas. Wrap lines at the highest semantic
level.
+- Prefer switch expressions (`case X -> ...`) over statement switches; an
exhaustive enum switch needs no `default`.
Review Comment:
The current line only tells the agent half of it ("enum switch needs no
default") and could lead an agent to strip the default from a String switch.
Something like this might be complete:
```
Prefer switch expressions (case X -> ...) over statement switches. An
exhaustive enum switch needs no default. For
String/non-exhaustive switches, the required default should throw an
informative error (e.g. Unsupported X), not a generic one.
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]