don't allow named method scope classes, to move into field initializer

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@928 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent f02a601510
commit 938e5ab478
  1. 17
      jode/jode/expr/ConstructorOperator.java

@ -148,6 +148,23 @@ public class ConstructorOperator extends Operator
} }
} }
public boolean isConstant() {
ClassInfo clazz = getClassInfo();
InnerClassInfo outer = getOuterClassInfo(clazz);
ClassAnalyzer clazzAna = methodAnalyzer.getClassAnalyzer(clazz);
if ((Decompiler.options & Decompiler.OPTION_ANON) != 0
&& clazzAna != null
&& outer != null && outer.outer == null && outer.name != null
&& clazzAna.getParent() == methodAnalyzer) {
/* This is a named method scope class, it needs
* declaration. And therefore can't be moved into
* a field initializer. */
return false;
}
return super.isConstant();
}
/** /**
* We add the named method scoped classes to the declarables, and * We add the named method scoped classes to the declarables, and
* only fillDeclarables on the parameters we will print. * only fillDeclarables on the parameters we will print.

Loading…
Cancel
Save