Skip to content

Commit ce97578

Browse files
committed
Remove unused methods from ConditionReference
1 parent 7b2db8a commit ce97578

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/logic/ConditionReference.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55
package software.amazon.smithy.rulesengine.logic;
66

7-
import java.util.Set;
8-
import software.amazon.smithy.rulesengine.language.syntax.Identifier;
97
import software.amazon.smithy.rulesengine.language.syntax.rule.Condition;
108

119
/**
@@ -15,12 +13,10 @@ public final class ConditionReference {
1513

1614
private final Condition condition;
1715
private final boolean negated;
18-
private final String returnVar;
1916

2017
public ConditionReference(Condition condition, boolean negated) {
2118
this.condition = condition;
2219
this.negated = negated;
23-
this.returnVar = condition.getResult().map(Identifier::toString).orElse(null);
2420
}
2521

2622
/**
@@ -50,33 +46,6 @@ public Condition getCondition() {
5046
return condition;
5147
}
5248

53-
/**
54-
* Get the complexity of the condition.
55-
*
56-
* @return the complexity.
57-
*/
58-
public int getComplexity() {
59-
return condition.getFunction().getComplexity();
60-
}
61-
62-
/**
63-
* Get the references used by the condition.
64-
*
65-
* @return the references.
66-
*/
67-
public Set<String> getReferences() {
68-
return condition.getFunction().getReferences();
69-
}
70-
71-
/**
72-
* Get the name of the variable this condition defines, if any, or null.
73-
*
74-
* @return the defined variable name or null.
75-
*/
76-
public String getReturnVariable() {
77-
return returnVar;
78-
}
79-
8049
@Override
8150
public String toString() {
8251
return (negated ? "!" : "") + condition.toString();

smithy-rules-engine/src/test/java/software/amazon/smithy/rulesengine/logic/cfg/CfgBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void createConditionReferenceHandlesVariableBinding() {
234234
ConditionReference ref = builder.createConditionReference(cond);
235235

236236
assertNotNull(ref);
237-
assertEquals("parsedUrl", ref.getReturnVariable());
237+
assertEquals(cond, ref.getCondition());
238238
}
239239

240240
@Test
@@ -275,6 +275,6 @@ void createConditionReferenceIgnoresNegationWithVariableBinding() {
275275
// Should not be treated as simple negation due to variable binding
276276
assertFalse(ref.isNegated());
277277
assertInstanceOf(Not.class, ref.getCondition().getFunction());
278-
assertEquals("notRegionSet", ref.getReturnVariable());
278+
assertEquals(negatedWithBinding, ref.getCondition());
279279
}
280280
}

0 commit comments

Comments
 (0)