Re: RFR: 8290316: Ensure that all directory streams are closed in java.base [v2]

2022-07-16 Thread Chris Hegarty
On Sat, 16 Jul 2022 03:35:06 GMT, Bernd  wrote:

>> Ryan Ernst has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   address formatting feedback
>
> src/java.base/share/classes/java/time/chrono/HijrahChronology.java line 1041:
> 
>> 1039: try (Stream stream = Files.list(CONF_PATH)) {
>> 1040: stream.map(p -> p.getFileName().toString())
>> 1041: .filter(fn -> 
>> fn.matches("hijrah-config-[^\\.]+\\.properties"))
> 
> BTW Should this use RESOURCE_PREFIX/SUFFIX and is the \\ inside [character 
> class] suppose to quote the .?

@ecki this seems orthogonal to this particular issue. Maybe it could be 
considered separately, if needed.

-

PR: https://git.openjdk.org/jdk/pull/9518


Re: RFR: 8290316: Ensure that all directory streams are closed in java.base [v2]

2022-07-16 Thread Chris Hegarty
On Fri, 15 Jul 2022 19:33:56 GMT, Ryan Ernst  wrote:

>> This commit guards uses of Files methods returning path streams in
>> java.base to use try-with-resources.
>
> Ryan Ernst has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   address formatting feedback

Changes requested by chegar (Reviewer).

src/java.base/share/classes/jdk/internal/jrtfs/ExplodedImage.java line 262:

> 260: p = module.relativize(p);
> 261: String pkgName = slashesToDots(p.toString());
> 262: // skip META-INFO and empty strings

Trivially, while here can we fix this typo, META-INFO <- drop the `O`

src/java.base/share/classes/jdk/internal/jrtfs/ExplodedImage.java line 271:

> 269: moduleNames.add(moduleName);
> 270: }
> 271: });

There is a missing closing curly brace here (which should come on the next 
line), but otherwise looks fine.

src/java.base/share/classes/jdk/internal/module/ModulePatcher.java line 138:

> 136: stream.filter(path -> (!isAutomatic
> 137: || path.toString().endsWith(".class"))
> 138: && !isHidden(path))

Trivially, can the indentation of the two boolean operators be pushed in so 
that they align underneath the lambda parameter.

-

PR: https://git.openjdk.org/jdk/pull/9518


Re: RFR: 8290316: Ensure that all directory streams are closed in java.base [v2]

2022-07-15 Thread Bernd
On Fri, 15 Jul 2022 19:33:56 GMT, Ryan Ernst  wrote:

>> This commit guards uses of Files methods returning path streams in
>> java.base to use try-with-resources.
>
> Ryan Ernst has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   address formatting feedback

src/java.base/share/classes/java/time/chrono/HijrahChronology.java line 1041:

> 1039: try (Stream stream = Files.list(CONF_PATH)) {
> 1040: stream.map(p -> p.getFileName().toString())
> 1041: .filter(fn -> 
> fn.matches("hijrah-config-[^\\.]+\\.properties"))

BTW Should this use RESOURCE_PREFIX/SUFFIX and is the \\ inside [character 
class] suppose to quote the .?

-

PR: https://git.openjdk.org/jdk/pull/9518


Re: RFR: 8290316: Ensure that all directory streams are closed in java.base [v2]

2022-07-15 Thread Ryan Ernst
> This commit guards uses of Files methods returning path streams in
> java.base to use try-with-resources.

Ryan Ernst has updated the pull request incrementally with one additional 
commit since the last revision:

  address formatting feedback

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/9518/files
  - new: https://git.openjdk.org/jdk/pull/9518/files/bba7406f..c0a09f91

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=9518=01
 - incr: https://webrevs.openjdk.org/?repo=jdk=9518=00-01

  Stats: 25 lines in 4 files changed: 3 ins; 4 del; 18 mod
  Patch: https://git.openjdk.org/jdk/pull/9518.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9518/head:pull/9518

PR: https://git.openjdk.org/jdk/pull/9518