Skip to content

Commit

Permalink
CoercingComparator: fix problem marker
Browse files Browse the repository at this point in the history
"Unlikely argument type for equals(): TB seems to be unrelated to TA"
  • Loading branch information
EcljpseB0T authored and jukzi committed Feb 13, 2024
1 parent 8d19a8e commit 8c311cc
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ public static <TA extends Object, TB extends Object> int coerceAndCompare(TA o1,
* was impossible
* @see Object#equals(Object)
*/
public static <TA extends Object, TB extends Object> boolean coerceAndEquals(TA o1, TB o2)
throws IllegalArgumentException {
static boolean coerceAndEquals(Object o1, Object o2) throws IllegalArgumentException {
if (o1 == o2)
return true;

Expand All @@ -326,8 +325,8 @@ public static <TA extends Object, TB extends Object> boolean coerceAndEquals(TA
if (o2.getClass().isAssignableFrom(o1.getClass()))
return o2.equals(o1);
try {
CoercingComparator<TA> ca = getComparator(o1, o2);
CoercingComparator<TB> cb = getComparator(o2, o1);
CoercingComparator<?> ca = getComparator(o1, o2);
CoercingComparator<?> cb = getComparator(o2, o1);
return ca.getCoercePrio() <= cb.getCoercePrio() ? o1.equals(ca.coerce(o2)) : o2.equals(cb.coerce(o1));
} catch (IllegalArgumentException e) {
//
Expand Down

0 comments on commit 8c311cc

Please sign in to comment.