mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8373699: JLink: ModuleReader should be closed in JlinkTask.getReleaseInfo(mref)
Reviewed-by: alanb
This commit is contained in:
parent
67beb9cd81
commit
b42861a2aa
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -248,8 +248,8 @@ public class JlinkTask {
|
|||||||
* Read the release.txt from the module.
|
* Read the release.txt from the module.
|
||||||
*/
|
*/
|
||||||
private static Optional<String> getReleaseInfo(ModuleReference mref) {
|
private static Optional<String> getReleaseInfo(ModuleReference mref) {
|
||||||
try {
|
try (var moduleReader = mref.open()) {
|
||||||
Optional<InputStream> release = mref.open().open(JDK_RELEASE_RESOURCE);
|
Optional<InputStream> release = moduleReader.open(JDK_RELEASE_RESOURCE);
|
||||||
|
|
||||||
if (release.isEmpty()) {
|
if (release.isEmpty()) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user