Repository navigation
Conversation
Converts the statement-form switch blocks in iceberg-api to expression form, clearing the 89 StatementSwitchToExpressionSwitch ErrorProne warnings the module emits and removing the risk of accidental fall-through in the converted code.
uros-b
left a comment
There was a problem hiding this comment.
I first spotted this in api/src/main/java/org/apache/iceberg/types/TypeUtil.java, but after a full API module sweep, it seems there are many occurrences... Perhaps this can be split up into a few PRs instead of doing all at once; or if it's too invasive, we can drop the changes altogether - WDYT @szehon-ho?
|
cc @huaxingao |
|
cc @nastra |
|
#16881 did this and we reverted based on the discussion that we should do this individually as PRs go in rather than 1 full sweep. |
|
@nssalian do you have any thoughts about the alternative approach with a couple of PRs? the aim is to eventually reach a holistic state of improved code across the repo, but we don't have to do all at once, we can do it in parts instead |
|
cc @szehon-ho |
|
@uros-b The community consensus in the other PR I mentioned is that we don't create one-off PRs for these changes, since they're sometimes cosmetic and touch a large surface area of code at once. My understanding was that these changes would go in as part of other PRs that might be features/bug fixes, and reviewers would use their discretion while reviewing and merging. I'll defer to @szehon-ho and @RussellSpitzer |
|
Thank you for the input @nssalian, I don't have any strong opinion here, just looking for the best way to scope clearing the 89 existing |
|
On another note, these are already big changes touching a lot of files, so I'm not sure whether mixing them with feature work would really help... I think that would probably make it even more messy. Also, I would be happy to close these PRs if the maintainers suggest so, but in that case - why don't we also disable the Right now it seems like a bit of a conundrum, we have repo wide warnings in place for a known issue that we're not acting on. Seems like we should be able to figure out a good way forward to either resolve these warnings or get rid of them |
I should clarify: I meant modifying just the surface of the code that new features/ fixes add. Not addressing all at once. Again, this was left to reviewer/maintainer discretion while reviewing the code changes. The whole idea was not to do this in one go. I don't think there was objection to doing the changes themselves.
This might be a good intermediate solution. I do think we should do a pass and figure out how to add newer JDK features - records, switch statements as a community overall, but that's a larger discussion. @uros-b there are past threads on this; feel free to restart them or start a new topic so we can discuss it on the mailing list. |
|
@RussellSpitzer @szehon-ho what are your thoughts here? |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Converts the statement-form switch blocks in iceberg-api to expression form, clearing the 89
StatementSwitchToExpressionSwitchErrorProne warnings the module emits and removing the risk of accidental fall-through in the converted code.