fillInGenSet now takes Collection instead Set as parameter

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1069 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 26 years ago
parent 0f38b5d122
commit 00edbfd0df
  1. 8
      jode/jode/expr/CheckNullOperator.java
  2. 6
      jode/jode/expr/ConstructorOperator.java
  3. 8
      jode/jode/expr/Expression.java
  4. 1
      jode/jode/expr/LocalStoreOperator.java
  5. 8
      jode/jode/expr/Operator.java

@ -23,9 +23,9 @@ import jode.decompiler.LocalInfo;
import jode.decompiler.TabbedPrintWriter; import jode.decompiler.TabbedPrintWriter;
///#ifdef JDK12 ///#ifdef JDK12
///import java.util.Set; ///import java.util.Collection;
///#else ///#else
import jode.util.Set; import jode.util.Collection;
///#endif ///#endif
/** /**
@ -74,13 +74,13 @@ public class CheckNullOperator extends Operator {
local.remove(); local.remove();
} }
public void fillInGenSet(Set in, Set gen) { public void fillInGenSet(Collection in, Collection gen) {
if (gen != null) if (gen != null)
gen.add(local); gen.add(local);
super.fillInGenSet(in, gen); super.fillInGenSet(in, gen);
} }
public void fillDeclarables(Set used) { public void fillDeclarables(Collection used) {
used.add(local); used.add(local);
super.fillDeclarables(used); super.fillDeclarables(used);
} }

@ -33,9 +33,9 @@ import jode.decompiler.Scope;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
///#ifdef JDK12 ///#ifdef JDK12
///import java.util.Set; ///import java.util.Collection;
///#else ///#else
import jode.util.Set; import jode.util.Collection;
///#endif ///#endif
public class ConstructorOperator extends Operator public class ConstructorOperator extends Operator
@ -165,7 +165,7 @@ public class ConstructorOperator extends Operator
* 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.
*/ */
public void fillDeclarables(Set used) { public void fillDeclarables(Collection used) {
ClassInfo clazz = getClassInfo(); ClassInfo clazz = getClassInfo();
InnerClassInfo outer = getOuterClassInfo(clazz); InnerClassInfo outer = getOuterClassInfo(clazz);
ClassAnalyzer clazzAna = methodAnalyzer.getClassAnalyzer(clazz); ClassAnalyzer clazzAna = methodAnalyzer.getClassAnalyzer(clazz);

@ -23,9 +23,9 @@ import jode.GlobalOptions;
import jode.decompiler.TabbedPrintWriter; import jode.decompiler.TabbedPrintWriter;
///#ifdef JDK12 ///#ifdef JDK12
///import java.util.Set; ///import java.util.Collection;
///#else ///#else
import jode.util.Set; import jode.util.Collection;
///#endif ///#endif
public abstract class Expression { public abstract class Expression {
@ -228,10 +228,10 @@ public abstract class Expression {
return true; return true;
} }
public void fillInGenSet(Set in, Set gen) { public void fillInGenSet(Collection in, Collection gen) {
} }
public void fillDeclarables(Set used) { public void fillDeclarables(Collection used) {
} }
public abstract void dumpExpression(TabbedPrintWriter writer) public abstract void dumpExpression(TabbedPrintWriter writer)

@ -35,6 +35,7 @@ public class LocalStoreOperator extends LValueExpression
} }
public boolean isRead() { public boolean isRead() {
/* if it is part of a += operator, this is a read. */
return parent != null && parent.getOperatorIndex() != ASSIGN_OP; return parent != null && parent.getOperatorIndex() != ASSIGN_OP;
} }

@ -23,9 +23,9 @@ import jode.GlobalOptions;
import jode.decompiler.TabbedPrintWriter; import jode.decompiler.TabbedPrintWriter;
///#ifdef JDK12 ///#ifdef JDK12
///import java.util.Set; ///import java.util.Collection;
///#else ///#else
import jode.util.Set; import jode.util.Collection;
///#endif ///#endif
public abstract class Operator extends Expression { public abstract class Operator extends Expression {
@ -163,7 +163,7 @@ public abstract class Operator extends Expression {
return this; return this;
} }
public void fillInGenSet(Set in, Set gen) { public void fillInGenSet(Collection in, Collection gen) {
if (this instanceof LocalVarOperator) { if (this instanceof LocalVarOperator) {
LocalVarOperator varOp = (LocalVarOperator) this; LocalVarOperator varOp = (LocalVarOperator) this;
if (varOp.isRead() && in != null) if (varOp.isRead() && in != null)
@ -175,7 +175,7 @@ public abstract class Operator extends Expression {
subExpressions[i].fillInGenSet(in,gen); subExpressions[i].fillInGenSet(in,gen);
} }
public void fillDeclarables(Set used) { public void fillDeclarables(Collection used) {
if (this instanceof LocalVarOperator) { if (this instanceof LocalVarOperator) {
used.add(((LocalVarOperator) this).getLocalInfo()); used.add(((LocalVarOperator) this).getLocalInfo());
} }

Loading…
Cancel
Save