nagaboinaramgopal commented on code in PR #14049:
URL: https://github.com/apache/cloudstack/pull/14049#discussion_r3940391999


##########
api/src/main/java/org/apache/cloudstack/api/response/TemplateOVFPropertyResponse.java:
##########
@@ -76,7 +76,7 @@ public boolean equals(Object other) {
 
     @Override
     public int hashCode() {
-        return key.hashCode();
+        return key == null ? 0 : key.hashCode();
     }

Review Comment:
   Good call @DaanHoogland . I checked and TemplateOVFPropertyResponse isn't 
referenced anywhere outside its own file, so equals()/hashCode() have no 
callers at all, nothing keys it in a set or map. Rather than harden a method 
that shouldn't be here, I've dropped both equals() and hashCode() (and the test 
that came with them). That removes the NPE path entirely and takes out more 
code than it adds. Updated the 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