diff --git a/src/main/java/org/javarosa/core/model/data/BooleanData.java b/src/main/java/org/javarosa/core/model/data/BooleanData.java index d05fe8433..519b16295 100644 --- a/src/main/java/org/javarosa/core/model/data/BooleanData.java +++ b/src/main/java/org/javarosa/core/model/data/BooleanData.java @@ -64,7 +64,7 @@ public String getDisplayText() { @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { data = (Boolean) o; } diff --git a/src/main/java/org/javarosa/core/model/data/DateData.java b/src/main/java/org/javarosa/core/model/data/DateData.java index faf3cece8..102ab9c2f 100644 --- a/src/main/java/org/javarosa/core/model/data/DateData.java +++ b/src/main/java/org/javarosa/core/model/data/DateData.java @@ -61,7 +61,7 @@ public IAnswerData clone () { } @Override - public void setValue (Object o) { + public void setValue (@NotNull Object o) { //Should not ever be possible to set this to a null value if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); diff --git a/src/main/java/org/javarosa/core/model/data/DateTimeData.java b/src/main/java/org/javarosa/core/model/data/DateTimeData.java index 39b8f5399..c91e1b511 100644 --- a/src/main/java/org/javarosa/core/model/data/DateTimeData.java +++ b/src/main/java/org/javarosa/core/model/data/DateTimeData.java @@ -42,7 +42,7 @@ public DateTimeData() { } - public DateTimeData (Date d) { + public DateTimeData (@NotNull Date d) { setValue(d); } @@ -52,7 +52,7 @@ public IAnswerData clone () { } @Override - public void setValue (Object o) { + public void setValue (@NotNull Object o) { //Should not ever be possible to set this to a null value if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); diff --git a/src/main/java/org/javarosa/core/model/data/DecimalData.java b/src/main/java/org/javarosa/core/model/data/DecimalData.java index 74e22bebb..412ae07e7 100644 --- a/src/main/java/org/javarosa/core/model/data/DecimalData.java +++ b/src/main/java/org/javarosa/core/model/data/DecimalData.java @@ -45,7 +45,7 @@ public DecimalData() { public DecimalData(double d) { this.d = d; } - public DecimalData(Double d) { + public DecimalData(@NotNull Double d) { setValue(d); } @@ -65,7 +65,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/GeoPointData.java b/src/main/java/org/javarosa/core/model/data/GeoPointData.java index 72ddf4ace..275d3b8ae 100644 --- a/src/main/java/org/javarosa/core/model/data/GeoPointData.java +++ b/src/main/java/org/javarosa/core/model/data/GeoPointData.java @@ -115,7 +115,7 @@ public String getDisplayText() { @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if (o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/GeoShapeData.java b/src/main/java/org/javarosa/core/model/data/GeoShapeData.java index d684d867b..98714be02 100644 --- a/src/main/java/org/javarosa/core/model/data/GeoShapeData.java +++ b/src/main/java/org/javarosa/core/model/data/GeoShapeData.java @@ -114,7 +114,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if (o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/GeoTraceData.java b/src/main/java/org/javarosa/core/model/data/GeoTraceData.java index df66af7a2..3d7275b43 100644 --- a/src/main/java/org/javarosa/core/model/data/GeoTraceData.java +++ b/src/main/java/org/javarosa/core/model/data/GeoTraceData.java @@ -120,7 +120,7 @@ public String getDisplayText() { @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if (o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/IAnswerData.java b/src/main/java/org/javarosa/core/model/data/IAnswerData.java index 9399c0ced..8ebfc79b6 100644 --- a/src/main/java/org/javarosa/core/model/data/IAnswerData.java +++ b/src/main/java/org/javarosa/core/model/data/IAnswerData.java @@ -125,7 +125,7 @@ static IAnswerData wrapData(Object val, int intDataType) { * Null Data will not overwrite existing values. * @throws NullPointerException if o is null */ - void setValue (Object o); //can't be null + void setValue (@NotNull Object o); //can't be null /** * @return The value of this answer, will never * be null diff --git a/src/main/java/org/javarosa/core/model/data/IntegerData.java b/src/main/java/org/javarosa/core/model/data/IntegerData.java index c5ec4ed41..f37dd35f7 100644 --- a/src/main/java/org/javarosa/core/model/data/IntegerData.java +++ b/src/main/java/org/javarosa/core/model/data/IntegerData.java @@ -45,7 +45,7 @@ public IntegerData() { public IntegerData(int n) { this.n = n; } - public IntegerData(Integer n) { + public IntegerData(@NotNull Integer n) { setValue(n); } @@ -65,7 +65,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/LongData.java b/src/main/java/org/javarosa/core/model/data/LongData.java index c6097ea23..e33289121 100644 --- a/src/main/java/org/javarosa/core/model/data/LongData.java +++ b/src/main/java/org/javarosa/core/model/data/LongData.java @@ -44,7 +44,7 @@ public LongData() { public LongData(long n) { this.n = n; } - public LongData(Long n) { + public LongData(@NotNull Long n) { setValue(n); } @@ -64,7 +64,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/MultiPointerAnswerData.java b/src/main/java/org/javarosa/core/model/data/MultiPointerAnswerData.java index c088e91a1..453a48997 100644 --- a/src/main/java/org/javarosa/core/model/data/MultiPointerAnswerData.java +++ b/src/main/java/org/javarosa/core/model/data/MultiPointerAnswerData.java @@ -65,7 +65,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/MultipleItemsData.java b/src/main/java/org/javarosa/core/model/data/MultipleItemsData.java index 2c4f30404..c3be74e85 100644 --- a/src/main/java/org/javarosa/core/model/data/MultipleItemsData.java +++ b/src/main/java/org/javarosa/core/model/data/MultipleItemsData.java @@ -49,7 +49,7 @@ public MultipleItemsData() { } - public MultipleItemsData(List vs) { + public MultipleItemsData(@NotNull List vs) { setValue(vs); } @@ -63,7 +63,7 @@ public IAnswerData clone () { } @Override - public void setValue (Object o) { + public void setValue (@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/PointerAnswerData.java b/src/main/java/org/javarosa/core/model/data/PointerAnswerData.java index 48755b770..29088a6dc 100644 --- a/src/main/java/org/javarosa/core/model/data/PointerAnswerData.java +++ b/src/main/java/org/javarosa/core/model/data/PointerAnswerData.java @@ -66,7 +66,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/SelectMultiData.java b/src/main/java/org/javarosa/core/model/data/SelectMultiData.java index 02e86dbe8..f1bfcb6b4 100644 --- a/src/main/java/org/javarosa/core/model/data/SelectMultiData.java +++ b/src/main/java/org/javarosa/core/model/data/SelectMultiData.java @@ -17,6 +17,7 @@ package org.javarosa.core.model.data; import org.javarosa.core.model.data.helper.Selection; +import org.jetbrains.annotations.NotNull; import java.util.List; @@ -32,7 +33,7 @@ public SelectMultiData() { } - public SelectMultiData(List vs) { + public SelectMultiData(@NotNull List vs) { setValue(vs); } } diff --git a/src/main/java/org/javarosa/core/model/data/SelectOneData.java b/src/main/java/org/javarosa/core/model/data/SelectOneData.java index 4b393853a..dce5536e1 100644 --- a/src/main/java/org/javarosa/core/model/data/SelectOneData.java +++ b/src/main/java/org/javarosa/core/model/data/SelectOneData.java @@ -45,7 +45,7 @@ public SelectOneData() { } - public SelectOneData (Selection s) { + public SelectOneData (@NotNull Selection s) { setValue(s); } @@ -55,7 +55,7 @@ public IAnswerData clone () { } @Override - public void setValue (Object o) { + public void setValue (@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/StringData.java b/src/main/java/org/javarosa/core/model/data/StringData.java index eb83ed9b7..24e1d95c6 100644 --- a/src/main/java/org/javarosa/core/model/data/StringData.java +++ b/src/main/java/org/javarosa/core/model/data/StringData.java @@ -41,7 +41,7 @@ public StringData() { } - public StringData (String s) { + public StringData (@NotNull String s) { setValue(s); } @@ -51,7 +51,7 @@ public IAnswerData clone () { } @Override - public void setValue (Object o) { + public void setValue (@NotNull Object o) { //string should not be null or empty; the entire StringData reference should be null in this case if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); diff --git a/src/main/java/org/javarosa/core/model/data/TimeData.java b/src/main/java/org/javarosa/core/model/data/TimeData.java index 8c919ad78..5a9b753b3 100644 --- a/src/main/java/org/javarosa/core/model/data/TimeData.java +++ b/src/main/java/org/javarosa/core/model/data/TimeData.java @@ -37,7 +37,7 @@ public class TimeData implements IAnswerData { public TimeData() { } - public TimeData (Date d) { + public TimeData (@NotNull Date d) { setValue(d); } @@ -47,7 +47,7 @@ public IAnswerData clone () { } @Override - public void setValue (Object o) { + public void setValue (@NotNull Object o) { if(o == null) { throw new NullPointerException("Attempt to set an IAnswerData class to null."); } diff --git a/src/main/java/org/javarosa/core/model/data/UncastData.java b/src/main/java/org/javarosa/core/model/data/UncastData.java index c94d5be0d..e5c00f443 100644 --- a/src/main/java/org/javarosa/core/model/data/UncastData.java +++ b/src/main/java/org/javarosa/core/model/data/UncastData.java @@ -52,7 +52,7 @@ public String getDisplayText() { } @Override - public void setValue(Object o) { + public void setValue(@NotNull Object o) { value = (String)o; }