I have two cases, both in different packages:
First (package firstCase;)
Implementation of the functional interface MyInterface with a method in the body of which there is a call with a lambda of the functional interface of the same type MyInterface.
package firstCase;
public class InterfaceSource implements MyInterface {
@Override
public void testMethod() {
InterfaceDest.someSimilarUsingOfMyInterface(()->{
;
});
}
}
As a result, Proguard retains the former name of the method.
Second (package secondCase;)
Implementation of the functional interface MyInterface with a method in the body of which there is nothing.
package secondCase;
public class InterfaceSource implements MyInterface {
@Override
public void testMethod() {
;
}
}
As a result, Proguard changes the name of the method.
Mappings:
firstCase.InterfaceDest -> pkg.a:
void <init>() -> <init>
void someSimilarUsingOfMyInterface(firstCase.MyInterface) -> a
firstCase.InterfaceSource -> pkg.b:
void <init>() -> <init>
void testMethod() -> testMethod <<<<<<<<<<<<<<<<
void lambda$testMethod$0() -> a
firstCase.MyInterface -> pkg.c:
void testMethod() -> testMethod
main.Main -> main.Main:
void <init>() -> <init>
void main(java.lang.String[]) -> main
secondCase.InterfaceSource -> pkg.d:
void <init>() -> <init>
void testMethod() -> a <<<<<<<<<<<<<<<<
secondCase.MyInterface -> pkg.e:
void testMethod() -> a
Config:
-injars /test/in.zip
-outjars /test/out.zip
-libraryjars /test/jdk1.8.0_281/jre/lib/rt.jar
-dontshrink
-dontoptimize
-printmapping /test/pg.map
-repackageclasses pkg
-printconfiguration /test/pg.cfg
-keepclasseswithmembers,includedescriptorclasses,includecode class ***Main*** {
*** ***(...);
}
Full code: GitHub - numerolog/pg-naming-doubt
Question: Is that how it should be?
Thanks.