This is an automated email from the ASF dual-hosted git repository.
lizhimin pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 500c46866a [ISSUE #9978] Remove static from loadJsonConfig and unify
exception strings (#9979)
500c46866a is described below
commit 500c46866ac135eb0e0d42e6e61ffe7e43589a6e
Author: yx9o <[email protected]>
AuthorDate: Wed Jan 14 10:36:46 2026 +0800
[ISSUE #9978] Remove static from loadJsonConfig and unify exception strings
(#9979)
---
.../java/org/apache/rocketmq/proxy/config/Configuration.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git
a/proxy/src/main/java/org/apache/rocketmq/proxy/config/Configuration.java
b/proxy/src/main/java/org/apache/rocketmq/proxy/config/Configuration.java
index 175ff438f8..71c244a925 100644
--- a/proxy/src/main/java/org/apache/rocketmq/proxy/config/Configuration.java
+++ b/proxy/src/main/java/org/apache/rocketmq/proxy/config/Configuration.java
@@ -51,7 +51,7 @@ public class Configuration {
authConfig.setClusterName(proxyConfig.getRocketMQClusterName());
}
- public static String loadJsonConfig() throws Exception {
+ private String loadJsonConfig() throws Exception {
String configFileName = ProxyConfig.DEFAULT_CONFIG_FILE_NAME;
String filePath = System.getProperty(CONFIG_PATH_PROPERTY);
if (StringUtils.isBlank(filePath)) {
@@ -67,13 +67,15 @@ public class Configuration {
File file = new File(filePath);
log.info("The current configuration file path is {}", filePath);
if (!file.exists()) {
- log.warn("the config file {} not exist", filePath);
- throw new RuntimeException(String.format("the config file %s not
exist", filePath));
+ String msg = String.format("the config file %s not exist",
filePath);
+ log.warn(msg);
+ throw new RuntimeException(msg);
}
long fileLength = file.length();
if (fileLength <= 0) {
- log.warn("the config file {} length is zero", filePath);
- throw new RuntimeException(String.format("the config file %s
length is zero", filePath));
+ String msg = String.format("the config file %s length is zero",
filePath);
+ log.warn(msg);
+ throw new RuntimeException(msg);
}
return new String(Files.readAllBytes(file.toPath()),
StandardCharsets.UTF_8);