diff --git a/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/ClassFileArchiveEntryHandler.java b/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/ClassFileArchiveEntryHandler.java index 8679accff6c2..a4866f1a3ce0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/ClassFileArchiveEntryHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/ClassFileArchiveEntryHandler.java @@ -61,8 +61,9 @@ public void handleEntry(ArchiveEntry entry, ArchiveContext context) { private ClassDescriptor toClassDescriptor(ArchiveEntry entry) { try (InputStream inputStream = entry.getStreamAccess().accessInputStream()) { Indexer indexer = new Indexer(); - ClassInfo classInfo = indexer.index( inputStream ); + indexer.index( inputStream ); Index index = indexer.complete(); + ClassInfo classInfo = index.getKnownClasses().iterator().next(); return toClassDescriptor( classInfo, index, entry ); } catch (IOException e) {