Skip to content

Commit

Permalink
Turn on additional IntelliJ inspections and fix violations (Trivial I…
Browse files Browse the repository at this point in the history
…f). #1323

Signed-off-by: Alexander Goldberg <alexander.goldberg@bnymellon.com>
  • Loading branch information
goldbal330 committed Jan 13, 2023
1 parent 412d842 commit 48b73f0
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/3_Consistent_Style.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/IDE.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -115,16 +115,12 @@ private static boolean nullSafeEquals(Object value, Object other)
{
if (value == null)
{
if (other == null)
{
return true;
}
return other == null;
}
else if (other == value || value.equals(other))
else
{
return true;
return other == value || value.equals(other);
}
return false;
}

@Override
Expand Down
Expand Up @@ -1856,10 +1856,7 @@ public boolean equals(Object o)
{
V v1 = this.value;
Object v2 = e.getValue();
if (v1 == v2 || v1 != null && v1.equals(v2))
{
return true;
}
return v1 == v2 || v1 != null && v1.equals(v2);
}
return false;
}
Expand Down
Expand Up @@ -1969,10 +1969,7 @@ public boolean equals(Object o)
{
V v1 = this.value;
Object v2 = e.getValue();
if (v1 == v2 || v1 != null && v1.equals(v2))
{
return true;
}
return v1 == v2 || v1 != null && v1.equals(v2);
}
return false;
}
Expand Down
Expand Up @@ -2539,16 +2539,12 @@ private static boolean nullSafeEquals(Object value, Object other)
{
if (value == null)
{
if (other == null)
{
return true;
}
return other == null;
}
else if (other == value || value.equals(other))
else
{
return true;
return other == value || value.equals(other);
}
return false;
}

protected class EntrySet implements Set<Entry<K, V>>, Serializable, BatchIterable<Entry<K, V>>
Expand Down
Expand Up @@ -1053,16 +1053,12 @@ private static boolean nullSafeEquals(Object value, Object other)
{
if (value == null)
{
if (other == null)
{
return true;
}
return other == null;
}
else if (other == value || value.equals(other))
else
{
return true;
return other == value || value.equals(other);
}
return false;
}

private K toNonSentinel(Object key)
Expand Down
Expand Up @@ -1072,17 +1072,11 @@ private boolean nullSafeEquals(K key, Object other)
{
if (key == null)
{
if (other == null)
{
return true;
}
return other == null;
}
else if (key != NULL_KEY && other != null)
{
if (this.hashingStrategy.equals(key, this.toNonSentinel(other)))
{
return true;
}
return this.hashingStrategy.equals(key, this.toNonSentinel(other));
}
return false;
}
Expand Down
Expand Up @@ -2268,16 +2268,12 @@ private static boolean nullSafeEquals(Object value, Object other)
{
if (value == null)
{
if (other == null)
{
return true;
}
return other == null;
}
else if (other == value || value.equals(other))
else
{
return true;
return other == value || value.equals(other);
}
return false;
}

protected class EntrySet implements Set<Entry<K, V>>, Serializable, BatchIterable<Entry<K, V>>
Expand Down
Expand Up @@ -702,11 +702,7 @@ public boolean equalsIntList(IntList list)
}
i += Character.charCount(codePoint);
}
if (size < list.size())
{
return false;
}
return true;
return size >= list.size();
}

private boolean equalsCodePointAdapter(CodePointAdapter adapter)
Expand Down
Expand Up @@ -45,12 +45,7 @@ public boolean equals(Object o)

B b = (B) o;

if (this.i != b.i)
{
return false;
}

return true;
return this.i == b.i;
}

@Override
Expand Down
Expand Up @@ -45,12 +45,7 @@ public boolean equals(Object o)

C c = (C) o;

if (Double.compare(c.d, this.d) != 0)
{
return false;
}

return true;
return Double.compare(c.d, this.d) == 0;
}

@Override
Expand Down
Expand Up @@ -61,12 +61,7 @@ public boolean equals(Object o)
{
return false;
}
if (!this.lastName.equals(person.lastName))
{
return false;
}

return true;
return this.lastName.equals(person.lastName);
}

@Override
Expand Down

0 comments on commit 48b73f0

Please sign in to comment.