Class ScopeHidingVariableRewriter
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.opgraph.op4rewriters.ScopeHidingVariableRewriter
-
- All Implemented Interfaces:
Op04Rewriter
public class ScopeHidingVariableRewriter extends java.lang.Object implements Op04Rewriter
We may have deep inner classes, with references to each other. So this.Inner2.this.Inner1.this But this is illegal. So remove the outer one, leaving this.Inner1.this (the LHS this is still illegal, but will be removed later).
-
-
Field Summary
Fields Modifier and Type Field Description private ClassCacheclassCacheprivate java.util.List<LocalVariable>collisionsprivate Methodmethodprivate java.util.Set<java.lang.String>outerNamesprivate java.util.Set<java.lang.String>usedNames
-
Constructor Summary
Constructors Constructor Description ScopeHidingVariableRewriter(java.util.List<ClassFileField> fieldVariables, Method method, ClassCache classCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckCollision(LocalVariable localVariable)voidrewrite(Op04StructuredStatement root)
-
-
-
Field Detail
-
method
private final Method method
-
classCache
private final ClassCache classCache
-
outerNames
private final java.util.Set<java.lang.String> outerNames
-
usedNames
private final java.util.Set<java.lang.String> usedNames
-
collisions
private java.util.List<LocalVariable> collisions
-
-
Constructor Detail
-
ScopeHidingVariableRewriter
public ScopeHidingVariableRewriter(java.util.List<ClassFileField> fieldVariables, Method method, ClassCache classCache)
-
-
Method Detail
-
checkCollision
private void checkCollision(LocalVariable localVariable)
-
rewrite
public void rewrite(Op04StructuredStatement root)
- Specified by:
rewritein interfaceOp04Rewriter
-
-