From 7e1c3ec4b3fabede2d14f629790c46060059b780 Mon Sep 17 00:00:00 2001 From: Mark Murphy Date: Fri, 16 Dec 2016 05:17:38 +0000 Subject: [PATCH] Findbugs fix git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1774556 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/xwpf/model/WMLHelper.java | 4 ++-- .../java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xwpf/model/WMLHelper.java b/src/ooxml/java/org/apache/poi/xwpf/model/WMLHelper.java index 7c30d21b01..0761aebebe 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/model/WMLHelper.java +++ b/src/ooxml/java/org/apache/poi/xwpf/model/WMLHelper.java @@ -20,14 +20,14 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff; public final class WMLHelper { - public static boolean STOnOffToBoolean (STOnOff.Enum value) { + public static boolean convertSTOnOffToBoolean (STOnOff.Enum value) { if (value == STOnOff.TRUE || value == STOnOff.ON || value == STOnOff.X_1) { return true; } return false; } - public static STOnOff.Enum BooleanToSTOnOff (boolean value) { + public static STOnOff.Enum convertBooleanToSTOnOff (boolean value) { return (value ? STOnOff.TRUE : STOnOff.FALSE); } } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java index 3f530df765..454a4c3f22 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java @@ -30,7 +30,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtCell; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTrPr; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff; /** @@ -197,7 +196,7 @@ public class XWPFTableRow { CTTrPr trpr = getTrPr(); if (trpr.sizeOfCantSplitArray() > 0) { CTOnOff onoff = trpr.getCantSplitArray(0); - isCant = (onoff.isSetVal() ? WMLHelper.STOnOffToBoolean(onoff.getVal()) : true); + isCant = (onoff.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(onoff.getVal()) : true); } } return isCant; @@ -214,7 +213,7 @@ public class XWPFTableRow { public void setCantSplitRow(boolean split) { CTTrPr trpr = getTrPr(); CTOnOff onoff = (trpr.sizeOfCantSplitArray() > 0 ? trpr.getCantSplitArray(0) : trpr.addNewCantSplit()); - onoff.setVal(WMLHelper.BooleanToSTOnOff(split)); + onoff.setVal(WMLHelper.convertBooleanToSTOnOff(split)); } /** @@ -244,7 +243,7 @@ public class XWPFTableRow { CTTrPr trpr = getTrPr(); if (trpr.sizeOfTblHeaderArray() > 0) { CTOnOff rpt = trpr.getTblHeaderArray(0); - repeat = (rpt.isSetVal() ? WMLHelper.STOnOffToBoolean(rpt.getVal()) : true); + repeat = (rpt.isSetVal() ? WMLHelper.convertSTOnOffToBoolean(rpt.getVal()) : true); } } return repeat; @@ -261,6 +260,6 @@ public class XWPFTableRow { public void setRepeatHeader(boolean repeat) { CTTrPr trpr = getTrPr(); CTOnOff onoff = (trpr.sizeOfTblHeaderArray() > 0 ? trpr.getTblHeaderArray(0) : trpr.addNewTblHeader()); - onoff.setVal(WMLHelper.BooleanToSTOnOff(repeat)); + onoff.setVal(WMLHelper.convertBooleanToSTOnOff(repeat)); } }