Skip to content

Commit

Permalink
Improve generics arguments (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego authored Jan 31, 2023
1 parent 0b5aead commit 0067f6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/treasuredata/client/TDHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public Request prepareRequest(TDApiRequest apiRequest, Optional<String> apiKeyCa
: String.format("%s://%s%s%s", config.useSSL ? "https" : "http", config.endpoint, portStr, apiRequest.getPath());

if (!apiRequest.getQueryParams().isEmpty()) {
List<String> queryParamList = new ArrayList<String>(apiRequest.getQueryParams().size());
List<String> queryParamList = new ArrayList<>(apiRequest.getQueryParams().size());
for (Map.Entry<String, String> queryParam : apiRequest.getQueryParams().entrySet()) {
queryParamList.add(String.format("%s=%s", urlEncode(queryParam.getKey()), urlEncode(queryParam.getValue())));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/treasuredata/client/model/TDColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static List<TDColumn> parseTuple(String jsonStr)
try {
String unescaped = jsonStr.replaceAll("\\\"", "\"");
JSONArray arr = castToArray(new JSONParser().parse(unescaped));
List<TDColumn> columnList = new ArrayList<TDColumn>(arr.size());
List<TDColumn> columnList = new ArrayList<>(arr.size());
for (Object e : arr) {
JSONArray columnNameAndType = castToArray(e);
String[] s = new String[columnNameAndType.size()];
Expand All @@ -121,7 +121,7 @@ public static List<TDColumn> parseTuple(String jsonStr)
}
catch (ParseException e) {
LoggerFactory.getLogger(TDColumn.class).error("Failed to parse json string", e);
return new ArrayList<TDColumn>(0);
return new ArrayList<>(0);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/treasuredata/client/TestTDClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class TestTDClientConfig
static ImmutableMap<TDClientConfig.Type, Object> m;

static {
ImmutableMap.Builder p = ImmutableMap.<TDClientConfig.Type, Object>builder();
ImmutableMap.Builder<TDClientConfig.Type, Object> p = ImmutableMap.builder();
p.put(API_ENDPOINT, "api2.treasuredata.com");
p.put(API_PORT, 8981);
p.put(USESSL, true);
Expand All @@ -83,7 +83,7 @@ public class TestTDClientConfig
p.put(PASSOWRD, "yyyy");
m = p.build();

assertTrue(new HashSet(TDClientConfig.knownProperties()).containsAll(m.keySet()));
assertTrue(new HashSet<>(TDClientConfig.knownProperties()).containsAll(m.keySet()));
}

private void validate(TDClientConfig config)
Expand Down Expand Up @@ -136,7 +136,7 @@ public void testConfigParam()
@Test
public void testProxyParam()
{
Map<TDClientConfig.Type, Object> m = new HashMap<TDClientConfig.Type, Object>();
Map<TDClientConfig.Type, Object> m = new HashMap<>();
m.put(PROXY_HOST, "localhost1");
m.put(PROXY_PORT, 8982);
m.put(PROXY_USER, "pp");
Expand Down

0 comments on commit 0067f6d

Please sign in to comment.