RongtongJin commented on code in PR #9440:
URL: https://github.com/apache/rocketmq/pull/9440#discussion_r2122395737
##########
common/src/main/java/org/apache/rocketmq/common/MixAll.java:
##########
@@ -334,11 +334,17 @@ public static String properties2String(final Properties
properties, final boolea
public static Properties string2Properties(final String str) {
Properties properties = new Properties();
+ String processedStr = str;
+
+ if (isWindows()) {
+ processedStr = str.replace("\\", "\\\\");
+ log.info("Detected Windows OS, escaped backslashes for properties
string.");
+ }
try {
- InputStream in = new
ByteArrayInputStream(str.getBytes(DEFAULT_CHARSET));
+ InputStream in = new
ByteArrayInputStream(processedStr.getBytes(DEFAULT_CHARSET));
properties.load(in);
} catch (Exception e) {
- log.error("Failed to handle properties", e);
+ log.error("Failed to handle properties from string: '{}'",
processedStr, e);
return null;
}
Review Comment:
This is still used in many places on the server side, so it would be better
to only modify the section of getBrokerConfig returned by admin tools
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]