@@ -44,6 +44,7 @@ class MethodNameUtil {
4444 // Strings corresponding to the names of the methods (and their owners) used to identify
4545 // assertions in this handler.
4646 private static final String IS_NOT_NULL_METHOD = "isNotNull" ;
47+ private static final String IS_HAS_SIZE_METHOD = "hasSize" ;
4748 private static final String IS_OWNER_TRUTH_SUBJECT = "com.google.common.truth.Subject" ;
4849 private static final String IS_INSTANCE_OF_METHOD = "isInstanceOf" ;
4950 private static final String IS_INSTANCE_OF_ANY_METHOD = "isInstanceOfAny" ;
@@ -88,6 +89,7 @@ class MethodNameUtil {
8889 // here refers to com.sun.tools.javac.util.Name. Comparing methods using Names is faster than
8990 // comparing using strings.
9091 private Name isNotNull ;
92+ private Name hasSize ;
9193
9294 private Name isInstanceOf ;
9395 private Name isInstanceOfAny ;
@@ -133,6 +135,7 @@ class MethodNameUtil {
133135 @ Initializer
134136 void initializeMethodNames (Name .Table table ) {
135137 isNotNull = table .fromString (IS_NOT_NULL_METHOD );
138+ hasSize = table .fromString (IS_HAS_SIZE_METHOD );
136139 isOwnerTruthSubject = table .fromString (IS_OWNER_TRUTH_SUBJECT );
137140
138141 isInstanceOf = table .fromString (IS_INSTANCE_OF_METHOD );
@@ -180,6 +183,10 @@ boolean isMethodIsNotNull(Symbol.MethodSymbol methodSymbol, VisitorState state)
180183 || matchesAssertJAssertMethod (methodSymbol , isNotNull , state );
181184 }
182185
186+ boolean isMethodHasSize (Symbol .MethodSymbol methodSymbol , VisitorState state ) {
187+ return matchesAssertJAssertMethod (methodSymbol , hasSize , state );
188+ }
189+
183190 boolean isMethodIsInstanceOf (Symbol .MethodSymbol methodSymbol , VisitorState state ) {
184191 return matchesMethod (methodSymbol , isInstanceOf , isOwnerTruthSubject )
185192 || matchesAssertJAssertMethod (methodSymbol , isInstanceOf , state )
0 commit comments