diff options
author | Nick Burch <nick@apache.org> | 2015-09-01 21:09:20 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2015-09-01 21:09:20 +0000 |
commit | 498f0b20e6d013c5a7caf7d23999ae887d5a9708 (patch) | |
tree | 8a16e27b42f0dc5c86df4720bee5f41828985bb5 /src/testcases/org/apache/poi | |
parent | 8ea74b39d91155f2a728e13b6cc0bdbdc1d4d093 (diff) | |
download | poi-498f0b20e6d013c5a7caf7d23999ae887d5a9708.tar.gz poi-498f0b20e6d013c5a7caf7d23999ae887d5a9708.zip |
Fix some Forbidden APIs errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1700670 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi')
6 files changed, 16 insertions, 8 deletions
diff --git a/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java b/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java index b908c933a2..ed79510f40 100644 --- a/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java +++ b/src/testcases/org/apache/poi/hpsf/basic/TestClassID.java @@ -17,6 +17,8 @@ package org.apache.poi.hpsf.basic; +import java.util.Locale; + import junit.framework.Assert; import junit.framework.TestCase; @@ -115,7 +117,7 @@ public final class TestClassID extends TestCase { 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10} , 0 ); - Assert.assertEquals(clsidTest.toString().toUpperCase(), + Assert.assertEquals(clsidTest.toString().toUpperCase(Locale.ROOT), "{04030201-0605-0807-090A-0B0C0D0E0F10}" ); } diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java b/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java index fbbe0efdbd..7bfab92493 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java @@ -19,6 +19,7 @@ package org.apache.poi.ss.formula.eval; import java.io.PrintStream; import java.util.Collection; +import java.util.Locale; import junit.framework.Assert; import junit.framework.AssertionFailedError; @@ -211,7 +212,7 @@ public final class TestFormulasFromSpreadsheet extends TestCase { default: throw new RuntimeException("unexpected result"); case Result.NO_EVALUATIONS_FOUND: // do nothing - String uname = targetFunctionName.toUpperCase(); + String uname = targetFunctionName.toUpperCase(Locale.ROOT); if(startRowIndex >= SS.START_FUNCTIONS_ROW_INDEX && funcs.contains(uname)) { logger.log(POILogger.WARN, uname + ": function is supported but missing test data"); diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java index a3e810474d..9e52a4efd7 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java @@ -19,6 +19,7 @@ package org.apache.poi.ss.formula.eval; import java.io.PrintStream; import java.util.Collection; +import java.util.Locale; import junit.framework.Assert; import junit.framework.AssertionFailedError; @@ -201,7 +202,7 @@ public final class TestMultiSheetEval extends TestCase { default: throw new RuntimeException("unexpected result"); case Result.NO_EVALUATIONS_FOUND: // do nothing - String uname = targetFunctionName.toUpperCase(); + String uname = targetFunctionName.toUpperCase(Locale.ROOT); if(startRowIndex >= SS.START_FUNCTIONS_ROW_INDEX && funcs.contains(uname)) { logger.log(POILogger.WARN, uname + ": function is supported but missing test data"); diff --git a/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java b/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java index c074c97379..408028d667 100644 --- a/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java +++ b/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; @@ -229,7 +230,7 @@ public class NumberRenderingSpreadsheetGenerator { } catch (IOException e) { throw new RuntimeException(e); } - return "0x" + Long.toHexString(l).toUpperCase(); + return "0x" + Long.toHexString(l).toUpperCase(Locale.ROOT); } private static boolean isNaNBytes(byte[] fileContent, int offset) { diff --git a/src/testcases/org/apache/poi/ss/util/NumberToTextConversionExamples.java b/src/testcases/org/apache/poi/ss/util/NumberToTextConversionExamples.java index 91f9c41429..1dcedc97a2 100644 --- a/src/testcases/org/apache/poi/ss/util/NumberToTextConversionExamples.java +++ b/src/testcases/org/apache/poi/ss/util/NumberToTextConversionExamples.java @@ -16,10 +16,11 @@ ==================================================================== */ package org.apache.poi.ss.util; + +import java.util.Locale; + /** * Contains specific examples of <tt>double</tt> values and their rendering in Excel. - * - * @author Josh Micich */ final class NumberToTextConversionExamples { @@ -62,7 +63,7 @@ final class NumberToTextConversionExamples { _doubleValue = d; } private static String doubleToHexString(double d) { - return "0x" + Long.toHexString(Double.doubleToLongBits(d)).toUpperCase() + "L"; + return "0x" + Long.toHexString(Double.doubleToLongBits(d)).toUpperCase(Locale.ROOT) + "L"; } public String getJavaRendering() { return _javaRendering; diff --git a/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java b/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java index 48fe7a3f86..f33ece477f 100644 --- a/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java +++ b/src/testcases/org/apache/poi/ss/util/TestNumberToTextConverter.java @@ -21,6 +21,8 @@ import junit.framework.AssertionFailedError; import junit.framework.ComparisonFailure; import junit.framework.TestCase; +import java.util.Locale; + import org.apache.poi.hssf.record.FormulaRecord; import org.apache.poi.ss.formula.constant.ConstantValueParser; import org.apache.poi.ss.formula.ptg.NumberPtg; @@ -74,7 +76,7 @@ public final class TestNumberToTextConverter extends TestCase { } private static String formatExample(ExampleConversion example) { - String hexLong = Long.toHexString(example.getRawDoubleBits()).toUpperCase(); + String hexLong = Long.toHexString(example.getRawDoubleBits()).toUpperCase(Locale.ROOT); String longRep = "0x" + "0000000000000000".substring(hexLong.length()) + hexLong+ "L"; return "ec(" + longRep + ", \"" + example.getJavaRendering() + "\", \"" + example.getExcelRendering() + "\")"; } |