Lambda analyse hack no more working in java 12

To bring errors in compile time I'm using java function references to refer object based queries. Since it is not possible to lookup the referenced function name (in fact a stupid behaviour) I was forced to use a hack to get the referenced name.

Now it looks like the hack and even no other way exists to get the function name in java 12 (and maybe in earlier versions). I tested the current openjdk12 against my tool and it looks like it's not working.

Therefore I switched the way to save my code consistency. The alternative way is to generate classes which are containing information about the existing function names.

A maven plugin analyses existing classes and generates new ones. The generated classes will only be updated if the content is changes. In this way it is possible to commit the classes to the software repository.

To switch your project you need to add the plugin configuration to your pom:


And mark the concerning classes with the annotation @GenerateConst rebuild the project to generate the new classes. The will be generated direct to the corresponding root class and add a underscore to the class name.

Use the static fields to refer the function names.


Beliebte Posts aus diesem Blog

Sonatype Nexus fails with random "peer not authenticated" errors behind ingress

Creating a flux sync configuration referring a config map for substitution

[mhus lib] Reorg in generation 7 nearly finished