Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message shows inner class name instead of file name #217

Open
archiecobbs opened this issue Oct 19, 2023 · 1 comment
Open

Error message shows inner class name instead of file name #217

archiecobbs opened this issue Oct 19, 2023 · 1 comment

Comments

@archiecobbs
Copy link

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.

@gaul
Copy link
Owner

gaul commented Oct 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants