-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
When trying to convert the following sample class:
public class Main {
private static final Logger logger = LogManager.getLogger();
static public void main(String[] args) {
logger.debug(logger.getName());
}
}
A ConversionException is thrown:
org.apache.logging.log4j.weaver.ConversionException: Unsupported method 'org.apache.logging.log4j.Logger#getName'.
Based on the stack trace a located the bug to be in the LoggerConversionHandler
in the handleMethodInstruction
method.
It seems the default operation to an unplanned function is to throw exception instead of keeping the call as is. There is already a section in the switch for this kind of calls, so creating the NOP as the default will also remove a bit of bloat and support more functions. My suggestion is simple:
default:
// These are NOPs
mv.invokeInterface(LOGGER_TYPE, new Method(name, descriptor));
ppkarwasz
Metadata
Metadata
Assignees
Labels
No labels