Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

x cannot be used as identifier as it is a keyword

Open milahu opened this issue 2 years ago • 1 comments

all decompilers fail on this method

    public synchronized void log(LogRecord record) {
    }

error: record cannot be used as identifier as it is a keyword

quickfix: rename to _record

milahu avatar Oct 04 '21 05:10 milahu

The decompilers are working correctly. The class probably was compiled with debug symbols and the variable was probably called record if compiled on an older JVM. I assume this is a compiler warning you've run into. If you're running Recaf with a newer JDK then javac will not like that the variable name is record. The assembler won't care though because at the bytecode level variables can be named anything.

In the config menu you can strip debug info, which should resolve the problem since decompilers will then determine their own variable names (Usually just camel case of the class name). But in the future, we could probably filter debug info like this to prevent some cases of this occurring. But it would be a bit more difficult to integrate things properly if name record appeared as a field or method name due to how the context systems work.

Col-E avatar Oct 04 '21 10:10 Col-E