isFinal added

merged setSpecial into setConstant
skipWriting added


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@841 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 8536526d24
commit 5cecebf238
  1. 30
      jode/jode/decompiler/FieldAnalyzer.java

@ -72,29 +72,25 @@ public class FieldAnalyzer implements Analyzer {
return isSynthetic;
}
public boolean isFinal() {
return Modifier.isFinal(modifiers);
}
public void analyzedSynthetic() {
analyzedSynthetic = true;
}
public boolean setInitializer(Expression expr) {
expr.makeInitializer();
if (constant != null)
return constant.equals(expr);
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);
if (isSynthetic && isFinal()
&& (fieldName.startsWith("this$")
|| fieldName.startsWith("val$")))
analyzedSynthetic();
else
expr.makeInitializer();
constant = expr;
return true;
}
@ -116,11 +112,13 @@ public class FieldAnalyzer implements Analyzer {
constant = constant.simplify();
}
public boolean skipWriting() {
return analyzedSynthetic;
}
public void dumpSource(TabbedPrintWriter writer)
throws java.io.IOException
{
if (analyzedSynthetic)
return; /*XXX*/
if (isDeprecated) {
writer.println("/**");
writer.println(" * @deprecated");

Loading…
Cancel
Save