You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2022/07/16 20:21:22 UTC

svn commit: r1902784 - in /poi/trunk: poi-examples/src/main/java/org/apache/poi/examples/hsmf/ poi-ooxml/src/main/java/org/apache/poi/xwpf/model/ poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/ poi/src/main/java/org/apache/poi/ss/formula/eval/ p...

Author: fanningpj
Date: Sat Jul 16 20:21:22 2022
New Revision: 1902784

URL: http://svn.apache.org/viewvc?rev=1902784&view=rev
Log:
[github-356] accept some of the changes in this PR (not all)

Modified:
    poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/hsmf/Msg2txt.java
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java
    poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionEval.java
    poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java

Modified: poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/hsmf/Msg2txt.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/hsmf/Msg2txt.java?rev=1902784&r1=1902783&r2=1902784&view=diff
==============================================================================
--- poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/hsmf/Msg2txt.java (original)
+++ poi/trunk/poi-examples/src/main/java/org/apache/poi/examples/hsmf/Msg2txt.java Sat Jul 16 20:21:22 2022
@@ -142,7 +142,7 @@ public class Msg2txt {
      * @param args the list of MSG files to process
      */
     public static void main(String[] args) {
-        if(args.length <= 0) {
+        if(args.length == 0) {
             System.err.println("No files names provided");
         } else {
             for (String arg : args) {

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java?rev=1902784&r1=1902783&r2=1902784&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java Sat Jul 16 20:21:22 2022
@@ -110,7 +110,7 @@ public class XWPFHeaderFooterPolicy {
             CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
             POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
             XWPFHeader hdr = null;
-            if (relatedPart != null && relatedPart instanceof XWPFHeader) {
+            if (relatedPart instanceof XWPFHeader) {
                 hdr = (XWPFHeader) relatedPart;
             }
             // Assign it; treat invalid options as "default" POI-60293
@@ -128,7 +128,7 @@ public class XWPFHeaderFooterPolicy {
             CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
             POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
             XWPFFooter ftr = null;
-            if (relatedPart != null && relatedPart instanceof XWPFFooter) {
+            if (relatedPart instanceof XWPFFooter) {
                 ftr = (XWPFFooter) relatedPart;
             }
             // Assign it; treat invalid options as "default" POI-60293

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java?rev=1902784&r1=1902783&r2=1902784&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java Sat Jul 16 20:21:22 2022
@@ -290,7 +290,7 @@ public abstract class XWPFHeaderFooter e
      */
     public XWPFPictureData getPictureDataByID(String blipID) {
         POIXMLDocumentPart relatedPart = getRelationById(blipID);
-        if (relatedPart != null && relatedPart instanceof XWPFPictureData) {
+        if (relatedPart instanceof XWPFPictureData) {
             return (XWPFPictureData) relatedPart;
         }
         return null;

Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionEval.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionEval.java?rev=1902784&r1=1902783&r2=1902784&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionEval.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionEval.java Sat Jul 16 20:21:22 2022
@@ -428,7 +428,7 @@ public final class FunctionEval {
         Collection<String> lst = new TreeSet<>();
         for (int i = 0; i < functions.length; i++) {
             Function func = functions[i];
-            if (func != null && (func instanceof NotImplementedFunction)) {
+            if ((func instanceof NotImplementedFunction)) {
                 FunctionMetadata metaData = FunctionMetadataRegistry.getFunctionByIndex(i);
                 lst.add(metaData.getName());
             }

Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java?rev=1902784&r1=1902783&r2=1902784&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java Sat Jul 16 20:21:22 2022
@@ -414,7 +414,7 @@ final class MathX {
      */
     public static double nChooseK(int n, int k) {
         double d = 1;
-        if (n<0 || k<0 || n<k) {
+        if (k < 0 || n < k) {
             d= Double.NaN;
         }
         else {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org