Class InvokespecialAgent
- java.lang.Object
-
- org.eolang.opeo.decompilation.agents.InvokespecialAgent
-
- All Implemented Interfaces:
DecompilationAgent
public final class InvokespecialAgent extends Object implements DecompilationAgent
Invokespecial instruction handler.- Since:
- 0.1
- To do:
- #229:90min Is Labeled Class an Abstraction Failure?
As you can see in
InvokespecialAgentwe use many 'instanceof' checks. This is a clear sign that the class hierarchy is not well designed. The original problem lies in theLabeledclass. We need to find more elegant solutions to handle labels in AST. - Suppressed Checkstyle violations:
- NoJavadocForOverriddenMethodsCheck (500 lines), MultilineJavadocTagsCheck (500 lines)
-
-
Constructor Summary
Constructors Constructor Description InvokespecialAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappropriate(DecompilerState state)Check if the agent is suitable for the current state.voidhandle(DecompilerState state)Handle invokespecial instruction.org.eolang.opeo.decompilation.agents.Supportedsupported()Supported opcodes.
-
-
-
Method Detail
-
appropriate
public boolean appropriate(DecompilerState state)
Description copied from interface:DecompilationAgentCheck if the agent is suitable for the current state.- Specified by:
appropriatein interfaceDecompilationAgent- Parameters:
state- Current state.- Returns:
- True if the agent is suitable for the current state.
-
supported
public org.eolang.opeo.decompilation.agents.Supported supported()
Description copied from interface:DecompilationAgentSupported opcodes.- Specified by:
supportedin interfaceDecompilationAgent- Returns:
- Supported opcodes.
-
handle
public void handle(DecompilerState state)
Handle invokespecial instruction.- Specified by:
handlein interfaceDecompilationAgent- Parameters:
state- Current instruction to handle together with operand stack and variables.- To do:
- #344:90min Super and Constructor classes ambiguity.
Recently I removed the following code from this method:
state.stack().push( new Constructor( target, new Attributes().descriptor(descriptor).interfaced(interfaced), args ) );The reason behind this integration test with WebProperties$Resources$Chain$Strategy$Content.xmir class. SeeJeoAndOpeoTestfor more info. We need to use both Super and This classes. Moreover, we might need to add some other representations. Don't forget to remove suppressions.
-
-