renamed one more variable

This commit is contained in:
long 2021-03-22 10:29:36 -06:00
parent b5e12473db
commit 8e45a33e2d
1 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ public final class TerserUtil {
public static final String FIELD_NAME_IDENTIFIER = "identifier"; public static final String FIELD_NAME_IDENTIFIER = "identifier";
private static final String OUR_EQUALS_DEEP = "equalsDeep"; private static final String EQUALS_DEEP = "equalsDeep";
public static final Collection<String> IDS_AND_META_EXCLUDES = public static final Collection<String> IDS_AND_META_EXCLUDES =
Collections.unmodifiableSet(Stream.of("id", "identifier", "meta").collect(Collectors.toSet())); Collections.unmodifiableSet(Stream.of("id", "identifier", "meta").collect(Collectors.toSet()));
@ -188,7 +188,7 @@ public final class TerserUtil {
} }
/** /**
* Checks if two items are equal via {@link #OUR_EQUALS_DEEP} method * Checks if two items are equal via {@link #EQUALS_DEEP} method
* *
* @param theItem1 First item to compare * @param theItem1 First item to compare
* @param theItem2 Second item to compare * @param theItem2 Second item to compare
@ -199,9 +199,9 @@ public final class TerserUtil {
return theItem2 == null; return theItem2 == null;
} }
final Method method = getMethod(theItem1, OUR_EQUALS_DEEP); final Method method = getMethod(theItem1, EQUALS_DEEP);
if (method == null) { if (method == null) {
throw new IllegalArgumentException(String.format("Instance %s do not provide %s method", theItem1, OUR_EQUALS_DEEP)); throw new IllegalArgumentException(String.format("Instance %s do not provide %s method", theItem1, EQUALS_DEEP));
} }
return equals(theItem1, theItem2, method); return equals(theItem1, theItem2, method);
} }
@ -211,14 +211,14 @@ public final class TerserUtil {
try { try {
return (Boolean) theMethod.invoke(theItem1, theItem2); return (Boolean) theMethod.invoke(theItem1, theItem2);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(String.format("Unable to compare equality via %s", OUR_EQUALS_DEEP), e); throw new RuntimeException(String.format("Unable to compare equality via %s", EQUALS_DEEP), e);
} }
} }
return theItem1.equals(theItem2); return theItem1.equals(theItem2);
} }
private static boolean contains(IBase theItem, List<IBase> theItems) { private static boolean contains(IBase theItem, List<IBase> theItems) {
final Method method = getMethod(theItem, OUR_EQUALS_DEEP); final Method method = getMethod(theItem, EQUALS_DEEP);
return theItems.stream().anyMatch(i -> equals(i, theItem, method)); return theItems.stream().anyMatch(i -> equals(i, theItem, method));
} }