RFR: JDK-8292498: java/lang/invoke/lambda/LogGeneratedClassesTest.java failed with "AssertionError: only show error once expected [1] but found [0]" [v2]

Joe Darcy darcy at openjdk.org
Thu Aug 18 16:12:26 UTC 2022


On Thu, 18 Aug 2022 15:23:40 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> > Stupid question: it seems none of these lambdas/anonymous classes capture any parameters, all are stateless, and several seems to be identical. Would it make the code cleaner to use static inner classes?
> 
> Keeping the source for the function/body close to or nested in the declaration of each enum is very desirable.

Yes, the enum's method was coded in approximately this way to help with maintenance and readability. If this proves to be troublesome over time, there are harder-to-read/understand refactorings that could be used instead.

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

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


More information about the core-libs-dev mailing list