YxAc commented on code in PR #89:
URL: https://github.com/apache/rocketmq-mqtt/pull/89#discussion_r862317524
##########
mqtt-common/src/main/java/org/apache/rocketmq/mqtt/common/util/NamespaceUtil.java:
##########
@@ -24,45 +24,35 @@ public class NamespaceUtil {
private static final int RESOURCE_LENGTH = 2;
public static final String MQ_DEFAULT_NAMESPACE_NAME = "DEFAULT_INSTANCE";
- public NamespaceUtil() {
- }
-
public static String encodeToNamespaceResource(String namespace, String
resource) {
- return resource != null && namespace != null ? StringUtils.join(new
String[]{namespace, "%", resource}) : resource;
+ return resource != null && namespace != null ?
StringUtils.join(namespace, NAMESPACE_SPLITER, resource) : resource;
}
public static String decodeOriginResource(String resource) {
- if (resource != null && resource.contains("%")) {
- int firstIndex = resource.indexOf("%");
+ if (resource != null && resource.contains(NAMESPACE_SPLITER)) {
+ int firstIndex = resource.indexOf(NAMESPACE_SPLITER);
Review Comment:
using defined constant
--
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]