Skip to content

Commit

Permalink
generics cleanups (redis#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland authored Apr 13, 2020
1 parent 8135738 commit 49c127c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/main/java/redis/clients/jedis/AccessControlUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

public class AccessControlUser {

private final List<String> flags = new ArrayList<String>();
private final List<String> keys = new ArrayList<String>();
private final List<String> passwords = new ArrayList<String>();
private final List<String> flags = new ArrayList<>();
private final List<String> keys = new ArrayList<>();
private final List<String> passwords = new ArrayList<>();
private String commands;

public AccessControlUser() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/redis/clients/jedis/JedisClusterInfoCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void discoverClusterNodesAndSlots(Jedis jedis) {
int size = slotInfo.size();
for (int i = MASTER_NODE_INDEX; i < size; i++) {
List<Object> hostInfos = (List<Object>) slotInfo.get(i);
if (hostInfos.size() <= 0) {
if (hostInfos.isEmpty()) {
continue;
}

Expand Down Expand Up @@ -254,7 +254,7 @@ public JedisPool getSlotPool(int slot) {
public Map<String, JedisPool> getNodes() {
r.lock();
try {
return new HashMap<String, JedisPool>(nodes);
return new HashMap<>(nodes);
} finally {
r.unlock();
}
Expand All @@ -263,7 +263,7 @@ public Map<String, JedisPool> getNodes() {
public List<JedisPool> getShuffledNodesPool() {
r.lock();
try {
List<JedisPool> pools = new ArrayList<JedisPool>(nodes.values());
List<JedisPool> pools = new ArrayList<>(nodes.values());
Collections.shuffle(pools);
return pools;
} finally {
Expand Down Expand Up @@ -306,7 +306,7 @@ public static String getNodeKey(Jedis jedis) {
}

private List<Integer> getAssignedSlotArray(List<Object> slotInfo) {
List<Integer> slotNums = new ArrayList<Integer>();
List<Integer> slotNums = new ArrayList<>();
for (int slot = ((Long) slotInfo.get(0)).intValue(); slot <= ((Long) slotInfo.get(1))
.intValue(); slot++) {
slotNums.add(slot);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/redis/clients/jedis/StreamGroupInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
*/
public class StreamGroupInfo implements Serializable {

public final static String NAME = "name";
public final static String CONSUMERS = "consumers";
public final static String PENDING = "pending";
public final static String LAST_DELIVERED = "last-delivered-id";
public static final String NAME = "name";
public static final String CONSUMERS = "consumers";
public static final String PENDING = "pending";
public static final String LAST_DELIVERED = "last-delivered-id";


private final String name;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/redis/clients/jedis/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public List<Response<?>> execGetResponse() {
if (unformatted == null) {
return null;
}
List<Response<?>> response = new ArrayList<Response<?>>();
List<Response<?>> response = new ArrayList<>();
for (Object o : unformatted) {
response.add(generateResponse(o));
}
Expand Down

0 comments on commit 49c127c

Please sign in to comment.