Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "updated the checker framework version" #617

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static org.apache.calcite.linq4j.Nullness.castNonNullCheck;
import static org.apache.calcite.util.Static.RESOURCE;

import static org.checkerframework.checker.nullness.NullnessUtil.castNonNull;

/**
* Represents an INTERVAL qualifier.
*
Expand Down Expand Up @@ -817,7 +818,7 @@ private int[] evaluateIntervalLiteralAsDayToSecond(
}

if (hasFractionalSecond) {
secondFrac = normalizeSecondFraction(castNonNullCheck(m.group(5)));
secondFrac = normalizeSecondFraction(castNonNull(m.group(5)));
} else {
secondFrac = ZERO;
}
Expand Down Expand Up @@ -968,7 +969,7 @@ private int[] evaluateIntervalLiteralAsHourToSecond(
}

if (hasFractionalSecond) {
secondFrac = normalizeSecondFraction(castNonNullCheck(m.group(4)));
secondFrac = normalizeSecondFraction(castNonNull(m.group(4)));
} else {
secondFrac = ZERO;
}
Expand Down Expand Up @@ -1074,7 +1075,7 @@ private int[] evaluateIntervalLiteralAsMinuteToSecond(
}

if (hasFractionalSecond) {
secondFrac = normalizeSecondFraction(castNonNullCheck(m.group(3)));
secondFrac = normalizeSecondFraction(castNonNull(m.group(3)));
} else {
secondFrac = ZERO;
}
Expand Down Expand Up @@ -1142,7 +1143,7 @@ private int[] evaluateIntervalLiteralAsSecond(
}

if (hasFractionalSecond) {
secondFrac = normalizeSecondFraction(castNonNullCheck(m.group(2)));
secondFrac = normalizeSecondFraction(castNonNull(m.group(2)));
} else {
secondFrac = ZERO;
}
Expand Down Expand Up @@ -1246,7 +1247,7 @@ public int[] evaluateIntervalLiteral(String value, SqlParserPos pos,
}

private static BigDecimal parseField(Matcher m, int i) {
return new BigDecimal(castNonNullCheck(m.group(i)));
return new BigDecimal(castNonNull(m.group(i)));
}

private CalciteContextException invalidValueException(SqlParserPos pos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.List;
import java.util.Objects;

import static org.apache.calcite.linq4j.Nullness.castNonNullCheck;
import static org.checkerframework.checker.nullness.NullnessUtil.castNonNull;

/**
* Abstract implementation of {@link SqlValidatorNamespace}.
Expand Down Expand Up @@ -221,7 +221,7 @@ protected RelDataType toStruct(RelDataType type, @Nullable SqlNode unnest) {
}
return validator.getTypeFactory().builder()
.add(
castNonNullCheck(
castNonNull(
validator.deriveAlias(
Objects.requireNonNull(unnest, "unnest"),
0)),
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ org.owasp.dependencycheck.version=5.2.2
# docker-maven-plugin.version=1.2.0

# Tools
checkerframework.version=3.42.0
checkerframework.version=3.7.0
checkstyle.version=8.28
spotbugs.version=3.1.11
errorprone.version=2.4.0
Expand Down
7 changes: 0 additions & 7 deletions linq4j/src/main/java/org/apache/calcite/linq4j/Nullness.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,4 @@ private Nullness() {
//noinspection ConstantConditions
return (@NonNull T) ref;
}

@EnsuresNonNull({"#1"})
public static <T> T castNonNullCheck(T ref) {
assert ref != null : "Misuse of castNonNull: called with a null argument";

return ref;
}
}
Loading