From cf14c50b47b0f150778afc8461b7cc892c15b779 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 3 May 1999 10:51:17 +0000 Subject: [PATCH] ThisOperator, allow special this$0 git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@733 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/FieldAnalyzer.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/jode/jode/decompiler/FieldAnalyzer.java b/jode/jode/decompiler/FieldAnalyzer.java index 3067d7c..e7f28a4 100644 --- a/jode/jode/decompiler/FieldAnalyzer.java +++ b/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);