Skip to content

Commit 92f83ea

Browse files
committed
HHH-18500 If superclass is null, class should not be enhanced, simply return empty collection
1 parent 5af1856 commit 92f83ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/PersistentAttributeTransformer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ private static Collection<AnnotatedFieldDescription> collectInheritPersistentFie
148148
}
149149
TypeDefinition managedCtSuperclass = managedCtClass.getSuperClass();
150150

151-
if ( enhancementContext.isEntityClass( managedCtSuperclass.asErasure() ) ) {
151+
// If managedCtSuperclass is null, managedCtClass can be either interface or module-info.
152+
// Interfaces are already filtered-out, and module-info does not have any fields to enhance
153+
// so we can safely return empty list.
154+
if ( managedCtSuperclass == null || enhancementContext.isEntityClass( managedCtSuperclass.asErasure() ) ) {
152155
return Collections.emptyList();
153156
}
154157
else if ( !enhancementContext.isMappedSuperclassClass( managedCtSuperclass.asErasure() ) ) {

0 commit comments

Comments
 (0)