From 9f7ddfac537eb2737190f88f015ac8b092ccb8d9 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Sat, 9 Apr 2022 09:54:46 +0200 Subject: [PATCH] Some feedback from yesterday ;) --- .../errorprone/bugpatterns/PrimitiveComparisonCheck.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheck.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheck.java index 4d6a548d23a..2e6b9f187a1 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheck.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/PrimitiveComparisonCheck.java @@ -99,10 +99,10 @@ private static Optional tryMakeMethodCallMorePrecise( private static String mayPrefixWithTypeArguments( String preferredMethodName, MethodInvocationTree tree, Type cmpType, VisitorState state) { - int typeArguments = tree.getTypeArguments().size(); - boolean methodNameIsComparing = preferredMethodName.equals("comparing"); + int typeArgumentsCount = tree.getTypeArguments().size(); + boolean methodNameIsComparing = "comparing".equals(preferredMethodName); - if (typeArguments == 0 || (typeArguments == 1 && !methodNameIsComparing)) { + if (typeArgumentsCount == 0 || (typeArgumentsCount == 1 && !methodNameIsComparing)) { return preferredMethodName; }