Lint issues fixed
This commit is contained in:
@@ -120,7 +120,7 @@ public class CalculatorEditorImpl implements CalculatorEditor {
|
||||
}
|
||||
|
||||
private void fireStateChangedEvent(boolean majorChanges, @Nonnull CalculatorEditorViewState oldViewState, @Nonnull CalculatorEditorViewState newViewState) {
|
||||
assert Thread.holdsLock(viewLock);
|
||||
if (!Thread.holdsLock(viewLock)) throw new AssertionError();
|
||||
|
||||
if (majorChanges) {
|
||||
calculator.fireCalculatorEvent(editor_state_changed, newChangeEventData(oldViewState, newViewState));
|
||||
|
@@ -46,7 +46,7 @@ public class CalculatorKeyboardImpl implements CalculatorKeyboard {
|
||||
public void buttonPressed(@Nullable final String text) {
|
||||
|
||||
if (!Strings.isEmpty(text)) {
|
||||
assert text != null;
|
||||
if (text == null) throw new AssertionError();
|
||||
|
||||
// process special buttons
|
||||
boolean processed = processSpecialButtons(text);
|
||||
|
@@ -24,15 +24,13 @@ package org.solovyev.android.calculator;
|
||||
|
||||
import jscl.math.function.Function;
|
||||
import jscl.math.function.IConstant;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import org.solovyev.android.calculator.math.MathType;
|
||||
import org.solovyev.android.calculator.text.TextProcessor;
|
||||
import org.solovyev.common.collections.Collections;
|
||||
import org.solovyev.common.msg.MessageType;
|
||||
import org.solovyev.common.search.StartsWithFinder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -135,7 +133,7 @@ public class ToJsclTextProcessor implements TextProcessor<PreparedExpression, St
|
||||
offset = varName.length();
|
||||
} else {
|
||||
final String value = var.getValue();
|
||||
assert value != null;
|
||||
if (value == null) throw new AssertionError();
|
||||
|
||||
if (var.getDoubleValue() != null) {
|
||||
//result.append(value);
|
||||
|
@@ -82,7 +82,7 @@ public class CalculatorPlotterImpl implements CalculatorPlotter {
|
||||
public boolean addFunction(@Nonnull Generic expression) {
|
||||
final List<Constant> variables = new ArrayList<Constant>(CalculatorUtils.getNotSystemConstants(expression));
|
||||
|
||||
assert variables.size() <= 2;
|
||||
if (variables.size() > 2) throw new AssertionError();
|
||||
|
||||
final Constant xVariable;
|
||||
if (variables.size() > 0) {
|
||||
@@ -316,7 +316,7 @@ public class CalculatorPlotterImpl implements CalculatorPlotter {
|
||||
|
||||
// NOTE: this method must be called from synchronized block
|
||||
private void onFunctionsChanged() {
|
||||
assert Thread.holdsLock(functions);
|
||||
if (!Thread.holdsLock(functions)) throw new AssertionError();
|
||||
|
||||
int maxArity = 0;
|
||||
for (PlotFunction function : functions) {
|
||||
|
@@ -69,7 +69,7 @@ public class MapPlotResourceManager implements PlotResourceManager {
|
||||
}
|
||||
|
||||
private void addLineDef(@Nonnull final PlotLineDef toBeAdded) {
|
||||
assert Thread.holdsLock(this);
|
||||
if (!Thread.holdsLock(this)) throw new AssertionError();
|
||||
|
||||
List<PlotLineDef> registeredLineDefs = registeredLineDefsMap.get(toBeAdded);
|
||||
if (registeredLineDefs == null) {
|
||||
@@ -94,7 +94,7 @@ public class MapPlotResourceManager implements PlotResourceManager {
|
||||
}
|
||||
|
||||
private void removeLineDef(@Nonnull final PlotLineDef toBeRemoved) {
|
||||
assert Thread.holdsLock(this);
|
||||
if (!Thread.holdsLock(this)) throw new AssertionError();
|
||||
|
||||
List<PlotLineDef> registeredLineDefs = registeredLineDefsMap.get(toBeRemoved);
|
||||
|
||||
|
Reference in New Issue
Block a user