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

Conor Cleary ccleary at openjdk.java.net
Tue Apr 13 09:36:58 UTC 2021


On Mon, 12 Apr 2021 16:44:16 GMT, Aleksei Efimov <aefimov 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/javax/naming/ldap/StartTlsRequest.java line 223:
> 
>> 221:      */
>> 222:     private final ClassLoader getContextClassLoader() {
>> 223:         PrivilegedAction<ClassLoader> pa = () -> Thread.currentThread().getContextClassLoader();
> 
> We can use here an instance method reference to beautify code a little bit more:
> ```PrivilegedAction<ClassLoader> pa = Thread.currentThread()::getContextClassLoader;```

Good idea, also would fit in with the style of the method just after, `priviligedHasNext()` as that also uses a functional interface.

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

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


More information about the security-dev mailing list