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 9348883695..561c0f8f64 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 @@ -41,9 +41,11 @@ public class ClassFileArchiveEntryHandler implements ArchiveEntryHandler { }; private final ScanResultCollector resultCollector; + private final Indexer indexer; public ClassFileArchiveEntryHandler(ScanResultCollector resultCollector) { this.resultCollector = resultCollector; + this.indexer = new Indexer(); } @Override @@ -60,7 +62,6 @@ public class ClassFileArchiveEntryHandler implements ArchiveEntryHandler { private ClassDescriptor toClassDescriptor(ArchiveEntry entry) { try (InputStream inputStream = entry.getStreamAccess().accessInputStream()) { - Indexer indexer = new Indexer(); ClassSummary classSummary = indexer.indexWithSummary( inputStream ); Index index = indexer.complete(); return toClassDescriptor( classSummary, index, entry );