Skip to content

Commit

Permalink
CheckerFramework and ErrorProne fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
  • Loading branch information
mihaibudiu committed Sep 4, 2024
1 parent 258aa0a commit 8a651dd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion core/src/main/java/org/apache/calcite/util/Variant.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public boolean isVariantNull() {
return this.isVariantNull;
}

@Override public boolean equals(Object o) {
@Override public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
Expand Down Expand Up @@ -173,6 +173,9 @@ public boolean isVariantNull() {
// are printed with double quotes
// https://docs.snowflake.com/en/sql-reference/data-types-semistructured
quote = "\"";
break;
default:
break;
}
return quote + value + quote;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.calcite.util.rtti;

import org.checkerframework.checker.nullness.qual.Nullable;

/** Runtime type information about a base (primitive) SQL type. */
public class BasicSqlTypeRtti extends RuntimeTypeInformation {
private final int precision;
Expand All @@ -28,7 +30,7 @@ public BasicSqlTypeRtti(RuntimeSqlTypeName typeName, int precision, int scale) {
this.scale = scale;
}

@Override public boolean equals(Object o) {
@Override public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.calcite.util.rtti;

import org.checkerframework.checker.nullness.qual.Nullable;

import java.util.Arrays;

/** Runtime type information which contains some type parameters. */
Expand Down Expand Up @@ -55,7 +57,7 @@ public String getTypeString() {
return builder.toString();
}

@Override public boolean equals(Object o) {
@Override public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.calcite.util.rtti;

import org.checkerframework.checker.nullness.qual.Nullable;

import java.util.Arrays;
import java.util.Map;

Expand Down Expand Up @@ -49,7 +51,7 @@ public String getTypeString() {
return builder.toString();
}

@Override public boolean equals(Object o) {
@Override public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
Expand Down

0 comments on commit 8a651dd

Please sign in to comment.