Skip to content

Commit d24fad7

Browse files
committed
More bullet proofing
1 parent 402b9ee commit d24fad7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.apache.commons.lang3.ClassUtils.Interfaces;
4343
import org.apache.commons.lang3.Validate;
4444
import org.apache.commons.lang3.stream.LangCollectors;
45+
import org.apache.commons.lang3.stream.Streams;
4546

4647
/**
4748
* Utility reflection methods focused on {@link Method}s, originally from Commons BeanUtils.
@@ -1022,8 +1023,8 @@ public static Object invokeStaticMethod(final Class<?> cls, final String methodN
10221023
private static Method requireNonNull(final Method method, final Class<?> cls, final String methodName, final Class<?>[] parameterTypes)
10231024
throws NoSuchMethodException {
10241025
if (method == null) {
1025-
throw new NoSuchMethodException(String.format("No method: %s.%s(%s)", cls.getName(), methodName,
1026-
Stream.of(parameterTypes).map(ClassUtils::getName).collect(LangCollectors.joining(", "))));
1026+
throw new NoSuchMethodException(String.format("No method: %s.%s(%s)", ClassUtils.getName(cls), methodName,
1027+
Streams.of(parameterTypes).map(ClassUtils::getName).collect(LangCollectors.joining(", "))));
10271028
}
10281029
return method;
10291030
}

0 commit comments

Comments
 (0)