StringToString should ignore method references
A source code analyzer
Brought to you by:
adangel,
juansotuyo
The rule should not be triggered when a toString() is passed as a method reference. In general a method reference is preferred to an ad hoc lambda by having shorter byte code and potential for future JVM optimizations.
void log(Supplier<string> msg) { ... }
log("abc"::toString); // fails rule
log(() -> "abc"); // passes rule</string>
This will be fixed with PMD 5.3.4.
Commit: https://github.com/pmd/pmd/commit/3abfc2fccb1ab76f2ec4f8f64c252f81adb1949c