Skip to content

Commit c90007e

Browse files
authored
Tune check-style.xml (#344)
* Update check-style.xml to add the Indentation configuration * Reformat java files
1 parent aae5ebd commit c90007e

File tree

7 files changed

+40
-33
lines changed

7 files changed

+40
-33
lines changed

check-style.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF,
4040
LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, INSTANCE_INIT, STATIC_INIT"/>
4141
</module>
42+
<module name="Indentation">
43+
<property name="basicOffset" value="4"/>
44+
<property name="caseIndent" value="4"/>
45+
<property name="throwsIndent" value="4"/>
46+
<property name="lineWrappingIndentation" value="4"/>
47+
<property name="arrayInitIndent" value="2"/>
48+
</module>
4249
<module name="EmptyStatement"/>
4350
<module name="EmptyForInitializerPad"/>
4451
<module name="EmptyForIteratorPad">

src/main/java/com/treasuredata/client/TDClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,9 @@ public String submit(TDJobRequest jobRequest)
696696
buildUrl("/v3/job/issue", jobRequest.getType().getType(), jobRequest.getDatabase()),
697697
queryParam,
698698
jobRequest.getConfig().map((config) -> {
699-
ObjectNode body = config.objectNode();
700-
body.set("config", config);
701-
return body.toString();
699+
ObjectNode body = config.objectNode();
700+
body.set("config", config);
701+
return body.toString();
702702
}),
703703
TDJobSubmitResult.class);
704704
return result.getJobId();

src/main/java/com/treasuredata/client/TDClientApi.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
*/
1919
package com.treasuredata.client;
2020

21-
import java.util.Collection;
22-
import java.util.Map;
23-
import java.util.Optional;
24-
2521
import com.google.common.collect.Multimap;
2622
import com.treasuredata.client.model.TDApiKey;
2723
import com.treasuredata.client.model.TDBulkImportSession;
@@ -51,8 +47,11 @@
5147

5248
import java.io.File;
5349
import java.io.InputStream;
50+
import java.util.Collection;
5451
import java.util.Date;
5552
import java.util.List;
53+
import java.util.Map;
54+
import java.util.Optional;
5655
import java.util.function.Function;
5756

5857
/**
@@ -315,7 +314,7 @@ default <Result> Result jobResult(String jobId, TDResultFormat format, com.googl
315314
@Deprecated
316315
default <Result> Result getBulkImportErrorRecords(String sessionName, com.google.common.base.Function<InputStream, Result> resultStreamHandler)
317316
{
318-
return this.getBulkImportErrorRecords(sessionName, (Function<InputStream, Result>) resultStreamHandler::apply);
317+
return this.getBulkImportErrorRecords(sessionName, (Function<InputStream, Result>) resultStreamHandler::apply);
319318
}
320319

321320
<Result> Result getBulkImportErrorRecords(String sessionName, Function<InputStream, Result> resultStreamHandler);

src/main/java/com/treasuredata/client/TDHttpClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ private TDHttpClient(TDClientConfig config, OkHttpClient httpClient, ObjectMappe
150150
* Get a {@link TDHttpClient} that uses the specified headers for each request. Reuses the same
151151
* underlying http client so closing the returned instance will return this instance as well.
152152
*
153-
* @deprecated Use {@link #withHeaders(Map)} instead.
154153
* @param headers
155154
* @return
155+
* @deprecated Use {@link #withHeaders(Map)} instead.
156156
*/
157157
@Deprecated
158158
public TDHttpClient withHeaders(Multimap<String, String> headers)
@@ -324,7 +324,7 @@ else if (apiRequest.getContent().isPresent()) {
324324
}
325325
}
326326
else if (queryStr.length() > 0) {
327-
request = request.put(createRequestBodyWithoutCharset(mediaTypeXwwwFormUrlencoded, queryStr));
327+
request = request.put(createRequestBodyWithoutCharset(mediaTypeXwwwFormUrlencoded, queryStr));
328328
}
329329
else {
330330
// We should set content-length explicitly for an empty put
@@ -525,12 +525,12 @@ public String call(TDApiRequest apiRequest, Optional<String> apiKeyCache)
525525
}
526526

527527
/**
528-
* @deprecated Use {@link #call(TDApiRequest, Optional, Function)} instead.
529528
* @param apiRequest
530529
* @param apiKeyCache
531530
* @param contentStreamHandler
532531
* @param <Result>
533532
* @return
533+
* @deprecated Use {@link #call(TDApiRequest, Optional, Function)} instead.
534534
*/
535535
@Deprecated
536536
public <Result> Result call(TDApiRequest apiRequest, Optional<String> apiKeyCache, final com.google.common.base.Function<InputStream, Result> contentStreamHandler)

src/main/java/com/treasuredata/client/model/TDBulkLoadSessionStartRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class TDBulkLoadSessionStartRequest
1515
TDBulkLoadSessionStartRequest(
1616
@JsonProperty("scheduled_time") String scheduledTime,
1717
@JsonProperty("domain_key") String domainKey
18-
)
18+
)
1919
{
2020
this.scheduledTime = scheduledTime;
2121
this.domainKey = domainKey;

src/main/java/com/treasuredata/client/model/TDSavedQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public TDSavedQuery(
8888
@JsonProperty("result") String result,
8989
@JsonProperty("next_time") String nextTime,
9090
@JsonProperty("engine_version") TDJob.EngineVersion engineVersion
91-
)
91+
)
9292
{
9393
this.id = id;
9494
this.name = name;

src/test/java/com/treasuredata/client/model/TestTDColumn.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import static org.junit.jupiter.api.Assertions.assertFalse;
4444
import static org.junit.jupiter.api.Assertions.assertTrue;
4545
import static org.junit.jupiter.api.Assertions.fail;
46+
4647
/**
4748
*
4849
*/
@@ -257,27 +258,27 @@ public void serializableTest()
257258
}
258259

259260
private static void checkJsonSerDe(TDColumn column)
260-
throws IOException
261+
throws IOException
261262
{
262-
ObjectMapper mapper = new ObjectMapper();
263-
String json = mapper.writeValueAsString(column);
264-
TDColumn value = mapper.readValue(json, TDColumn.class);
263+
ObjectMapper mapper = new ObjectMapper();
264+
String json = mapper.writeValueAsString(column);
265+
TDColumn value = mapper.readValue(json, TDColumn.class);
265266

266-
assertEquals(value.getName(), column.getName());
267-
assertEquals(value.getType(), column.getType());
268-
assertTrue(Arrays.equals(value.getKey(), column.getKey()));
269-
}
267+
assertEquals(value.getName(), column.getName());
268+
assertEquals(value.getType(), column.getType());
269+
assertTrue(Arrays.equals(value.getKey(), column.getKey()));
270+
}
270271

271-
@Test
272-
public void jsonSerDeTest()
273-
throws Exception
274-
{
275-
checkJsonSerDe(new TDColumn("int", TDColumnType.INT));
276-
checkJsonSerDe(new TDColumn("str", TDColumnType.STRING, "hello".getBytes(StandardCharsets.UTF_8)));
277-
checkJsonSerDe(new TDColumn("long", TDColumnType.LONG));
278-
checkJsonSerDe(new TDColumn("double", TDColumnType.DOUBLE, "world".getBytes(StandardCharsets.UTF_8)));
279-
checkJsonSerDe(new TDColumn("float", TDColumnType.FLOAT));
280-
checkJsonSerDe(new TDColumn("array_string", newArrayType(TDColumnType.STRING)));
281-
checkJsonSerDe(new TDColumn("map_string", newMapType(TDColumnType.INT, TDColumnType.STRING)));
282-
}
272+
@Test
273+
public void jsonSerDeTest()
274+
throws Exception
275+
{
276+
checkJsonSerDe(new TDColumn("int", TDColumnType.INT));
277+
checkJsonSerDe(new TDColumn("str", TDColumnType.STRING, "hello".getBytes(StandardCharsets.UTF_8)));
278+
checkJsonSerDe(new TDColumn("long", TDColumnType.LONG));
279+
checkJsonSerDe(new TDColumn("double", TDColumnType.DOUBLE, "world".getBytes(StandardCharsets.UTF_8)));
280+
checkJsonSerDe(new TDColumn("float", TDColumnType.FLOAT));
281+
checkJsonSerDe(new TDColumn("array_string", newArrayType(TDColumnType.STRING)));
282+
checkJsonSerDe(new TDColumn("map_string", newMapType(TDColumnType.INT, TDColumnType.STRING)));
283+
}
283284
}

0 commit comments

Comments
 (0)