Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Java 8 added support for static interfaces. This means that an invokestatic instruction may refer to either a CONSTANT_Methodref_info or a CONSTANT_InterfaceMethodref_info. See https://stackoverflow.com/questions/34360718/invokestatic-on-static-method-in-interface for a detailed explanation. Currently, if InstructionFactory.createInvoke sees an Const.INVOKEINTERFACE it generates an InterfaceMethodref and a Methodref otherwise. This is incorrect. I could not figure out any way to make the correct decision programmatically as the original instruction is not available. So I added an additional createInvoke method with a boolean argument that says whether or not to use an InterfaceMethodref. The semantics of the original createInvoke method are unchanged.