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

Conor Cleary ccleary at openjdk.java.net
Tue Apr 13 10:04:19 UTC 2021


> ### Description
> This fix is part of a previous effort to both cleanup/modernise JNDI code, the details of which can be seen in [JDK-8048091](https://bugs.openjdk.java.net/browse/JDK-8048091). A number JNDI methods under `java.naming` use Anonymous Inner Classes in cases where only a single object unique to the requirements of the method is used. The issues these occurrences of AICs cause are highlighted below.
> 
> - AICs, in the cases concerned with this fix, are used where only one operation is required. While AICs can be useful for more complex implementations (using interfaces, multiple methods needed, local fields etc.), Lambdas are better suited here as they result in a more readable and concise solution.
> 
> ### Fixes
> - Where applicable, occurrences of AICs were replaced with lambdas to address the issues above resulting primarily in more readable/concise code.

Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:

  8048199: Cleaner syntak in getContextClassLoader

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3416/files
  - new: https://git.openjdk.java.net/jdk/pull/3416/files/840ea35c..5d6ecd31

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3416&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3416&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3416.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3416/head:pull/3416

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


More information about the security-dev mailing list