RFR: 8048199: Replace anonymous inner classes with lambdas, where applicable, in JNDI [v2]

YassinHajaj github.com+18174180+yassinhajaj at openjdk.java.net
Sun Apr 25 09:48:38 UTC 2021


On Mon, 12 Apr 2021 16:12:17 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Conor Cleary has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Update copyright headers
>>  - Tidied up lambdas
>
> src/java.naming/share/classes/com/sun/jndi/ldap/LdapPoolManager.java line 400:
> 
>> 398:     private static final String getProperty(final String propName, final String defVal) {
>> 399:         PrivilegedAction<String> pa = () -> System.getProperty(propName, defVal);
>> 400:         return AccessController.doPrivileged(pa);
> 
> Hmmm... This is not strictly equivalent but will work because java.naming is loaded by the boot loader and has the permission to read all system properties. I guess the code on the left-hand side was written at a time where JNDI was still in a stand-alone library?

@dfuch I noticed the same about the swallowed exception that returns the default value. This wouldn't cause any regression?

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

PR: https://git.openjdk.java.net/jdk/pull/3416


More information about the security-dev mailing list