Skip to content

Commit 766e762

Browse files
RoundingMode: Rename variables to avoid shadowing
1 parent e06058a commit 766e762

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/org/sosy_lab/java_smt/test/FloatingPointFormulaManagerTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,21 @@ public void floatingPointType() {
9595

9696
@Test
9797
public void roundingModeVisitor() {
98-
FloatingPointFormula var =
98+
FloatingPointFormula variable =
9999
fpmgr.makeVariable("a", FloatingPointType.getSinglePrecisionFloatingPointType());
100-
FloatingPointFormula f = fpmgr.sqrt(var, FloatingPointRoundingMode.NEAREST_TIES_TO_EVEN);
100+
FloatingPointFormula original =
101+
fpmgr.sqrt(variable, FloatingPointRoundingMode.NEAREST_TIES_TO_EVEN);
101102

102103
for (FloatingPointRoundingMode rm : FloatingPointRoundingMode.values()) {
103104
if (solver == Solvers.MATHSAT5 && rm == FloatingPointRoundingMode.NEAREST_TIES_AWAY) {
104105
// SKIP MathSAT does not support rounding mode "nearest-ties-away"
105106
continue;
106107
}
107108
// Build a term with a different rounding mode, then replace it in the visitor
108-
FloatingPointFormula g =
109+
FloatingPointFormula substituted =
109110
(FloatingPointFormula)
110111
mgr.visit(
111-
fpmgr.sqrt(var, rm),
112+
fpmgr.sqrt(variable, rm),
112113
new FormulaVisitor<Formula>() {
113114
@Override
114115
public Formula visitFreeVariable(Formula f, String name) {
@@ -149,7 +150,7 @@ public Formula visitQuantifier(
149150
});
150151

151152
// Check that after the substitution the rounding mode is the default again
152-
assertThat(f).isEqualTo(g);
153+
assertThat(original).isEqualTo(substituted);
153154
}
154155
}
155156

0 commit comments

Comments
 (0)