HBASE-17207 Arrays.asList() with too few arguments. (John Leach)

This commit is contained in:
anoopsamjohn 2016-12-06 14:42:14 +05:30
parent c7b8b63cd1
commit f112427425
6 changed files with 12 additions and 8 deletions

View File

@ -27,7 +27,7 @@ import org.apache.hadoop.hbase.ipc.RpcControllerFactory;
import java.io.IOException; import java.io.IOException;
import java.io.InterruptedIOException; import java.io.InterruptedIOException;
import java.util.Arrays; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
@ -129,7 +129,7 @@ public class BufferedMutatorImpl implements BufferedMutator {
@Override @Override
public void mutate(Mutation m) throws InterruptedIOException, public void mutate(Mutation m) throws InterruptedIOException,
RetriesExhaustedWithDetailsException { RetriesExhaustedWithDetailsException {
mutate(Arrays.asList(m)); mutate(Collections.singletonList(m));
} }
@Override @Override

View File

@ -19,7 +19,7 @@
package org.apache.hadoop.hbase.client; package org.apache.hadoop.hbase.client;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -68,7 +68,7 @@ public final class MultiAction {
* @param a * @param a
*/ */
public void add(byte[] regionName, Action a) { public void add(byte[] regionName, Action a) {
add(regionName, Arrays.asList(a)); add(regionName, Collections.singletonList(a));
} }
/** /**

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.filter;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.Cell;
@ -194,7 +195,7 @@ final public class FilterList extends FilterBase {
* @param filter another filter * @param filter another filter
*/ */
public void addFilter(Filter filter) { public void addFilter(Filter filter) {
addFilter(Arrays.asList(filter)); addFilter(Collections.singletonList(filter));
} }
@Override @Override

View File

@ -54,6 +54,7 @@ import java.net.InetSocketAddress;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -355,7 +356,7 @@ public final class FanOutOneBlockAsyncDFSOutputSaslHelper {
throw new IOException(String.format("Invalid cipher suite, %s=%s", throw new IOException(String.format("Invalid cipher suite, %s=%s",
DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY, cipherSuites)); DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY, cipherSuites));
} }
return Arrays.asList(new CipherOption(CipherSuite.AES_CTR_NOPADDING)); return Collections.singletonList(new CipherOption(CipherSuite.AES_CTR_NOPADDING));
} }
private void sendSaslMessage(ChannelHandlerContext ctx, byte[] payload, private void sendSaslMessage(ChannelHandlerContext ctx, byte[] payload,

View File

@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.master;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -63,7 +64,7 @@ public class RackManager {
} }
// just a note - switchMapping caches results (at least the implementation should unless the // just a note - switchMapping caches results (at least the implementation should unless the
// resolution is really a lightweight process) // resolution is really a lightweight process)
List<String> racks = switchMapping.resolve(Arrays.asList(server.getHostname())); List<String> racks = switchMapping.resolve(Collections.singletonList(server.getHostname()));
if (racks != null && !racks.isEmpty()) { if (racks != null && !racks.isEmpty()) {
return racks.get(0); return racks.get(0);
} }

View File

@ -21,6 +21,7 @@ import com.google.common.base.Preconditions;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -243,7 +244,7 @@ public class RegionStateStore {
// Called when meta is not on master // Called when meta is not on master
List<Put> list = shouldPutBarrier ? List<Put> list = shouldPutBarrier ?
Arrays.asList(metaPut, MetaTableAccessor.makeBarrierPut(hri.getEncodedNameAsBytes(), Arrays.asList(metaPut, MetaTableAccessor.makeBarrierPut(hri.getEncodedNameAsBytes(),
openSeqNum, hri.getTable().getName())) : Arrays.asList(metaPut); openSeqNum, hri.getTable().getName())) : Collections.singletonList(metaPut);
multiHConnection.processBatchCallback(list, TableName.META_TABLE_NAME, null, null); multiHConnection.processBatchCallback(list, TableName.META_TABLE_NAME, null, null);
} catch (IOException ioe) { } catch (IOException ioe) {