Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df228257 authored by William Escande's avatar William Escande
Browse files

Errorprone: EqualsHashCode

Test: m Bluetooth
Bug: 344658662
Flag: Exempt, enforce error in the futur
Change-Id: Iab1ded80555f60a6c335f97aef55a99214d021e3
parent db360885
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ android_app {
            "-Xep:EmptyBlockTag:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:EqualsGetClass:ERROR",
            "-Xep:EqualsHashCode:ERROR",
            "-Xep:FallThrough:ERROR",
            "-Xep:Finalize:ERROR",
            "-Xep:HidingField:ERROR",
+6 −2
Original line number Diff line number Diff line
@@ -269,11 +269,10 @@ public class AvrcpItem {
            return true;
        }

        if (!(o instanceof AvrcpItem)) {
        if (!(o instanceof AvrcpItem other)) {
            return false;
        }

        AvrcpItem other = ((AvrcpItem) o);
        return Objects.equals(mUuid, other.getUuid())
                && Objects.equals(mDevice, other.getDevice())
                && mUid == other.getUid()
@@ -293,6 +292,11 @@ public class AvrcpItem {
                && Objects.equals(mImageUri, other.getCoverArtLocation());
    }

    @Override
    public int hashCode() {
        return Objects.hash(mUuid);
    }

    /** Builder for an AvrcpItem */
    public static class Builder {
        private static final String TAG = "AvrcpItem.Builder";
+8 −4
Original line number Diff line number Diff line
@@ -357,12 +357,16 @@ public class BrowseTree {
        }

        @Override
        public boolean equals(Object other) {
            if (!(other instanceof BrowseNode)) {
        public boolean equals(Object obj) {
            if (!(obj instanceof BrowseNode other)) {
                return false;
            }
            BrowseNode otherNode = (BrowseNode) other;
            return getID().equals(otherNode.getID());
            return getID().equals(other.getID());
        }

        @Override
        public int hashCode() {
            return Objects.hash(getID());
        }

        public synchronized void toTreeString(int depth, StringBuilder sb) {
+11 −0
Original line number Diff line number Diff line
@@ -160,6 +160,17 @@ public class BipAttachmentFormat {
                && Objects.equals(a.getModifiedDate(), getModifiedDate());
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                getContentType(),
                getName(),
                getCharset(),
                getSize(),
                getCreatedDate(),
                getModifiedDate());
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
+5 −0
Original line number Diff line number Diff line
@@ -126,6 +126,11 @@ public class BipDateTime {
        return d.isUtc() == isUtc() && Objects.equals(d.getTime(), getTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(isUtc(), getTime());
    }

    @Override
    @SuppressLint("ToStringReturnsNull")
    public String toString() {
Loading