Skip ModuleFinder#ofSystem usage on native
gh-28506 introduces a big footprint regression on native, so it should for now be skipped when compiling to native images. Such support could potentially be re-introduced via gh-29081. Closes gh-29183
This commit is contained in:
parent
39208eaccd
commit
23a58e6bab
|
@ -48,6 +48,7 @@ import java.util.zip.ZipException;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import org.springframework.core.NativeDetector;
|
||||||
import org.springframework.core.io.DefaultResourceLoader;
|
import org.springframework.core.io.DefaultResourceLoader;
|
||||||
import org.springframework.core.io.FileSystemResource;
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
|
@ -191,6 +192,7 @@ import org.springframework.util.StringUtils;
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
|
* @author Sebastien Deleuze
|
||||||
* @since 1.0.2
|
* @since 1.0.2
|
||||||
* @see #CLASSPATH_ALL_URL_PREFIX
|
* @see #CLASSPATH_ALL_URL_PREFIX
|
||||||
* @see org.springframework.util.AntPathMatcher
|
* @see org.springframework.util.AntPathMatcher
|
||||||
|
@ -206,8 +208,10 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
|
||||||
* @since 6.0
|
* @since 6.0
|
||||||
* @see #isNotSystemModule
|
* @see #isNotSystemModule
|
||||||
*/
|
*/
|
||||||
private static final Set<String> systemModuleNames = ModuleFinder.ofSystem().findAll().stream()
|
private static final Set<String> systemModuleNames = NativeDetector.inNativeImage() ? Collections.emptySet() :
|
||||||
.map(moduleReference -> moduleReference.descriptor().name()).collect(Collectors.toSet());
|
ModuleFinder.ofSystem().findAll().stream()
|
||||||
|
.map(moduleReference -> moduleReference.descriptor().name())
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link Predicate} that tests whether the supplied {@link ResolvedModule}
|
* {@link Predicate} that tests whether the supplied {@link ResolvedModule}
|
||||||
|
|
Loading…
Reference in New Issue