garydgregory commented on a change in pull request #757:
URL: https://github.com/apache/commons-lang/pull/757#discussion_r820810506



##########
File path: src/main/java/org/apache/commons/lang3/event/EventUtils.java
##########
@@ -48,11 +49,11 @@
         try {
             MethodUtils.invokeMethod(eventSource, "add" + 
listenerType.getSimpleName(), listener);
         } catch (final NoSuchMethodException e) {
-            throw new IllegalArgumentException("Class " + 
eventSource.getClass().getName()
+            throw new IllegalArgumentException("Class " + 
ClassUtils.getName(eventSource)

Review comment:
       @arturobernalg 
   We're going through the same issue, over and over. I'm going to stop 
reviewing this PR until you can tell us that you've verified each call site you 
changed and whether it is justified. In this case, what happens when 
`eventSource` is null? Please do walk through the code instead of blindly 
changing all callers for Object#getClass(). Hint: if eventSource is null, we 
never get here, so if we are here it is never null and safe to call getName().




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to