Skip to content

Commit

Permalink
Don't cache URL connection when loading junit-platform.properties c…
Browse files Browse the repository at this point in the history
…ontents

See also https://bugs.openjdk.java.net/browse/JDK-8224794

Closes #2194

(cherry picked from commit 4359d97)
  • Loading branch information
sormuras committed Mar 20, 2020
1 parent 0dcbc71 commit edcbd81
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -12,6 +12,7 @@

import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -63,7 +64,9 @@ private static Properties fromClasspathResource(String configFileName) {
URL configFileUrl = resources.get(0);
logger.info(() -> String.format(
"Loading JUnit Platform configuration parameters from classpath resource [%s].", configFileUrl));
try (InputStream inputStream = configFileUrl.openStream()) {
URLConnection urlConnection = configFileUrl.openConnection();
urlConnection.setUseCaches(false);
try (InputStream inputStream = urlConnection.getInputStream()) {
props.load(inputStream);
}
}
Expand Down

0 comments on commit edcbd81

Please sign in to comment.