From e14f66ea77f56c8a39da2ed762070643ca271979 Mon Sep 17 00:00:00 2001 From: chenrl Date: Fri, 30 Apr 2021 14:19:39 +0800 Subject: [PATCH] fix some nonconformity after checkstyle --- .../main/java/org/apache/rocketmq/client/ClientConfig.java | 2 +- .../rocketmq/common/utils/NameServerAddressUtils.java | 2 +- .../org/apache/rocketmq/example/ordermessage/Producer.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java b/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java index 4e56d4b1..3ab214b8 100644 --- a/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java +++ b/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java @@ -94,7 +94,7 @@ public class ClientConfig { public void changeInstanceNameToPID() { if (this.instanceName.equals("DEFAULT")) { - this.instanceName = UtilAll.getPid()+ "#" + System.nanoTime(); + this.instanceName = UtilAll.getPid() + "#" + System.nanoTime(); } } diff --git a/common/src/main/java/org/apache/rocketmq/common/utils/NameServerAddressUtils.java b/common/src/main/java/org/apache/rocketmq/common/utils/NameServerAddressUtils.java index 955e39d3..85dc95fe 100644 --- a/common/src/main/java/org/apache/rocketmq/common/utils/NameServerAddressUtils.java +++ b/common/src/main/java/org/apache/rocketmq/common/utils/NameServerAddressUtils.java @@ -34,7 +34,7 @@ public class NameServerAddressUtils { if (StringUtils.isEmpty(endpoint)) { return null; } - return endpoint.substring(endpoint.lastIndexOf("/")+1, endpoint.indexOf('.')); + return endpoint.substring(endpoint.lastIndexOf("/") + 1, endpoint.indexOf('.')); } public static String getNameSrvAddrFromNamesrvEndpoint(String nameSrvEndpoint) { diff --git a/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java b/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java index ba8ef4d5..c5d864fa 100644 --- a/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java +++ b/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java @@ -16,12 +16,9 @@ */ package org.apache.rocketmq.example.ordermessage; -import java.io.UnsupportedEncodingException; -import java.util.List; import org.apache.rocketmq.client.exception.MQBrokerException; import org.apache.rocketmq.client.exception.MQClientException; import org.apache.rocketmq.client.producer.DefaultMQProducer; -import org.apache.rocketmq.client.producer.MQProducer; import org.apache.rocketmq.client.producer.MessageQueueSelector; import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.common.message.Message; @@ -29,6 +26,9 @@ import org.apache.rocketmq.common.message.MessageQueue; import org.apache.rocketmq.remoting.common.RemotingHelper; import org.apache.rocketmq.remoting.exception.RemotingException; +import java.io.UnsupportedEncodingException; +import java.util.List; + public class Producer { public static void main(String[] args) throws UnsupportedEncodingException { try { -- GitLab