File tree Expand file tree Collapse file tree
microsphere-core/src/main/java/io/microsphere/classloading Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import org .slf4j .Logger ;
66import org .slf4j .LoggerFactory ;
77
8+ import javax .annotation .Nonnull ;
9+ import javax .annotation .Nullable ;
810import java .net .URL ;
911import java .util .Iterator ;
1012import java .util .LinkedHashSet ;
1416import java .util .StringJoiner ;
1517
1618import static io .microsphere .net .URLUtils .normalizePath ;
19+ import static io .microsphere .util .ClassLoaderUtils .getDefaultClassLoader ;
1720import static io .microsphere .util .ClassPathUtils .getBootstrapClassPaths ;
1821import static io .microsphere .util .ServiceLoaderUtils .loadServicesList ;
1922import static java .lang .System .getProperty ;
@@ -36,14 +39,14 @@ public class ArtifactDetector {
3639
3740 private static final List <ArtifactResolver > ARTIFACT_INFO_RESOLVERS = loadServicesList (ArtifactResolver .class , DEFAULT_CLASS_LOADER );
3841
39- private final ClassLoader classLoader ;
42+ private final @ Nonnull ClassLoader classLoader ;
4043
4144 public ArtifactDetector () {
4245 this (DEFAULT_CLASS_LOADER );
4346 }
4447
45- public ArtifactDetector (ClassLoader classLoader ) {
46- this .classLoader = classLoader ;
48+ public ArtifactDetector (@ Nullable ClassLoader classLoader ) {
49+ this .classLoader = classLoader == null ? getDefaultClassLoader () : classLoader ;
4750 }
4851
4952 public List <Artifact > detect () {
You can’t perform that action at this time.
0 commit comments