RFR: 8295953: Use enhanced-for cycle instead of Enumeration in sun.security

Weijun Wang weijun at openjdk.org
Wed Oct 26 17:00:07 UTC 2022


On Thu, 20 Oct 2022 11:21:41 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java line 412:
>> 
>>> 410:                 ObjectIdentifier findOID = ObjectIdentifier.of(oid);
>>> 411:                 for (Extension ex : extensions.getAllExtensions()) {
>>> 412:                     ObjectIdentifier inCertOID = ex.getExtensionId();
>> 
>> Is the old `getElements` method still useful?
>
> It seems it's not used in current codebase anymore. Do you propose to drop it?

Re-read. Maybe not. A lot of other x509 classes have this `getElements` method and it seems the one you touched is the only actually used. This might be an obsolete convention and if we want to remove them we can remove them in another issue.

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

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



More information about the security-dev mailing list