pingpingy1 commented on code in PR #1670:
URL: https://github.com/apache/cxf/pull/1670#discussion_r1476978565


##########
rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java:
##########
@@ -118,7 +119,7 @@ public class ManagedRMEndpoint implements ManagedComponent {
     }
 
     public ManagedRMEndpoint(RMEndpoint endpoint) {
-        this.endpoint = endpoint;
+        this.endpoint = Objects.requireNonNull(endpoint, "endpoint");

Review Comment:
   @reta Truth be told, I could imagine very few scenarios in the wild where 
`null` could be passed here as described.
   My PR was intended as a nice-to-have guard for debugging possible future 
NPEs more quickly, though perhaps in highly unlikely scenarios.
   Still, one may imagine a situation where one should create a 
`ManagedRMEndpoint` for an `RMEndpoint` instance that they hadn't explicitly 
created, for example to automate a part of the management process.
   I do believe that a fail-fast guard against `null` values could go a long 
way in not just debugging but also consciously preparing for such issues, as I 
have anecdotally experienced with other projects; hence my PR.



-- 
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