align to checkstyle

pull/251/head
cheese8 3 years ago
parent de3b6d8745
commit 713b6f7baa

@ -76,7 +76,8 @@ public class PolarisFeignLoadBalancer extends FeignLoadBalancer {
try {
String labelHeaderValuesContent = labelHeaderValues.stream().findFirst().get();
labelHeaderValuesMap.putAll(JacksonUtils.deserialize2Map(URLDecoder.decode(labelHeaderValuesContent, StandardCharsets.UTF_8.name())));
} catch (UnsupportedEncodingException e) {
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException("unsupported charset exception " + StandardCharsets.UTF_8.name());
}
routerContext.setLabels(PolarisRouterContext.RULE_ROUTER_LABELS, labelHeaderValuesMap);

@ -29,6 +29,7 @@ import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.util.CollectionUtils;
@ -113,7 +114,8 @@ public class RouterLabelFeignInterceptor implements RequestInterceptor, Ordered
String encodedLabelsContent;
try {
encodedLabelsContent = URLEncoder.encode(JacksonUtils.serialize2Json(labels), StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException("unsupported charset exception " + StandardCharsets.UTF_8.name());
}
requestTemplate.header(RouterConstants.ROUTER_LABEL_HEADER, encodedLabelsContent);

@ -124,7 +124,8 @@ public class RouterLabelFeignInterceptorTest {
try {
String routerLabelContent = routerLabels.stream().findFirst().get();
routerLabelsMap.putAll(JacksonUtils.deserialize2Map(URLDecoder.decode(routerLabelContent, StandardCharsets.UTF_8.name())));
} catch (UnsupportedEncodingException e) {
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException("unsupported charset exception " + StandardCharsets.UTF_8.name());
}
Assert.assertNotNull(routerLabelsMap);

Loading…
Cancel
Save