You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2022/01/16 02:03:10 UTC

[commons-imaging] 10/24: [IMAGING-159] Fix spotbugs errors

This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 07e0761656a7d7d5af53ff6e9b3b94fd4d74633b
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Thu Jul 15 17:02:26 2021 +1200

    [IMAGING-159] Fix spotbugs errors
---
 src/conf/spotbugs-exclude-filter.xml                           | 10 ++++++++++
 .../commons/imaging/formats/png/PngImagingParameters.java      |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index 0cfc7cb..244862f 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -178,6 +178,16 @@
     <Method name="&lt;init&gt;" />
     <Bug pattern="EI_EXPOSE_REP2" />
   </Match>
+  <Match>
+    <Class name="org.apache.commons.imaging.formats.tiff.TiffImagingParameters" />
+    <Method name="getExif" />
+    <Bug pattern="EI_EXPOSE_REP" />
+  </Match>
+  <Match>
+    <Class name="org.apache.commons.imaging.formats.tiff.TiffImagingParameters" />
+    <Method name="setExif" />
+    <Bug pattern="EI_EXPOSE_REP2" />
+  </Match>
   <!-- Reason: For code clarity, we could use a simple 'else', but instead keep a complete expression -->
   <Match>
     <Class name="org.apache.commons.imaging.formats.pnm.PnmImageParser" />
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/PngImagingParameters.java b/src/main/java/org/apache/commons/imaging/formats/png/PngImagingParameters.java
index 1f859f8..88ac49b 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/PngImagingParameters.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/PngImagingParameters.java
@@ -95,6 +95,6 @@ public class PngImagingParameters extends XmpImagingParameters {
     }
 
     public void setTextChunks(List<? extends PngText> textChunks) {
-        this.textChunks = textChunks;
+        this.textChunks = Collections.unmodifiableList(textChunks);
     }
 }