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
InvokespecialAgent
we use many 'instanceof' checks. This is a clear sign that the class hierarchy is not well designed. The original problem lies in theLabeled
class. 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 boolean
appropriate(DecompilerState state)
Check if the agent is suitable for the current state.void
handle(DecompilerState state)
Handle invokespecial instruction.org.eolang.opeo.decompilation.agents.Supported
supported()
Supported opcodes.
-
-
-
Method Detail
-
appropriate
public boolean appropriate(DecompilerState state)
Description copied from interface:DecompilationAgent
Check if the agent is suitable for the current state.- Specified by:
appropriate
in 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:DecompilationAgent
Supported opcodes.- Specified by:
supported
in interfaceDecompilationAgent
- Returns:
- Supported opcodes.
-
handle
public void handle(DecompilerState state)
Handle invokespecial instruction.- Specified by:
handle
in 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. SeeJeoAndOpeoTest
for 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.
-
-