--- a/src/java.base/share/classes/java/text/DecimalFormat.java Thu Dec 13 16:14:07 2018 +0100
+++ b/src/java.base/share/classes/java/text/DecimalFormat.java Thu Dec 13 15:31:05 2018 +0100
@@ -1113,11 +1113,9 @@
// Records the need for adding prefix or suffix
fastPathData.positiveAffixesRequired
- = (positivePrefix.length() != 0)
- || (positiveSuffix.length() != 0);
+ = !positivePrefix.isEmpty() || !positiveSuffix.isEmpty();
fastPathData.negativeAffixesRequired
- = (negativePrefix.length() != 0)
- || (negativeSuffix.length() != 0);
+ = !negativePrefix.isEmpty() || !negativeSuffix.isEmpty();
// Creates a cached char container for result, with max possible size.
int maxNbIntegralDigits = 10;
@@ -2062,7 +2060,7 @@
Format.Field signAttribute) {
int start = result.length();
- if (string.length() > 0) {
+ if (!string.isEmpty()) {
result.append(string);
for (int counter = 0, max = positions.length; counter < max;
counter++) {
@@ -3042,7 +3040,7 @@
} else {
string = symbols.getCurrencySymbol();
}
- if (string.length() > 0) {
+ if (!string.isEmpty()) {
if (positions == null) {
positions = new ArrayList<>(2);
}
@@ -3613,7 +3611,7 @@
}
}
- if (pattern.length() == 0) {
+ if (pattern.isEmpty()) {
posPrefixPattern = posSuffixPattern = "";
setMinimumIntegerDigits(0);
setMaximumIntegerDigits(MAXIMUM_INTEGER_DIGITS);