You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/12/01 02:57:12 UTC
[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3365: ARTEMIS-1883 Improve FQQN validation
jbertram commented on a change in pull request #3365:
URL: https://github.com/apache/activemq-artemis/pull/3365#discussion_r533040806
##########
File path: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/CompositeAddress.java
##########
@@ -41,12 +44,25 @@ public static SimpleString toFullyQualified(SimpleString address, SimpleString q
return result;
}
+ /**
+ * Checks whether a given string complies the fully qualified queue name (FQQN) standard or not.
+ *
+ * @param address The string to check for FQQN standard compliance.
+ * @return boolean
+ */
public static boolean isFullyQualified(String address) {
- return address == null ? false : address.contains(SEPARATOR);
+ List<String> split = Splitter.onPattern(SEPARATOR).splitToList(address);
Review comment:
This method is used a lot throughout the code-base including during message routing (which is important to performance). Therefore, the less garbage it produces the better. Here you're creating a `List` of `String` objects. I think this could be implemented more simply with something like `String.indexOf` instead. What do you think?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org