GeezerVison is showing github.com — Replace findbugs by spotbugs (#4931) · lltopk/rocketmq@f23fdbe
File treeExpand file treeCollapse file tree Open diff view settings src/main/java/org/apache/rocketmq/acl/common
src/main/java/org/apache/rocketmq/broker
src/main/java/org/apache/rocketmq/client
src/main/java/org/apache/rocketmq/common
src/main/java/org/apache/rocketmq/container
src/main/java/org/apache/rocketmq/example
src/main/java/org/apache/rocketmq/filter/parser
src/main/java/org/apache/rocketmq/logging
src/main/java/org/apache/rocketmq/proxy
src/main/java/org/apache/rocketmq/store
src/main/java/org/apache/rocketmq/test
src/main/java/org/apache/rocketmq/tools
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: acl/pom.xml +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 18 | 18 | <artifactId>rocketmq-acl</artifactId> | 19 | 19 | <name>rocketmq-acl ${project.version}</name> | 20 | 20 |
| | 21 | + <properties> | | 22 | + <project.root>${basedir}/..</project.root> | | 23 | + </properties> | | 24 | + | 21 | 25 | <dependencies> | 22 | 26 | <dependency> | 23 | 27 | <groupId>${project.groupId}</groupId> | |
Collapse file Copy file name to clipboardExpand all lines: acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | import com.alibaba.fastjson.JSONObject; | 20 | 20 | import java.io.FileInputStream; | 21 | 21 | import java.io.FileNotFoundException; | 22 | | -import java.io.FileWriter; | 23 | 22 | import java.io.InputStream; | 24 | 23 | import java.io.PrintWriter; | 25 | 24 | import java.util.Map; | @@ -256,7 +255,7 @@ public static <T> T getYamlDataObject(InputStream fis, Class<T> clazz) { | 256 | 255 |
| 257 | 256 | public static boolean writeDataObject(String path, Map<String, Object> dataMap) { | 258 | 257 | Yaml yaml = new Yaml(); | 259 | | - try (PrintWriter pw = new PrintWriter(new FileWriter(path))) { | | 258 | + try (PrintWriter pw = new PrintWriter(path, "UTF-8")) { | 260 | 259 | String dumpAsMap = yaml.dumpAsMap(dataMap); | 261 | 260 | pw.print(dumpAsMap); | 262 | 261 | pw.flush(); | |
Collapse file Copy file name to clipboardExpand all lines: broker/pom.xml +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | <artifactId>rocketmq-broker</artifactId> | 22 | 22 | <name>rocketmq-broker ${project.version}</name> | 23 | 23 |
| | 24 | + <properties> | | 25 | + <project.root>${basedir}/..</project.root> | | 26 | + </properties> | | 27 | + | 24 | 28 | <dependencies> | 25 | 29 | <dependency> | 26 | 30 | <groupId>${project.groupId}</groupId> | |
Collapse file Copy file name to clipboardExpand all lines: broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,7 @@ public class BrokerStartup { | 53 | 53 | public static CommandLine commandLine = null; | 54 | 54 | public static String configFile = null; | 55 | 55 | public static InternalLogger log; | 56 | | - public static SystemConfigFileHelper configFileHelper = new SystemConfigFileHelper(); | | 56 | + public static final SystemConfigFileHelper configFileHelper = new SystemConfigFileHelper(); | 57 | 57 |
| 58 | 58 | public static void main(String[] args) { | 59 | 59 | start(createBrokerController(args)); | |
Collapse file Copy file name to clipboardExpand all lines: broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 22 | 22 | import io.netty.channel.ChannelHandlerContext; | 23 | 23 | import java.io.UnsupportedEncodingException; | 24 | 24 | import java.net.UnknownHostException; | | 25 | +import java.nio.charset.StandardCharsets; | 25 | 26 | import java.util.ArrayList; | 26 | 27 | import java.util.HashMap; | 27 | 28 | import java.util.HashSet; | @@ -374,7 +375,7 @@ private RemotingCommand updateAndGetGroupForbidden(ChannelHandlerContext ctx, Re | 374 | 375 | groupForbidden.setGroup(group); | 375 | 376 | groupForbidden.setTopic(topic); | 376 | 377 | groupForbidden.setReadable(!groupManager.getForbidden(group, topic, PermName.INDEX_PERM_READ)); | 377 | | - response.setBody(groupForbidden.toJson().getBytes()); | | 378 | + response.setBody(groupForbidden.toJson().getBytes(StandardCharsets.UTF_8)); | 378 | 379 | return response; | 379 | 380 | } | 380 | 381 |
| |
Collapse file Copy file name to clipboardExpand all lines: broker/src/main/java/org/apache/rocketmq/broker/processor/PopBufferMergeService.java +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 17 | 17 | package org.apache.rocketmq.broker.processor; | 18 | 18 |
| 19 | 19 | import com.alibaba.fastjson.JSON; | | 20 | +import java.nio.charset.StandardCharsets; | 20 | 21 | import java.util.Iterator; | 21 | 22 | import java.util.Map; | 22 | 23 | import java.util.concurrent.ConcurrentHashMap; | @@ -605,7 +606,7 @@ private boolean cancelCkTimer(final PopCheckPointWrapper pointWrapper) { | 605 | 606 | PopCheckPoint point = pointWrapper.getCk(); | 606 | 607 | MessageExtBrokerInner msgInner = new MessageExtBrokerInner(); | 607 | 608 | msgInner.setTopic(popMessageProcessor.reviveTopic); | 608 | | - msgInner.setBody((pointWrapper.getReviveQueueId() + "-" + pointWrapper.getReviveQueueOffset()).getBytes()); | | 609 | + msgInner.setBody((pointWrapper.getReviveQueueId() + "-" + pointWrapper.getReviveQueueOffset()).getBytes(StandardCharsets.UTF_8)); | 609 | 610 | msgInner.setQueueId(pointWrapper.getReviveQueueId()); | 610 | 611 | msgInner.setTags(PopAckConstants.CK_TAG); | 611 | 612 | msgInner.setBornTimestamp(System.currentTimeMillis()); | |
Collapse file Copy file name to clipboardExpand all lines: broker/src/main/java/org/apache/rocketmq/broker/processor/ReplyMessageProcessor.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -301,7 +301,7 @@ private void handlePutMessageResult(PutMessageResult putMessageResult, | 301 | 301 |
| 302 | 302 | int commercialBaseCount = brokerController.getBrokerConfig().getCommercialBaseCount(); | 303 | 303 | int wroteSize = putMessageResult.getAppendMessageResult().getWroteBytes(); | 304 | | - int incValue = (int) Math.ceil(wroteSize / commercialSizePerMsg) * commercialBaseCount; | | 304 | + int incValue = (int) Math.ceil(wroteSize * 1.0 / commercialSizePerMsg) * commercialBaseCount; | 305 | 305 |
| 306 | 306 | sendMessageContext.setCommercialSendStats(BrokerStatsManager.StatsType.SEND_SUCCESS); | 307 | 307 | sendMessageContext.setCommercialSendTimes(incValue); | @@ -311,7 +311,7 @@ private void handlePutMessageResult(PutMessageResult putMessageResult, | 311 | 311 | } else { | 312 | 312 | if (hasSendMessageHook()) { | 313 | 313 | int wroteSize = request.getBody().length; | 314 | | - int incValue = (int) Math.ceil(wroteSize / commercialSizePerMsg); | | 314 | + int incValue = (int) Math.ceil(wroteSize * 1.0 / commercialSizePerMsg); | 315 | 315 |
| 316 | 316 | sendMessageContext.setCommercialSendStats(BrokerStatsManager.StatsType.SEND_FAILURE); | 317 | 317 | sendMessageContext.setCommercialSendTimes(incValue); | |
Collapse file Copy file name to clipboardExpand all lines: broker/src/main/java/org/apache/rocketmq/broker/transaction/queue/TransactionalMessageUtil.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 |
| 25 | 25 | public class TransactionalMessageUtil { | 26 | 26 | public static final String REMOVETAG = "d"; | 27 | | - public static Charset charset = StandardCharsets.UTF_8; | | 27 | + public static final Charset charset = StandardCharsets.UTF_8; | 28 | 28 |
| 29 | 29 | public static String buildOpTopic() { | 30 | 30 | return TopicValidator.RMQ_SYS_TRANS_OP_HALF_TOPIC; | |
Collapse file Copy file name to clipboardExpand all lines: broker/src/main/java/org/apache/rocketmq/broker/util/HookUtils.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -127,7 +127,7 @@ public static PutMessageResult handleScheduleMessage(BrokerController brokerCont | 127 | 127 | || tranType == MessageSysFlag.TRANSACTION_COMMIT_TYPE) { | 128 | 128 | if (!isRolledTimerMessage(msg)) { | 129 | 129 | if (checkIfTimerMessage(msg)) { | 130 | | - if (!MessageStoreConfig.isTimerWheelEnable()) { | | 130 | + if (!brokerController.getMessageStoreConfig().isTimerWheelEnable()) { | 131 | 131 | //wheel timer is not enabled, reject the message | 132 | 132 | return new PutMessageResult(PutMessageStatus.WHEEL_TIMER_NOT_ENABLE, null); | 133 | 133 | } | |
Collapse file Copy file name to clipboardExpand all lines: client/pom.xml +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 27 | 27 | <artifactId>rocketmq-client</artifactId> | 28 | 28 | <name>rocketmq-client ${project.version}</name> | 29 | 29 |
| | 30 | + <properties> | | 31 | + <project.root>${basedir}/..</project.root> | | 32 | + </properties> | | 33 | + | 30 | 34 | <dependencies> | 31 | 35 | <dependency> | 32 | 36 | <groupId>${project.groupId}</groupId> | |
|