fix with logger + jscl version update

This commit is contained in:
Sergey Solovyev 2013-01-15 21:54:25 +04:00
parent 1e2b5ac830
commit bfe89e893d
8 changed files with 32 additions and 28 deletions

View File

@ -12,19 +12,19 @@ target=android-15
android.library.reference.1=../android-app-core android.library.reference.1=../android-app-core
android.library.reference.2=../android-app-widget android.library.reference.2=../android-app-widget
android.library.reference.3=../android-app-onscreen android.library.reference.3=../android-app-onscreen
android.library.reference.4=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-all_1.0.6 android.library.reference.4=gen-external-apklibs/org.solovyev.android_android-common-all_1.0.6
android.library.reference.5=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.6 android.library.reference.5=gen-external-apklibs/org.solovyev.android_android-common-ads_1.0.6
android.library.reference.6=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-core_1.0.6 android.library.reference.6=gen-external-apklibs/org.solovyev.android_android-common-core_1.0.6
android.library.reference.7=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-billing_1.0.6 android.library.reference.7=gen-external-apklibs/org.solovyev.android_android-common-billing_1.0.6
android.library.reference.8=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-db_1.0.6 android.library.reference.8=gen-external-apklibs/org.solovyev.android_android-common-db_1.0.6
android.library.reference.9=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-http_1.0.6 android.library.reference.9=gen-external-apklibs/org.solovyev.android_android-common-http_1.0.6
android.library.reference.10=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-list_1.0.6 android.library.reference.10=gen-external-apklibs/org.solovyev.android_android-common-list_1.0.6
android.library.reference.11=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-view_1.0.6 android.library.reference.11=gen-external-apklibs/org.solovyev.android_android-common-view_1.0.6
android.library.reference.12=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.6 android.library.reference.12=gen-external-apklibs/org.solovyev.android_android-common-preferences_1.0.6
android.library.reference.13=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.6 android.library.reference.13=gen-external-apklibs/org.solovyev.android_android-common-menu_1.0.6
android.library.reference.14=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-other_1.0.6 android.library.reference.14=gen-external-apklibs/org.solovyev.android_android-common-other_1.0.6
android.library.reference.15=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-sherlock_1.0.6 android.library.reference.15=gen-external-apklibs/org.solovyev.android_android-common-sherlock_1.0.6
android.library.reference.16=../android-app-core/gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0 android.library.reference.16=gen-external-apklibs/com.actionbarsherlock_actionbarsherlock_4.2.0
android.library.reference.17=../android-app-core/gen-external-apklibs/org.solovyev.android_android-common-keyboard_1.0.6 android.library.reference.17=gen-external-apklibs/org.solovyev.android_android-common-keyboard_1.0.6

View File

@ -25,12 +25,12 @@ public class AndroidCalculatorLogger implements CalculatorLogger {
} }
@Override @Override
public void debug(@Nullable String tag, @NotNull String message, @NotNull Throwable e) { public void debug(@Nullable String tag, @Nullable String message, @NotNull Throwable e) {
Log.d(getTag(tag), message, e); Log.d(getTag(tag), message, e);
} }
@Override @Override
public void error(@Nullable String tag, @NotNull String message, @NotNull Throwable e) { public void error(@Nullable String tag, @Nullable String message, @NotNull Throwable e) {
Log.e(getTag(tag), message, e); Log.e(getTag(tag), message, e);
} }
} }

View File

@ -6,12 +6,12 @@
package org.solovyev.android.calculator; package org.solovyev.android.calculator;
import jscl.CustomFunctionCalculationException;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.solovyev.common.JBuilder; import org.solovyev.common.JBuilder;
import org.solovyev.common.math.MathEntity; import org.solovyev.common.math.MathEntity;
import org.solovyev.common.math.MathRegistry; import org.solovyev.common.math.MathRegistry;
import org.solovyev.common.msg.Message;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -68,9 +68,13 @@ public abstract class AbstractCalculatorMathRegistry<T extends MathEntity, P ext
for (P entity : persistenceContainer.getEntities()) { for (P entity : persistenceContainer.getEntities()) {
if (!contains(entity.getName())) { if (!contains(entity.getName())) {
try { try {
add(createBuilder(entity)); final JBuilder<? extends T> builder = createBuilder(entity);
} catch (CustomFunctionCalculationException e) { add(builder);
Locator.getInstance().getLogger().error(null, e.getMessage(), e); } catch (ArithmeticException e) {
Locator.getInstance().getLogger().error(null, e.getLocalizedMessage(), e);
if (e instanceof Message) {
Locator.getInstance().getNotifier().showMessage((Message)e);
}
} }
} }
} }

View File

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

View File

@ -79,7 +79,7 @@ public class CalculatorParseException extends SersoException implements Message
} }
@Override @Override
@Nullable @NotNull
public String getLocalizedMessage() { public String getLocalizedMessage() {
return this.message.getLocalizedMessage(Locale.getDefault()); return this.message.getLocalizedMessage(Locale.getDefault());
} }

View File

@ -14,7 +14,7 @@ public class SystemOutCalculatorLogger implements CalculatorLogger {
private static final String TAG = SystemOutCalculatorLogger.class.getSimpleName(); private static final String TAG = SystemOutCalculatorLogger.class.getSimpleName();
@Override @Override
public void debug(@Nullable String tag, @NotNull String message) { public void debug(@Nullable String tag, @Nullable String message) {
System.out.println(getTag(tag) + ": " + message); System.out.println(getTag(tag) + ": " + message);
} }
@ -24,13 +24,13 @@ public class SystemOutCalculatorLogger implements CalculatorLogger {
} }
@Override @Override
public void debug(@Nullable String tag, @NotNull String message, @NotNull Throwable e) { public void debug(@Nullable String tag, @Nullable String message, @NotNull Throwable e) {
debug(tag, message); debug(tag, message);
e.printStackTrace(System.out); e.printStackTrace(System.out);
} }
@Override @Override
public void error(@Nullable String tag, @NotNull String message, @NotNull Throwable e) { public void error(@Nullable String tag, @Nullable String message, @NotNull Throwable e) {
System.out.println(getTag(tag) + ": " + message); System.out.println(getTag(tag) + ": " + message);
e.printStackTrace(System.out); e.printStackTrace(System.out);
} }

View File

@ -308,7 +308,7 @@ public class AFunction implements IFunction, MathPersistenceEntity, Serializable
} }
@Override @Override
@Nullable @NotNull
public String getLocalizedMessage() { public String getLocalizedMessage() {
return message.getLocalizedMessage(); return message.getLocalizedMessage();
} }

View File

@ -160,7 +160,7 @@
<dependency> <dependency>
<groupId>org.solovyev</groupId> <groupId>org.solovyev</groupId>
<artifactId>jscl</artifactId> <artifactId>jscl</artifactId>
<version>1.0.0</version> <version>1.0.1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>xercesImpl</artifactId> <artifactId>xercesImpl</artifactId>