From 99da69fdc1c0d3826de39732e426060a557df141 Mon Sep 17 00:00:00 2001 From: franz1981 Date: Wed, 12 Apr 2023 13:34:52 +0200 Subject: [PATCH] HHH-16462 Share the same Jandex Indexer while indexing different files --- .../boot/archive/scan/spi/ClassFileArchiveEntryHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 );