diff --git a/app/src/main/java/com/todoroo/andlib/data/AbstractModel.java b/app/src/main/java/com/todoroo/andlib/data/AbstractModel.java index 96be06638..6da7011e9 100644 --- a/app/src/main/java/com/todoroo/andlib/data/AbstractModel.java +++ b/app/src/main/java/com/todoroo/andlib/data/AbstractModel.java @@ -16,10 +16,6 @@ import com.todoroo.andlib.data.Property.PropertyVisitor; import com.todoroo.andlib.utility.AndroidUtilities; import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.Map.Entry; @@ -402,39 +398,6 @@ public abstract class AbstractModel implements Parcelable, Cloneable { return trans != null; } - // --- property management - - /** - * Looks inside the given class and finds all declared properties - */ - protected static Property[] generateProperties(Class cls) { - ArrayList> properties = new ArrayList<>(); - if(cls.getSuperclass() != AbstractModel.class) { - properties.addAll(Arrays.asList(generateProperties( - (Class) cls.getSuperclass()))); - } - - // a property is public, static & extends Property - for(Field field : cls.getFields()) { - if((field.getModifiers() & Modifier.STATIC) == 0) { - continue; - } - if(!Property.class.isAssignableFrom(field.getType())) { - continue; - } - try { - if(((Property) field.get(null)).table == null) { - continue; - } - properties.add((Property) field.get(null)); - } catch (IllegalArgumentException | IllegalAccessException e) { - throw new RuntimeException(e); - } - } - - return properties.toArray(new Property[properties.size()]); - } - /** * Visitor that saves a value into a content values store * diff --git a/app/src/main/java/com/todoroo/astrid/data/Task.java b/app/src/main/java/com/todoroo/astrid/data/Task.java index 1ba682d8e..97027e412 100644 --- a/app/src/main/java/com/todoroo/astrid/data/Task.java +++ b/app/src/main/java/com/todoroo/astrid/data/Task.java @@ -175,7 +175,29 @@ public class Task extends AbstractModel { TABLE, "remoteId"); /** List of all properties for this model */ - public static final Property[] PROPERTIES = generateProperties(Task.class); + public static final Property[] PROPERTIES = new Property[] { + CALENDAR_URI, + COMPLETION_DATE, + CREATION_DATE, + DELETION_DATE, + DUE_DATE, + ELAPSED_SECONDS, + ESTIMATED_SECONDS, + HIDE_UNTIL, + ID, + IMPORTANCE, + MODIFICATION_DATE, + NOTES, + RECURRENCE, + REMINDER_FLAGS, + REMINDER_LAST, + REMINDER_PERIOD, + REMINDER_SNOOZE, + REPEAT_UNTIL, + TIMER_START, + TITLE, + UUID + }; // --- notification flags @@ -198,10 +220,6 @@ public class Task extends AbstractModel { public static final int IMPORTANCE_SHOULD_DO = 2; public static final int IMPORTANCE_NONE = 3; - /** - * @return colors that correspond to importance values - */ - // --- defaults /** Default values container */