Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ci/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
Description: none
-->
<module name="Checker">
<module name="NewlineAtEndOfFile">
</module>
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="RedundantImport"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ protected String normalizeUri(String endpoint) {
public void onRefreshEndpointEvent(RefreshEndpointEvent event) {
refreshEndpoint(event, RefreshEndpointEvent.CONFIG_CENTER_NAME);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ private static SignRequest createSignRequest() {
public void addHeaders(Map<String, String> headers) {
this.globalHeaders = headers;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public String getSummary() {
public void setSummary(String summary) {
this.summary = summary;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ public void clientGetFormattedItemOnInvocationNotFound() {
ITEM.appendClientFormattedItem(finishEvent, strBuilder);
MatcherAssert.assertThat(strBuilder.toString(), Matchers.is(InvocationContextAccessItem.NOT_FOUND));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private void wrapPropertyToMessage(String protoName, Object property) {
private String tryFindEnumType(List<String> enums) {
if (enums != null && !enums.isEmpty()) {
String strEnums = enums.toString();
String enumName = "Enum_" + Hashing.sha256().hashString(strEnums, StandardCharsets.UTF_8).toString();
String enumName = "Enum_" + Hashing.sha256().hashString(strEnums, StandardCharsets.UTF_8);
pending.add(() -> createEnum(enumName, enums));
return enumName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2167,8 +2167,8 @@ public Builder setOperationNameBytes(
}
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableCseContext() {
onChanged();;
if (cseContext_ == null) {
onChanged();
if (cseContext_ == null) {
cseContext_ = com.google.protobuf.MapField.newMapField(
CseContextDefaultEntryHolder.defaultEntry);
}
Expand Down Expand Up @@ -2298,8 +2298,8 @@ public Builder putAllCseContext(
}
private com.google.protobuf.MapField<java.lang.String, io.protostuff.runtime.model.ModelProtobuf.User>
internalGetMutableUserMap() {
onChanged();;
if (userMap_ == null) {
onChanged();
if (userMap_ == null) {
userMap_ = com.google.protobuf.MapField.newMapField(
UserMapDefaultEntryHolder.defaultEntry);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Future<Void> end() {
protected Future<Void> doEndWithUpload() {
request.setChunked(true);

String boundary = "boundary" + UUID.randomUUID().toString();
String boundary = "boundary" + UUID.randomUUID();
putHeader(CONTENT_TYPE, MULTIPART_FORM_DATA + "; charset=UTF-8; boundary=" + boundary);

return genBodyForm(boundary).onSuccess(v -> attachFiles(boundary)).onFailure(e -> asyncResp.consumerFail(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ public void should_merge_invocation_context_from_request() {

assertThat(invocation.getContext("k")).isEqualTo("v");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ void createInvocation() {

Mockito.verify(routingContext, Mockito.times(1)).put(RestConst.REST_INVOCATION_CONTEXT, invocation);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ void should_decode_values_start_with_delimiter() {
should_decode(",,1", new int[] {0, 0, 1});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ void should_decode_null_to_single() {
should_decode((String) null, null);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ void should_decode_values_start_with_delimiter() {
should_decode("||1", new int[] {0, 0, 1});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ void should_decode_values_start_with_delimiter() {
should_decode(" 1", new int[] {0, 0, 1});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ void should_decode_values_start_with_delimiter() {
should_decode("\t\t1", new int[] {0, 0, 1});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ void can_override_by_customize_implement() {
assertThat(queryCodecs.find(QueryCodecCsv.CODEC_NAME).getClass())
.isEqualTo(MyQueryCodecCsv.class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ public String getParamName(){
}.getMockInstance();
return new PathVarParamWriter(restParam);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ public void appendQuery() {
builder.appendQuery("gh", "jk");
Assertions.assertEquals("?ab=cd&ef=&gh=jk", builder.build());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,4 @@ public void should_not_encode_transfer_encoding_header() throws ExecutionExcepti
}
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public class InvocationHandlersStartEvent extends InvocationBaseEvent {
public InvocationHandlersStartEvent(Invocation invocation) {
super(invocation);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public class InvocationStartSendRequestEvent extends InvocationBaseEvent {
public InvocationStartSendRequestEvent(Invocation invocation) {
super(invocation);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public class InvocationTimeoutCheckEvent extends InvocationBaseEvent {
public InvocationTimeoutCheckEvent(Invocation invocation) {
super(invocation);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ private String getJavaBeanPropertyName(JavaBeanProperty property) {
.findFirst()
.orElse(property.getName());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private boolean useResourceBundleMessageInterpolator() {
public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) {
Set<ConstraintViolation<Object>> violations = doValidate(invocation);
if (violations.size() > 0) {
LOGGER.error("Parameter validation failed : " + violations.toString());
LOGGER.error("Parameter validation failed : " + violations);
return AsyncUtils.completeExceptionally(new ConstraintViolationException(violations));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public static Endpoint getOrCreate(String uri) {
public static Endpoint create(String uri) {
return EndpointUtils.parse(EndpointUtils.formatFromUri(uri));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private static String extractHostFromPath(URIBuilder builder) {
if (path.startsWith("/")) {
path = path.substring(1);
}
if (path.indexOf("/") != -1) {
if (path.contains("/")) {
path = path.substring(0, path.indexOf("/"));
}
return path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ private void registerUrlPrefixToSwagger(Swagger swagger) {
swagger.setBasePath(urlPrefix + swagger.getBasePath());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ void should_get_invocation_timeout_value() {
assertThat(config.getMsInvocationTimeout()).isEqualTo(1);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ void should_protect_when_converter_throw_exception() {
+ "converter exception:org.apache.servicecomb.foundation.test.scaffolding.exception.RuntimeExceptionWithoutStackTrace: mock exception when convert\n");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ void should_log_detail() {
"Request timeout, Details: The timeout period of 30000ms has been exceeded while executing GET /xxx for server 1.1.1.1:8080.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ private void checkHighwayChain(Transport transport, FilterNode chain)
.get();
assertThat(msg).containsExactly("main", THREAD_NAME, THREAD_NAME);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ public void should_include_all_validate_detail() {
assertThat(details.stream().map(ValidateDetail::getMessage))
.contains("not null", "can not be null", "can not be blank");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ public void should_unify_IllegalArgumentException_message_when_convert_exception
CommonExceptionData data = (CommonExceptionData) throwable.getErrorData();
assertThat(data.getMessage()).isEqualTo("Parameters not valid or types not match.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ public void should_invoke_next_directly_when_invocation_already_has_endpoint()
}
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ public void should_finish_invocation_when_invocation_fail() {
}
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ void should_set_endpoint_to_invocation_when_map_arguments() {

assertThat(holder.value).isSameAs(endpoint);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ void should_not_change() {
assertThat(formatFromUri("abc://host:123?q1=v1")).isEqualTo("abc://host:123?q1=v1");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ void should_calc_elapsed_time_as_passing_time() {

assertThat(elapsedNanoTime).isEqualTo(TimeUnit.MILLISECONDS.toNanos(90));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ public void checkTimeout(Invocation invocation) {

assertThat(invocation.getContext(CHAIN_PROCESSING)).isEqualTo("60");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void testEncrypt() {

String expected = "{name=userName, age=10, userId=serviceTokenTest-userId, body1=b1, body2=b2, body3=b3}";
Assert.isTrue(expected.equalsIgnoreCase(result.toString()),
String.format("expected: %s\nreal : %s", expected, result.toString()));
String.format("expected: %s\nreal : %s", expected, result));
}

protected void testRecursiveSelf() {
Expand Down Expand Up @@ -227,7 +227,7 @@ protected void testDownloadBigFile() {
}
return null;
});
Assert.isTrue(size.get() == 10 * 1024 * 1024, "size is : " + String.valueOf(size.get()) + " not 10 * 1024 * 1024");
Assert.isTrue(size.get() == 10 * 1024 * 1024, "size is : " + size.get() + " not 10 * 1024 * 1024");
System.out.println("test download bigFile finished");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Response afterReceiveRequest(Invocation invocation, HttpServletRequestEx
hasher.putString(name, StandardCharsets.UTF_8);
hasher.putString(requestEx.getParameter(name), StandardCharsets.UTF_8);
}
LOGGER.info("afterReceiveRequest signature: {}", hasher.hash().toString());
LOGGER.info("afterReceiveRequest signature: {}", hasher.hash());

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
#

log4j.rootLogger=INFO,stdout
log4j.appender.stdout.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss,SSS/zzz}][%t][%p]%m %l%n
log4j.appender.stdout.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss,SSS/zzz}][%t][%p]%m %l%n
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@ public class QueryParamWithListSchema {
@Path("queryListCSV")
@GET
public String queryListCSV(@ApiParam(collectionFormat = "csv") @QueryParam("queryList") List<String> queryList) {
return queryList == null ? "null" : queryList.size() + ":" + queryList.toString();
return queryList == null ? "null" : queryList.size() + ":" + queryList;
}

@Path("queryListSSV")
@GET
public String queryListSSV(@ApiParam(collectionFormat = "ssv") @QueryParam("queryList") List<String> queryList) {
return queryList == null ? "null" : queryList.size() + ":" + queryList.toString();
return queryList == null ? "null" : queryList.size() + ":" + queryList;
}

@Path("queryListTSV")
@GET
public String queryListTSV(@ApiParam(collectionFormat = "tsv") @QueryParam("queryList") List<String> queryList) {
return queryList == null ? "null" : queryList.size() + ":" + queryList.toString();
return queryList == null ? "null" : queryList.size() + ":" + queryList;
}

@Path("queryListPIPES")
@GET
public String queryListPIPES(@ApiParam(collectionFormat = "pipes") @QueryParam("queryList") List<String> queryList) {
return queryList == null ? "null" : queryList.size() + ":" + queryList.toString();
return queryList == null ? "null" : queryList.size() + ":" + queryList;
}

@Path("queryListMULTI")
@GET
public String queryListMULTI(@ApiParam(collectionFormat = "multi") @QueryParam("queryList") List<String> queryList) {
return queryList == null ? "null" : queryList.size() + ":" + queryList.toString();
return queryList == null ? "null" : queryList.size() + ":" + queryList;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public int reduce(int a, int b) {
}

public int add(String a, String b) {
return Integer.valueOf(a) + Integer.valueOf(b);
return Integer.parseInt(a) + Integer.parseInt(b);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ public void testRestTransport() throws Exception {
public String getMicroserviceName() {
return "demo-multi-service-center-serverB";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

demo.multi.service.center.serverB.actual.key6=key6
demo.multi.service.center.serverB.actual.key7.1=key71
demo.multi.service.center.serverB.actual.key7.2=key72
demo.multi.service.center.serverB.actual.key7.2=key72
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public int getCode() {
public void setCode(int code) {
this.code = code;
}
}
}
Loading