File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/java.base/share/classes/java/lang/module Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2015, 2020 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2015, 2022 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -213,9 +213,17 @@ default void release(ByteBuffer bb) {
213213 * when using the stream to list the module contents and access is denied
214214 * by the security manager. </p>
215215 *
216+ * <p> The returned stream may contain references to one or more open directories
217+ * in the module. The directories are closed by closing the stream. </p>
218+ *
216219 * <p> The behavior of the stream when used after the module reader is
217220 * closed is implementation specific and therefore not specified. </p>
218221 *
222+ * @apiNote
223+ * This method should be used within a try-with-resources statement or similar
224+ * control structure to ensure that any open directories referenced by the
225+ * stream are closed promptly after the stream's operations have completed.
226+ *
219227 * @return A stream of elements that are the names of all resources
220228 * in the module
221229 *
You can’t perform that action at this time.
0 commit comments