From: Javen O'Neal Date: Mon, 4 Jul 2016 02:14:02 +0000 (+0000) Subject: findbugs fixes X-Git-Tag: REL_3_15_BETA3~210 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=20e2d685443f3125676a26164a7783679d703c75;p=poi.git findbugs fixes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751195 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/util/BitField.java b/src/java/org/apache/poi/util/BitField.java index f171145b4e..90f60db9e3 100644 --- a/src/java/org/apache/poi/util/BitField.java +++ b/src/java/org/apache/poi/util/BitField.java @@ -126,8 +126,7 @@ public class BitField * value; the results of using it for a multi-bit field is to * determine whether *any* of its bits are set * - * @param holder the int data containing the bits we're interested - * in + * @param holder the int data containing the bits we're interested in * * @return true if any of the bits are set, else false */ @@ -142,8 +141,7 @@ public class BitField * isSet, in that all of the bits in a multi-bit set must be set * for this method to return true * - * @param holder the int data containing the bits we're interested - * in + * @param holder the int data containing the bits we're interested in * * @return true if all of the bits are set, else false */ @@ -156,8 +154,7 @@ public class BitField /** * Replace the bits with new values. * - * @param holder the int data containint the bits we're interested - * in + * @param holder the int data containing the bits we're interested in * @param value the new value for the specified bits * * @return the value of holder with the bits from the value @@ -172,8 +169,7 @@ public class BitField /** * Replace the bits with new values. * - * @param holder the short data containing the bits we're - * interested in + * @param holder the short data containing the bits we're interested in * @param value the new value for the specified bits * * @return the value of holder with the bits from the value @@ -188,8 +184,7 @@ public class BitField /** * Clear the bits. * - * @param holder the int data containing the bits we're interested - * in + * @param holder the int data containing the bits we're interested in * * @return the value of holder with the specified bits cleared * (set to 0) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java index 3cbd3f085a..0f5a949957 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java @@ -95,73 +95,80 @@ public final class BorderCode implements Cloneable { return _dptLineWidth.getShortValue(_info); } + /** + * @param lineWidth the width of the line to set + */ public void setLineWidth(int lineWidth) { - _dptLineWidth.setValue(_info, lineWidth); + _info = _dptLineWidth.setShortValue(_info, (short)lineWidth); } /** * Border type code: - *
  • 0 none - *
  • 1 single - *
  • 2 thick - *
  • 3 double - *
  • 5 hairline - *
  • 6 dot - *
  • 7 dash large gap - *
  • 8 dot dash - *
  • 9 dot dot dash - *
  • 10 triple - *
  • 11 thin-thick small gap - *
  • 12 thick-thin small gap - *
  • 13 thin-thick-thin small gap - *
  • 14 thin-thick medium gap - *
  • 15 thick-thin medium gap - *
  • 16 thin-thick-thin medium gap - *
  • 17 thin-thick large gap - *
  • 18 thick-thin large gap - *
  • 19 thin-thick-thin large gap - *
  • 20 wave - *
  • 21 double wave - *
  • 22 dash small gap - *
  • 23 dash dot stroked - *
  • 24 emboss 3D - *
  • 25 engrave 3D - *
  • codes 64 - 230 represent border art types and are used only for page borders + * */ public int getBorderType() { return _brcType.getShortValue(_info); } public void setBorderType(int borderType) { - _info = (short)_brcType.setValue(_info, borderType); + _info = _brcType.setShortValue(_info, (short)borderType); } /** * Color: - *
  • 0 Auto - *
  • 1 Black - *
  • 2 Blue - *
  • 3 Cyan - *
  • 4 Green - *
  • 5 Magenta - *
  • 6 Red - *
  • 7 Yellow - *
  • 8 White - *
  • 9 DkBlue - *
  • 10 DkCyan - *
  • 11 DkGreen - *
  • 12 DkMagenta - *
  • 13 DkRed - *
  • 14 DkYellow - *
  • 15 DkGray - *
  • 16 LtGray + * */ public short getColor() { return _ico.getShortValue(_info2); } public void setColor(short color) { - _info2 = (short)_ico.setValue(_info2, color); + _info2 = _ico.setShortValue(_info2, color); } /**