I want to keep argument names of interface methods after compilation in Java.
Below is an example.
Before compiling:
interface IFoo {
void hello(String what);
}
After compiling using javac -g:vars IFoo.java
interface IFoo {
void hello(String str);
}
The argument what
is renamed to str
.
How can I keep the argument names?
You need to generate debugging information when compiling.
This is what the Javac option -g
does:
-g
— Generates all debugging information, including local variables.
If you are using Maven, you can set <debug>true</debug>
in the compiler plugin's configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With