From: Andreas Beeker Date: Sat, 15 Aug 2015 13:05:00 +0000 (+0000) Subject: FindBugs - DLS_DEAD_LOCAL_STORE X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5827cee62d312a16233c4f022059c6cfcdb09b5f;p=poi.git FindBugs - DLS_DEAD_LOCAL_STORE git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696050 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java b/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java index a35eb16d7c..f64bf23c7c 100644 --- a/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java +++ b/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java @@ -328,8 +328,7 @@ public class DataSpaceMapUtils { public static String readUtf8LPP4(LittleEndianInput is) { int length = is.readInt(); if (length == 0 || length == 4) { - @SuppressWarnings("unused") - int skip = is.readInt(); // ignore + /* int skip = */ is.readInt(); return length == 0 ? null : ""; } diff --git a/src/java/org/apache/poi/poifs/storage/DataInputBlock.java b/src/java/org/apache/poi/poifs/storage/DataInputBlock.java index a571a4f22e..2550d2d910 100644 --- a/src/java/org/apache/poi/poifs/storage/DataInputBlock.java +++ b/src/java/org/apache/poi/poifs/storage/DataInputBlock.java @@ -79,7 +79,7 @@ public final class DataInputBlock { // simple case - will always be one byte in each block int i = prevBlock._buf.length-1; - int b0 = prevBlock._buf[i++] & 0xFF; + int b0 = prevBlock._buf[i] & 0xFF; int b1 = _buf[_readIndex++] & 0xFF; return (b1 << 8) + (b0 << 0); } diff --git a/src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java b/src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java index 2c0c11c61c..62445f8522 100644 --- a/src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java +++ b/src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java @@ -1485,16 +1485,16 @@ public final class WordDocument { _headerBuffer.append("\r\n"); return thisPage; } - @SuppressWarnings("unused") + private void addBorder(StringBuffer buf, short[] brc, String where) { if((brc[0] & 0xff00) != 0 && brc[0] != -1) { - int type = (brc[0] & 0xff00) >> 8; + // int type = (brc[0] & 0xff00) >> 8; float width = (brc[0] & 0x00ff)/8.0f; String style = getBorderStyle(brc[0]); String color = getColor(brc[1] & 0x00ff); - String thickness = getBorderThickness(brc[0]); + // String thickness = getBorderThickness(brc[0]); buf.append("border-" + where + "-style=\"" + style + "\"\r\n"); buf.append("border-" + where + "-color=\"" + color + "\"\r\n"); buf.append("border-" + where + "-width=\"" + width + "pt\"\r\n"); @@ -1520,22 +1520,22 @@ public final class WordDocument { t.printStackTrace(); } } - private String getBorderThickness(int style) - { - switch(style) - { - case 1: - return "medium"; - case 2: - return "thick"; - case 3: - return "medium"; - case 5: - return "thin"; - default: - return "medium"; - } - } +// private String getBorderThickness(int style) +// { +// switch(style) +// { +// case 1: +// return "medium"; +// case 2: +// return "thick"; +// case 3: +// return "medium"; +// case 5: +// return "thin"; +// default: +// return "medium"; +// } +// } private String getColor(int ico)