Skip to content
Permalink
Browse files

Change method to use 'this' instead of a parameter

  • Loading branch information...
danielb987 committed Sep 20, 2018
1 parent a19f898 commit 7fca7b5f153dcab3456eeca39964bb841892970c
@@ -59,20 +59,20 @@
OR;

// This method is used by DefaultConditionalManagerXml.store() for backward compatibility
public static int getIntValue(Operator oper, boolean not) {
public int getIntValue(boolean not) {
if (not) {
switch (oper) {
switch (this) {
case NONE: return OPERATOR_NOT; // backward compatibility
case AND: return OPERATOR_AND_NOT; // backward compatibility
case OR: return OPERATOR_OR;
default: throw new IllegalArgumentException(String.format("operator %s is unknown", oper.name()));
default: throw new IllegalArgumentException(String.format("operator %s is unknown", this.name()));
}
} else {
switch (oper) {
switch (this) {
case NONE: return OPERATOR_NONE;
case AND: return OPERATOR_AND;
case OR: return OPERATOR_OR;
default: throw new IllegalArgumentException(String.format("operator %s is unknown", oper.name()));
default: throw new IllegalArgumentException(String.format("operator %s is unknown", this.name()));
}
}
}
@@ -98,7 +98,7 @@ public Element store(Object o) {
for (int k = 0; k < variableList.size(); k++) {
ConditionalVariable variable = variableList.get(k);
Element vElem = new Element("conditionalStateVariable"); // NOI18N
int oper = Conditional.Operator.getIntValue(variable.getOpern(), variable.isNegated());
int oper = variable.getOpern().getIntValue(variable.isNegated());
if (oper == Conditional.OPERATOR_AND && variable.isNegated()) {
oper = Conditional.OPERATOR_AND_NOT; // backward compatibility
} else if (oper == Conditional.OPERATOR_NONE && variable.isNegated()) {

0 comments on commit 7fca7b5

Please sign in to comment.
You can’t perform that action at this time.