poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1777056 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java
Date Tue, 03 Jan 2017 03:52:58 GMT
Author: onealj
Date: Tue Jan  3 03:52:58 2017
New Revision: 1777056

URL: http://svn.apache.org/viewvc?rev=1777056&view=rev
Log:
use Collections.singletonList and Collections.emptyList where appropriate

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java?rev=1777056&r1=1777055&r2=1777056&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java Tue Jan  3 03:52:58
2017
@@ -21,7 +21,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.zip.InflaterInputStream;
 
@@ -85,7 +85,7 @@ public final class Picture
 
     private PICF _picf;
     private PICFAndOfficeArtData _picfAndOfficeArtData;
-    private List<? extends EscherRecord> _blipRecords;
+    private final List<? extends EscherRecord> _blipRecords;
 
     private byte[] content;
     private int dataBlockStartOfsset;
@@ -100,7 +100,7 @@ public final class Picture
      */
     public Picture( EscherBlipRecord blipRecord )
     {
-       this._blipRecords = Arrays.asList(new EscherBlipRecord[] {blipRecord});
+       this._blipRecords = Collections.singletonList(blipRecord);
     }
 
     /**
@@ -115,7 +115,9 @@ public final class Picture
         this.dataBlockStartOfsset = dataBlockStartOfsset;
 
         if ( _picfAndOfficeArtData != null && _picfAndOfficeArtData.getBlipRecords()
!= null) {
-           _blipRecords = _picfAndOfficeArtData.getBlipRecords();
+            _blipRecords = _picfAndOfficeArtData.getBlipRecords();
+        } else {
+            _blipRecords = Collections.emptyList();
         }
         
         if ( fillBytes ) {



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


Mime
View raw message