You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/09/21 14:09:16 UTC

[GitHub] [commons-lang] aherbert commented on pull request #953: Handle error messages with special characters.

aherbert commented on PR #953:
URL: https://github.com/apache/commons-lang/pull/953#issuecomment-1253767801

   IIUC the fix should remove the new public method and then add a private function:
   ```Java
   private static String getMessage(final String message, final Object... values) {
       return values.length == 0 ? message : String.format(message, values);
   }
   ```
   for use as:
   ```Java
   public static void isTrue(final boolean expression, final String message, final Object... values) {
       if (!expression) {
           throw new IllegalArgumentException(getMessage(message, values));
       }
   }
   ```
   This can be used in all call sites that have a varargs.


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org