Skip to content

Commit

Permalink
[MINOR] Remove the unnecessary boxing (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoothzj authored Jan 22, 2022
1 parent 93b2442 commit 8fcddf0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void init() {
if (StringUtils.isNotBlank(consumeTimeoutStr)) {
Preconditions.checkState(StringUtils.isNumeric(consumeTimeoutStr),
String.format("%s error", ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_CONSUME_TIMEOUT));
consumeTimeout = Long.valueOf(consumeTimeoutStr);
consumeTimeout = Long.parseLong(consumeTimeoutStr);
}

String clientPullBatchSizeStr =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void processRequest(ChannelHandlerContext ctx, AsyncContext<HttpCommand>
String remoteAddr = RemotingHelper.parseChannelRemoteAddr(ctx.channel());
String user = heartbeatRequestHeader.getUsername();
String pass = heartbeatRequestHeader.getPasswd();
int requestCode = Integer.valueOf(heartbeatRequestHeader.getCode());
int requestCode = Integer.parseInt(heartbeatRequestHeader.getCode());
try {
Acl.doAclCheckInHttpHeartbeat(remoteAddr, user, pass, sys, client.topic, requestCode);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private void doRedirect(String group, String purpose, int judge, List<String> ev
String newProxyIp = eventMeshRecommendResult.get(i).split(":")[0];
String newProxyPort = eventMeshRecommendResult.get(i).split(":")[1];
String redirectSessionAddr = EventMeshTcp2Client.redirectClient2NewEventMesh(eventMeshTCPServer, newProxyIp,
Integer.valueOf(newProxyPort), sessionList.get(i), eventMeshTCPServer.getClientSessionGroupMapping());
Integer.parseInt(newProxyPort), sessionList.get(i), eventMeshTCPServer.getClientSessionGroupMapping());
logger.info("doRebalance,redirect sessionAddr:{}", redirectSessionAddr);
try {
Thread.sleep(eventMeshTCPServer.getEventMeshTCPConfiguration().sleepIntervalInRebalanceRedirectMills);
Expand All @@ -192,7 +192,7 @@ public int caculateRedirectNum(String eventMeshName, String group, String purpos
Map<String, Integer> clientDistributionMap) throws Exception {
int sum = 0;
for (Integer item : clientDistributionMap.values()) {
sum += item.intValue();
sum += item;
}
int currentNum = 0;
if (clientDistributionMap.get(eventMeshName) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ValueComparator implements Comparator<Map.Entry<String, Integer>> {
@Override
public int compare(Map.Entry<String, Integer> x, Map.Entry<String, Integer> y) {
if (x.getValue().intValue() != y.getValue().intValue()) {
return x.getValue().intValue() - y.getValue().intValue();
return x.getValue() - y.getValue();
} else {
return x.getKey().compareTo(y.getKey());
}
Expand Down

0 comments on commit 8fcddf0

Please sign in to comment.