Skip to content

Commit

Permalink
feat: refactoring using introduce explaining variable
Browse files Browse the repository at this point in the history
  • Loading branch information
NIKUNJ LALITKUMAR HUDKA authored and JakeWharton committed Nov 28, 2023
1 parent 26d74d2 commit e2f26c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions retrofit/src/main/java/retrofit2/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ static boolean equals(Type a, Type b) {
ParameterizedType pb = (ParameterizedType) b;
Object ownerA = pa.getOwnerType();
Object ownerB = pb.getOwnerType();
return (ownerA == ownerB || (ownerA != null && ownerA.equals(ownerB)))
&& pa.getRawType().equals(pb.getRawType())
&& Arrays.equals(pa.getActualTypeArguments(), pb.getActualTypeArguments());
boolean ownersAreEqual = ownerA == ownerB || (ownerA != null && ownerA.equals(ownerB));
boolean rawTypesAreEqual = pa.getRawType().equals(pb.getRawType());
boolean typeArgumentsAreEqual = Arrays.equals(pa.getActualTypeArguments(), pb.getActualTypeArguments());

return ownersAreEqual && rawTypesAreEqual && typeArgumentsAreEqual;

} else if (a instanceof GenericArrayType) {
if (!(b instanceof GenericArrayType)) return false;
Expand Down

0 comments on commit e2f26c6

Please sign in to comment.