Validate's String.format without arguments (closes #238)
While calling String.format("some string") without any additional arguments is not technically wrong, it's redundant, as it just returns the same string. Removing these calls and just using the string instead both cleans up the code and offers a (very slight) performance gain.
This commit is contained in:
parent
954ade4c1a
commit
a64153a371
|
@ -1052,7 +1052,7 @@ public class Validate {
|
|||
public static void inclusiveBetween(final long start, final long end, final long value, final String message) {
|
||||
// TODO when breaking BC, consider returning value
|
||||
if (value < start || value > end) {
|
||||
throw new IllegalArgumentException(String.format(message));
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1096,7 +1096,7 @@ public class Validate {
|
|||
public static void inclusiveBetween(final double start, final double end, final double value, final String message) {
|
||||
// TODO when breaking BC, consider returning value
|
||||
if (value < start || value > end) {
|
||||
throw new IllegalArgumentException(String.format(message));
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1190,7 +1190,7 @@ public class Validate {
|
|||
public static void exclusiveBetween(final long start, final long end, final long value, final String message) {
|
||||
// TODO when breaking BC, consider returning value
|
||||
if (value <= start || value >= end) {
|
||||
throw new IllegalArgumentException(String.format(message));
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1234,7 +1234,7 @@ public class Validate {
|
|||
public static void exclusiveBetween(final double start, final double end, final double value, final String message) {
|
||||
// TODO when breaking BC, consider returning value
|
||||
if (value <= start || value >= end) {
|
||||
throw new IllegalArgumentException(String.format(message));
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue