Use java.util.Objects.equals

pull/996/head
Alex Baker 4 years ago
parent c5ec1126be
commit 9baf3d5e2a

@ -9,6 +9,8 @@ package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.AS;
import static com.todoroo.andlib.sql.SqlConstants.SPACE;
import java.util.Objects;
public abstract class DBObject<T extends DBObject<?>> implements Cloneable {
protected final String expression;
@ -37,29 +39,16 @@ public abstract class DBObject<T extends DBObject<?>> implements Cloneable {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof DBObject)) {
return false;
}
DBObject<?> dbObject = (DBObject<?>) o;
if (alias != null ? !alias.equals(dbObject.alias) : dbObject.alias != null) {
return false;
}
if (expression != null
? !expression.equals(dbObject.expression)
: dbObject.expression != null) {
return false;
}
return true;
return Objects.equals(expression, dbObject.expression) && Objects.equals(alias, dbObject.alias);
}
@Override
public int hashCode() {
int result = alias != null ? alias.hashCode() : 0;
result = 31 * result + (expression != null ? expression.hashCode() : 0);
return result;
return Objects.hash(expression, alias);
}
@Override

@ -3,7 +3,6 @@ package com.todoroo.astrid.api;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.google.common.base.Objects;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Join;
import com.todoroo.andlib.sql.QueryTemplate;
@ -11,6 +10,7 @@ import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.tasks.R;
import org.tasks.data.CaldavCalendar;
import org.tasks.data.CaldavTask;
@ -103,6 +103,6 @@ public class CaldavFilter extends Filter {
@Override
public boolean areContentsTheSame(@NonNull FilterListItem other) {
return super.areContentsTheSame(other)
&& Objects.equal(calendar, ((CaldavFilter) other).calendar);
&& Objects.equals(calendar, ((CaldavFilter) other).calendar);
}
}

@ -3,7 +3,7 @@ package com.todoroo.astrid.api;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.google.common.base.Objects;
import java.util.Objects;
import org.tasks.R;
public class CustomFilter extends Filter {
@ -84,6 +84,6 @@ public class CustomFilter extends Filter {
@Override
public boolean areContentsTheSame(@NonNull FilterListItem other) {
return super.areContentsTheSame(other)
&& Objects.equal(criterion, ((CustomFilter) other).criterion);
&& Objects.equals(criterion, ((CustomFilter) other).criterion);
}
}

@ -10,6 +10,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public abstract class CustomFilterCriterion implements Parcelable {
@ -79,33 +80,16 @@ public abstract class CustomFilterCriterion implements Parcelable {
if (!(o instanceof CustomFilterCriterion)) {
return false;
}
CustomFilterCriterion that = (CustomFilterCriterion) o;
if (valuesForNewTasks != null
? !valuesForNewTasks.equals(that.valuesForNewTasks)
: that.valuesForNewTasks != null) {
return false;
}
if (identifier != null ? !identifier.equals(that.identifier) : that.identifier != null) {
return false;
}
if (text != null ? !text.equals(that.text) : that.text != null) {
return false;
}
if (sql != null ? !sql.equals(that.sql) : that.sql != null) {
return false;
}
return name != null ? name.equals(that.name) : that.name == null;
return Objects.equals(valuesForNewTasks, that.valuesForNewTasks)
&& Objects.equals(identifier, that.identifier)
&& Objects.equals(text, that.text)
&& Objects.equals(sql, that.sql)
&& Objects.equals(name, that.name);
}
@Override
public int hashCode() {
int result = valuesForNewTasks != null ? valuesForNewTasks.hashCode() : 0;
result = 31 * result + (identifier != null ? identifier.hashCode() : 0);
result = 31 * result + (text != null ? text.hashCode() : 0);
result = 31 * result + (sql != null ? sql.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
return Objects.hash(valuesForNewTasks, identifier, text, sql, name);
}
}

@ -10,11 +10,11 @@ import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.MenuRes;
import androidx.annotation.NonNull;
import com.google.common.base.Objects;
import com.todoroo.andlib.sql.QueryTemplate;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* A <code>FilterListFilter</code> allows users to display tasks that have something in common.
@ -229,12 +229,12 @@ public class Filter extends FilterListItem {
@Override
public boolean areItemsTheSame(@NonNull FilterListItem other) {
return other instanceof Filter && Objects.equal(sqlQuery, ((Filter) other).sqlQuery);
return other instanceof Filter && Objects.equals(sqlQuery, ((Filter) other).sqlQuery);
}
@Override
public boolean areContentsTheSame(@NonNull FilterListItem other) {
return super.areContentsTheSame(other)
&& Objects.equal(sqlQuery, ((Filter) other).sqlQuery);
&& Objects.equals(sqlQuery, ((Filter) other).sqlQuery);
}
}

@ -10,7 +10,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import com.google.common.base.Objects;
import java.util.Objects;
import org.tasks.R;
/**
@ -56,7 +56,7 @@ public abstract class FilterListItem implements Parcelable {
public abstract boolean areItemsTheSame(@NonNull FilterListItem other);
public boolean areContentsTheSame(@NonNull FilterListItem other) {
return Objects.equal(listingTitle, other.listingTitle)
return Objects.equals(listingTitle, other.listingTitle)
&& icon == other.icon
&& tint == other.tint
&& count == other.count;

@ -3,7 +3,6 @@ package com.todoroo.astrid.api;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.google.common.base.Objects;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Join;
import com.todoroo.andlib.sql.QueryTemplate;
@ -11,6 +10,7 @@ import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.tasks.R;
import org.tasks.data.GoogleTask;
import org.tasks.data.GoogleTaskList;
@ -130,6 +130,6 @@ public class GtasksFilter extends Filter {
@Override
public boolean areContentsTheSame(@NonNull FilterListItem other) {
return super.areContentsTheSame(other) && Objects.equal(list, ((GtasksFilter) other).list);
return super.areContentsTheSame(other) && Objects.equals(list, ((GtasksFilter) other).list);
}
}

@ -14,6 +14,7 @@ import com.todoroo.astrid.helper.UUIDHelper;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.tasks.filters.FilterCriteriaProvider;
import timber.log.Timber;
@ -145,46 +146,20 @@ public class CriterionInstance {
if (!(o instanceof CriterionInstance)) {
return false;
}
CriterionInstance that = (CriterionInstance) o;
if (selectedIndex != that.selectedIndex) {
return false;
}
if (type != that.type) {
return false;
}
if (end != that.end) {
return false;
}
if (start != that.start) {
return false;
}
if (max != that.max) {
return false;
}
if (id != null ? !id.equals(that.id) : that.id != null) {
return false;
}
if (criterion != null ? !criterion.equals(that.criterion) : that.criterion != null) {
return false;
}
return selectedText != null
? selectedText.equals(that.selectedText)
: that.selectedText == null;
return selectedIndex == that.selectedIndex
&& type == that.type
&& end == that.end
&& start == that.start
&& max == that.max
&& Objects.equals(criterion, that.criterion)
&& Objects.equals(selectedText, that.selectedText)
&& Objects.equals(id, that.id);
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (criterion != null ? criterion.hashCode() : 0);
result = 31 * result + selectedIndex;
result = 31 * result + (selectedText != null ? selectedText.hashCode() : 0);
result = 31 * result + type;
result = 31 * result + end;
result = 31 * result + start;
result = 31 * result + max;
return result;
return Objects.hash(criterion, selectedIndex, selectedText, type, end, start, max, id);
}
@Override

@ -21,7 +21,6 @@ import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import com.google.common.base.Objects;
import com.google.ical.values.RRule;
import com.todoroo.andlib.data.Property.IntegerProperty;
import com.todoroo.andlib.data.Property.LongProperty;
@ -33,6 +32,7 @@ import com.todoroo.astrid.dao.TaskDao;
import java.lang.annotation.Retention;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;
import org.tasks.backup.XmlReader;
import org.tasks.data.Tag;
import org.tasks.time.DateTime;
@ -757,72 +757,26 @@ public class Task implements Parcelable {
return false;
}
if (id != null ? !id.equals(task.id) : task.id != null) {
return false;
}
if (title != null ? !title.equals(task.title) : task.title != null) {
return false;
}
if (priority != null ? !priority.equals(task.priority) : task.priority != null) {
return false;
}
if (dueDate != null ? !dueDate.equals(task.dueDate) : task.dueDate != null) {
return false;
}
if (hideUntil != null ? !hideUntil.equals(task.hideUntil) : task.hideUntil != null) {
return false;
}
if (created != null ? !created.equals(task.created) : task.created != null) {
return false;
}
if (modified != null ? !modified.equals(task.modified) : task.modified != null) {
return false;
}
if (completed != null ? !completed.equals(task.completed) : task.completed != null) {
return false;
}
if (deleted != null ? !deleted.equals(task.deleted) : task.deleted != null) {
return false;
}
if (notes != null ? !notes.equals(task.notes) : task.notes != null) {
return false;
}
if (estimatedSeconds != null
? !estimatedSeconds.equals(task.estimatedSeconds)
: task.estimatedSeconds != null) {
return false;
}
if (elapsedSeconds != null
? !elapsedSeconds.equals(task.elapsedSeconds)
: task.elapsedSeconds != null) {
return false;
}
if (notificationFlags != null
? !notificationFlags.equals(task.notificationFlags)
: task.notificationFlags != null) {
return false;
}
if (notifications != null
? !notifications.equals(task.notifications)
: task.notifications != null) {
return false;
}
if (recurrence != null ? !recurrence.equals(task.recurrence) : task.recurrence != null) {
return false;
}
if (repeatUntil != null ? !repeatUntil.equals(task.repeatUntil) : task.repeatUntil != null) {
return false;
}
if (calendarUri != null ? !calendarUri.equals(task.calendarUri) : task.calendarUri != null) {
return false;
}
if (parent != task.parent) {
return false;
}
if (!Objects.equal(parentUuid, task.parentUuid)) {
return false;
}
return remoteId != null ? remoteId.equals(task.remoteId) : task.remoteId == null;
return Objects.equals(id, task.id)
&& Objects.equals(title, task.title)
&& Objects.equals(priority, task.priority)
&& Objects.equals(dueDate, task.dueDate)
&& Objects.equals(hideUntil, task.hideUntil)
&& Objects.equals(created, task.created)
&& Objects.equals(modified, task.modified)
&& Objects.equals(completed, task.completed)
&& Objects.equals(deleted, task.deleted)
&& Objects.equals(notes, task.notes)
&& Objects.equals(estimatedSeconds, task.estimatedSeconds)
&& Objects.equals(elapsedSeconds, task.elapsedSeconds)
&& Objects.equals(notificationFlags, task.notificationFlags)
&& Objects.equals(notifications, task.notifications)
&& Objects.equals(recurrence, task.recurrence)
&& Objects.equals(repeatUntil, task.repeatUntil)
&& Objects.equals(calendarUri, task.calendarUri)
&& parent == task.parent
&& Objects.equals(parentUuid, task.parentUuid)
&& Objects.equals(remoteId, task.remoteId);
}
public boolean googleTaskUpToDate(Task original) {
@ -833,22 +787,12 @@ public class Task implements Parcelable {
return false;
}
if (title != null ? !title.equals(original.title) : original.title != null) {
return false;
}
if (dueDate != null ? !dueDate.equals(original.dueDate) : original.dueDate != null) {
return false;
}
if (completed != null ? !completed.equals(original.completed) : original.completed != null) {
return false;
}
if (deleted != null ? !deleted.equals(original.deleted) : original.deleted != null) {
return false;
}
if (parent != original.parent) {
return false;
}
return notes != null ? notes.equals(original.notes) : original.notes == null;
return Objects.equals(title, original.title)
&& Objects.equals(dueDate, original.dueDate)
&& Objects.equals(completed, original.completed)
&& Objects.equals(deleted, original.deleted)
&& parent == original.parent
&& Objects.equals(notes, original.notes);
}
public boolean caldavUpToDate(Task original) {
@ -859,35 +803,15 @@ public class Task implements Parcelable {
return false;
}
if (title != null ? !title.equals(original.title) : original.title != null) {
return false;
}
if (priority != null ? !priority.equals(original.priority) : original.priority != null) {
return false;
}
if (dueDate != null ? !dueDate.equals(original.dueDate) : original.dueDate != null) {
return false;
}
if (completed != null ? !completed.equals(original.completed) : original.completed != null) {
return false;
}
if (deleted != null ? !deleted.equals(original.deleted) : original.deleted != null) {
return false;
}
if (notes != null ? !notes.equals(original.notes) : original.notes != null) {
return false;
}
if (recurrence != null
? !recurrence.equals(original.recurrence)
: original.recurrence != null) {
return false;
}
if (parent != original.parent) {
return false;
}
return repeatUntil != null
? repeatUntil.equals(original.repeatUntil)
: original.repeatUntil == null;
return Objects.equals(title, original.title)
&& Objects.equals(priority, original.priority)
&& Objects.equals(dueDate, original.dueDate)
&& Objects.equals(completed, original.completed)
&& Objects.equals(deleted, original.deleted)
&& Objects.equals(notes, original.notes)
&& Objects.equals(recurrence, original.recurrence)
&& parent == original.parent
&& Objects.equals(repeatUntil, original.repeatUntil);
}
public boolean isSaved() {
@ -946,118 +870,41 @@ public class Task implements Parcelable {
if (!(o instanceof Task)) {
return false;
}
Task task = (Task) o;
if (collapsed != task.collapsed) {
return false;
}
if (parent != task.parent) {
return false;
}
if (id != null ? !id.equals(task.id) : task.id != null) {
return false;
}
if (title != null ? !title.equals(task.title) : task.title != null) {
return false;
}
if (priority != null ? !priority.equals(task.priority) : task.priority != null) {
return false;
}
if (dueDate != null ? !dueDate.equals(task.dueDate) : task.dueDate != null) {
return false;
}
if (hideUntil != null ? !hideUntil.equals(task.hideUntil) : task.hideUntil != null) {
return false;
}
if (created != null ? !created.equals(task.created) : task.created != null) {
return false;
}
if (modified != null ? !modified.equals(task.modified) : task.modified != null) {
return false;
}
if (completed != null ? !completed.equals(task.completed) : task.completed != null) {
return false;
}
if (deleted != null ? !deleted.equals(task.deleted) : task.deleted != null) {
return false;
}
if (notes != null ? !notes.equals(task.notes) : task.notes != null) {
return false;
}
if (estimatedSeconds != null ? !estimatedSeconds.equals(task.estimatedSeconds)
: task.estimatedSeconds != null) {
return false;
}
if (elapsedSeconds != null ? !elapsedSeconds.equals(task.elapsedSeconds)
: task.elapsedSeconds != null) {
return false;
}
if (timerStart != null ? !timerStart.equals(task.timerStart) : task.timerStart != null) {
return false;
}
if (notificationFlags != null ? !notificationFlags.equals(task.notificationFlags)
: task.notificationFlags != null) {
return false;
}
if (notifications != null ? !notifications.equals(task.notifications)
: task.notifications != null) {
return false;
}
if (lastNotified != null ? !lastNotified.equals(task.lastNotified)
: task.lastNotified != null) {
return false;
}
if (snoozeTime != null ? !snoozeTime.equals(task.snoozeTime) : task.snoozeTime != null) {
return false;
}
if (recurrence != null ? !recurrence.equals(task.recurrence) : task.recurrence != null) {
return false;
}
if (repeatUntil != null ? !repeatUntil.equals(task.repeatUntil) : task.repeatUntil != null) {
return false;
}
if (calendarUri != null ? !calendarUri.equals(task.calendarUri) : task.calendarUri != null) {
return false;
}
if (remoteId != null ? !remoteId.equals(task.remoteId) : task.remoteId != null) {
return false;
}
if (parentUuid != null ? !parentUuid.equals(task.parentUuid) : task.parentUuid != null) {
return false;
}
return transitoryData != null ? transitoryData.equals(task.transitoryData)
: task.transitoryData == null;
return collapsed == task.collapsed
&& parent == task.parent
&& Objects.equals(id, task.id)
&& Objects.equals(title, task.title)
&& Objects.equals(priority, task.priority)
&& Objects.equals(dueDate, task.dueDate)
&& Objects.equals(hideUntil, task.hideUntil)
&& Objects.equals(created, task.created)
&& Objects.equals(modified, task.modified)
&& Objects.equals(completed, task.completed)
&& Objects.equals(deleted, task.deleted)
&& Objects.equals(notes, task.notes)
&& Objects.equals(estimatedSeconds, task.estimatedSeconds)
&& Objects.equals(elapsedSeconds, task.elapsedSeconds)
&& Objects.equals(timerStart, task.timerStart)
&& Objects.equals(notificationFlags, task.notificationFlags)
&& Objects.equals(notifications, task.notifications)
&& Objects.equals(lastNotified, task.lastNotified)
&& Objects.equals(snoozeTime, task.snoozeTime)
&& Objects.equals(recurrence, task.recurrence)
&& Objects.equals(repeatUntil, task.repeatUntil)
&& Objects.equals(calendarUri, task.calendarUri)
&& Objects.equals(remoteId, task.remoteId)
&& Objects.equals(parentUuid, task.parentUuid)
&& Objects.equals(transitoryData, task.transitoryData);
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + (priority != null ? priority.hashCode() : 0);
result = 31 * result + (dueDate != null ? dueDate.hashCode() : 0);
result = 31 * result + (hideUntil != null ? hideUntil.hashCode() : 0);
result = 31 * result + (created != null ? created.hashCode() : 0);
result = 31 * result + (modified != null ? modified.hashCode() : 0);
result = 31 * result + (completed != null ? completed.hashCode() : 0);
result = 31 * result + (deleted != null ? deleted.hashCode() : 0);
result = 31 * result + (notes != null ? notes.hashCode() : 0);
result = 31 * result + (estimatedSeconds != null ? estimatedSeconds.hashCode() : 0);
result = 31 * result + (elapsedSeconds != null ? elapsedSeconds.hashCode() : 0);
result = 31 * result + (timerStart != null ? timerStart.hashCode() : 0);
result = 31 * result + (notificationFlags != null ? notificationFlags.hashCode() : 0);
result = 31 * result + (notifications != null ? notifications.hashCode() : 0);
result = 31 * result + (lastNotified != null ? lastNotified.hashCode() : 0);
result = 31 * result + (snoozeTime != null ? snoozeTime.hashCode() : 0);
result = 31 * result + (recurrence != null ? recurrence.hashCode() : 0);
result = 31 * result + (repeatUntil != null ? repeatUntil.hashCode() : 0);
result = 31 * result + (calendarUri != null ? calendarUri.hashCode() : 0);
result = 31 * result + (remoteId != null ? remoteId.hashCode() : 0);
result = 31 * result + (collapsed ? 1 : 0);
result = 31 * result + (int) (parent ^ (parent >>> 32));
result = 31 * result + (parentUuid != null ? parentUuid.hashCode() : 0);
result = 31 * result + (transitoryData != null ? transitoryData.hashCode() : 0);
return result;
return Objects
.hash(id, title, priority, dueDate, hideUntil, created, modified, completed, deleted, notes,
estimatedSeconds, elapsedSeconds, timerStart, notificationFlags, notifications,
lastNotified, snoozeTime, recurrence, repeatUntil, calendarUri, remoteId, collapsed,
parent, parentUuid, transitoryData);
}
@Retention(SOURCE)

@ -9,6 +9,7 @@ import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import java.util.Objects;
import org.tasks.security.KeyStoreEncryption;
@Entity(tableName = "caldav_accounts")
@ -228,58 +229,25 @@ public class CaldavAccount implements Parcelable {
if (!(o instanceof CaldavAccount)) {
return false;
}
CaldavAccount that = (CaldavAccount) o;
if (id != that.id) {
return false;
}
if (suppressRepeatingTasks != that.suppressRepeatingTasks) {
return false;
}
if (accountType != that.accountType) {
return false;
}
if (collapsed != that.collapsed) {
return false;
}
if (uuid != null ? !uuid.equals(that.uuid) : that.uuid != null) {
return false;
}
if (name != null ? !name.equals(that.name) : that.name != null) {
return false;
}
if (url != null ? !url.equals(that.url) : that.url != null) {
return false;
}
if (username != null ? !username.equals(that.username) : that.username != null) {
return false;
}
if (password != null ? !password.equals(that.password) : that.password != null) {
return false;
}
if (error != null ? !error.equals(that.error) : that.error != null) {
return false;
}
return encryptionKey != null
? encryptionKey.equals(that.encryptionKey)
: that.encryptionKey == null;
return id == that.id
&& suppressRepeatingTasks == that.suppressRepeatingTasks
&& accountType == that.accountType
&& collapsed == that.collapsed
&& Objects.equals(uuid, that.uuid)
&& Objects.equals(name, that.name)
&& Objects.equals(url, that.url)
&& Objects.equals(username, that.username)
&& Objects.equals(password, that.password)
&& Objects.equals(error, that.error)
&& Objects.equals(encryptionKey, that.encryptionKey);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (uuid != null ? uuid.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (username != null ? username.hashCode() : 0);
result = 31 * result + (password != null ? password.hashCode() : 0);
result = 31 * result + (error != null ? error.hashCode() : 0);
result = 31 * result + (suppressRepeatingTasks ? 1 : 0);
result = 31 * result + (encryptionKey != null ? encryptionKey.hashCode() : 0);
result = 31 * result + accountType;
result = 31 * result + (collapsed ? 1 : 0);
return result;
return Objects
.hash(id, uuid, name, url, username, password, error, suppressRepeatingTasks, encryptionKey,
accountType, collapsed);
}
@Override

@ -8,6 +8,7 @@ import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import java.util.Objects;
import org.tasks.themes.CustomIcons;
@Entity(tableName = "caldav_lists")
@ -160,44 +161,20 @@ public final class CaldavCalendar implements Parcelable {
if (!(o instanceof CaldavCalendar)) {
return false;
}
CaldavCalendar that = (CaldavCalendar) o;
if (id != that.id) {
return false;
}
if (color != that.color) {
return false;
}
if (account != null ? !account.equals(that.account) : that.account != null) {
return false;
}
if (uuid != null ? !uuid.equals(that.uuid) : that.uuid != null) {
return false;
}
if (name != null ? !name.equals(that.name) : that.name != null) {
return false;
}
if (ctag != null ? !ctag.equals(that.ctag) : that.ctag != null) {
return false;
}
if (url != null ? !url.equals(that.url) : that.url != null) {
return false;
}
return icon != null ? icon.equals(that.icon) : that.icon == null;
return id == that.id
&& color == that.color
&& Objects.equals(account, that.account)
&& Objects.equals(uuid, that.uuid)
&& Objects.equals(name, that.name)
&& Objects.equals(ctag, that.ctag)
&& Objects.equals(url, that.url)
&& Objects.equals(icon, that.icon);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (uuid != null ? uuid.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + color;
result = 31 * result + (ctag != null ? ctag.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (icon != null ? icon.hashCode() : 0);
return result;
return Objects.hash(id, account, uuid, name, color, ctag, url, icon);
}
@Override

@ -7,6 +7,7 @@ import androidx.room.Entity;
import androidx.room.PrimaryKey;
import com.todoroo.andlib.utility.AndroidUtilities;
import java.util.Map;
import java.util.Objects;
import org.tasks.themes.CustomIcons;
@Entity(tableName = "filters")
@ -103,40 +104,19 @@ public class Filter {
if (!(o instanceof Filter)) {
return false;
}
Filter filter = (Filter) o;
if (id != filter.id) {
return false;
}
if (title != null ? !title.equals(filter.title) : filter.title != null) {
return false;
}
if (sql != null ? !sql.equals(filter.sql) : filter.sql != null) {
return false;
}
if (values != null ? !values.equals(filter.values) : filter.values != null) {
return false;
}
if (criterion != null ? !criterion.equals(filter.criterion) : filter.criterion != null) {
return false;
}
if (color != null ? !color.equals(filter.color) : filter.color != null) {
return false;
}
return icon != null ? icon.equals(filter.icon) : filter.icon == null;
return id == filter.id
&& Objects.equals(title, filter.title)
&& Objects.equals(sql, filter.sql)
&& Objects.equals(values, filter.values)
&& Objects.equals(criterion, filter.criterion)
&& Objects.equals(color, filter.color)
&& Objects.equals(icon, filter.icon);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + (sql != null ? sql.hashCode() : 0);
result = 31 * result + (values != null ? values.hashCode() : 0);
result = 31 * result + (criterion != null ? criterion.hashCode() : 0);
result = 31 * result + (color != null ? color.hashCode() : 0);
result = 31 * result + (icon != null ? icon.hashCode() : 0);
return result;
return Objects.hash(id, title, sql, values, criterion, color, icon);
}
@Override

@ -13,6 +13,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
import java.io.Serializable;
import java.util.Objects;
import org.tasks.R;
import org.tasks.preferences.Preferences;
@ -156,39 +157,21 @@ public class Geofence implements Serializable, Parcelable {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof Geofence)) {
return false;
}
Geofence location = (Geofence) o;
if (id != location.id) {
return false;
}
if (task != location.task) {
return false;
}
if (radius != location.radius) {
return false;
}
if (arrival != location.arrival) {
return false;
}
if (departure != location.departure) {
return false;
}
return place != null ? place.equals(location.place) : location.place == null;
Geofence geofence = (Geofence) o;
return id == geofence.id
&& task == geofence.task
&& radius == geofence.radius
&& arrival == geofence.arrival
&& departure == geofence.departure
&& Objects.equals(place, geofence.place);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (task ^ (task >>> 32));
result = 31 * result + (place != null ? place.hashCode() : 0);
result = 31 * result + radius;
result = 31 * result + (arrival ? 1 : 0);
result = 31 * result + (departure ? 1 : 0);
return result;
return Objects.hash(id, task, place, radius, arrival, departure);
}
@Override

@ -7,6 +7,7 @@ import androidx.room.Index;
import androidx.room.PrimaryKey;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.Table;
import java.util.Objects;
@Entity(
tableName = "google_tasks",
@ -169,61 +170,28 @@ public class GoogleTask {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof GoogleTask)) {
return false;
}
GoogleTask that = (GoogleTask) o;
if (id != that.id) {
return false;
}
if (task != that.task) {
return false;
}
if (parent != that.parent) {
return false;
}
if (moved != that.moved) {
return false;
}
if (order != that.order) {
return false;
}
if (remoteOrder != that.remoteOrder) {
return false;
}
if (lastSync != that.lastSync) {
return false;
}
if (deleted != that.deleted) {
return false;
}
if (remoteId != null ? !remoteId.equals(that.remoteId) : that.remoteId != null) {
return false;
}
if (listId != null ? !listId.equals(that.listId) : that.listId != null) {
return false;
}
return remoteParent != null
? remoteParent.equals(that.remoteParent)
: that.remoteParent == null;
return id == that.id
&& task == that.task
&& parent == that.parent
&& moved == that.moved
&& order == that.order
&& remoteOrder == that.remoteOrder
&& lastSync == that.lastSync
&& deleted == that.deleted
&& Objects.equals(remoteId, that.remoteId)
&& Objects.equals(listId, that.listId)
&& Objects.equals(remoteParent, that.remoteParent);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (task ^ (task >>> 32));
result = 31 * result + (remoteId != null ? remoteId.hashCode() : 0);
result = 31 * result + (listId != null ? listId.hashCode() : 0);
result = 31 * result + (int) (parent ^ (parent >>> 32));
result = 31 * result + (moved ? 1 : 0);
result = 31 * result + (int) (order ^ (order >>> 32));
result = 31 * result + (remoteParent != null ? remoteParent.hashCode() : 0);
result = 31 * result + (int) (remoteOrder ^ (remoteOrder >>> 32));
result = 31 * result + (int) (lastSync ^ (lastSync >>> 32));
result = 31 * result + (int) (deleted ^ (deleted >>> 32));
return result;
return Objects
.hash(id, task, remoteId, listId, parent, remoteParent, moved, order, remoteOrder, lastSync,
deleted);
}
@Override

@ -7,6 +7,7 @@ import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import java.util.Objects;
@Entity(tableName = "google_task_accounts")
public class GoogleTaskAccount implements Parcelable {
@ -103,32 +104,17 @@ public class GoogleTaskAccount implements Parcelable {
if (!(o instanceof GoogleTaskAccount)) {
return false;
}
GoogleTaskAccount that = (GoogleTaskAccount) o;
if (id != that.id) {
return false;
}
if (collapsed != that.collapsed) {
return false;
}
if (account != null ? !account.equals(that.account) : that.account != null) {
return false;
}
if (error != null ? !error.equals(that.error) : that.error != null) {
return false;
}
return etag != null ? etag.equals(that.etag) : that.etag == null;
return id == that.id
&& collapsed == that.collapsed
&& Objects.equals(account, that.account)
&& Objects.equals(error, that.error)
&& Objects.equals(etag, that.etag);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (error != null ? error.hashCode() : 0);
result = 31 * result + (etag != null ? etag.hashCode() : 0);
result = 31 * result + (collapsed ? 1 : 0);
return result;
return Objects.hash(id, account, error, etag, collapsed);
}
@Override

@ -6,6 +6,7 @@ import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import java.util.Objects;
import org.tasks.themes.CustomIcons;
@Entity(tableName = "google_task_lists")
@ -152,44 +153,20 @@ public class GoogleTaskList implements Parcelable {
if (!(o instanceof GoogleTaskList)) {
return false;
}
GoogleTaskList that = (GoogleTaskList) o;
if (id != that.id) {
return false;
}
if (remoteOrder != that.remoteOrder) {
return false;
}
if (lastSync != that.lastSync) {
return false;
}
if (account != null ? !account.equals(that.account) : that.account != null) {
return false;
}
if (remoteId != null ? !remoteId.equals(that.remoteId) : that.remoteId != null) {
return false;
}
if (title != null ? !title.equals(that.title) : that.title != null) {
return false;
}
if (color != null ? !color.equals(that.color) : that.color != null) {
return false;
}
return icon != null ? icon.equals(that.icon) : that.icon == null;
return id == that.id
&& remoteOrder == that.remoteOrder
&& lastSync == that.lastSync
&& Objects.equals(account, that.account)
&& Objects.equals(remoteId, that.remoteId)
&& Objects.equals(title, that.title)
&& Objects.equals(color, that.color)
&& Objects.equals(icon, that.icon);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (account != null ? account.hashCode() : 0);
result = 31 * result + (remoteId != null ? remoteId.hashCode() : 0);
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + remoteOrder;
result = 31 * result + (int) (lastSync ^ (lastSync >>> 32));
result = 31 * result + (color != null ? color.hashCode() : 0);
result = 31 * result + (icon != null ? icon.hashCode() : 0);
return result;
return Objects.hash(id, account, remoteId, title, remoteOrder, lastSync, color, icon);
}
@Override

@ -7,6 +7,7 @@ import androidx.annotation.Nullable;
import androidx.room.Embedded;
import androidx.room.Ignore;
import java.io.Serializable;
import java.util.Objects;
public class Location implements Serializable, Parcelable {
@ -94,23 +95,16 @@ public class Location implements Serializable, Parcelable {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof Location)) {
return false;
}
Location location = (Location) o;
if (geofence != null ? !geofence.equals(location.geofence) : location.geofence != null) {
return false;
}
return place != null ? place.equals(location.place) : location.place == null;
return Objects.equals(geofence, location.geofence) && Objects.equals(place, location.place);
}
@Override
public int hashCode() {
int result = geofence != null ? geofence.hashCode() : 0;
result = 31 * result + (place != null ? place.hashCode() : 0);
return result;
return Objects.hash(geofence, place);
}
@Override

@ -25,6 +25,7 @@ import com.todoroo.andlib.data.Table;
import com.todoroo.astrid.helper.UUIDHelper;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.fortuna.ical4j.model.property.Geo;
@ -300,56 +301,22 @@ public class Place implements Serializable, Parcelable {
if (!(o instanceof Place)) {
return false;
}
Place place = (Place) o;
if (id != place.id) {
return false;
}
if (Double.compare(place.latitude, latitude) != 0) {
return false;
}
if (Double.compare(place.longitude, longitude) != 0) {
return false;
}
if (color != place.color) {
return false;
}
if (icon != place.icon) {
return false;
}
if (uid != null ? !uid.equals(place.uid) : place.uid != null) {
return false;
}
if (name != null ? !name.equals(place.name) : place.name != null) {
return false;
}
if (address != null ? !address.equals(place.address) : place.address != null) {
return false;
}
if (phone != null ? !phone.equals(place.phone) : place.phone != null) {
return false;
}
return url != null ? url.equals(place.url) : place.url == null;
return id == place.id
&& Double.compare(place.latitude, latitude) == 0
&& Double.compare(place.longitude, longitude) == 0
&& color == place.color
&& icon == place.icon
&& Objects.equals(uid, place.uid)
&& Objects.equals(name, place.name)
&& Objects.equals(address, place.address)
&& Objects.equals(phone, place.phone)
&& Objects.equals(url, place.url);
}
@Override
public int hashCode() {
int result;
long temp;
result = (int) (id ^ (id >>> 32));
result = 31 * result + (uid != null ? uid.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (address != null ? address.hashCode() : 0);
result = 31 * result + (phone != null ? phone.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
temp = Double.doubleToLongBits(latitude);
result = 31 * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(longitude);
result = 31 * result + (int) (temp ^ (temp >>> 32));
result = 31 * result + color;
result = 31 * result + icon;
return result;
return Objects.hash(id, uid, name, address, phone, url, latitude, longitude, color, icon);
}
@Override

@ -1,6 +1,7 @@
package org.tasks.data;
import androidx.room.Embedded;
import java.util.Objects;
public class PlaceUsage {
@Embedded public Place place;
@ -23,23 +24,16 @@ public class PlaceUsage {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof PlaceUsage)) {
return false;
}
PlaceUsage that = (PlaceUsage) o;
if (count != that.count) {
return false;
}
return place != null ? place.equals(that.place) : that.place == null;
return count == that.count && Objects.equals(place, that.place);
}
@Override
public int hashCode() {
int result = place != null ? place.hashCode() : 0;
result = 31 * result + count;
return result;
return Objects.hash(place, count);
}
@Override

@ -1,5 +1,7 @@
package org.tasks.data;
import java.util.Objects;
public class SubsetCaldav {
public long cd_id;
public String cd_calendar;
@ -30,30 +32,16 @@ public class SubsetCaldav {
if (!(o instanceof SubsetCaldav)) {
return false;
}
SubsetCaldav that = (SubsetCaldav) o;
if (cd_id != that.cd_id) {
return false;
}
if (cd_parent != that.cd_parent) {
return false;
}
if (cd_calendar != null ? !cd_calendar.equals(that.cd_calendar) : that.cd_calendar != null) {
return false;
}
return cd_remote_parent != null
? cd_remote_parent.equals(that.cd_remote_parent)
: that.cd_remote_parent == null;
return cd_id == that.cd_id
&& cd_parent == that.cd_parent
&& Objects.equals(cd_calendar, that.cd_calendar)
&& Objects.equals(cd_remote_parent, that.cd_remote_parent);
}
@Override
public int hashCode() {
int result = (int) (cd_id ^ (cd_id >>> 32));
result = 31 * result + (cd_calendar != null ? cd_calendar.hashCode() : 0);
result = 31 * result + (int) (cd_parent ^ (cd_parent >>> 32));
result = 31 * result + (cd_remote_parent != null ? cd_remote_parent.hashCode() : 0);
return result;
return Objects.hash(cd_id, cd_calendar, cd_parent, cd_remote_parent);
}
@Override

@ -1,5 +1,7 @@
package org.tasks.data;
import java.util.Objects;
public class SubsetGoogleTask {
public long gt_id;
@ -43,28 +45,16 @@ public class SubsetGoogleTask {
if (!(o instanceof SubsetGoogleTask)) {
return false;
}
SubsetGoogleTask that = (SubsetGoogleTask) o;
if (gt_id != that.gt_id) {
return false;
}
if (gt_parent != that.gt_parent) {
return false;
}
if (gt_order != that.gt_order) {
return false;
}
return gt_list_id != null ? gt_list_id.equals(that.gt_list_id) : that.gt_list_id == null;
return gt_id == that.gt_id
&& gt_parent == that.gt_parent
&& gt_order == that.gt_order
&& Objects.equals(gt_list_id, that.gt_list_id);
}
@Override
public int hashCode() {
int result = (int) (gt_id ^ (gt_id >>> 32));
result = 31 * result + (int) (gt_parent ^ (gt_parent >>> 32));
result = 31 * result + (gt_list_id != null ? gt_list_id.hashCode() : 0);
result = 31 * result + (int) (gt_order ^ (gt_order >>> 32));
return result;
return Objects.hash(gt_id, gt_parent, gt_list_id, gt_order);
}
@Override

@ -8,6 +8,7 @@ import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import com.todoroo.astrid.data.Task;
import java.util.Objects;
import org.tasks.backup.XmlReader;
import org.tasks.themes.CustomIcons;
@ -143,38 +144,18 @@ public final class TagData implements Parcelable {
if (!(o instanceof TagData)) {
return false;
}
TagData tagData = (TagData) o;
if (id != null ? !id.equals(tagData.id) : tagData.id != null) {
return false;
}
if (remoteId != null ? !remoteId.equals(tagData.remoteId) : tagData.remoteId != null) {
return false;
}
if (name != null ? !name.equals(tagData.name) : tagData.name != null) {
return false;
}
if (color != null ? !color.equals(tagData.color) : tagData.color != null) {
return false;
}
if (tagOrdering != null
? !tagOrdering.equals(tagData.tagOrdering)
: tagData.tagOrdering != null) {
return false;
}
return icon != null ? icon.equals(tagData.icon) : tagData.icon == null;
return Objects.equals(id, tagData.id)
&& Objects.equals(remoteId, tagData.remoteId)
&& Objects.equals(name, tagData.name)
&& Objects.equals(color, tagData.color)
&& Objects.equals(tagOrdering, tagData.tagOrdering)
&& Objects.equals(icon, tagData.icon);
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (remoteId != null ? remoteId.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (color != null ? color.hashCode() : 0);
result = 31 * result + (tagOrdering != null ? tagOrdering.hashCode() : 0);
result = 31 * result + (icon != null ? icon.hashCode() : 0);
return result;
return Objects.hash(id, remoteId, name, color, tagOrdering, icon);
}
@Override

@ -2,6 +2,7 @@ package org.tasks.data;
import androidx.room.Embedded;
import com.todoroo.astrid.data.Task;
import java.util.Objects;
public class TaskContainer {
@Embedded public Task task;
@ -90,59 +91,28 @@ public class TaskContainer {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof TaskContainer)) {
return false;
}
TaskContainer that = (TaskContainer) o;
if (children != that.children) {
return false;
}
if (siblings != that.siblings) {
return false;
}
if (primarySort != that.primarySort) {
return false;
}
if (secondarySort != that.secondarySort) {
return false;
}
if (indent != that.indent) {
return false;
}
if (targetIndent != that.targetIndent) {
return false;
}
if (task != null ? !task.equals(that.task) : that.task != null) {
return false;
}
if (googletask != null ? !googletask.equals(that.googletask) : that.googletask != null) {
return false;
}
if (caldavTask != null ? !caldavTask.equals(that.caldavTask) : that.caldavTask != null) {
return false;
}
if (location != null ? !location.equals(that.location) : that.location != null) {
return false;
}
return tags != null ? tags.equals(that.tags) : that.tags == null;
return children == that.children
&& siblings == that.siblings
&& primarySort == that.primarySort
&& secondarySort == that.secondarySort
&& indent == that.indent
&& targetIndent == that.targetIndent
&& Objects.equals(task, that.task)
&& Objects.equals(googletask, that.googletask)
&& Objects.equals(caldavTask, that.caldavTask)
&& Objects.equals(location, that.location)
&& Objects.equals(tags, that.tags);
}
@Override
public int hashCode() {
int result = task != null ? task.hashCode() : 0;
result = 31 * result + (googletask != null ? googletask.hashCode() : 0);
result = 31 * result + (caldavTask != null ? caldavTask.hashCode() : 0);
result = 31 * result + (location != null ? location.hashCode() : 0);
result = 31 * result + (tags != null ? tags.hashCode() : 0);
result = 31 * result + children;
result = 31 * result + siblings;
result = 31 * result + (int) (primarySort ^ (primarySort >>> 32));
result = 31 * result + (int) (secondarySort ^ (secondarySort >>> 32));
result = 31 * result + indent;
result = 31 * result + targetIndent;
return result;
return Objects
.hash(task, googletask, caldavTask, location, tags, children, siblings, primarySort,
secondarySort, indent, targetIndent);
}
@Override

@ -2,6 +2,7 @@ package org.tasks.filters;
import androidx.room.Embedded;
import com.todoroo.astrid.api.CaldavFilter;
import java.util.Objects;
import org.tasks.data.CaldavCalendar;
public class CaldavFilters {
@ -22,22 +23,13 @@ public class CaldavFilters {
if (!(o instanceof CaldavFilters)) {
return false;
}
CaldavFilters that = (CaldavFilters) o;
if (count != that.count) {
return false;
}
return caldavCalendar != null
? caldavCalendar.equals(that.caldavCalendar)
: that.caldavCalendar == null;
return count == that.count && Objects.equals(caldavCalendar, that.caldavCalendar);
}
@Override
public int hashCode() {
int result = caldavCalendar != null ? caldavCalendar.hashCode() : 0;
result = 31 * result + count;
return result;
return Objects.hash(caldavCalendar, count);
}
@Override

@ -2,6 +2,7 @@ package org.tasks.filters;
import androidx.room.Embedded;
import com.todoroo.astrid.api.GtasksFilter;
import java.util.Objects;
import org.tasks.data.GoogleTaskList;
public class GoogleTaskFilters {
@ -22,22 +23,13 @@ public class GoogleTaskFilters {
if (!(o instanceof GoogleTaskFilters)) {
return false;
}
GoogleTaskFilters that = (GoogleTaskFilters) o;
if (count != that.count) {
return false;
}
return googleTaskList != null
? googleTaskList.equals(that.googleTaskList)
: that.googleTaskList == null;
return count == that.count && Objects.equals(googleTaskList, that.googleTaskList);
}
@Override
public int hashCode() {
int result = googleTaskList != null ? googleTaskList.hashCode() : 0;
result = 31 * result + count;
return result;
return Objects.hash(googleTaskList, count);
}
@Override

@ -1,6 +1,7 @@
package org.tasks.filters;
import androidx.room.Embedded;
import java.util.Objects;
import org.tasks.data.Place;
public class LocationFilters {
@ -21,20 +22,13 @@ public class LocationFilters {
if (!(o instanceof LocationFilters)) {
return false;
}
LocationFilters that = (LocationFilters) o;
if (count != that.count) {
return false;
}
return place != null ? place.equals(that.place) : that.place == null;
return count == that.count && Objects.equals(place, that.place);
}
@Override
public int hashCode() {
int result = place != null ? place.hashCode() : 0;
result = 31 * result + count;
return result;
return Objects.hash(place, count);
}
@Override

@ -2,6 +2,7 @@ package org.tasks.filters;
import androidx.room.Embedded;
import com.todoroo.astrid.api.TagFilter;
import java.util.Objects;
import org.tasks.data.TagData;
public class TagFilters {
@ -22,20 +23,13 @@ public class TagFilters {
if (!(o instanceof TagFilters)) {
return false;
}
TagFilters that = (TagFilters) o;
if (count != that.count) {
return false;
}
return tagData != null ? tagData.equals(that.tagData) : that.tagData == null;
return count == that.count && Objects.equals(tagData, that.tagData);
}
@Override
public int hashCode() {
int result = tagData != null ? tagData.hashCode() : 0;
result = 31 * result + count;
return result;
return Objects.hash(tagData, count);
}
@Override

@ -15,6 +15,7 @@ import androidx.preference.PreferenceManager;
import java.io.Serializable;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Objects;
import org.tasks.R;
public class Locale implements Serializable {
@ -159,20 +160,23 @@ public class Locale implements Serializable {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof Locale)) {
return false;
}
Locale locale = (Locale) o;
return languageOverride != null
? languageOverride.equals(locale.languageOverride)
: locale.languageOverride == null;
return appDirectionality == locale.appDirectionality
&& appDirectionalityMark == locale.appDirectionalityMark
&& hasUserOverrides == locale.hasUserOverrides
&& Objects.equals(deviceLocale, locale.deviceLocale)
&& Objects.equals(appLocale, locale.appLocale)
&& Objects.equals(languageOverride, locale.languageOverride);
}
@Override
public int hashCode() {
return languageOverride != null ? languageOverride.hashCode() : 0;
return Objects
.hash(deviceLocale, appLocale, appDirectionality, appDirectionalityMark, languageOverride,
hasUserOverrides);
}
@Override

@ -1,5 +1,6 @@
package org.tasks.location;
import java.util.Objects;
import org.tasks.data.Place;
class PlaceSearchResult {
@ -41,31 +42,19 @@ class PlaceSearchResult {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof PlaceSearchResult)) {
return false;
}
PlaceSearchResult that = (PlaceSearchResult) o;
if (id != null ? !id.equals(that.id) : that.id != null) {
return false;
}
if (name != null ? !name.equals(that.name) : that.name != null) {
return false;
}
if (address != null ? !address.equals(that.address) : that.address != null) {
return false;
}
return place != null ? place.equals(that.place) : that.place == null;
return Objects.equals(id, that.id)
&& Objects.equals(name, that.name)
&& Objects.equals(address, that.address)
&& Objects.equals(place, that.place);
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (address != null ? address.hashCode() : 0);
result = 31 * result + (place != null ? place.hashCode() : 0);
return result;
return Objects.hash(id, name, address, place);
}
@Override

@ -2,14 +2,14 @@ package org.tasks.tags;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;
import com.google.common.base.Objects;
import java.util.Objects;
import org.tasks.data.TagData;
class TagDiffCallback extends DiffUtil.ItemCallback<TagData> {
@Override
public boolean areItemsTheSame(@NonNull TagData oldItem, @NonNull TagData newItem) {
return Objects.equal(oldItem.getId(), newItem.getId());
return Objects.equals(oldItem.getId(), newItem.getId());
}
@Override

@ -16,6 +16,7 @@ import com.google.ical.values.Weekday;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Objects;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import org.tasks.locale.Locale;
@ -372,23 +373,16 @@ public class DateTime {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof DateTime)) {
return false;
}
DateTime dateTime = (DateTime) o;
if (timestamp != dateTime.timestamp) {
return false;
}
return !(timeZone != null ? !timeZone.equals(dateTime.timeZone) : dateTime.timeZone != null);
return timestamp == dateTime.timestamp && Objects.equals(timeZone, dateTime.timeZone);
}
@Override
public int hashCode() {
int result = timeZone != null ? timeZone.hashCode() : 0;
result = 31 * result + (int) (timestamp ^ (timestamp >>> 32));
return result;
return Objects.hash(timeZone, timestamp);
}
public String toString(String format) {

@ -14,7 +14,6 @@ import androidx.annotation.Nullable;
import butterknife.BindView;
import com.google.android.material.chip.Chip;
import com.google.android.material.chip.ChipGroup;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.todoroo.astrid.api.CaldavFilter;
import com.todoroo.astrid.api.Filter;
@ -22,6 +21,7 @@ import com.todoroo.astrid.api.GtasksFilter;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gtasks.GtasksListService;
import com.todoroo.astrid.service.TaskMover;
import java.util.Objects;
import javax.inject.Inject;
import org.tasks.R;
import org.tasks.activities.RemoteListPicker;
@ -185,7 +185,7 @@ public class RemoteListFragment extends TaskEditControlFragment {
}
private boolean hasChanges() {
return !Objects.equal(selectedList, originalList);
return !Objects.equals(selectedList, originalList);
}
@Override

Loading…
Cancel
Save