I've discovered what exactly annotations have classes in the final app. I need it because these annotations are using by some jar transformations in building process, but it is another story.
So my question is why the java.lang.invoke.LambdaForm$Hidden annotation is runtime annotation? What component uses it? Why?
It is used by the JVM runtime to hide lambda related frames in the stacktrace. Take this example:
public class LambdaStackTrace
{
public static void main(String[] args) throws Exception
{
"a".chars().forEach(c -> {
new Error().printStackTrace();
});
}
}
It will produce this stacktrace:
java.lang.Error
at LambdaStackTrace.lambda$0(LambdaStackTrace.java:6)
at java.lang.CharSequence$1CharIterator.forEachRemaining(CharSequence.java:149)
at java.util.Spliterators$IntIteratorSpliterator.forEachRemaining(Spliterators.java:1908)
at java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:557)
at LambdaStackTrace.main(LambdaStackTrace.java:5)
But if look at the frame stack in a debugger it will show you an additional frame which has a @Hidden annotation:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With