From 8ce74099d62455aaa6061d8df15ff01a3bdf4a73 Mon Sep 17 00:00:00 2001 From: Gabor Keszthelyi Date: Wed, 24 Jan 2018 23:13:56 +0100 Subject: [PATCH 1/2] Update FieldAdapter with Nullable/NonNull annotations. Fix code in implementations where it was needed. #644 --- .../dmfs/tasks/model/TaskFieldAdapters.java | 8 +-- .../java/org/dmfs/tasks/model/XmlModel.java | 4 +- .../model/adapters/BooleanFieldAdapter.java | 21 ++++--- .../model/adapters/ChecklistFieldAdapter.java | 17 ++--- .../model/adapters/ColorFieldAdapter.java | 17 +++-- .../CustomizedDefaultFieldAdapter.java | 19 +++--- .../DescriptionStringFieldAdapter.java | 8 ++- .../tasks/model/adapters/FieldAdapter.java | 28 +++++---- .../model/adapters/FloatFieldAdapter.java | 17 ++--- .../adapters/FormattedStringFieldAdapter.java | 19 +++--- .../model/adapters/IntegerFieldAdapter.java | 19 +++--- .../model/adapters/StringFieldAdapter.java | 17 ++--- .../model/adapters/TimeFieldAdapter.java | 18 +++--- .../model/adapters/TimezoneFieldAdapter.java | 62 +++++++------------ .../tasks/model/adapters/UriFieldAdapter.java | 19 +++--- .../dmfs/tasks/utils/BooleanBinaryLong.java | 47 ++++++++++++++ 16 files changed, 212 insertions(+), 128 deletions(-) create mode 100644 opentasks/src/main/java/org/dmfs/tasks/utils/BooleanBinaryLong.java diff --git a/opentasks/src/main/java/org/dmfs/tasks/model/TaskFieldAdapters.java b/opentasks/src/main/java/org/dmfs/tasks/model/TaskFieldAdapters.java index f1195736d..0c4766d59 100644 --- a/opentasks/src/main/java/org/dmfs/tasks/model/TaskFieldAdapters.java +++ b/opentasks/src/main/java/org/dmfs/tasks/model/TaskFieldAdapters.java @@ -62,7 +62,7 @@ public final class TaskFieldAdapters * Adapter for the status of a task. */ public final static IntegerFieldAdapter STATUS = (IntegerFieldAdapter) new IntegerFieldAdapter(Tasks.STATUS, Tasks.STATUS_NEEDS_ACTION) - .addContraint(new AdjustPercentComplete(PERCENT_COMPLETE)); + .addConstraint(new AdjustPercentComplete(PERCENT_COMPLETE)); /** * Adapter for the priority value of a task. @@ -108,7 +108,7 @@ public final class TaskFieldAdapters * Adapter for the checklist of a task. */ public final static ChecklistFieldAdapter CHECKLIST = (ChecklistFieldAdapter) new ChecklistFieldAdapter(Tasks.DESCRIPTION) - .addContraint(new ChecklistConstraint(STATUS, PERCENT_COMPLETE)); + .addConstraint(new ChecklistConstraint(STATUS, PERCENT_COMPLETE)); /** * Private adapter for the start date of a task. We need this to reference DTSTART from DUE. @@ -119,12 +119,12 @@ public final class TaskFieldAdapters /** * Adapter for the due date of a task. */ - public final static FieldAdapter