Fix some issues and remove unecessary code

pull/14/head
Sam Bosley 13 years ago
parent cbd2d92c0e
commit a0d7ac427c

@ -354,7 +354,6 @@ public abstract class AstridOrderedListUpdater<LIST> {
} }
try { try {
tree.put(-1L);
recursivelySerialize(root, tree); recursivelySerialize(root, tree);
} catch (JSONException e) { } catch (JSONException e) {
Log.e("OrderedListUpdater", "Error serializing tree model", e); //$NON-NLS-1$//$NON-NLS-2$ Log.e("OrderedListUpdater", "Error serializing tree model", e); //$NON-NLS-1$//$NON-NLS-2$
@ -362,7 +361,7 @@ public abstract class AstridOrderedListUpdater<LIST> {
return tree.toString(); return tree.toString();
} }
public static void recursivelySerialize(Node node, JSONArray serializeTo) throws JSONException { private static void recursivelySerialize(Node node, JSONArray serializeTo) throws JSONException {
ArrayList<Node> children = node.children; ArrayList<Node> children = node.children;
serializeTo.put(node.taskId); serializeTo.put(node.taskId);
for (Node child : children) { for (Node child : children) {

@ -2,9 +2,6 @@ package com.todoroo.astrid.subtasks;
import java.util.ArrayList; import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import android.util.Log; import android.util.Log;
import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.data.TodorooCursor;
@ -99,14 +96,7 @@ public class SubtasksMetadataMigration {
Node newNode = new Node(item.getValue(Metadata.TASK), parent, parent.indent + 1); Node newNode = new Node(item.getValue(Metadata.TASK), parent, parent.indent + 1);
parent.children.add(newNode); parent.children.add(newNode);
} }
return AstridOrderedListUpdater.serializeTree(root);
try {
JSONArray array = new JSONArray();
AstridOrderedListUpdater.recursivelySerialize(root, array);
return array.toString();
} catch (JSONException e) {
return "[]"; //$NON-NLS-1$
}
} }
private Node findNextParentForIndent(Node root, int indent) { private Node findNextParentForIndent(Node root, int indent) {

Loading…
Cancel
Save