aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2015-09-01 19:06:53 +0000
committerNick Burch <nick@apache.org>2015-09-01 19:06:53 +0000
commit6b67b0b1e0b4d9866b658cbbbb069b268ec249a7 (patch)
tree0eddd00c854ae462e1a8213d48dedfb506226d02 /src/examples
parent1c21c4efc65d7d16879ae90382b9d1f5bd9d8b8d (diff)
downloadpoi-6b67b0b1e0b4d9866b658cbbbb069b268ec249a7.tar.gz
poi-6b67b0b1e0b4d9866b658cbbbb069b268ec249a7.zip
Fix some Forbidden APIs errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1700644 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java5
-rw-r--r--src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
index 3cc124b67b..cc8ed41307 100644
--- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
+++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java
@@ -20,6 +20,7 @@ package org.apache.poi.hssf.usermodel.examples;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.util.Locale;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
@@ -198,7 +199,7 @@ public final class HSSFReadWrite {
}
}
} else if (args.length == 2) {
- if (args[1].toLowerCase().equals("write")) {
+ if (args[1].toLowerCase(Locale.ROOT).equals("write")) {
System.out.println("Write mode");
long time = System.currentTimeMillis();
HSSFReadWrite.testCreateSampleSheet(fileName);
@@ -213,7 +214,7 @@ public final class HSSFReadWrite {
wb.write(stream);
stream.close();
}
- } else if (args.length == 3 && args[2].toLowerCase().equals("modify1")) {
+ } else if (args.length == 3 && args[2].toLowerCase(Locale.ROOT).equals("modify1")) {
// delete row 0-24, row 74 - 99 && change cell 3 on row 39 to string "MODIFIED CELL!!"
HSSFWorkbook wb = HSSFReadWrite.readFile(fileName);
diff --git a/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java b/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
index 6eb493ca92..b4d80420ab 100644
--- a/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
+++ b/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java
@@ -23,6 +23,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
+import java.util.Locale;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFSheet;
@@ -382,7 +383,7 @@ public class AddDimensionedImage {
// the image files location is identified by interrogating the URL passed
// to the method, the images type is identified before it is added to the
// sheet.
- String sURL = imageFile.toString().toLowerCase();
+ String sURL = imageFile.toString().toLowerCase(Locale.ROOT);
if( sURL.endsWith(".png") ) {
imageType = Workbook.PICTURE_TYPE_PNG;
}
@@ -1043,4 +1044,4 @@ public class AddDimensionedImage {
return points / 72D * 25.4;
}
}
-} \ No newline at end of file
+}