Skip to content

Commit e615c29

Browse files
committed
Fix nullability problems
1 parent 78acc2e commit e615c29

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

checkerstubs/jboss.logging.astub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ public interface BasicLogger {
1010

1111
public interface Logger {
1212
void tracev(String format, @Nullable Object param1);
13+
void tracef(String format, @Nullable Object param1);
1314
}

hibernate-core/src/main/java/org/hibernate/engine/spi/EffectiveEntityGraph.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,18 @@ public void applyConfiguredGraph(@Nullable Map<String,?> properties) {
120120
loadHint = (RootGraphImplementor<?>) properties.get( GraphSemantic.LOAD.getJakartaHintName() );
121121
}
122122

123-
if ( fetchHint != null || loadHint != null ) {
124-
if ( fetchHint != null ) {
125-
if ( loadHint != null ) {
126-
// can't have both
127-
throw new IllegalArgumentException(
128-
"Passed properties contained both a LOAD and a FETCH graph which is illegal - " +
129-
"only one should be passed"
130-
);
131-
}
132-
applyGraph( fetchHint, GraphSemantic.FETCH );
133-
}
134-
else {
135-
applyGraph( loadHint, GraphSemantic.LOAD );
123+
if ( fetchHint != null ) {
124+
if ( loadHint != null ) {
125+
// can't have both
126+
throw new IllegalArgumentException(
127+
"Passed properties contained both a LOAD and a FETCH graph which is illegal - " +
128+
"only one should be passed"
129+
);
136130
}
131+
applyGraph( fetchHint, GraphSemantic.FETCH );
132+
}
133+
else if ( loadHint != null ) {
134+
applyGraph( loadHint, GraphSemantic.LOAD );
137135
}
138136
}
139137

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/FakeSqmToSqlAstConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.hibernate.sql.ast.tree.expression.QueryTransformer;
3030
import org.hibernate.sql.ast.tree.predicate.Predicate;
3131

32-
import jakarta.annotation.Nullable;
32+
import org.checkerframework.checker.nullness.qual.Nullable;
3333

3434
/**
3535
*

tooling/metamodel-generator/src/main/java/org/hibernate/processor/util/TypeUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,12 @@ public static boolean isPrimitive(String paramType) {
784784
public static final Set<String> PRIMITIVE_TYPES =
785785
Set.of("boolean", "char", "long", "int", "short", "byte", "double", "float");
786786

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

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

0 commit comments

Comments
 (0)