Check all calls to see if the value of the flag can be analysed, if so inline everywhere (otherwise tell the developer where it is ambiguous):
public static String pad(final String string, final int length, final char character, final boolean before) { if(before) { return leftPad(string, length, character); } else { return rightPad(string, length, character); } } |