gemmellr commented on code in PR #4959:
URL: https://github.com/apache/activemq-artemis/pull/4959#discussion_r1627254132


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java:
##########
@@ -56,20 +56,37 @@ public final class SimpleString implements CharSequence, 
Serializable, Comparabl
     * @param string String used to instantiate a SimpleString.
     * @return A new SimpleString
     */
-   public static SimpleString toSimpleString(final String string) {
+   public static SimpleString of(final String string) {
       if (string == null) {
          return null;
       }
       return new SimpleString(string);
    }
 
-   public static SimpleString toSimpleString(final String string, 
StringSimpleStringPool pool) {
+   public static SimpleString of(final String string, StringSimpleStringPool 
pool) {
       if (pool == null) {
-         return toSimpleString(string);
+         return of(string);
       }
       return pool.getOrCreate(string);
    }
 
+   public static SimpleString of(final byte[] data) {
+      return new SimpleString(data);
+   }
+
+   public static SimpleString of(final char c) {
+      return new SimpleString(c);
+   }
+
+   @Deprecated(forRemoval = true)
+   public static SimpleString toSimpleString(final String string) {
+      return of(string);
+   }
+
+   @Deprecated(forRemoval = true)
+   public static SimpleString toSimpleString(final String string, 
StringSimpleStringPool pool) {
+      return of(string, pool);
+   }

Review Comment:
   In this type of change its typical to have javadoc @ deprecated as well, 
indicating the replacement that should be used instead. E.g here the 
constructor is not deprecated (related question: should it also be?), so 
someone might notice the deprecation and switch to the constructor instead 
rather than the new 'of'.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to