HDFS-13318. RBF: Fix FindBugs in hadoop-hdfs-rbf. Contributed by Ekanth S.
(cherry picked from commit 3d0ee8b804
)
This commit is contained in:
parent
987d90aa4c
commit
471f758673
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.hadoop.hdfs.server.federation.resolver;
|
package org.apache.hadoop.hdfs.server.federation.resolver;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +32,9 @@ import java.util.Comparator;
|
||||||
* breaker, newest has priority. Expired NNs are excluded.
|
* breaker, newest has priority. Expired NNs are excluded.
|
||||||
*/
|
*/
|
||||||
public class NamenodePriorityComparator
|
public class NamenodePriorityComparator
|
||||||
implements Comparator<FederationNamenodeContext> {
|
implements Comparator<FederationNamenodeContext>, Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2304924292036293331L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(FederationNamenodeContext o1,
|
public int compare(FederationNamenodeContext o1,
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class RemoteMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.params = pParams;
|
this.params = pParams;
|
||||||
this.types = pTypes;
|
this.types = Arrays.copyOf(pTypes, pTypes.length);
|
||||||
this.methodName = method;
|
this.methodName = method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public class RemoteMethod {
|
||||||
* @return An array of calling types.
|
* @return An array of calling types.
|
||||||
*/
|
*/
|
||||||
public Class<?>[] getTypes() {
|
public Class<?>[] getTypes() {
|
||||||
return this.types;
|
return Arrays.copyOf(this.types, this.types.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue