mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8290316: Ensure that all directory streams are closed in java.base
Reviewed-by: chegar
This commit is contained in:
parent
db1e44c2dd
commit
53fc495e3a
5 changed files with 35 additions and 30 deletions
|
@ -86,6 +86,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
|
@ -1035,9 +1036,8 @@ public final class HijrahChronology extends AbstractChronology implements Serial
|
|||
AccessController.doPrivileged(
|
||||
(PrivilegedAction<Void>)() -> {
|
||||
if (Files.isDirectory(CONF_PATH)) {
|
||||
try {
|
||||
Files.list(CONF_PATH)
|
||||
.map(p -> p.getFileName().toString())
|
||||
try (Stream<Path> stream = Files.list(CONF_PATH)) {
|
||||
stream.map(p -> p.getFileName().toString())
|
||||
.filter(fn -> fn.matches("hijrah-config-[^\\.]+\\.properties"))
|
||||
.map(fn -> fn.replaceAll("(hijrah-config-|\\.properties)", ""))
|
||||
.forEach(idtype -> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue