Im and Re

This commit is contained in:
Sergey Solovyev
2012-11-15 23:28:28 +04:00
parent 1a8feb86db
commit 6dfc26dc2a
6 changed files with 34 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
package org.solovyev.android.calculator;
import jscl.CustomFunctionCalculationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.solovyev.common.JBuilder;
@@ -66,7 +67,11 @@ public abstract class AbstractCalculatorMathRegistry<T extends MathEntity, P ext
if (persistenceContainer != null) {
for (P entity : persistenceContainer.getEntities()) {
if (!contains(entity.getName())) {
add(createBuilder(entity));
try {
add(createBuilder(entity));
} catch (CustomFunctionCalculationException e) {
CalculatorLocatorImpl.getInstance().getLogger().error(null, e.getMessage(), e);
}
}
}
}

View File

@@ -13,4 +13,7 @@ public interface CalculatorLogger {
void debug(@Nullable String tag, @NotNull String message);
void debug(@Nullable String tag, @NotNull String message, @NotNull Throwable e);
void error(@Nullable String tag, @NotNull String message, @NotNull Throwable e);
}

View File

@@ -28,4 +28,10 @@ public class SystemOutCalculatorLogger implements CalculatorLogger {
debug(tag, message);
e.printStackTrace(System.out);
}
@Override
public void error(@Nullable String tag, @NotNull String message, @NotNull Throwable e) {
System.out.println(getTag(tag) + ": " + message);
e.printStackTrace(System.out);
}
}