HHH-16462 Share the same Jandex Indexer while indexing different files

This commit is contained in:
franz1981 2023-04-12 13:34:52 +02:00 committed by Christian Beikov
parent eece96bb12
commit 99da69fdc1
1 changed files with 2 additions and 1 deletions

View File

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