You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2018/02/26 22:07:03 UTC

svn commit: r1825419 - /tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java

Author: markt
Date: Mon Feb 26 22:07:02 2018
New Revision: 1825419

URL: http://svn.apache.org/viewvc?rev=1825419&view=rev
Log:
Spotbugs warning
Super class has defined hashCode() and equals() so override them here.
Probably unnecessary but play it safe.
Use Eclipse generated code.

Modified:
    tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java

Modified: tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java?rev=1825419&r1=1825418&r2=1825419&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java Mon Feb 26 22:07:02 2018
@@ -465,5 +465,32 @@ public class JmxRemoteLifecycleListener
             sslServerSocket.setNeedClientAuth(getNeedClientAuth());
             return sslServerSocket;
         }
+
+        // Super class defines hashCode() and equals(). Probably not used in
+        // Tomcat but for safety, override them here.
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = super.hashCode();
+            result = prime * result + ((bindAddress == null) ? 0 : bindAddress.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (!super.equals(obj))
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            SslRmiServerBindSocketFactory other = (SslRmiServerBindSocketFactory) obj;
+            if (bindAddress == null) {
+                if (other.bindAddress != null)
+                    return false;
+            } else if (!bindAddress.equals(other.bindAddress))
+                return false;
+            return true;
+        }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org