Fix for I calculations
This commit is contained in:
@@ -6,14 +6,14 @@ import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.solovyev.android.calculator.view.NumeralBaseConverterDialog;
|
||||
import org.solovyev.android.menu.ActivityMenuItem;
|
||||
import org.solovyev.android.menu.IdentifiableMenuItem;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 4/23/12
|
||||
* Time: 2:25 PM
|
||||
*/
|
||||
enum CalculatorMenu implements ActivityMenuItem {
|
||||
enum CalculatorMenu implements IdentifiableMenuItem {
|
||||
|
||||
settings(R.id.main_menu_item_settings){
|
||||
@Override
|
||||
|
@@ -114,7 +114,7 @@ public enum CalculatorEngine {
|
||||
|
||||
private final AndroidMathRegistry<Operator> postfixFunctionsRegistry = new AndroidPostfixFunctionsRegistry(engine.getPostfixFunctionsRegistry());
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
private ThreadKiller threadKiller = new AndroidThreadKiller();
|
||||
|
||||
// calculation thread timeout in seconds, after timeout thread would be interrupted
|
||||
@@ -256,9 +256,10 @@ public enum CalculatorEngine {
|
||||
final Thread calculationThreadLocal = calculationThread.getObject();
|
||||
|
||||
if (calculationThreadLocal != null) {
|
||||
// todo serso: interrupt doesn't stop the thread but it MUST be killed
|
||||
threadKiller.killThread(calculationThreadLocal);
|
||||
//calculationThreadLocal.stop();
|
||||
if (threadKiller != null) {
|
||||
threadKiller.killThread(calculationThreadLocal);
|
||||
}
|
||||
//calculationThreadLocal.stop();
|
||||
}
|
||||
|
||||
if (parseExceptionObject != null || evalExceptionObject != null) {
|
||||
@@ -396,7 +397,7 @@ public enum CalculatorEngine {
|
||||
}
|
||||
|
||||
// for tests only
|
||||
void setThreadKiller(@NotNull ThreadKiller threadKiller) {
|
||||
void setThreadKiller(@Nullable ThreadKiller threadKiller) {
|
||||
this.threadKiller = threadKiller;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user