modernizer-maven-plugin
modernizer-maven-plugin copied to clipboard
Error message shows inner class name instead of file name
I got an error report that looked like this (slightly cleaned up):
[INFO] --- modernizer:2.7.0:modernizer (modernizer) @ permazen-kv-simple ---
[ERROR] .../io/permazen/kv/simple/SimpleKVDatabase$1.java:269: Prefer Stream.filter(type::isInstance).map(type::cast)
[ERROR] .../io/permazen/kv/simple/SimpleKVDatabase$1.java:273: Prefer Stream.filter(type::isInstance).map(type::cast)
[ERROR] .../io/permazen/kv/simple/SimpleKVDatabase$1.java:273: Prefer Stream.map(java.util.function.Function<? super T, ? extends R>)
Notice that the error message shows the inner class name instead of the source file name, then a line number.
Obviously there is no file named SimpleKVDatabase$1.java .. It should just be SimpleKVDatabase.java.
ModernizerMojo.recurseFiles looks like it does some string munging on the name local variable. Could you investigate stripping the trailing inner class designation?