diff options
author | PJ Fanning <fanningpj@apache.org> | 2017-12-19 00:33:16 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2017-12-19 00:33:16 +0000 |
commit | 537badf156bab5e5bb909366deb5e0207455e339 (patch) | |
tree | dc0b0eb6fa67b274142281b48ccb71e8e80d9b25 /src/java | |
parent | 819eac1f82887c09acfa8be05fbe633acddc052b (diff) | |
download | poi-537badf156bab5e5bb909366deb5e0207455e339.tar.gz poi-537badf156bab5e5bb909366deb5e0207455e339.zip |
use StandardCharsets
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1818629 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java b/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java index e23275dbe3..feea7d7b45 100644 --- a/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java +++ b/src/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -64,14 +65,7 @@ final class FunctionMetadataReader { } try { - BufferedReader br; - try { - br = new BufferedReader(new InputStreamReader(is,"UTF-8")); - } catch(UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - - try { + try(BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { FunctionDataBuilder fdb = new FunctionDataBuilder(400); while (true) { @@ -90,8 +84,6 @@ final class FunctionMetadataReader { } return fdb.build(); - } finally { - br.close(); } } finally { is.close(); |