HHH-13859 Avoid attempting to index a module-info.class via Jandex
This commit is contained in:
parent
5defe54d31
commit
d3fdb657d6
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.boot.archive.scan.internal;
|
||||
|
||||
import org.hibernate.boot.archive.spi.ArchiveContext;
|
||||
import org.hibernate.boot.archive.spi.ArchiveEntry;
|
||||
import org.hibernate.boot.archive.spi.ArchiveEntryHandler;
|
||||
|
||||
public final class NoopEntryHandler implements ArchiveEntryHandler {
|
||||
|
||||
public static final ArchiveEntryHandler NOOP_INSTANCE = new NoopEntryHandler();
|
||||
|
||||
private NoopEntryHandler() {
|
||||
//Use the singleton.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEntry(ArchiveEntry entry, ArchiveContext context) {
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import java.net.URL;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.boot.archive.scan.internal.NoopEntryHandler;
|
||||
import org.hibernate.boot.archive.scan.internal.ScanResultCollector;
|
||||
import org.hibernate.boot.archive.spi.ArchiveContext;
|
||||
import org.hibernate.boot.archive.spi.ArchiveDescriptor;
|
||||
|
@ -132,6 +133,12 @@ public abstract class AbstractScannerImpl implements Scanner {
|
|||
if ( nameWithinArchive.endsWith( "package-info.class" ) ) {
|
||||
return packageEntryHandler;
|
||||
}
|
||||
else if ( nameWithinArchive.endsWith( "module-info.class" ) ) {
|
||||
//There's two reasons to skip this: the most important one is that Jandex
|
||||
//is unable to analyze them, so we need to dodge it.
|
||||
//Secondarily, we have no use for these so let's save the effort.
|
||||
return NoopEntryHandler.NOOP_INSTANCE;
|
||||
}
|
||||
else if ( nameWithinArchive.endsWith( ".class" ) ) {
|
||||
return classEntryHandler;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue