Initialize a collection when you create it.

This commit is contained in:
Gary Gregory 2020-11-20 16:09:58 -05:00
parent f2480a984f
commit d8f8d9a3a8
1 changed files with 1 additions and 2 deletions

View File

@ -1167,8 +1167,7 @@ public class ClassUtils {
return declaredMethod;
}
final List<Class<?>> candidateClasses = new ArrayList<>();
candidateClasses.addAll(getAllInterfaces(cls));
final List<Class<?>> candidateClasses = new ArrayList<>(getAllInterfaces(cls));
candidateClasses.addAll(getAllSuperclasses(cls));
for (final Class<?> candidateClass : candidateClasses) {