HHH-15274 Field LazyAttributeLoadingInterceptor#lazyFields can never be null

This commit is contained in:
Sanne Grinovero 2022-05-14 17:07:21 +01:00 committed by Sanne Grinovero
parent 8e78a61bcc
commit f2ac89a484
2 changed files with 3 additions and 2 deletions

View File

@ -125,7 +125,7 @@ public class LazyAttributeLoadingInterceptor extends AbstractLazyLoadInterceptor
}
private boolean isLazyAttribute(String fieldName) {
return lazyFields == null || lazyFields.contains( fieldName );
return lazyFields.contains( fieldName );
}
private boolean isInitializedLazyField(String fieldName) {
@ -133,7 +133,7 @@ public class LazyAttributeLoadingInterceptor extends AbstractLazyLoadInterceptor
}
public boolean hasAnyUninitializedAttributes() {
if ( lazyFields == null || lazyFields.isEmpty() ) {
if ( lazyFields.isEmpty() ) {
return false;
}

View File

@ -312,6 +312,7 @@ public final class CollectionHelper {
* The returned Set might be immutable, but there is no guarantee of this:
* consider it immutable but don't rely on this.
* The goal is to save memory.
* @return will never return null, but might return an immutable collection.
*/
public static <T> Set<T> toSmallSet(Set<T> set) {
switch ( set.size() ) {