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

   > > 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.
   > 
   > Clever! 👍😀 And call it from the other vararg methods.
   
   Done. Please review.


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

Reply via email to