File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
junit-platform-launcher/src/main/java/org/junit/platform/launcher/core Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1414import java .net .URL ;
1515import java .net .URLConnection ;
1616import java .util .Collections ;
17- import java .util .List ;
17+ import java .util .HashSet ;
1818import java .util .Map ;
1919import java .util .Optional ;
2020import java .util .Properties ;
21+ import java .util .Set ;
2122
2223import org .junit .platform .commons .logging .Logger ;
2324import org .junit .platform .commons .logging .LoggerFactory ;
@@ -52,7 +53,7 @@ private static Properties fromClasspathResource(String configFileName) {
5253
5354 try {
5455 ClassLoader classLoader = ClassLoaderUtils .getDefaultClassLoader ();
55- List <URL > resources = Collections .list (classLoader .getResources (configFileName ));
56+ Set <URL > resources = new HashSet <>( Collections .list (classLoader .getResources (configFileName ) ));
5657
5758 if (!resources .isEmpty ()) {
5859 if (resources .size () > 1 ) {
@@ -61,7 +62,7 @@ private static Properties fromClasspathResource(String configFileName) {
6162 resources .size (), configFileName ));
6263 }
6364
64- URL configFileUrl = resources .get (0 );
65+ URL configFileUrl = resources .iterator (). next (); // same as List# get(0)
6566 logger .info (() -> String .format (
6667 "Loading JUnit Platform configuration parameters from classpath resource [%s]." , configFileUrl ));
6768 URLConnection urlConnection = configFileUrl .openConnection ();
You can’t perform that action at this time.
0 commit comments