How to read this line in Java stack trace?

The stack is more complicated with lambda (note that the line number is lost due to obstruction). What does “access to $ lambda $ 12” really mean, and is there a way to find this in code without knowing the actual line number?

at com.group.RKGroup.com.my.MyClass access$lambda$12(com.group.RKGroup,int,com.my.PType) (RKGroup.java:43324)

The line number is useless because this stack trace was limited to Proguard.

+4
source share
2 answers

It looks like lambdainside a method, but ...

javacdoes not generate such names (next to this, but not this). javac(even if it is never specified) generates them as

lambda$<method-name-where-used>$<incremental-number>

Or if you have something like this:

List<Integer> r = Stream.of(1).map(x -> x).collect(Collectors.toList());
lambda$new$<incremental-number> 

, (access), retro-lambda android. IIRC , , , access -, 12- . , IIRC, - .

+1

, ​​ access. , 12- ... .

, - .

, , void [sic] . , .

, , , - -.

trace . , . , . - - .

+3

Source: https://habr.com/ru/post/1693989/


All Articles