Browse Source

[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
tags/REL_5_2_3
PJ Fanning 1 year ago
parent
commit
eaa27548fa

+ 1
- 2
poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/chart/XDDFChartAxis.java View File

@@ -408,11 +408,10 @@ public abstract class XDDFChartAxis implements HasShapeProperties {
}

protected long getNextAxId(CTPlotArea plotArea) {
long totalAxisCount = 0L
return 0L
+ plotArea.sizeOfValAxArray()
+ plotArea.sizeOfCatAxArray()
+ plotArea.sizeOfDateAxArray()
+ plotArea.sizeOfSerAxArray();
return totalAxisCount;
}
}

+ 1
- 2
poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java View File

@@ -492,8 +492,7 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo
private boolean isCursorInHdrF(XmlCursor cursor) {
try (XmlCursor verify = cursor.newCursor()) {
verify.toParent();
boolean result = (verify.getObject() == this.headerFooter);
return result;
return (verify.getObject() == this.headerFooter);
}
}


+ 1
- 2
poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java View File

@@ -336,8 +336,7 @@ public class XWPFTableCell implements IBody, ICell {
private boolean isCursorInTableCell(XmlCursor cursor) {
try (XmlCursor verify = cursor.newCursor()) {
verify.toParent();
boolean result = (verify.getObject() == this.ctTc);
return result;
return (verify.getObject() == this.ctTc);
}
}


+ 3
- 6
poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java View File

@@ -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);
}
}
}

+ 1
- 2
poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java View File

@@ -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;
}

/**

+ 1
- 2
poi/src/main/java/org/apache/poi/ss/formula/functions/Areas.java View File

@@ -40,8 +40,7 @@ public final class Areas implements Function {
RefListEval refListEval = (RefListEval) valueEval;
result = refListEval.getList().size();
}
NumberEval numberEval = new NumberEval(new NumberPtg(result));
return numberEval;
return new NumberEval(new NumberPtg(result));
} catch (Exception e) {
return ErrorEval.VALUE_INVALID;
}

Loading…
Cancel
Save