On Mon, 25 Aug 2025 13:19:29 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

> Can I please get a review of this trivial change to the 
> `ModuleDescriptor.packages()` method's specification?
> 
> The change here clarifies that this method returns all packages that belong 
> to the module and not just those that are exported or open. This 
> clarification should help avoid any confusion that may have been caused by 
> the second paragraph in that method's specification which talks about 
> exported and open packages.
> 
> This updated specification matches the existing implementation of this method.
> 
> I believe this will require a CSR, which I'll create shortly.

src/java.base/share/classes/java/lang/module/ModuleDescriptor.java line 1519:

> 1517: 
> 1518:     /**
> 1519:      * Returns the set of all packages in the module.

We changed this from "Returns the names of all packages in this module" to 
"Returns the set of packages in the module" as part of JDK-8173393 in JDK 9 
[1]. This was a large update and I can't recall if there was a reason to drop 
"all" at the time. Looking at the API docs now, I think it's useful to say "all 
packages".  It can use `{@return ..}` as Chen suggests. I think it might be 
clearer if we just dropped the second paragraph, it's not needed. (I think this 
second paragraph may date when when there was a method to get the 
concealed/non-exported packages).

[1] https://hg.openjdk.org/jdk9/jdk9/jdk/rev/1c8f054f6278

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26928#discussion_r2298608735

Reply via email to