ThisOperator, allow special this$0

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@733 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent d86fb31da2
commit cf14c50b47
  1. 21
      jode/jode/decompiler/FieldAnalyzer.java

@ -22,6 +22,8 @@ import java.lang.reflect.Modifier;
import jode.type.*;
import jode.bytecode.FieldInfo;
import jode.expr.Expression;
import jode.expr.ThisOperator;
import jode.expr.LocalLoadOperator;
import jode.expr.ConstOperator;
public class FieldAnalyzer implements Analyzer {
@ -62,6 +64,10 @@ public class FieldAnalyzer implements Analyzer {
return type;
}
public Expression getConstant() {
return constant;
}
public boolean isSynthetic() {
return isSynthetic;
}
@ -77,6 +83,21 @@ public class FieldAnalyzer implements Analyzer {
constant = expr;
return true;
}
public boolean setSpecial(Expression expr) {
if (!isSynthetic || !Modifier.isFinal(modifiers))
return false;
if (!fieldName.startsWith("this$")) {
if (!(expr instanceof LocalLoadOperator)
|| !fieldName.startsWith("val$"))
return false;
}
if (constant != null)
return constant.equals(expr);
analyzedSynthetic();
constant = expr;
return true;
}
public void analyze() {
imports.useType(type);

Loading…
Cancel
Save