poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1874263 - in /poi/trunk/src: java/org/apache/poi/poifs/filesystem/ java/org/apache/poi/poifs/property/ ooxml/java/org/apache/poi/openxml4j/opc/internal/
Date Thu, 20 Feb 2020 16:27:19 GMT
Author: axh
Date: Thu Feb 20 16:27:19 2020
New Revision: 1874263

URL: http://svn.apache.org/viewvc?rev=1874263&view=rev
Log:
replace some calls to Collection methods with shorter/more effective versions

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSDocument.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
    poi/trunk/src/java/org/apache/poi/poifs/property/Property.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSDocument.java?rev=1874263&r1=1874262&r2=1874263&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSDocument.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSDocument.java Thu Feb 20 16:27:19
2020
@@ -17,7 +17,7 @@
 
 package org.apache.poi.poifs.filesystem;
 
-import static java.util.Collections.emptyList;
+import static java.util.Collections.emptyIterator;
 
 import java.io.BufferedInputStream;
 import java.io.IOException;
@@ -235,7 +235,7 @@ public final class POIFSDocument impleme
     *		 store
     */
    public Iterator<Object> getViewableIterator() {
-      return emptyList().iterator();
+      return emptyIterator();
    }
 
    /**

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java?rev=1874263&r1=1874262&r2=1874263&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java Thu Feb 20 16:27:19
2020
@@ -858,7 +858,7 @@ public class POIFSFileSystem extends Blo
             return getRoot().getViewableIterator();
         }
 
-        return Collections.emptyList().iterator();
+        return Collections.emptyIterator();
     }
 
     /**

Modified: poi/trunk/src/java/org/apache/poi/poifs/property/Property.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/Property.java?rev=1874263&r1=1874262&r2=1874263&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/Property.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/Property.java Thu Feb 20 16:27:19 2020
@@ -500,7 +500,7 @@ public abstract class Property implement
      */
     public Iterator<Object> getViewableIterator()
     {
-        return Collections.emptyList().iterator();
+        return Collections.emptyIterator();
     }
 
     /**

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java?rev=1874263&r1=1874262&r2=1874263&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
Thu Feb 20 16:27:19 2020
@@ -286,8 +286,8 @@ public abstract class ContentTypeManager
             throw new IllegalArgumentException("contentType");
         }
 
-        return (this.defaultContentType.values().contains(contentType) || (this.overrideContentType
!= null && this.overrideContentType
-                .values().contains(contentType)));
+        return (this.defaultContentType.containsValue(contentType) || 
+                (this.overrideContentType != null && this.overrideContentType.containsValue(contentType)));
     }
 
     /**



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


Mime
View raw message