aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-08-06 21:06:50 +0000
committerPJ Fanning <fanningpj@apache.org>2022-08-06 21:06:50 +0000
commiteaa27548fa4f1d374cfb68c9a3f51b6d0e6b8d3d (patch)
tree80fbe200d1a084dbd5c404fbcc70b4315bd595d3 /poi-scratchpad/src
parent3247a4160e9ba6e5e788b4bcd6db3a40c4e24bdf (diff)
downloadpoi-eaa27548fa4f1d374cfb68c9a3f51b6d0e6b8d3d.tar.gz
poi-eaa27548fa4f1d374cfb68c9a3f51b6d0e6b8d3d.zip
[github-366] remove unnecessary local vars. Thanks to Arturo Bernal. This closes #366
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903257 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java9
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java3
2 files changed, 4 insertions, 8 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java
index 23c9bd770d..643463e191 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java
@@ -447,8 +447,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
if (val != null && !val.isEmpty()) {
int codepage = ((LongPropertyValue) val.get(0)).getValue();
try {
- String encoding = CodePageUtil.codepageToEncoding(codepage, true);
- generalcodepage = encoding;
+ generalcodepage = CodePageUtil.codepageToEncoding(codepage, true);
} catch (UnsupportedEncodingException e) {
LOG.atWarn().log("Invalid codepage ID {} set for the message via {}, ignoring", box(codepage), MAPIProperty.MESSAGE_CODEPAGE);
}
@@ -463,8 +462,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
int codepage = LocaleUtil.getDefaultCodePageFromLCID(lcid);
try {
if (codepage != 0) {
- String encoding = CodePageUtil.codepageToEncoding(codepage, true);
- generalcodepage = encoding;
+ generalcodepage = CodePageUtil.codepageToEncoding(codepage, true);
}
} catch (UnsupportedEncodingException e) {
LOG.atWarn().log("Invalid codepage ID {}from locale ID{} set for the message via {}, ignoring", box(codepage), box(lcid), MAPIProperty.MESSAGE_LOCALE_ID);
@@ -482,8 +480,7 @@ public class MAPIMessage extends POIReadOnlyDocument {
if (header.toLowerCase(LocaleUtil.getUserLocale()).startsWith("content-type")) {
Matcher m = GUESS_7_BIT_ENCODING_PATTERN.matcher(header);
if (m.matches()) {
- String encoding = m.group(1);
- generalcodepage = encoding;
+ generalcodepage = m.group(1);
}
}
}
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java
index e968f971fc..8304443080 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java
@@ -91,7 +91,7 @@ public abstract class GrfhicAbstractType
public String toString()
{
- String builder = "[Grfhic]\n" +
+ return "[Grfhic]\n" +
" .grfhic = " +
" ( " + field_1_grfhic + " )\n" +
" .fHtmlChecked = " + isFHtmlChecked() + '\n' +
@@ -103,7 +103,6 @@ public abstract class GrfhicAbstractType
" .fHtmlHangingIndentBeneathNumber = " + isFHtmlHangingIndentBeneathNumber() + '\n' +
" .fHtmlBuiltInBullet = " + isFHtmlBuiltInBullet() + '\n' +
"[/Grfhic]";
- return builder;
}
/**