Skip to content

Commit 7b36965

Browse files
committed
Merge pull request #1294 from mwinkels/patch-1
Fix IndexOutOfBoundsException in ReflectionUtils
2 parents 400662d + 9c440d3 commit 7b36965

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/swagger-jaxrs/src/main/java/io/swagger/jaxrs/utils/ReflectionUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ public static Method findMethod(Method methodToFind, Class<?> cls) {
8383
Type[] gpTypes = methodToFind.getGenericParameterTypes();
8484
methodLoop:
8585
for (Method method : cls.getMethods()) {
86-
if (!method.getName().equals(methodToSearch) || !method.getReturnType().isAssignableFrom(methodToFind.getReturnType())) {
86+
if (
87+
!method.getName().equals(methodToSearch) ||
88+
!method.getReturnType().isAssignableFrom(methodToFind.getReturnType()) ||
89+
method.getParameterTypes().length != pTypes.length
90+
) {
8791
continue;
8892
}
8993
Class<?>[] pt = method.getParameterTypes();

0 commit comments

Comments
 (0)