RFR: 8370688: java.util.jar.JarEntry.getCodeSigners() and getCertificates() should specify that they return a copy of the arrays
Chen Liang
liach at openjdk.org
Tue Dec 2 22:20:55 UTC 2025
On Tue, 2 Dec 2025 20:28:50 GMT, Koushik Muthukrishnan Thirupattur <duke at openjdk.org> wrote:
> The implementation of JarEntry.getCodeSigners() and getCertificates() both return a copy of the original array. However, the documentation of these 2 methods currently doesn't specify this.
I don't think we need to go this far as to add a new paragraph. Looking at examples like `Class::getMethods`, I think we can just change the first sentences of "Returns the ... objects" to "Returns an array containing the ... objects", which means the returned array is not the same as the underlying storage format.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28615#issuecomment-3604141759
More information about the core-libs-dev
mailing list