Adjust checkstyle rules. Make checkstyle fail the build when violations are found. Correct all current checkstyle violations.
This commit is contained in:
@ -55,6 +55,9 @@ public class App {
|
||||
return s.equals("+") || s.equals("-") || s.equals("*");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get expression for string
|
||||
*/
|
||||
public static Expression getOperatorInstance(String s, Expression left, Expression right) {
|
||||
switch (s) {
|
||||
case "+":
|
||||
@ -63,7 +66,8 @@ public class App {
|
||||
return new MinusExpression(left, right);
|
||||
case "*":
|
||||
return new MultiplyExpression(left, right);
|
||||
default:
|
||||
return new MultiplyExpression(left, right);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ public abstract class ExpressionTest<E extends Expression> {
|
||||
for (int i = -10; i < 10; i++) {
|
||||
for (int j = -10; j < 10; j++) {
|
||||
testData.add(new Object[]{
|
||||
new NumberExpression(i),
|
||||
new NumberExpression(j),
|
||||
resultCalc.apply(i, j)
|
||||
new NumberExpression(i),
|
||||
new NumberExpression(j),
|
||||
resultCalc.apply(i, j)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user