Skip to content

Commit

Permalink
API, Core: Fix errorprone warnings (apache#9419)
Browse files Browse the repository at this point in the history
* API, Core: Fix errorprone warnings

* Address comments

* Remove comment
  • Loading branch information
ajantha-bhat authored and geruh committed Jan 25, 2024
1 parent 4ba2e48 commit c09e6cf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public void clear() {
wrapperSet.clear();
}

@SuppressWarnings("CollectionUndefinedEquality")
@Override
public boolean equals(Object other) {
if (this == other) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public CharSequence get() {
}

@Override
@SuppressWarnings("UndefinedEquals")
public boolean equals(Object other) {
if (this == other) {
return true;
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/apache/iceberg/DeleteFileIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ private DeleteFile[] findEqPartitionDeletes(long seq, DataFile dataFile) {
return deletes == null ? EMPTY_DELETES : deletes.filter(seq, dataFile);
}

@SuppressWarnings("CollectionUndefinedEquality")
private DeleteFile[] findPathDeletes(long seq, DataFile dataFile) {
if (posDeletesByPath == null) {
return EMPTY_DELETES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static <P, T> T visitUnion(
// types match according to the following pattern:
// Before NULL, branch type i in the union maps to struct field i + 1.
// After NULL, branch type i in the union maps to struct field i.
int structFieldIndex = (encounteredNull) ? i : i + 1;
int structFieldIndex = encounteredNull ? i : i + 1;
if (types.get(i).getType() == Schema.Type.NULL) {
visit(visitor.nullType(), types.get(i), visitor);
encounteredNull = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ private DeleteWriteResult writeFileDeletes() throws IOException {
return new DeleteWriteResult(deleteFiles, referencedDataFiles);
}

@SuppressWarnings("CollectionUndefinedEquality")
private DeleteWriteResult writeDeletes(Collection<CharSequence> paths) throws IOException {
FileWriter<PositionDelete<T>, DeleteWriteResult> writer = writers.get();

Expand Down

0 comments on commit c09e6cf

Please sign in to comment.