private final DecimalFormat scientificFormat;
public ExcelGeneralNumberFormat(final Locale locale) {
- decimalSymbols = new DecimalFormatSymbols(locale);
+ decimalSymbols = DecimalFormatSymbols.getInstance(locale);
scientificFormat = new DecimalFormat("0.#####E0", decimalSymbols);
DataFormatter.setExcelStyleRoundingMode(scientificFormat);
integerFormat = new DecimalFormat("#", decimalSymbols);
java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[], boolean) @ Reflection usage fails with SecurityManagers and likely will not work any more in Java 9\r
java.lang.reflect.AccessibleObject#setAccessible(boolean) @ Reflection usage fails with SecurityManagers and likely will not work any more in Java 9\r
\r
-java.text.DecimalFormatSymbols#DecimalFormatSymbols() @ use DecimalFormatSymbols.getInstance()\r
-java.text.DecimalFormatSymbols#DecimalFormatSymbols(Locale) @ use DecimalFormatSymbols.getInstance()\r
+java.text.DecimalFormatSymbols#<init>() @ use DecimalFormatSymbols.getInstance()\r
+java.text.DecimalFormatSymbols#<init>(java.util.Locale) @ use DecimalFormatSymbols.getInstance()\r
\r
# the following are taken from the Elasticsearch source at https://github.com/elastic/elasticsearch/tree/master/buildSrc/src/main/resources/forbidden\r
\r
package org.apache.poi.hslf.model.textproperties;
+import java.util.Locale;
+
/**
* Definition of a property of some text, or its paragraph. Defines
* how to find out if it's present (via the mask on the paragraph or
@Override
public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
TextProp other = (TextProp) obj;
- if (dataValue != other.dataValue) return false;
- if (maskInHeader != other.maskInHeader) return false;
+ if (dataValue != other.dataValue) {
+ return false;
+ }
+ if (maskInHeader != other.maskInHeader) {
+ return false;
+ }
if (propName == null) {
- if (other.propName != null) return false;
- } else if (!propName.equals(other.propName)) return false;
- if (sizeOfDataBlock != other.sizeOfDataBlock) return false;
+ if (other.propName != null) {
+ return false;
+ }
+ } else if (!propName.equals(other.propName)) {
+ return false;
+ }
+ if (sizeOfDataBlock != other.sizeOfDataBlock) {
+ return false;
+ }
return true;
}
case 2: len = 6; break;
default: len = 10; break;
}
- return String.format("%s = %d (%0#"+len+"X mask / %d bytes)", propName, dataValue, maskInHeader, sizeOfDataBlock);
+ return String.format(Locale.ROOT, "%s = %d (%0#"+len+"X mask / %d bytes)", propName, dataValue, maskInHeader, sizeOfDataBlock);
}
}
\ No newline at end of file
HSSFCell cell = (HSSFCell) it.next();
log(formatter.formatCellValue(cell));
// in some locales the the decimal delimiter is a comma, not a dot
- char decimalSeparator = new DecimalFormatSymbols(LocaleUtil.getUserLocale()).getDecimalSeparator();
+ char decimalSeparator = DecimalFormatSymbols.getInstance(LocaleUtil.getUserLocale()).getDecimalSeparator();
assertEquals("12345678" + decimalSeparator + "9", formatter.formatCellValue(cell));
}
// now with a formula evaluator
HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(wb);
log(formatter.formatCellValue(cell, evaluator) + "\t\t\t (with evaluator)");
- char decimalSeparator = new DecimalFormatSymbols(LocaleUtil.getUserLocale()).getDecimalSeparator();
+ char decimalSeparator = DecimalFormatSymbols.getInstance(LocaleUtil.getUserLocale()).getDecimalSeparator();
assertEquals("24" + decimalSeparator + "50%", formatter.formatCellValue(cell,evaluator));
}