nastra commented on code in PR #9134:
URL: https://github.com/apache/iceberg/pull/9134#discussion_r1406496932
##########
core/src/main/java/org/apache/iceberg/UpdateSnapshotReferencesOperation.java:
##########
@@ -106,40 +106,41 @@ public UpdateSnapshotReferencesOperation
replaceBranch(String name, long snapsho
return this;
}
- public UpdateSnapshotReferencesOperation replaceBranch(String name, String
source) {
- return replaceBranch(name, source, false);
+ public UpdateSnapshotReferencesOperation replaceBranch(String from, String
to) {
+ return replaceBranch(from, to, false);
}
- public UpdateSnapshotReferencesOperation fastForward(String name, String
source) {
- return replaceBranch(name, source, true);
+ public UpdateSnapshotReferencesOperation fastForward(String from, String to)
{
+ return replaceBranch(from, to, true);
}
private UpdateSnapshotReferencesOperation replaceBranch(
- String name, String source, boolean fastForward) {
- Preconditions.checkNotNull(name, "Target branch cannot be null");
- Preconditions.checkNotNull(source, "Source ref cannot be null");
- SnapshotRef sourceRef = updatedRefs.get(source);
- SnapshotRef refToUpdate = updatedRefs.get(name);
- Preconditions.checkArgument(refToUpdate != null, "Target branch does not
exist: %s", name);
- Preconditions.checkArgument(sourceRef != null, "Ref does not exist: %s",
source);
- Preconditions.checkArgument(refToUpdate.isBranch(), "Ref %s is a tag not a
branch", name);
+ String from, String to, boolean fastForward) {
+ Preconditions.checkNotNull(from, "Branch to update cannot be null");
Review Comment:
I think we're a little inconsistent here in terms of null checking (throwing
NPE vs IAE) but I guess that's out-of-scope for this PR, so just wanted to
mention that
--
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]