@NonNull lints

This commit is contained in:
Milos Kozak 2021-02-19 15:47:07 +01:00
parent bd0758b846
commit fdb6bcc178
63 changed files with 205 additions and 140 deletions

View file

@ -1,8 +1,9 @@
package info.nightscout.androidaps.db; package info.nightscout.androidaps.db;
import androidx.annotation.NonNull;
import com.j256.ormlite.dao.CloseableIterator; import com.j256.ormlite.dao.CloseableIterator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.sql.SQLException; import java.sql.SQLException;
@ -20,31 +21,31 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
@Inject DatabaseHelperProvider() { @Inject DatabaseHelperProvider() {
} }
@Override public void createOrUpdate(@NotNull CareportalEvent careportalEvent) { @Override public void createOrUpdate(@NonNull CareportalEvent careportalEvent) {
MainApp.getDbHelper().createOrUpdate(careportalEvent); MainApp.getDbHelper().createOrUpdate(careportalEvent);
} }
@Override public void createOrUpdate(@NotNull DanaRHistoryRecord record) { @Override public void createOrUpdate(@NonNull DanaRHistoryRecord record) {
MainApp.getDbHelper().createOrUpdate(record); MainApp.getDbHelper().createOrUpdate(record);
} }
@Override public void createOrUpdate(@NotNull OmnipodHistoryRecord record) { @Override public void createOrUpdate(@NonNull OmnipodHistoryRecord record) {
MainApp.getDbHelper().createOrUpdate(record); MainApp.getDbHelper().createOrUpdate(record);
} }
@NotNull @Override public List<DanaRHistoryRecord> getDanaRHistoryRecordsByType(byte type) { @NonNull @Override public List<DanaRHistoryRecord> getDanaRHistoryRecordsByType(byte type) {
return MainApp.getDbHelper().getDanaRHistoryRecordsByType(type); return MainApp.getDbHelper().getDanaRHistoryRecordsByType(type);
} }
@NotNull @Override public List<TDD> getTDDs() { @NonNull @Override public List<TDD> getTDDs() {
return MainApp.getDbHelper().getTDDs(); return MainApp.getDbHelper().getTDDs();
} }
@Override public long size(@NotNull String table) { @Override public long size(@NonNull String table) {
return MainApp.getDbHelper().size(table); return MainApp.getDbHelper().size(table);
} }
@Override public void create(@NotNull DbRequest record) { @Override public void create(@NonNull DbRequest record) {
try { try {
MainApp.getDbHelper().create(record); MainApp.getDbHelper().create(record);
} catch (SQLException e) { } catch (SQLException e) {
@ -56,15 +57,15 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
MainApp.getDbHelper().deleteAllDbRequests(); MainApp.getDbHelper().deleteAllDbRequests();
} }
@Override public int deleteDbRequest(@NotNull String id) { @Override public int deleteDbRequest(@NonNull String id) {
return MainApp.getDbHelper().deleteDbRequest(id); return MainApp.getDbHelper().deleteDbRequest(id);
} }
@Override public void deleteDbRequestbyMongoId(@NotNull String action, @NotNull String _id) { @Override public void deleteDbRequestbyMongoId(@NonNull String action, @NonNull String _id) {
MainApp.getDbHelper().deleteDbRequestbyMongoId(action, _id); MainApp.getDbHelper().deleteDbRequestbyMongoId(action, _id);
} }
@NotNull @Override public CloseableIterator<DbRequest> getDbRequestInterator() { @NonNull @Override public CloseableIterator<DbRequest> getDbRequestInterator() {
return MainApp.getDbHelper().getDbRequestInterator(); return MainApp.getDbHelper().getDbRequestInterator();
} }
@ -72,19 +73,19 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
return MainApp.getDbHelper().roundDateToSec(date); return MainApp.getDbHelper().roundDateToSec(date);
} }
@Override public void createOrUpdateTDD(@NotNull TDD record) { @Override public void createOrUpdateTDD(@NonNull TDD record) {
MainApp.getDbHelper().createOrUpdateTDD(record); MainApp.getDbHelper().createOrUpdateTDD(record);
} }
@Override public void createOrUpdate(@NotNull TemporaryBasal tempBasal) { @Override public void createOrUpdate(@NonNull TemporaryBasal tempBasal) {
MainApp.getDbHelper().createOrUpdate(tempBasal); MainApp.getDbHelper().createOrUpdate(tempBasal);
} }
@NotNull @Override public TemporaryBasal findTempBasalByPumpId(long id) { @NonNull @Override public TemporaryBasal findTempBasalByPumpId(long id) {
return MainApp.getDbHelper().findTempBasalByPumpId(id); return MainApp.getDbHelper().findTempBasalByPumpId(id);
} }
@NotNull @Override public List<TemporaryBasal> getTemporaryBasalsDataFromTime(long mills, boolean ascending) { @NonNull @Override public List<TemporaryBasal> getTemporaryBasalsDataFromTime(long mills, boolean ascending) {
return MainApp.getDbHelper().getTemporaryBasalsDataFromTime(mills, ascending); return MainApp.getDbHelper().getTemporaryBasalsDataFromTime(mills, ascending);
} }
@ -92,7 +93,7 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
return MainApp.getDbHelper().getCareportalEventFromTimestamp(timestamp); return MainApp.getDbHelper().getCareportalEventFromTimestamp(timestamp);
} }
@NotNull @Override public List<OmnipodHistoryRecord> getAllOmnipodHistoryRecordsFromTimestamp(long timestamp, boolean ascending) { @NonNull @Override public List<OmnipodHistoryRecord> getAllOmnipodHistoryRecordsFromTimestamp(long timestamp, boolean ascending) {
return MainApp.getDbHelper().getAllOmnipodHistoryRecordsFromTimeStamp(timestamp, ascending); return MainApp.getDbHelper().getAllOmnipodHistoryRecordsFromTimeStamp(timestamp, ascending);
} }
@ -100,27 +101,27 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
return MainApp.getDbHelper().findOmnipodHistoryRecordByPumpId(pumpId); return MainApp.getDbHelper().findOmnipodHistoryRecordByPumpId(pumpId);
} }
@NotNull @Override public List<TDD> getTDDsForLastXDays(int days) { @NonNull @Override public List<TDD> getTDDsForLastXDays(int days) {
return MainApp.getDbHelper().getTDDsForLastXDays(days); return MainApp.getDbHelper().getTDDsForLastXDays(days);
} }
@NotNull @Override public List<ProfileSwitch> getProfileSwitchData(long from, boolean ascending) { @NonNull @Override public List<ProfileSwitch> getProfileSwitchData(long from, boolean ascending) {
return MainApp.getDbHelper().getProfileSwitchData(from, ascending); return MainApp.getDbHelper().getProfileSwitchData(from, ascending);
} }
@Override public void createOrUpdate(@NotNull InsightBolusID record) { @Override public void createOrUpdate(@NonNull InsightBolusID record) {
MainApp.getDbHelper().createOrUpdate(record); MainApp.getDbHelper().createOrUpdate(record);
} }
@Override public void createOrUpdate(@NotNull InsightPumpID record) { @Override public void createOrUpdate(@NonNull InsightPumpID record) {
MainApp.getDbHelper().createOrUpdate(record); MainApp.getDbHelper().createOrUpdate(record);
} }
@Override public void createOrUpdate(@NotNull InsightHistoryOffset record) { @Override public void createOrUpdate(@NonNull InsightHistoryOffset record) {
MainApp.getDbHelper().createOrUpdate(record); MainApp.getDbHelper().createOrUpdate(record);
} }
@Override public void delete(@NotNull ExtendedBolus extendedBolus) { @Override public void delete(@NonNull ExtendedBolus extendedBolus) {
MainApp.getDbHelper().delete(extendedBolus); MainApp.getDbHelper().delete(extendedBolus);
} }
@ -128,15 +129,15 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
return MainApp.getDbHelper().getExtendedBolusByPumpId(pumpId); return MainApp.getDbHelper().getExtendedBolusByPumpId(pumpId);
} }
@Nullable @Override public InsightBolusID getInsightBolusID(@NotNull String pumpSerial, int bolusID, long timestamp) { @Nullable @Override public InsightBolusID getInsightBolusID(@NonNull String pumpSerial, int bolusID, long timestamp) {
return MainApp.getDbHelper().getInsightBolusID(pumpSerial, bolusID, timestamp); return MainApp.getDbHelper().getInsightBolusID(pumpSerial, bolusID, timestamp);
} }
@Nullable @Override public InsightHistoryOffset getInsightHistoryOffset(@NotNull String pumpSerial) { @Nullable @Override public InsightHistoryOffset getInsightHistoryOffset(@NonNull String pumpSerial) {
return MainApp.getDbHelper().getInsightHistoryOffset(pumpSerial); return MainApp.getDbHelper().getInsightHistoryOffset(pumpSerial);
} }
@Nullable @Override public InsightPumpID getPumpStoppedEvent(@NotNull String pumpSerial, long before) { @Nullable @Override public InsightPumpID getPumpStoppedEvent(@NonNull String pumpSerial, long before) {
return MainApp.getDbHelper().getPumpStoppedEvent(pumpSerial, before); return MainApp.getDbHelper().getPumpStoppedEvent(pumpSerial, before);
} }
} }

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.general.food; package info.nightscout.androidaps.plugins.general.food;
import androidx.annotation.NonNull;
import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable; import com.j256.ormlite.table.DatabaseTable;
@ -123,7 +125,7 @@ public class Food {
gi = other.gi; gi = other.gi;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("_id=" + _id + ";"); sb.append("_id=" + _id + ";");

View file

@ -13,7 +13,7 @@ import android.text.Spanned;
import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.SwitchPreference; import androidx.preference.SwitchPreference;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -214,7 +214,7 @@ public class NSClientPlugin extends PluginBase {
} }
@Override @Override
public void preprocessPreferences(@NotNull PreferenceFragmentCompat preferenceFragment) { public void preprocessPreferences(@NonNull PreferenceFragmentCompat preferenceFragment) {
super.preprocessPreferences(preferenceFragment); super.preprocessPreferences(preferenceFragment);
if (config.getNSCLIENT()) { if (config.getNSCLIENT()) {

View file

@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
import androidx.work.Worker; import androidx.work.Worker;
import androidx.work.WorkerParameters; import androidx.work.WorkerParameters;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import javax.inject.Inject; import javax.inject.Inject;
@ -28,7 +28,7 @@ public class NSClientWorker extends Worker {
@Inject NSClientPlugin nsClientPlugin; @Inject NSClientPlugin nsClientPlugin;
@Inject BundleStore bundleStore; @Inject BundleStore bundleStore;
@NotNull @NonNull
@Override @Override
public Result doWork() { public Result doWork() {
Bundle bundle = bundleStore.pickup(getInputData().getLong(DataReceiver.STORE_KEY, -1)); Bundle bundle = bundleStore.pickup(getInputData().getLong(DataReceiver.STORE_KEY, -1));

View file

@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.sensitivity;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.collection.LongSparseArray; import androidx.collection.LongSparseArray;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -186,11 +186,11 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
return output; return output;
} }
@NotNull @Override public SensitivityType getId() { @NonNull @Override public SensitivityType getId() {
return SensitivityType.SENSITIVITY_AAPS; return SensitivityType.SENSITIVITY_AAPS;
} }
@NotNull @Override public JSONObject configuration() { @NonNull @Override public JSONObject configuration() {
JSONObject c = new JSONObject(); JSONObject c = new JSONObject();
try { try {
c.put(getResourceHelper().gs(R.string.key_absorption_maxtime), getSp().getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME)); c.put(getResourceHelper().gs(R.string.key_absorption_maxtime), getSp().getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME));
@ -203,7 +203,7 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
return c; return c;
} }
@Override public void applyConfiguration(@NotNull JSONObject configuration) { @Override public void applyConfiguration(@NonNull JSONObject configuration) {
try { try {
if (configuration.has(getResourceHelper().gs(R.string.key_absorption_maxtime))) if (configuration.has(getResourceHelper().gs(R.string.key_absorption_maxtime)))
getSp().putDouble(R.string.key_absorption_maxtime, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_maxtime))); getSp().putDouble(R.string.key_absorption_maxtime, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_maxtime)));

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sensitivity;
import androidx.collection.LongSparseArray; import androidx.collection.LongSparseArray;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -68,7 +68,7 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
this.dateUtil = dateUtil; this.dateUtil = dateUtil;
} }
@NotNull @Override @NonNull @Override
public AutosensResult detectSensitivity(IobCobCalculatorInterface iobCobCalculatorPlugin, long fromTime, long toTime) { public AutosensResult detectSensitivity(IobCobCalculatorInterface iobCobCalculatorPlugin, long fromTime, long toTime) {
// todo this method is called from the IobCobCalculatorPlugin, which leads to a circular // todo this method is called from the IobCobCalculatorPlugin, which leads to a circular
// dependency, this should be avoided // dependency, this should be avoided
@ -252,7 +252,7 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
return output; return output;
} }
@NotNull @Override public JSONObject configuration() { @NonNull @Override public JSONObject configuration() {
JSONObject c = new JSONObject(); JSONObject c = new JSONObject();
try { try {
c.put(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact), getSp().getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact)); c.put(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact), getSp().getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact));
@ -265,7 +265,7 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
return c; return c;
} }
@Override public void applyConfiguration(@NotNull JSONObject configuration) { @Override public void applyConfiguration(@NonNull JSONObject configuration) {
try { try {
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact))) if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact)))
getSp().putDouble(R.string.key_openapsama_min_5m_carbimpact, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact))); getSp().putDouble(R.string.key_openapsama_min_5m_carbimpact, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact)));
@ -280,7 +280,7 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
} }
} }
@NotNull @Override public SensitivityType getId() { @NonNull @Override public SensitivityType getId() {
return SensitivityType.SENSITIVITY_OREF1; return SensitivityType.SENSITIVITY_OREF1;
} }
} }

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sensitivity;
import androidx.collection.LongSparseArray; import androidx.collection.LongSparseArray;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -206,11 +206,11 @@ public class SensitivityWeightedAveragePlugin extends AbstractSensitivityPlugin
return output; return output;
} }
@NotNull @Override public SensitivityType getId() { @NonNull @Override public SensitivityType getId() {
return SensitivityType.SENSITIVITY_WEIGHTED; return SensitivityType.SENSITIVITY_WEIGHTED;
} }
@NotNull @Override public JSONObject configuration() { @NonNull @Override public JSONObject configuration() {
JSONObject c = new JSONObject(); JSONObject c = new JSONObject();
try { try {
c.put(getResourceHelper().gs(R.string.key_absorption_maxtime), getSp().getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME)); c.put(getResourceHelper().gs(R.string.key_absorption_maxtime), getSp().getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME));
@ -223,7 +223,7 @@ public class SensitivityWeightedAveragePlugin extends AbstractSensitivityPlugin
return c; return c;
} }
@Override public void applyConfiguration(@NotNull JSONObject configuration) { @Override public void applyConfiguration(@NonNull JSONObject configuration) {
try { try {
if (configuration.has(getResourceHelper().gs(R.string.key_absorption_maxtime))) if (configuration.has(getResourceHelper().gs(R.string.key_absorption_maxtime)))
getSp().putDouble(R.string.key_absorption_maxtime, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_maxtime))); getSp().putDouble(R.string.key_absorption_maxtime, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_maxtime)));

View file

@ -8,7 +8,7 @@ import androidx.annotation.Nullable;
import com.google.firebase.analytics.FirebaseAnalytics; import com.google.firebase.analytics.FirebaseAnalytics;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -765,7 +765,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
} }
@Override @Override
public void doProfileSwitch(@NotNull final ProfileStore profileStore, @NotNull final String profileName, final int duration, final int percentage, final int timeShift, final long date) { public void doProfileSwitch(@NonNull final ProfileStore profileStore, @NonNull final String profileName, final int duration, final int percentage, final int timeShift, final long date) {
ProfileSwitch profileSwitch = profileFunction.prepareProfileSwitch(profileStore, profileName, duration, percentage, timeShift, date); ProfileSwitch profileSwitch = profileFunction.prepareProfileSwitch(profileStore, profileName, duration, percentage, timeShift, date);
addToHistoryProfileSwitch(profileSwitch); addToHistoryProfileSwitch(profileSwitch);
if (percentage == 90 && duration == 10) if (percentage == 90 && duration == 10)

View file

@ -1255,9 +1255,9 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
} }
@NonNull @Override @NonNull @Override
public JSONObject getJSONStatus(@NotNull Profile profile, @NotNull String profileName, @NotNull String version) { public JSONObject getJSONStatus(@NonNull Profile profile, @NonNull String profileName, @NonNull String version) {
if (!pump.initialized) { if (!pump.initialized) {
return null; return new JSONObject();
} }
try { try {
@ -1302,7 +1302,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
getAapsLogger().warn(LTag.PUMP, "Failed to gather device status for upload " + e); getAapsLogger().warn(LTag.PUMP, "Failed to gather device status for upload " + e);
} }
return null; return new JSONObject();
} }
@NonNull @Override @NonNull @Override

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter; package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter;
import androidx.annotation.NonNull;
import java.util.Arrays; import java.util.Arrays;
public class BasalProfile { public class BasalProfile {
@ -29,7 +31,7 @@ public class BasalProfile {
return Arrays.hashCode(hourlyRates); return Arrays.hashCode(hourlyRates);
} }
@Override @NonNull @Override
public String toString() { public String toString() {
double total = 0d; double total = 0d;
for(int i = 0; i < 24; i++) { for(int i = 0; i < 24; i++) {

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter; package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import java.util.LinkedList; import java.util.LinkedList;
@ -46,7 +47,7 @@ public class CommandResult {
return this; return this;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "CommandResult{" + return "CommandResult{" +
"success=" + success + "success=" + success +

View file

@ -2,10 +2,11 @@ package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.commands;
import android.os.SystemClock; import android.os.SystemClock;
import androidx.annotation.NonNull;
import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute; import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute;
import org.monkey.d.ruffy.ruffy.driver.display.MenuType; import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -14,8 +15,8 @@ import java.util.Objects;
import info.nightscout.androidaps.logging.StacktraceLoggerWrapper; import info.nightscout.androidaps.logging.StacktraceLoggerWrapper;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.PumpWarningCodes; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.PumpWarningCodes;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.WarningOrErrorCode;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.WarningOrErrorCode;
import static info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter.State.DELIVERED; import static info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter.State.DELIVERED;
import static info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter.State.DELIVERING; import static info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter.State.DELIVERING;
@ -244,7 +245,7 @@ public class BolusCommand extends BaseCommand {
bolusProgressReporter.report(STOPPING, 0, 0); bolusProgressReporter.report(STOPPING, 0, 0);
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "BolusCommand{" + return "BolusCommand{" +
"bolus=" + bolus + "bolus=" + bolus +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.commands; package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.commands;
import androidx.annotation.NonNull;
import org.monkey.d.ruffy.ruffy.driver.display.MenuType; import org.monkey.d.ruffy.ruffy.driver.display.MenuType;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -35,7 +37,7 @@ public class CancelTbrCommand extends BaseCommand {
result = setTbrCommand.result; result = setTbrCommand.result;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "CancelTbrCommand{}"; return "CancelTbrCommand{}";
} }

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.data;
import androidx.collection.LongSparseArray; import androidx.collection.LongSparseArray;
import androidx.annotation.NonNull;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
@ -66,7 +67,7 @@ public class Profile {
this.injector = injector; this.injector = injector;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
if (json != null) if (json != null)
return json.toString(); return json.toString();

View file

@ -2,6 +2,8 @@ package info.nightscout.androidaps.db;
import android.graphics.Color; import android.graphics.Color;
import androidx.annotation.NonNull;
import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable; import com.j256.ormlite.table.DatabaseTable;
@ -132,7 +134,7 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval {
return getHoursFromStart() > hours; return getHoursFromStart() > hours;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "CareportalEvent{" + return "CareportalEvent{" +
"date= " + date + "date= " + date +

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.interfaces; package info.nightscout.androidaps.interfaces;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import java.util.List; import java.util.List;
@ -84,7 +84,7 @@ public interface TreatmentsInterface {
void addToHistoryProfileSwitch(ProfileSwitch profileSwitch); void addToHistoryProfileSwitch(ProfileSwitch profileSwitch);
void doProfileSwitch(@NotNull final ProfileStore profileStore, @NotNull final String profileName, final int duration, final int percentage, final int timeShift, final long date); void doProfileSwitch(@NonNull final ProfileStore profileStore, @NonNull final String profileName, final int duration, final int percentage, final int timeShift, final long date);
void doProfileSwitch(final int duration, final int percentage, final int timeShift); void doProfileSwitch(final int duration, final int percentage, final int timeShift);

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.iob.iobCobCalculator.data; package info.nightscout.androidaps.plugins.iob.iobCobCalculator.data;
import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -40,10 +42,10 @@ public class AutosensData implements DataPointWithLabelInterface {
} }
public class CarbsInPast { public class CarbsInPast {
long time = 0L; long time;
double carbs = 0d; double carbs;
public double min5minCarbImpact = 0d; public double min5minCarbImpact;
double remaining = 0d; double remaining;
public CarbsInPast(Treatment t, boolean isAAPSOrWeighted) { public CarbsInPast(Treatment t, boolean isAAPSOrWeighted) {
time = t.date; time = t.date;
@ -68,7 +70,7 @@ public class AutosensData implements DataPointWithLabelInterface {
this.remaining = other.remaining; this.remaining = other.remaining;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return String.format(Locale.ENGLISH, "CarbsInPast: time: %s carbs: %.02f min5minCI: %.02f remaining: %.2f", dateUtil.dateAndTimeString(time), carbs, min5minCarbImpact, remaining); return String.format(Locale.ENGLISH, "CarbsInPast: time: %s carbs: %.02f min5minCI: %.02f remaining: %.2f", dateUtil.dateAndTimeString(time), carbs, min5minCarbImpact, remaining);
} }
@ -103,7 +105,7 @@ public class AutosensData implements DataPointWithLabelInterface {
public boolean uam = false; public boolean uam = false;
public List<Double> extraDeviation = new ArrayList<>(); public List<Double> extraDeviation = new ArrayList<>();
@Override @NonNull @Override
public String toString() { public String toString() {
return String.format(Locale.ENGLISH, "AutosensData: %s pastSensitivity=%s delta=%.02f avgDelta=%.02f bgi=%.02f deviation=%.02f avgDeviation=%.02f absorbed=%.02f carbsFromBolus=%.02f cob=%.02f autosensRatio=%.02f slopeFromMaxDeviation=%.02f slopeFromMinDeviation=%.02f activeCarbsList=%s", return String.format(Locale.ENGLISH, "AutosensData: %s pastSensitivity=%s delta=%.02f avgDelta=%.02f bgi=%.02f deviation=%.02f avgDeviation=%.02f absorbed=%.02f carbsFromBolus=%.02f cob=%.02f autosensRatio=%.02f slopeFromMaxDeviation=%.02f slopeFromMinDeviation=%.02f activeCarbsList=%s",
dateUtil.dateAndTimeString(time), pastSensitivity, delta, avgDelta, bgi, deviation, avgDeviation, absorbed, carbsFromBolus, cob, autosensResult.ratio, slopeFromMaxDeviation, slopeFromMinDeviation, activeCarbsList.toString()); dateUtil.dateAndTimeString(time), pastSensitivity, delta, avgDelta, bgi, deviation, avgDeviation, absorbed, carbsFromBolus, cob, autosensResult.ratio, slopeFromMaxDeviation, slopeFromMinDeviation, activeCarbsList.toString());
@ -121,7 +123,7 @@ public class AutosensData implements DataPointWithLabelInterface {
// remove carbs older than timeframe // remove carbs older than timeframe
public void removeOldCarbs(long toTime, boolean isAAPSOrWeighted) { public void removeOldCarbs(long toTime, boolean isAAPSOrWeighted) {
double maxAbsorptionHours = Constants.DEFAULT_MAX_ABSORPTION_TIME; double maxAbsorptionHours;
if (isAAPSOrWeighted) { if (isAAPSOrWeighted) {
maxAbsorptionHours = sp.getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME); maxAbsorptionHours = sp.getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME);
} else { } else {

View file

@ -6,7 +6,6 @@ import android.content.ServiceConnection;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import org.jetbrains.annotations.NotNull;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -445,7 +444,7 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements PumpI
return pumpType.getManufacturer(); return pumpType.getManufacturer();
} }
@NotNull @NonNull
public PumpType model() { public PumpType model() {
return pumpType; return pumpType;
} }

View file

@ -6,6 +6,8 @@ import android.text.Spanned;
import android.text.method.NumberKeyListener; import android.text.method.NumberKeyListener;
import android.view.KeyEvent; import android.view.KeyEvent;
import androidx.annotation.NonNull;
class DigitsKeyListenerWithComma extends NumberKeyListener { class DigitsKeyListenerWithComma extends NumberKeyListener {
/** /**
@ -30,7 +32,7 @@ class DigitsKeyListenerWithComma extends NumberKeyListener {
private static final DigitsKeyListenerWithComma[] sInstance = new DigitsKeyListenerWithComma[4]; private static final DigitsKeyListenerWithComma[] sInstance = new DigitsKeyListenerWithComma[4];
@Override @Override @NonNull
protected char[] getAcceptedChars() { protected char[] getAcceptedChars() {
return mAccepted; return mAccepted;
} }
@ -109,7 +111,7 @@ class DigitsKeyListenerWithComma extends NumberKeyListener {
Spanned dest, int dstart, int dend) { Spanned dest, int dstart, int dend) {
CharSequence out = super.filter(source, start, end, dest, dstart, dend); CharSequence out = super.filter(source, start, end, dest, dstart, dend);
if (mSign == false && mDecimal == false) { if (!mSign && !mDecimal) {
return out; return out;
} }

View file

@ -194,7 +194,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
// This is called from APS // This is called from APS
@NonNull @Override @NonNull @Override
public PumpEnactResult setTempBasalAbsolute(double absoluteRate, int durationInMinutes, Profile profile, boolean enforceNew) { public PumpEnactResult setTempBasalAbsolute(double absoluteRate, int durationInMinutes, @NonNull Profile profile, boolean enforceNew) {
// Recheck pump status if older than 30 min // Recheck pump status if older than 30 min
//This should not be needed while using queue because connection should be done before calling this //This should not be needed while using queue because connection should be done before calling this
//if (pump.lastConnection.getTime() + 30 * 60 * 1000L < System.currentTimeMillis()) { //if (pump.lastConnection.getTime() + 30 * 60 * 1000L < System.currentTimeMillis()) {
@ -234,7 +234,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
} }
if (doLowTemp || doHighTemp) { if (doLowTemp || doHighTemp) {
Integer percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue(); int percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue();
// Any basal less than 0.10u/h will be dumped once per hour, not every 4 mins. So if it's less than .10u/h, set a zero temp. // Any basal less than 0.10u/h will be dumped once per hour, not every 4 mins. So if it's less than .10u/h, set a zero temp.
if (absoluteRate < 0.10d) percentRate = 0; if (absoluteRate < 0.10d) percentRate = 0;
if (percentRate < 100) percentRate = Round.ceilTo((double) percentRate, 10d).intValue(); if (percentRate < 100) percentRate = Round.ceilTo((double) percentRate, 10d).intValue();
@ -314,7 +314,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
} }
// Now set new extended, no need to to stop previous (if running) because it's replaced // Now set new extended, no need to to stop previous (if running) because it's replaced
Double extendedAmount = extendedRateToSet / 2 * durationInHalfHours; double extendedAmount = extendedRateToSet / 2 * durationInHalfHours;
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Setting extended: " + extendedAmount + "U halfhours: " + durationInHalfHours); aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Setting extended: " + extendedAmount + "U halfhours: " + durationInHalfHours);
result = setExtendedBolus(extendedAmount, durationInMinutes); result = setExtendedBolus(extendedAmount, durationInMinutes);
if (!result.success) { if (!result.success) {
@ -365,14 +365,13 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
result.isTempCancel = true; result.isTempCancel = true;
result.comment = resourceHelper.gs(R.string.ok); result.comment = resourceHelper.gs(R.string.ok);
aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK"); aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK");
return result;
} else { } else {
result.success = false; result.success = false;
result.comment = resourceHelper.gs(R.string.danar_valuenotsetproperly); result.comment = resourceHelper.gs(R.string.danar_valuenotsetproperly);
result.isTempCancel = true; result.isTempCancel = true;
aapsLogger.error("cancelRealTempBasal: Failed to cancel temp basal"); aapsLogger.error("cancelRealTempBasal: Failed to cancel temp basal");
return result;
} }
return result;
} }
@Override @Override

View file

@ -220,7 +220,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
// This is called from APS // This is called from APS
@NonNull @Override @NonNull @Override
public PumpEnactResult setTempBasalAbsolute(double absoluteRate, int durationInMinutes, Profile profile, boolean enforceNew) { public PumpEnactResult setTempBasalAbsolute(double absoluteRate, int durationInMinutes, @NonNull Profile profile, boolean enforceNew) {
// Recheck pump status if older than 30 min // Recheck pump status if older than 30 min
//This should not be needed while using queue because connection should be done before calling this //This should not be needed while using queue because connection should be done before calling this
//if (pump.lastConnection.getTime() + 30 * 60 * 1000L < System.currentTimeMillis()) { //if (pump.lastConnection.getTime() + 30 * 60 * 1000L < System.currentTimeMillis()) {
@ -298,7 +298,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
} }
@NonNull @Override @NonNull @Override
public PumpEnactResult setTempBasalPercent(int percent, int durationInMinutes, Profile profile, boolean enforceNew) { public PumpEnactResult setTempBasalPercent(int percent, int durationInMinutes, @NonNull Profile profile, boolean enforceNew) {
DanaPump pump = danaPump; DanaPump pump = danaPump;
PumpEnactResult result = new PumpEnactResult(getInjector()); PumpEnactResult result = new PumpEnactResult(getInjector());
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value(); percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
@ -386,14 +386,13 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
result.isTempCancel = true; result.isTempCancel = true;
result.comment = resourceHelper.gs(R.string.ok); result.comment = resourceHelper.gs(R.string.ok);
aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK"); aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK");
return result;
} else { } else {
result.success = false; result.success = false;
result.comment = resourceHelper.gs(R.string.danar_valuenotsetproperly); result.comment = resourceHelper.gs(R.string.danar_valuenotsetproperly);
result.isTempCancel = true; result.isTempCancel = true;
aapsLogger.error("cancelRealTempBasal: Failed to cancel temp basal"); aapsLogger.error("cancelRealTempBasal: Failed to cancel temp basal");
return result;
} }
return result;
} }
@NonNull @Override @NonNull @Override

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.danar;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.NonNull;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -134,7 +135,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
// Pump interface // Pump interface
@NonNull @Override @NonNull @Override
public PumpEnactResult setNewBasalProfile(Profile profile) { public PumpEnactResult setNewBasalProfile(@NonNull Profile profile) {
PumpEnactResult result = new PumpEnactResult(getInjector()); PumpEnactResult result = new PumpEnactResult(getInjector());
if (sExecutionService == null) { if (sExecutionService == null) {
@ -155,7 +156,6 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
Notification notification = new Notification(Notification.FAILED_UDPATE_PROFILE, getResourceHelper().gs(R.string.failedupdatebasalprofile), Notification.URGENT); Notification notification = new Notification(Notification.FAILED_UDPATE_PROFILE, getResourceHelper().gs(R.string.failedupdatebasalprofile), Notification.URGENT);
rxBus.send(new EventNewNotification(notification)); rxBus.send(new EventNewNotification(notification));
result.comment = getResourceHelper().gs(R.string.failedupdatebasalprofile); result.comment = getResourceHelper().gs(R.string.failedupdatebasalprofile);
return result;
} else { } else {
rxBus.send(new EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED)); rxBus.send(new EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED));
rxBus.send(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE)); rxBus.send(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
@ -164,12 +164,12 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
result.success = true; result.success = true;
result.enacted = true; result.enacted = true;
result.comment = "OK"; result.comment = "OK";
return result;
} }
return result;
} }
@Override @Override
public boolean isThisProfileSet(Profile profile) { public boolean isThisProfileSet(@NonNull Profile profile) {
if (!isInitialized()) if (!isInitialized())
return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS
if (danaPump.getPumpProfiles() == null) if (danaPump.getPumpProfiles() == null)
@ -217,7 +217,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
} }
@NonNull @Override @NonNull @Override
public PumpEnactResult setTempBasalPercent(int percent, int durationInMinutes, Profile profile, boolean enforceNew) { public PumpEnactResult setTempBasalPercent(int percent, int durationInMinutes, @NonNull Profile profile, boolean enforceNew) {
DanaPump pump = danaPump; DanaPump pump = danaPump;
PumpEnactResult result = new PumpEnactResult(getInjector()); PumpEnactResult result = new PumpEnactResult(getInjector());
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value(); percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
@ -319,13 +319,12 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
result.success = true; result.success = true;
result.comment = getResourceHelper().gs(R.string.ok); result.comment = getResourceHelper().gs(R.string.ok);
getAapsLogger().debug(LTag.PUMP, "cancelExtendedBolus: OK"); getAapsLogger().debug(LTag.PUMP, "cancelExtendedBolus: OK");
return result;
} else { } else {
result.success = false; result.success = false;
result.comment = getResourceHelper().gs(R.string.danar_valuenotsetproperly); result.comment = getResourceHelper().gs(R.string.danar_valuenotsetproperly);
getAapsLogger().error("cancelExtendedBolus: Failed to cancel extended bolus"); getAapsLogger().error("cancelExtendedBolus: Failed to cancel extended bolus");
return result;
} }
return result;
} }
@Override @Override

View file

@ -312,7 +312,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin {
} }
// Now set new extended, no need to to stop previous (if running) because it's replaced // Now set new extended, no need to to stop previous (if running) because it's replaced
Double extendedAmount = extendedRateToSet / 2 * durationInHalfHours; double extendedAmount = extendedRateToSet / 2 * durationInHalfHours;
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Setting extended: " + extendedAmount + "U halfhours: " + durationInHalfHours); aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Setting extended: " + extendedAmount + "U halfhours: " + durationInHalfHours);
result = setExtendedBolus(extendedAmount, durationInMinutes); result = setExtendedBolus(extendedAmount, durationInMinutes);
if (!result.success) { if (!result.success) {

View file

@ -10,7 +10,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.preference.Preference; import androidx.preference.Preference;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import org.joda.time.LocalDateTime; import org.joda.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
@ -202,7 +202,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
} }
@Override @Override
public void updatePreferenceSummary(@NotNull Preference pref) { public void updatePreferenceSummary(@NonNull Preference pref) {
super.updatePreferenceSummary(pref); super.updatePreferenceSummary(pref);
if (pref.getKey().equals(getResourceHelper().gs(R.string.key_rileylink_mac_address))) { if (pref.getKey().equals(getResourceHelper().gs(R.string.key_rileylink_mac_address))) {

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import androidx.annotation.NonNull;
import org.joda.time.Instant; import org.joda.time.Instant;
import java.util.ArrayList; import java.util.ArrayList;
@ -219,7 +220,6 @@ public class BasalProfile {
aapsLogger.warn(LTag.PUMPCOMM,"Raw Data is empty."); aapsLogger.warn(LTag.PUMPCOMM,"Raw Data is empty.");
return entries; // an empty list return entries; // an empty list
} }
boolean done = false;
int r, st; int r, st;
for (int i = 0; i < mRawData.length - 2; i += 3) { for (int i = 0; i < mRawData.length - 2; i += 3) {
@ -312,7 +312,7 @@ public class BasalProfile {
currentTime = (currentTime * 30) / 60; currentTime = (currentTime * 30) / 60;
int lastHour = 0; int lastHour;
if ((i + 1) == entries.size()) { if ((i + 1) == entries.size()) {
lastHour = 24; lastHour = 24;
} else { } else {
@ -357,7 +357,7 @@ public class BasalProfile {
} }
public String toString() { @NonNull public String toString() {
return basalProfileToString(); return basalProfileToString();
} }

View file

@ -2,6 +2,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import androidx.annotation.NonNull;
import java.util.Locale; import java.util.Locale;
import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType; import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType;
@ -29,7 +31,7 @@ public class BatteryStatusDTO {
int percentInt = (int) (percent * 100.0d); int percentInt = (int) (percent * 100.0d);
if (percentInt<0) if (percentInt < 0)
percentInt = 1; percentInt = 1;
if (percentInt > 100) if (percentInt > 100)
@ -39,7 +41,7 @@ public class BatteryStatusDTO {
} }
public String toString() { @NonNull public String toString() {
return String.format(Locale.ENGLISH, "BatteryStatusDTO [voltage=%.2f, alkaline=%d, lithium=%d, niZn=%d, nimh=%d]", return String.format(Locale.ENGLISH, "BatteryStatusDTO [voltage=%.2f, alkaline=%d, lithium=%d, niZn=%d, nimh=%d]",
voltage == null ? 0.0f : voltage, voltage == null ? 0.0f : voltage,
getCalculatedPercent(BatteryType.Alkaline), getCalculatedPercent(BatteryType.Alkaline),

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.medtronic.data.dto; package info.nightscout.androidaps.plugins.pump.medtronic.data.dto;
import androidx.annotation.NonNull;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -205,7 +207,7 @@ public class DailyTotalsDTO {
//LOG.debug("523: {}", toString()); //LOG.debug("523: {}", toString());
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return new ToStringBuilder(this) return new ToStringBuilder(this)
.append("bgAvg", bgAvg) .append("bgAvg", bgAvg)

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.medtronic.data.dto; package info.nightscout.androidaps.plugins.pump.medtronic.data.dto;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -120,7 +120,7 @@ public class TempBasalPair extends info.nightscout.androidaps.plugins.pump.commo
} }
@NotNull @Override @NonNull @Override
public String toString() { public String toString() {
return "TempBasalPair [" + "Rate=" + insulinRate + ", DurationMinutes=" + durationMinutes + ", IsPercent=" return "TempBasalPair [" + "Rate=" + insulinRate + ", DurationMinutes=" + durationMinutes + ", IsPercent="
+ isPercent + "]"; + isPercent + "]";

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.plugins.pump.medtronic.driver; package info.nightscout.androidaps.plugins.pump.medtronic.driver;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -160,7 +160,7 @@ public class MedtronicPumpStatus extends info.nightscout.androidaps.plugins.pump
return BatteryType.None; return BatteryType.None;
} }
@NotNull @NonNull
public String getErrorInfo() { public String getErrorInfo() {
return (errorDescription == null) ? "-" : errorDescription; return (errorDescription == null) ? "-" : errorDescription;
} }

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command; package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command;
import androidx.annotation.NonNull;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.CommandType; import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.CommandType;
@ -23,7 +25,7 @@ public final class DeactivateCommand extends NonceEnabledCommand {
.array()); .array());
} }
@Override public String toString() { @Override @NonNull public String toString() {
return "DeactivateCommand{" + return "DeactivateCommand{" +
"nonce=" + nonce + "nonce=" + nonce +
", commandType=" + commandType + ", commandType=" + commandType +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command; package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command;
import androidx.annotation.NonNull;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.CommandType; import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.CommandType;
@ -25,7 +27,7 @@ public final class GetVersionCommand extends HeaderEnabledCommand {
.array()); .array());
} }
@Override public String toString() { @Override @NonNull public String toString() {
return "GetVersionCommand{" + return "GetVersionCommand{" +
"commandType=" + commandType + "commandType=" + commandType +
", uniqueId=" + uniqueId + ", uniqueId=" + uniqueId +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition; package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition;
import androidx.annotation.NonNull;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
public class AlertConfiguration implements Encodable { public class AlertConfiguration implements Encodable {
@ -45,7 +47,7 @@ public class AlertConfiguration implements Encodable {
.array(); .array();
} }
@Override public String toString() { @NonNull @Override public String toString() {
return "AlertConfiguration{" + return "AlertConfiguration{" +
"slot=" + slot + "slot=" + slot +
", enabled=" + enabled + ", enabled=" + enabled +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response; package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response;
import androidx.annotation.NonNull;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.Arrays; import java.util.Arrays;
@ -200,7 +202,7 @@ public class AlarmStatusResponse extends AdditionalStatusResponseBase {
return returnAddressOfPodAlarmHandlerCaller; return returnAddressOfPodAlarmHandlerCaller;
} }
@Override public String toString() { @NonNull @Override public String toString() {
return "AlarmStatusResponse{" + return "AlarmStatusResponse{" +
"messageType=" + messageType + "messageType=" + messageType +
", messageLength=" + messageLength + ", messageLength=" + messageLength +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import java.util.Collections; import java.util.Collections;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
@ -44,7 +46,7 @@ public class AcknowledgeAlertsCommand extends NonceResyncableMessageBlock {
encode(); encode();
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "AcknowledgeAlertsCommand{" + return "AcknowledgeAlertsCommand{" +
"alerts=" + alerts + "alerts=" + alerts +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
@ -22,7 +24,7 @@ public class AssignAddressCommand extends MessageBlock {
return MessageBlockType.ASSIGN_ADDRESS; return MessageBlockType.ASSIGN_ADDRESS;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "AssignAddressCommand{" + return "AssignAddressCommand{" +
"address=" + address + "address=" + address +

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import java.util.ArrayList; import java.util.ArrayList;
@ -112,7 +113,7 @@ public class BasalScheduleExtraCommand extends MessageBlock {
return new ArrayList<>(rateEntries); return new ArrayList<>(rateEntries);
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "BasalScheduleExtraCommand{" + return "BasalScheduleExtraCommand{" +
"acknowledgementBeep=" + acknowledgementBeep + "acknowledgementBeep=" + acknowledgementBeep +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
@ -42,7 +44,7 @@ public class BeepConfigCommand extends MessageBlock {
return MessageBlockType.BEEP_CONFIG; return MessageBlockType.BEEP_CONFIG;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "BeepConfigCommand{" + return "BeepConfigCommand{" +
"beepType=" + beepType + "beepType=" + beepType +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
@ -40,7 +42,7 @@ public class ConfigureAlertsCommand extends NonceResyncableMessageBlock {
encode(); encode();
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "ConfigureAlertsCommand{" + return "ConfigureAlertsCommand{" +
"configurations=" + configurations + "configurations=" + configurations +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
@ -32,7 +34,7 @@ public class DeactivatePodCommand extends NonceResyncableMessageBlock {
encode(); encode();
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "DeactivatePodCommand{" + return "DeactivatePodCommand{" +
"nonce=" + nonce + "nonce=" + nonce +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
@ -39,7 +41,7 @@ public class FaultConfigCommand extends NonceResyncableMessageBlock {
encode(); encode();
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "FaultConfigCommand{" + return "FaultConfigCommand{" +
"tab5sub16=" + tab5sub16 + "tab5sub16=" + tab5sub16 +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
@ -21,7 +23,7 @@ public class GetStatusCommand extends MessageBlock {
return MessageBlockType.GET_STATUS; return MessageBlockType.GET_STATUS;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "GetStatusCommand{" + return "GetStatusCommand{" +
"podInfoType=" + podInfoType + "podInfoType=" + podInfoType +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
@ -60,7 +62,7 @@ public class ErrorResponse extends MessageBlock {
return nonceSearchKey; return nonceSearchKey;
} }
@Override public String toString() { @Override @NonNull public String toString() {
return "ErrorResponse{" + return "ErrorResponse{" +
"errorResponseCode=" + errorResponseCode + "errorResponseCode=" + errorResponseCode +
", nonceSearchKey=" + nonceSearchKey + ", nonceSearchKey=" + nonceSearchKey +

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
@ -34,6 +35,7 @@ public class AlertConfiguration {
return alertSlot; return alertSlot;
} }
@SuppressWarnings("unused")
public AlertTrigger<?> getAlertTrigger() { public AlertTrigger<?> getAlertTrigger() {
return alertTrigger; return alertTrigger;
} }
@ -75,7 +77,7 @@ public class AlertConfiguration {
return encodedData; return encodedData;
} }
@Override public String toString() { @NonNull @Override public String toString() {
return "AlertConfiguration{" + return "AlertConfiguration{" +
"alertType=" + alertType + "alertType=" + alertType +
", alertSlot=" + alertSlot + ", alertSlot=" + alertSlot +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -51,7 +53,7 @@ public class AlertSet {
return Objects.hash(alertSlots); return Objects.hash(alertSlots);
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "AlertSet{" + return "AlertSet{" +
"alertSlots=" + alertSlots + "alertSlots=" + alertSlots +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
import androidx.annotation.NonNull;
public abstract class AlertTrigger<T> { public abstract class AlertTrigger<T> {
private final T value; private final T value;
@ -11,7 +13,7 @@ public abstract class AlertTrigger<T> {
return value; return value;
} }
@Override public String toString() { @NonNull @Override public String toString() {
return "AlertTrigger{" + return "AlertTrigger{" +
"value=" + value + "value=" + value +
'}'; '}';

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
import androidx.annotation.NonNull;
import java.util.Locale; import java.util.Locale;
public class FirmwareVersion { public class FirmwareVersion {
@ -13,7 +15,7 @@ public class FirmwareVersion {
this.patch = patch; this.patch = patch;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return String.format(Locale.getDefault(), "%d.%d.%d", major, minor, patch); return String.format(Locale.getDefault(), "%d.%d.%d", major, minor, patch);
} }

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
@ -49,7 +51,7 @@ public class BasalDeliverySchedule extends DeliverySchedule implements IRawRepre
return checksum; return checksum;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "BasalDeliverySchedule{" + return "BasalDeliverySchedule{" +
"currentSegment=" + currentSegment + "currentSegment=" + currentSegment +

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import java.util.ArrayList; import java.util.ArrayList;
@ -90,7 +91,7 @@ public class BasalDeliveryTable {
return numSegments; return numSegments;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "BasalDeliveryTable{" + return "BasalDeliveryTable{" +
"entries=" + entries + "entries=" + entries +

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import java.util.ArrayList; import java.util.ArrayList;
@ -85,7 +86,7 @@ public class BasalSchedule {
return durations; return durations;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "BasalSchedule{" + return "BasalSchedule{" +
"entries=" + entries + "entries=" + entries +

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import java.util.Objects; import java.util.Objects;
@ -32,7 +33,7 @@ public class BasalScheduleEntry {
return startTime; return startTime;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "BasalScheduleEntry{" + return "BasalScheduleEntry{" +
"rate=" + rate + "rate=" + rate +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable;
@ -42,7 +44,7 @@ public class BasalTableEntry implements IRawRepresentable {
return alternateSegmentPulse; return alternateSegmentPulse;
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return "BasalTableEntry{" + return "BasalTableEntry{" +
"segments=" + segments + "segments=" + segments +

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule;
import androidx.annotation.NonNull;
import org.joda.time.Duration; import org.joda.time.Duration;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
@ -50,7 +52,7 @@ public class BolusDeliverySchedule extends DeliverySchedule implements IRawRepre
return checksum; return checksum;
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return "BolusDeliverySchedule{" + return "BolusDeliverySchedule{" +
"units=" + units + "units=" + units +

View file

@ -13,7 +13,7 @@ import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -198,7 +198,7 @@ public class ErosPodHistoryActivity extends NoSplashAppCompatActivity {
this.name = entryGroup.getTranslated(); this.name = entryGroup.getTranslated();
} }
@NotNull @NonNull
@Override @Override
public String toString() { public String toString() {
return name; return name;
@ -220,7 +220,7 @@ public class ErosPodHistoryActivity extends NoSplashAppCompatActivity {
} }
@NotNull @NonNull
@Override @Override
public HistoryViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { public HistoryViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.omnipod_eros_pod_history_item, // View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.omnipod_eros_pod_history_item, //
@ -230,7 +230,7 @@ public class ErosPodHistoryActivity extends NoSplashAppCompatActivity {
@Override @Override
public void onBindViewHolder(@NotNull HistoryViewHolder holder, int position) { public void onBindViewHolder(@NonNull HistoryViewHolder holder, int position) {
OmnipodHistoryRecord record = historyList.get(position); OmnipodHistoryRecord record = historyList.get(position);
if (record != null) { if (record != null) {

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data; package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data;
import androidx.annotation.NonNull;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -29,7 +31,7 @@ public class BleAdvertisedData {
} }
public String toString() { @NonNull public String toString() {
return "BleAdvertisedData [name=" + mName + ", UUIDs=" + mUuids + "]"; return "BleAdvertisedData [name=" + mName + ", UUIDs=" + mUuids + "]";
} }
} }

View file

@ -10,6 +10,8 @@ import androidx.viewpager.widget.ViewPager;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -78,7 +80,7 @@ public class RileyLinkStatusActivity extends NoSplashAppCompatActivity {
super(fm); super(fm);
} }
@Override @NonNull @Override
public Fragment getItem(int position) { public Fragment getItem(int position) {
this.lastSelectedPosition = position; this.lastSelectedPosition = position;
return fragmentList.get(position); return fragmentList.get(position);

View file

@ -9,7 +9,7 @@ import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -120,7 +120,7 @@ public class RileyLinkStatusHistoryFragment extends DaggerFragment implements Re
} }
@NotNull @NonNull
@Override @Override
public RecyclerViewAdapter.HistoryViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { public RecyclerViewAdapter.HistoryViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.rileylink_status_history_item, // View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.rileylink_status_history_item, //

View file

@ -4,7 +4,7 @@ import android.bluetooth.BluetoothAdapter;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import org.jetbrains.annotations.NotNull; import androidx.annotation.NonNull;
import javax.inject.Inject; import javax.inject.Inject;
@ -236,7 +236,7 @@ public abstract class RileyLinkService extends DaggerService {
rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady); rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady);
} }
@NotNull public RileyLinkBLE getRileyLinkBLE() { @NonNull public RileyLinkBLE getRileyLinkBLE() {
return rileyLinkBLE; return rileyLinkBLE;
} }

View file

@ -208,7 +208,7 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
} }
private boolean isLowRes(WatchMode watchMode) { private boolean isLowRes(WatchMode watchMode) {
return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN); return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN);
} }

View file

@ -172,7 +172,7 @@ public class NOChart extends WatchFace implements SharedPreferences.OnSharedPref
} }
private boolean isLowRes(WatchMode watchMode) { private boolean isLowRes(WatchMode watchMode) {
return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN); return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN);
} }

View file

@ -36,7 +36,7 @@ public class BgWatchDataTest {
// GIVEN // GIVEN
BgWatchData inserted = new BgWatchData( BgWatchData inserted = new BgWatchData(
88.0, 160.0, 90.0, 88.0, 160.0, 90.0,
WearUtilMocker.REF_NOW - Constants.MINUTE_IN_MS*4*1, 1 WearUtilMocker.REF_NOW - Constants.MINUTE_IN_MS * 4, 1
); );
Set<BgWatchData> set = new HashSet<>(); Set<BgWatchData> set = new HashSet<>();
@ -76,7 +76,7 @@ public class BgWatchDataTest {
assertNotEquals(item1, item3sameTimeSameDiffColor); assertNotEquals(item1, item3sameTimeSameDiffColor);
assertNotEquals(item1, item4differentTime); assertNotEquals(item1, item4differentTime);
assertFalse(item1.equals("aa bbb")); assertNotEquals("aa bbb", item1);
} }
/** /**

View file

@ -39,7 +39,7 @@ public class PairTest {
assertNotEquals(no1, no3); assertNotEquals(no1, no3);
assertEquals(no1, no4); assertEquals(no1, no4);
assertFalse(left.equals("aa bbb")); assertNotEquals("aa bbb", left);
} }
@Test @Test
@ -49,6 +49,7 @@ public class PairTest {
Set<Pair> set = new HashSet<>(); Set<Pair> set = new HashSet<>();
// THEN // THEN
//noinspection ConstantConditions
assertFalse(set.contains(inserted)); assertFalse(set.contains(inserted));
set.add(inserted); set.add(inserted);
assertTrue(set.contains(inserted)); assertTrue(set.contains(inserted));

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.testing.utils; package info.nightscout.androidaps.testing.utils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import java.util.Objects; import java.util.Objects;
@ -36,7 +37,7 @@ public class BasalWatchDataExt extends BasalWatchData {
@Override @Override
public boolean equals(@Nullable Object obj) { public boolean equals(@Nullable Object obj) {
if ((obj instanceof BasalWatchData)||(obj instanceof BasalWatchDataExt)) { if (obj instanceof BasalWatchData) {
return (this.startTime == ((BasalWatchData) obj).startTime) return (this.startTime == ((BasalWatchData) obj).startTime)
&& (this.endTime == ((BasalWatchData) obj).endTime) && (this.endTime == ((BasalWatchData) obj).endTime)
&& (this.amount == ((BasalWatchData) obj).amount); && (this.amount == ((BasalWatchData) obj).amount);
@ -45,7 +46,7 @@ public class BasalWatchDataExt extends BasalWatchData {
} }
} }
@Override @NonNull @Override
public String toString() { public String toString() {
return startTime+", "+endTime+", "+amount; return startTime+", "+endTime+", "+amount;
} }

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.testing.utils; package info.nightscout.androidaps.testing.utils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import java.util.Objects; import java.util.Objects;
@ -42,7 +43,7 @@ public class BgWatchDataExt extends BgWatchData {
@Override @Override
public boolean equals(@Nullable Object obj) { public boolean equals(@Nullable Object obj) {
if ((obj instanceof BgWatchData)||(obj instanceof BgWatchDataExt)) { if (obj instanceof BgWatchData) {
return (this.sgv == ((BgWatchData) obj).sgv) return (this.sgv == ((BgWatchData) obj).sgv)
&& (this.high == ((BgWatchData) obj).high) && (this.high == ((BgWatchData) obj).high)
&& (this.low == ((BgWatchData) obj).low) && (this.low == ((BgWatchData) obj).low)
@ -53,7 +54,7 @@ public class BgWatchDataExt extends BgWatchData {
} }
} }
@Override @Override @NonNull
public String toString() { public String toString() {
return sgv+", "+high+", "+low+", "+timestamp+", "+color; return sgv+", "+high+", "+low+", "+timestamp+", "+color;
} }