@NonNull lints

This commit is contained in:
Milos Kozak 2021-02-19 15:47:07 +01:00
parent 87ffeb1d31
commit d85276fcda
63 changed files with 204 additions and 142 deletions

View file

@ -1,8 +1,9 @@
package info.nightscout.androidaps.db;
import androidx.annotation.NonNull;
import com.j256.ormlite.dao.CloseableIterator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.sql.SQLException;
@ -20,31 +21,31 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
@Inject DatabaseHelperProvider() {
}
@Override public void createOrUpdate(@NotNull CareportalEvent careportalEvent) {
@Override public void createOrUpdate(@NonNull CareportalEvent careportalEvent) {
MainApp.getDbHelper().createOrUpdate(careportalEvent);
}
@Override public void createOrUpdate(@NotNull DanaRHistoryRecord record) {
@Override public void createOrUpdate(@NonNull DanaRHistoryRecord record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void createOrUpdate(@NotNull OmnipodHistoryRecord record) {
@Override public void createOrUpdate(@NonNull OmnipodHistoryRecord 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);
}
@NotNull @Override public List<TDD> getTDDs() {
@NonNull @Override public List<TDD> getTDDs() {
return MainApp.getDbHelper().getTDDs();
}
@Override public long size(@NotNull String table) {
@Override public long size(@NonNull String table) {
return MainApp.getDbHelper().size(table);
}
@Override public void create(@NotNull DbRequest record) {
@Override public void create(@NonNull DbRequest record) {
try {
MainApp.getDbHelper().create(record);
} catch (SQLException e) {
@ -56,15 +57,15 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
MainApp.getDbHelper().deleteAllDbRequests();
}
@Override public int deleteDbRequest(@NotNull String id) {
@Override public int deleteDbRequest(@NonNull String 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);
}
@NotNull @Override public CloseableIterator<DbRequest> getDbRequestInterator() {
@NonNull @Override public CloseableIterator<DbRequest> getDbRequestInterator() {
return MainApp.getDbHelper().getDbRequestInterator();
}
@ -72,19 +73,19 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
return MainApp.getDbHelper().roundDateToSec(date);
}
@Override public void createOrUpdateTDD(@NotNull TDD record) {
@Override public void createOrUpdateTDD(@NonNull TDD record) {
MainApp.getDbHelper().createOrUpdateTDD(record);
}
@Override public void createOrUpdate(@NotNull TemporaryBasal tempBasal) {
@Override public void createOrUpdate(@NonNull TemporaryBasal tempBasal) {
MainApp.getDbHelper().createOrUpdate(tempBasal);
}
@NotNull @Override public TemporaryBasal findTempBasalByPumpId(long id) {
@NonNull @Override public TemporaryBasal findTempBasalByPumpId(long 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);
}
@ -92,7 +93,7 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
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);
}
@ -100,27 +101,27 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
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);
}
@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);
}
@Override public void createOrUpdate(@NotNull InsightBolusID record) {
@Override public void createOrUpdate(@NonNull InsightBolusID record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void createOrUpdate(@NotNull InsightPumpID record) {
@Override public void createOrUpdate(@NonNull InsightPumpID record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void createOrUpdate(@NotNull InsightHistoryOffset record) {
@Override public void createOrUpdate(@NonNull InsightHistoryOffset record) {
MainApp.getDbHelper().createOrUpdate(record);
}
@Override public void delete(@NotNull ExtendedBolus extendedBolus) {
@Override public void delete(@NonNull ExtendedBolus extendedBolus) {
MainApp.getDbHelper().delete(extendedBolus);
}
@ -128,15 +129,15 @@ public class DatabaseHelperProvider implements DatabaseHelperInterface {
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);
}
@Nullable @Override public InsightHistoryOffset getInsightHistoryOffset(@NotNull String pumpSerial) {
@Nullable @Override public InsightHistoryOffset getInsightHistoryOffset(@NonNull String 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);
}
}

View file

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

View file

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

View file

@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import javax.inject.Inject;
@ -28,7 +28,7 @@ public class NSClientWorker extends Worker {
@Inject NSClientPlugin nsClientPlugin;
@Inject BundleStore bundleStore;
@NotNull
@NonNull
@Override
public Result doWork() {
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.collection.LongSparseArray;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import org.json.JSONException;
import org.json.JSONObject;
@ -186,11 +186,11 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
return output;
}
@NotNull @Override public SensitivityType getId() {
@NonNull @Override public SensitivityType getId() {
return SensitivityType.SENSITIVITY_AAPS;
}
@NotNull @Override public JSONObject configuration() {
@NonNull @Override public JSONObject configuration() {
JSONObject c = new JSONObject();
try {
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;
}
@Override public void applyConfiguration(@NotNull JSONObject configuration) {
@Override public void applyConfiguration(@NonNull JSONObject configuration) {
try {
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)));

View file

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

View file

@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sensitivity;
import androidx.collection.LongSparseArray;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import org.json.JSONException;
import org.json.JSONObject;
@ -206,11 +206,11 @@ public class SensitivityWeightedAveragePlugin extends AbstractSensitivityPlugin
return output;
}
@NotNull @Override public SensitivityType getId() {
@NonNull @Override public SensitivityType getId() {
return SensitivityType.SENSITIVITY_WEIGHTED;
}
@NotNull @Override public JSONObject configuration() {
@NonNull @Override public JSONObject configuration() {
JSONObject c = new JSONObject();
try {
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;
}
@Override public void applyConfiguration(@NotNull JSONObject configuration) {
@Override public void applyConfiguration(@NonNull JSONObject configuration) {
try {
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)));

View file

@ -8,7 +8,7 @@ import androidx.annotation.Nullable;
import com.google.firebase.analytics.FirebaseAnalytics;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
@ -765,7 +765,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
}
@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);
addToHistoryProfileSwitch(profileSwitch);
if (percentage == 90 && duration == 10)

View file

@ -1255,9 +1255,9 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
}
@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) {
return null;
return new JSONObject();
}
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);
}
return null;
return new JSONObject();
}
@NonNull @Override

View file

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

View file

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

View file

@ -2,10 +2,11 @@ package info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.commands;
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.MenuType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
@ -14,8 +15,8 @@ import java.util.Objects;
import info.nightscout.androidaps.logging.StacktraceLoggerWrapper;
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.WarningOrErrorCode;
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.DELIVERING;
@ -244,7 +245,7 @@ public class BolusCommand extends BaseCommand {
bolusProgressReporter.report(STOPPING, 0, 0);
}
@Override
@Override @NonNull
public String toString() {
return "BolusCommand{" +
"bolus=" + bolus +

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
package info.nightscout.androidaps.interfaces;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import java.util.List;
@ -84,7 +84,7 @@ public interface TreatmentsInterface {
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);

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.iob.iobCobCalculator.data;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@ -40,10 +42,10 @@ public class AutosensData implements DataPointWithLabelInterface {
}
public class CarbsInPast {
long time = 0L;
double carbs = 0d;
public double min5minCarbImpact = 0d;
double remaining = 0d;
long time;
double carbs;
public double min5minCarbImpact;
double remaining;
public CarbsInPast(Treatment t, boolean isAAPSOrWeighted) {
time = t.date;
@ -68,7 +70,7 @@ public class AutosensData implements DataPointWithLabelInterface {
this.remaining = other.remaining;
}
@Override
@NonNull @Override
public String toString() {
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 List<Double> extraDeviation = new ArrayList<>();
@Override
@NonNull @Override
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",
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
public void removeOldCarbs(long toTime, boolean isAAPSOrWeighted) {
double maxAbsorptionHours = Constants.DEFAULT_MAX_ABSORPTION_TIME;
double maxAbsorptionHours;
if (isAAPSOrWeighted) {
maxAbsorptionHours = sp.getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME);
} else {

View file

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

View file

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

View file

@ -194,7 +194,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
// This is called from APS
@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
//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()) {
@ -234,7 +234,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
}
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.
if (absoluteRate < 0.10d) percentRate = 0;
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
Double extendedAmount = extendedRateToSet / 2 * durationInHalfHours;
double extendedAmount = extendedRateToSet / 2 * durationInHalfHours;
aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Setting extended: " + extendedAmount + "U halfhours: " + durationInHalfHours);
result = setExtendedBolus(extendedAmount, durationInMinutes);
if (!result.success) {
@ -365,14 +365,13 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
result.isTempCancel = true;
result.comment = resourceHelper.gs(R.string.ok);
aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK");
return result;
} else {
result.success = false;
result.comment = resourceHelper.gs(R.string.danar_valuenotsetproperly);
result.isTempCancel = true;
aapsLogger.error("cancelRealTempBasal: Failed to cancel temp basal");
return result;
}
return result;
}
@Override

View file

@ -220,7 +220,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
// This is called from APS
@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
//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()) {
@ -298,7 +298,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
}
@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;
PumpEnactResult result = new PumpEnactResult(getInjector());
percent = constraintChecker.applyBasalPercentConstraints(new Constraint<>(percent), profile).value();
@ -386,14 +386,13 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
result.isTempCancel = true;
result.comment = resourceHelper.gs(R.string.ok);
aapsLogger.debug(LTag.PUMP, "cancelRealTempBasal: OK");
return result;
} else {
result.success = false;
result.comment = resourceHelper.gs(R.string.danar_valuenotsetproperly);
result.isTempCancel = true;
aapsLogger.error("cancelRealTempBasal: Failed to cancel temp basal");
return result;
}
return result;
}
@NonNull @Override

View file

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

View file

@ -10,7 +10,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.Preference;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import org.joda.time.LocalDateTime;
import java.util.ArrayList;
@ -202,7 +202,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
}
@Override
public void updatePreferenceSummary(@NotNull Preference pref) {
public void updatePreferenceSummary(@NonNull Preference pref) {
super.updatePreferenceSummary(pref);
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 androidx.annotation.NonNull;
import org.joda.time.Instant;
import java.util.ArrayList;
@ -219,7 +220,6 @@ public class BasalProfile {
aapsLogger.warn(LTag.PUMPCOMM,"Raw Data is empty.");
return entries; // an empty list
}
boolean done = false;
int r, st;
for (int i = 0; i < mRawData.length - 2; i += 3) {
@ -312,7 +312,7 @@ public class BasalProfile {
currentTime = (currentTime * 30) / 60;
int lastHour = 0;
int lastHour;
if ((i + 1) == entries.size()) {
lastHour = 24;
} else {
@ -357,7 +357,7 @@ public class BasalProfile {
}
public String toString() {
@NonNull public String toString() {
return basalProfileToString();
}

View file

@ -2,6 +2,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto;
import com.google.gson.annotations.Expose;
import androidx.annotation.NonNull;
import java.util.Locale;
import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType;
@ -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]",
voltage == null ? 0.0f : voltage,
getCalculatedPercent(BatteryType.Alkaline),

View file

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

View file

@ -1,6 +1,6 @@
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.List;
@ -120,7 +120,7 @@ public class TempBasalPair extends info.nightscout.androidaps.plugins.pump.commo
}
@NotNull @Override
@NonNull @Override
public String toString() {
return "TempBasalPair [" + "Rate=" + insulinRate + ", DurationMinutes=" + durationMinutes + ", IsPercent="
+ isPercent + "]";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command;
import androidx.annotation.NonNull;
import java.nio.ByteBuffer;
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;
}
@Override
@NonNull @Override
public String toString() {
return "AssignAddressCommand{" +
"address=" + address +

View file

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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
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.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
@ -32,7 +34,7 @@ public class DeactivatePodCommand extends NonceResyncableMessageBlock {
encode();
}
@Override
@Override @NonNull
public String toString() {
return "DeactivatePodCommand{" +
"nonce=" + nonce +

View file

@ -1,5 +1,7 @@
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.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType;
@ -39,7 +41,7 @@ public class FaultConfigCommand extends NonceResyncableMessageBlock {
encode();
}
@Override
@Override @NonNull
public String toString() {
return "FaultConfigCommand{" +
"tab5sub16=" + tab5sub16 +

View file

@ -1,5 +1,7 @@
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.definition.MessageBlockType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
@ -21,7 +23,7 @@ public class GetStatusCommand extends MessageBlock {
return MessageBlockType.GET_STATUS;
}
@Override
@Override @NonNull
public String toString() {
return "GetStatusCommand{" +
"podInfoType=" + podInfoType +

View file

@ -1,5 +1,7 @@
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.omnipod.eros.driver.communication.message.MessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode;
@ -60,7 +62,7 @@ public class ErrorResponse extends MessageBlock {
return nonceSearchKey;
}
@Override public String toString() {
@Override @NonNull public String toString() {
return "ErrorResponse{" +
"errorResponseCode=" + errorResponseCode +
", nonceSearchKey=" + nonceSearchKey +

View file

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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition;
import androidx.annotation.NonNull;
import java.util.Locale;
public class FirmwareVersion {
@ -13,7 +15,7 @@ public class FirmwareVersion {
this.patch = patch;
}
@Override
@Override @NonNull
public String toString() {
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;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
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;
}
@Override
@NonNull @Override
public String toString() {
return "BasalDeliverySchedule{" +
"currentSegment=" + currentSegment +

View file

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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
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.omnipod.eros.driver.communication.message.IRawRepresentable;
@ -42,7 +44,7 @@ public class BasalTableEntry implements IRawRepresentable {
return alternateSegmentPulse;
}
@Override
@NonNull @Override
public String toString() {
return "BasalTableEntry{" +
"segments=" + segments +

View file

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

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.Collections;
@ -120,7 +120,7 @@ public class RileyLinkStatusHistoryFragment extends DaggerFragment implements Re
}
@NotNull
@NonNull
@Override
public RecyclerViewAdapter.HistoryViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
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.Intent;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import javax.inject.Inject;
@ -236,7 +236,7 @@ public abstract class RileyLinkService extends DaggerService {
rileyLinkServiceData.setRileyLinkServiceState(RileyLinkServiceState.BluetoothReady);
}
@NotNull public RileyLinkBLE getRileyLinkBLE() {
@NonNull public RileyLinkBLE getRileyLinkBLE() {
return rileyLinkBLE;
}

View file

@ -208,7 +208,7 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
}
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) {
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
BgWatchData inserted = new BgWatchData(
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<>();
@ -76,7 +76,7 @@ public class BgWatchDataTest {
assertNotEquals(item1, item3sameTimeSameDiffColor);
assertNotEquals(item1, item4differentTime);
assertFalse(item1.equals("aa bbb"));
assertNotEquals("aa bbb", item1);
}
/**

View file

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

View file

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

View file

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