Skip to content

Checkerframework fixes #10662

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

Merged
merged 3 commits into from
Jul 30, 2025
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id 'biz.aQute.bnd' version '7.1.0' apply false

id "com.diffplug.spotless" version "7.0.4"
id 'org.checkerframework' version '0.6.55'
id 'org.checkerframework' version '0.6.56'
id 'org.hibernate.orm.build.jdks'

id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
Expand Down
1 change: 1 addition & 0 deletions checkerstubs/jboss.logging.astub
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ public interface BasicLogger {

public interface Logger {
void tracev(String format, @Nullable Object param1);
void tracef(String format, @Nullable Object param1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,18 @@ public void applyConfiguredGraph(@Nullable Map<String,?> properties) {
loadHint = (RootGraphImplementor<?>) properties.get( GraphSemantic.LOAD.getJakartaHintName() );
}

if ( fetchHint != null || loadHint != null ) {
if ( fetchHint != null ) {
if ( loadHint != null ) {
// can't have both
throw new IllegalArgumentException(
"Passed properties contained both a LOAD and a FETCH graph which is illegal - " +
"only one should be passed"
);
}
applyGraph( fetchHint, GraphSemantic.FETCH );
}
else {
applyGraph( loadHint, GraphSemantic.LOAD );
if ( fetchHint != null ) {
if ( loadHint != null ) {
// can't have both
throw new IllegalArgumentException(
"Passed properties contained both a LOAD and a FETCH graph which is illegal - " +
"only one should be passed"
);
}
applyGraph( fetchHint, GraphSemantic.FETCH );
}
else if ( loadHint != null ) {
applyGraph( loadHint, GraphSemantic.LOAD );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.hibernate.sql.ast.tree.expression.QueryTransformer;
import org.hibernate.sql.ast.tree.predicate.Predicate;

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

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,15 @@ spotless {

tasks.compileJava.dependsOn tasks.spotlessJavaApply

dependencies {
compileOnly libs.checkerFramework
testCompileOnly libs.checkerFramework
checkerFramework libs.checkerFrameworkChecker
}

checkerFramework {
excludeTests = true
skipCheckerFramework = true
skipCheckerFramework = !gradle.startParameter.taskNames.contains("ciCheck")
checkers = [
'org.checkerframework.checker.nullness.NullnessChecker'
]
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dependencyResolutionManagement {
// WARNING: When upgrading to a version of bytebuddy that supports a new bytecode version,
// make sure to remove the now unnecessary net.bytebuddy.experimental=true in relevant CI jobs (Jenkinsfile).
def byteBuddyVersion = version "byteBuddy", "1.17.6"
def checkerFrameworkVersion = version "checkerFramework", "3.49.5"
def classmateVersion = version "classmate", "1.7.0"
def geolatteVersion = version "geolatte", "1.10"
def hibernateModelsVersion = version "hibernateModels", "1.0.1"
Expand All @@ -102,6 +103,9 @@ dependencyResolutionManagement {
library( "byteBuddy", "net.bytebuddy", "byte-buddy" ).versionRef( byteBuddyVersion )
library( "byteBuddyAgent", "net.bytebuddy", "byte-buddy-agent" ).versionRef( byteBuddyVersion )

library( "checkerFramework", "org.checkerframework", "checker-qual-android" ).versionRef( checkerFrameworkVersion )
library( "checkerFrameworkChecker", "org.checkerframework", "checker" ).versionRef( checkerFrameworkVersion )

library( "logging", "org.jboss.logging", "jboss-logging" ).versionRef( jbossLoggingVersion )
library( "loggingAnnotations", "org.jboss.logging", "jboss-logging-annotations" ).versionRef( jbossLoggingToolVersion )
library( "loggingProcessor", "org.jboss.logging", "jboss-logging-processor" ).versionRef( jbossLoggingToolVersion )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,12 @@ public static boolean isPrimitive(String paramType) {
public static final Set<String> PRIMITIVE_TYPES =
Set.of("boolean", "char", "long", "int", "short", "byte", "double", "float");

public static TypeMirror resolveTypeMirror(TypeElement typeElement, Element element, String name) {
public static @Nullable TypeMirror resolveTypeMirror(TypeElement typeElement, Element element, String name) {
final var mirrorMap = resolveTypeParameters( typeElement.asType(), element, Map.of(), new HashSet<>() );
return mirrorMap == null ? null : mirrorMap.get( name );
}

private static Map<String, TypeMirror> resolveTypeParameters(TypeMirror type, Element element, Map<String, TypeMirror> parametersMap, Collection<Element> visited) {
private static @Nullable Map<String, TypeMirror> resolveTypeParameters(TypeMirror type, Element element, Map<String, TypeMirror> parametersMap, Collection<Element> visited) {
if ( !(type instanceof DeclaredType declaredType
&& declaredType.asElement() instanceof TypeElement typeElement) ) {
return null;
Expand Down