diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-10-17 20:44:36 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-10-17 20:44:36 +0000 |
commit | 87a764956c280960f6117eee1bfb351d94c3a23b (patch) | |
tree | c5518744cfb432bb519882f354fafba4921e38aa /poi-examples | |
parent | b20897a996059e6df7d651ff28361a0c22c7ef1d (diff) | |
download | poi-87a764956c280960f6117eee1bfb351d94c3a23b.tar.gz poi-87a764956c280960f6117eee1bfb351d94c3a23b.zip |
sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894331 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples')
-rw-r--r-- | poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java index 75ea1c3499..3716c5c4eb 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java @@ -425,11 +425,10 @@ public class ToCSV { * * @param file An instance of the File class that encapsulates a handle * referring to the CSV file. - * @throws java.io.FileNotFoundException Thrown if the file cannot be found. * @throws java.io.IOException Thrown to indicate and error occurred in the * underylying file system. */ - private void saveCSVFile(File file) throws FileNotFoundException, IOException { + private void saveCSVFile(File file) throws IOException { ArrayList<String> line; StringBuilder buffer; String csvLineElement; @@ -584,7 +583,7 @@ public class ToCSV { // set of speech marks. Thus, "Yes" he said would become // """Yes"" he said" if(field.contains("\"")) { - buffer = new StringBuilder(field.replaceAll("\"", "\\\"\\\"")); + buffer = new StringBuilder(field.replace("\"", "\\\"\\\"")); buffer.insert(0, "\""); buffer.append("\""); } @@ -609,7 +608,7 @@ public class ToCSV { field = field.replaceAll(this.separator, ("\\\\" + this.separator)); } if(field.contains("\n")) { - field = field.replaceAll("\n", "\\\\\n"); + field = field.replace("\n", "\\\\\n"); } return(field); } |