fixes + @NotNull -> @Nonnull
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class CalculatorEditorImplTest extends AbstractCalculatorTest {
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
private CalculatorEditor calculatorEditor;
|
||||
|
||||
@Before
|
||||
|
@@ -2,8 +2,8 @@ package org.solovyev.android.calculator;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.mockito.Mockito;
|
||||
import org.solovyev.android.calculator.external.CalculatorExternalListenersContainer;
|
||||
import org.solovyev.android.calculator.history.CalculatorHistory;
|
||||
@@ -29,7 +29,7 @@ public class CalculatorTestUtils {
|
||||
Locator.getInstance().getEngine().init();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
static CalculatorEngineImpl newCalculatorEngine() {
|
||||
final MathEntityDao mathEntityDao = Mockito.mock(MathEntityDao.class);
|
||||
|
||||
@@ -43,11 +43,11 @@ public class CalculatorTestUtils {
|
||||
return new CalculatorEngineImpl(jsclEngine, varsRegistry, functionsRegistry, operatorsRegistry, postfixFunctionsRegistry, null);
|
||||
}
|
||||
|
||||
public static void assertEval(@NotNull String expected, @NotNull String expression) {
|
||||
public static void assertEval(@Nonnull String expected, @Nonnull String expression) {
|
||||
assertEval(expected, expression, JsclOperation.numeric);
|
||||
}
|
||||
|
||||
public static void assertEval(@NotNull String expected, @NotNull String expression, @NotNull JsclOperation operation) {
|
||||
public static void assertEval(@Nonnull String expected, @Nonnull String expression, @Nonnull JsclOperation operation) {
|
||||
final Calculator calculator = Locator.getInstance().getCalculator();
|
||||
|
||||
Locator.getInstance().getDisplay().setViewState(CalculatorDisplayViewStateImpl.newDefaultInstance());
|
||||
@@ -73,11 +73,11 @@ public class CalculatorTestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertError(@NotNull String expression) {
|
||||
public static void assertError(@Nonnull String expression) {
|
||||
assertError(expression, JsclOperation.numeric);
|
||||
}
|
||||
|
||||
public static <S extends Serializable> S testSerialization(@NotNull S serializable) throws IOException, ClassNotFoundException {
|
||||
public static <S extends Serializable> S testSerialization(@Nonnull S serializable) throws IOException, ClassNotFoundException {
|
||||
final ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
ObjectOutputStream oos = null;
|
||||
@@ -108,13 +108,13 @@ public class CalculatorTestUtils {
|
||||
@Nullable
|
||||
private CalculatorEventData calculatorEventData;
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
private final CountDownLatch latch;
|
||||
|
||||
@Nullable
|
||||
private volatile CalculatorDisplayViewState result = null;
|
||||
|
||||
public TestCalculatorEventListener(@NotNull CountDownLatch latch) {
|
||||
public TestCalculatorEventListener(@Nonnull CountDownLatch latch) {
|
||||
this.latch = latch;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class CalculatorTestUtils {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatorEvent(@NotNull CalculatorEventData calculatorEventData, @NotNull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
public void onCalculatorEvent(@Nonnull CalculatorEventData calculatorEventData, @Nonnull CalculatorEventType calculatorEventType, @Nullable Object data) {
|
||||
if (this.calculatorEventData != null && calculatorEventData.isSameSequence(this.calculatorEventData)) {
|
||||
if (calculatorEventType == CalculatorEventType.display_state_changed) {
|
||||
final CalculatorDisplayChangeEventData displayChange = (CalculatorDisplayChangeEventData) data;
|
||||
@@ -146,7 +146,7 @@ public class CalculatorTestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertError(@NotNull String expression, @NotNull JsclOperation operation) {
|
||||
public static void assertError(@Nonnull String expression, @Nonnull JsclOperation operation) {
|
||||
final Calculator calculator = Locator.getInstance().getCalculator();
|
||||
|
||||
Locator.getInstance().getDisplay().setViewState(CalculatorDisplayViewStateImpl.newDefaultInstance());
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package org.solovyev.android.calculator.history;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.solovyev.android.calculator.CalculatorDisplayViewStateImpl;
|
||||
@@ -47,7 +47,7 @@ public class CalculatorHistoryImplTest {
|
||||
Assert.assertEquals("123+3", states.get(0).getEditorState().getText());
|
||||
}
|
||||
|
||||
private void addState(@NotNull CalculatorHistory calculatorHistory, @NotNull String text) {
|
||||
private void addState(@Nonnull CalculatorHistory calculatorHistory, @Nonnull String text) {
|
||||
calculatorHistory.addState(CalculatorHistoryState.newInstance(CalculatorEditorViewStateImpl.newInstance(text, 3), CalculatorDisplayViewStateImpl.newDefaultInstance()));
|
||||
}
|
||||
}
|
||||
|
@@ -3,8 +3,8 @@ package org.solovyev.android.calculator.model;
|
||||
import jscl.util.ExpressionGenerator;
|
||||
import org.hamcrest.BaseMatcher;
|
||||
import org.hamcrest.Description;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -90,8 +90,8 @@ public class FunctionsTest {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Functions testXml(@NotNull Functions in, @Nullable String expectedXml) throws Exception {
|
||||
@Nonnull
|
||||
private Functions testXml(@Nonnull Functions in, @Nullable String expectedXml) throws Exception {
|
||||
final String actualXml = toXml(in);
|
||||
|
||||
if (expectedXml != null) {
|
||||
@@ -142,8 +142,8 @@ public class FunctionsTest {
|
||||
testXml(in, null);
|
||||
}
|
||||
|
||||
private void assertEquals(@NotNull final AFunction expected,
|
||||
@NotNull AFunction actual) {
|
||||
private void assertEquals(@Nonnull final AFunction expected,
|
||||
@Nonnull AFunction actual) {
|
||||
//Assert.assertEquals(expected.getId(), actual.getId());
|
||||
Assert.assertEquals(expected.getContent(), actual.getContent());
|
||||
Assert.assertEquals(expected.getDescription(), actual.getDescription());
|
||||
|
@@ -6,7 +6,7 @@ import jscl.MathEngine;
|
||||
import jscl.math.Expression;
|
||||
import jscl.text.ParseException;
|
||||
import jscl.util.ExpressionGeneratorWithInput;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import javax.annotation.Nonnull;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@@ -91,7 +91,7 @@ public class NumeralBaseTest extends AbstractCalculatorTest {
|
||||
}
|
||||
}
|
||||
|
||||
public static void testExpression(@NotNull String[] line, @NotNull Converter<String, String> converter) throws ParseException, CalculatorEvalException, CalculatorParseException {
|
||||
public static void testExpression(@Nonnull String[] line, @Nonnull Converter<String, String> converter) throws ParseException, CalculatorEvalException, CalculatorParseException {
|
||||
final String dec = line[0].toUpperCase();
|
||||
final String hex = "0x:" + line[1].toUpperCase();
|
||||
final String bin = "0b:" + line[2].toUpperCase();
|
||||
@@ -109,36 +109,36 @@ public class NumeralBaseTest extends AbstractCalculatorTest {
|
||||
|
||||
private static class DummyExpression implements Converter<String, String> {
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@NotNull String s) {
|
||||
public String convert(@Nonnull String s) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Expression1 implements Converter<String, String> {
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@NotNull String s) {
|
||||
public String convert(@Nonnull String s) {
|
||||
return s + "*" + s;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Expression2 implements Converter<String, String> {
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@NotNull String s) {
|
||||
public String convert(@Nonnull String s) {
|
||||
return s + "*" + s + " * sin(" + s + ") - 0b:1101";
|
||||
}
|
||||
}
|
||||
|
||||
private static class Expression3 implements Converter<String, String> {
|
||||
|
||||
@NotNull
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@NotNull String s) {
|
||||
public String convert(@Nonnull String s) {
|
||||
return s + "*" + s + " * sin(" + s + ") - 0b:1101 + √(" + s + ") + exp ( " + s + ")";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user