tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1043153 - in /tomcat/trunk/java/org/apache: catalina/tribes/membership/Membership.java tomcat/util/net/URL.java
Date Tue, 07 Dec 2010 18:05:31 GMT
Author: markt
Date: Tue Dec  7 18:05:31 2010
New Revision: 1043153

URL: http://svn.apache.org/viewvc?rev=1043153&view=rev
Log:
Fix a couple of 'high priority' FindBugs warnings

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java
    tomcat/trunk/java/org/apache/tomcat/util/net/URL.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java?rev=1043153&r1=1043152&r2=1043153&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java Tue Dec  7 18:05:31
2010
@@ -18,6 +18,7 @@
 package org.apache.catalina.tribes.membership;
 
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -37,8 +38,8 @@ import org.apache.catalina.tribes.Member
  * @author Peter Rossbach
  * @version $Id$
  */
-public class Membership
-{
+public class Membership implements Cloneable {
+
     protected static final MemberImpl[] EMPTY_MEMBERS = new MemberImpl[0];
     
     private final Object membersLock = new Object();
@@ -270,8 +271,12 @@ public class Membership
     
     // --------------------------------------------- Inner Class
 
-    private class MemberComparator implements Comparator<Member> {
+    private static class MemberComparator implements Comparator<Member>,
+            Serializable {
+
+        private static final long serialVersionUID = 1L;
 
+        @Override
         public int compare(Member m1, Member m2) {
             //longer alive time, means sort first
             long result = m2.getMemberAliveTime() - m1.getMemberAliveTime();

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/URL.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/URL.java?rev=1043153&r1=1043152&r2=1043153&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/URL.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/URL.java Tue Dec  7 18:05:31 2010
@@ -316,6 +316,20 @@ public final class URL implements Serial
     }
 
 
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((file == null) ? 0 : file.hashCode());
+        result = prime * result + ((host == null) ? 0 : host.hashCode());
+        result = prime * result + port;
+        result = prime * result +
+                ((protocol == null) ? 0 : protocol.hashCode());
+        result = prime * result + ((ref == null) ? 0 : ref.hashCode());
+        return result;
+    }
+
+
     /**
      * Return the authority part of the URL.
      */



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


Mime
View raw message