michaelandrepearce commented on a change in pull request #3365:
URL: https://github.com/apache/activemq-artemis/pull/3365#discussion_r533684357



##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/CompositeAddress.java
##########
@@ -41,12 +41,35 @@ 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);
+      if (address == null) {
+         return false;
+      }
+
+      int index = address.indexOf(SEPARATOR);

Review comment:
       Does it need to start at 0 or can we safely assume we can use fromIndex 
1 given we expect at least on character before. Like wise is it worth checking 
the length is >= 4 on the expectation there has to be a character before and 
after the seperator? To return quicker in such cases theres no need to iterate 
to fail




----------------------------------------------------------------
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:
[email protected]


Reply via email to