Class ObjectTypeUsageRewriter
java.lang.Object
org.benf.cfr.reader.bytecode.analysis.parse.rewriters.AbstractExpressionRewriter
org.benf.cfr.reader.bytecode.analysis.opgraph.op4rewriters.transformers.ObjectTypeUsageRewriter
- All Implemented Interfaces:
StructuredStatementTransformer
,ExpressionRewriter
public class ObjectTypeUsageRewriter
extends AbstractExpressionRewriter
implements StructuredStatementTransformer
Detect potential invalid usages of fields - where the class we expect to be calling them with doesn't
match the class needed to access the fields in question.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionObjectTypeUsageRewriter
(AnonymousClassUsage anonymousClassUsage, ClassFile classFile) -
Method Summary
Modifier and TypeMethodDescriptionprivate LValue
handleFieldVariable
(FieldVariable fieldVariable) private Expression
private void
markLocalVar
(Expression object) private boolean
needsReWrite
(Expression lhsObject, JavaTypeInstance owningClassType, UnaryFunction<ClassFile, Boolean> checkVisible) rewriteExpression
(Expression expression, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) rewriteExpression
(LValue lValue, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) void
transform
(StructuredStatement in, StructuredScope scope) Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.rewriters.AbstractExpressionRewriter
handleStatement, rewriteExpression, rewriteExpression
-
Field Details
-
isAnonVar
-
canHaveVar
private boolean canHaveVar
-
-
Constructor Details
-
ObjectTypeUsageRewriter
-
-
Method Details
-
transform
-
transform
- Specified by:
transform
in interfaceStructuredStatementTransformer
-
rewriteExpression
public Expression rewriteExpression(Expression expression, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) - Specified by:
rewriteExpression
in interfaceExpressionRewriter
- Overrides:
rewriteExpression
in classAbstractExpressionRewriter
-
rewriteExpression
public LValue rewriteExpression(LValue lValue, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) - Specified by:
rewriteExpression
in interfaceExpressionRewriter
- Overrides:
rewriteExpression
in classAbstractExpressionRewriter
-
needsReWrite
private boolean needsReWrite(Expression lhsObject, JavaTypeInstance owningClassType, UnaryFunction<ClassFile, Boolean> checkVisible) -
handleMemberFunction
-
handleFieldVariable
-
markLocalVar
-