modernizer-maven-plugin icon indicating copy to clipboard operation
modernizer-maven-plugin copied to clipboard

Error message shows inner class name instead of file name

Open archiecobbs opened this issue 2 years ago • 1 comments

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.

archiecobbs avatar Oct 19 '23 15:10 archiecobbs

ModernizerMojo.recurseFiles looks like it does some string munging on the name local variable. Could you investigate stripping the trailing inner class designation?

gaul avatar Oct 20 '23 02:10 gaul