You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2022/06/17 09:51:56 UTC

svn commit: r1902007 - in /xmlgraphics/commons/trunk: ./ src/main/java/org/apache/xmlgraphics/image/codec/png/ src/main/java/org/apache/xmlgraphics/image/codec/tiff/ src/main/java/org/apache/xmlgraphics/image/loader/pipeline/

Author: ssteiner
Date: Fri Jun 17 09:51:56 2022
New Revision: 1902007

URL: http://svn.apache.org/viewvc?rev=1902007&view=rev
Log:
Fix compile warning

Modified:
    xmlgraphics/commons/trunk/build.xml
    xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
    xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java
    xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java

Modified: xmlgraphics/commons/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/build.xml?rev=1902007&r1=1902006&r2=1902007&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/build.xml (original)
+++ xmlgraphics/commons/trunk/build.xml Fri Jun 17 09:51:56 2022
@@ -232,6 +232,7 @@
       <src path="${src.java.dir}"/>
       <patternset refid="compile-pattern"/>
       <classpath refid="libs-build-classpath"/>
+      <compilerarg value="-Xlint:cast"/>
     </javac>
   </target>
 
@@ -321,6 +322,7 @@
           <include name="${name}-${version}.jar"/>
         </fileset>
       </classpath>
+      <compilerarg value="-Xlint:cast"/>
     </javac>
     <copy todir="${build.dir}/test-classes" includeEmptyDirs="false">
       <fileset dir="${test.res.dir}"/>

Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java?rev=1902007&r1=1902006&r2=1902007&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java (original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java Fri Jun 17 09:51:56 2022
@@ -174,7 +174,7 @@ public abstract class PNGEncodeParam imp
                    IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam1"));
             }
 
-            palette = (int[])(rgb.clone());
+            palette = rgb.clone();
             paletteSet = true;
         }
 
@@ -192,7 +192,7 @@ public abstract class PNGEncodeParam imp
             if (!paletteSet) {
                 throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam3"));
             }
-            return (int[])(palette.clone());
+            return palette.clone();
         }
 
         /**
@@ -530,7 +530,7 @@ public abstract class PNGEncodeParam imp
          * <p> The 'tRNS' chunk will encode this information.
          */
         public void setTransparentRGB(int[] transparentRGB) {
-            transparency = (int[])(transparentRGB.clone());
+            transparency = transparentRGB.clone();
             transparencySet = true;
         }
 
@@ -547,7 +547,7 @@ public abstract class PNGEncodeParam imp
             if (!transparencySet) {
                 throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam10"));
             }
-            return (int[])(transparency.clone());
+            return transparency.clone();
         }
     }
 
@@ -653,7 +653,7 @@ public abstract class PNGEncodeParam imp
         if (chromaticity.length != 8) {
             throw new IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam28"));
         }
-        this.chromaticity = (float[])(chromaticity.clone());
+        this.chromaticity = chromaticity.clone();
         chromaticitySet = true;
     }
 
@@ -692,7 +692,7 @@ public abstract class PNGEncodeParam imp
         if (!chromaticitySet) {
             throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam12"));
         }
-        return (float[])(chromaticity.clone());
+        return chromaticity.clone();
     }
 
     /**
@@ -767,7 +767,7 @@ public abstract class PNGEncodeParam imp
      * <p> The 'hIST' chunk will encode this information.
      */
     public void setPaletteHistogram(int[] paletteHistogram) {
-        this.paletteHistogram = (int[])(paletteHistogram.clone());
+        this.paletteHistogram = paletteHistogram.clone();
         paletteHistogramSet = true;
     }
 
@@ -813,7 +813,7 @@ public abstract class PNGEncodeParam imp
      * <p> The 'iCCP' chunk will encode this information.
      */
     public void setICCProfileData(byte[] iccProfileData) {
-        this.iccProfileData = (byte[])(iccProfileData.clone());
+        this.iccProfileData = iccProfileData.clone();
         iccProfileDataSet = true;
     }
 
@@ -829,7 +829,7 @@ public abstract class PNGEncodeParam imp
         if (!iccProfileDataSet) {
             throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam15"));
         }
-        return (byte[])(iccProfileData.clone());
+        return iccProfileData.clone();
     }
 
     /**
@@ -862,7 +862,7 @@ public abstract class PNGEncodeParam imp
      * <p> The 'pHYS' chunk will encode this information.
      */
     public void setPhysicalDimension(int[] physicalDimension) {
-        this.physicalDimension = (int[])(physicalDimension.clone());
+        this.physicalDimension = physicalDimension.clone();
         physicalDimensionSet = true;
     }
 
@@ -895,7 +895,7 @@ public abstract class PNGEncodeParam imp
         if (!physicalDimensionSet) {
             throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam16"));
         }
-        return (int[])(physicalDimension.clone());
+        return physicalDimension.clone();
     }
 
     /**
@@ -926,7 +926,7 @@ public abstract class PNGEncodeParam imp
      * <p> The 'sPLT' chunk will encode this information.
      */
     public void setSuggestedPalette(PNGSuggestedPaletteEntry[] palette) {
-        suggestedPalette = (PNGSuggestedPaletteEntry[])(palette.clone());
+        suggestedPalette = palette.clone();
         suggestedPaletteSet = true;
     }
 
@@ -945,7 +945,7 @@ public abstract class PNGEncodeParam imp
         if (!suggestedPaletteSet) {
             throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam17"));
         }
-        return (PNGSuggestedPaletteEntry[])(suggestedPalette.clone());
+        return suggestedPalette.clone();
     }
 
     /**
@@ -979,7 +979,7 @@ public abstract class PNGEncodeParam imp
      * <p> The 'sBIT' chunk will encode this information.
      */
     public void setSignificantBits(int[] significantBits) {
-        this.significantBits = (int[])(significantBits.clone());
+        this.significantBits = significantBits.clone();
         significantBitsSet = true;
     }
 
@@ -997,7 +997,7 @@ public abstract class PNGEncodeParam imp
         if (!significantBitsSet) {
             throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam18"));
         }
-        return (int[])significantBits.clone();
+        return significantBits.clone();
     }
 
     /**

Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java?rev=1902007&r1=1902006&r2=1902007&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java (original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java Fri Jun 17 09:51:56 2022
@@ -813,7 +813,7 @@ class TIFFFaxDecoder {
                     entry = nextLesserThan8Bits(7);
 
                     // Run these through the 2DCodes table
-                    entry = (int)(twoDCodes[entry] & 0xff);
+                    entry = twoDCodes[entry] & 0xff;
 
                     // Get the code and the number of bits used up
                     code = (entry & 0x78) >>> 3;
@@ -963,7 +963,7 @@ class TIFFFaxDecoder {
                 // Get the next seven bits
                 entry = nextLesserThan8Bits(7);
                 // Run these through the 2DCodes table
-                entry = (int)(twoDCodes[entry] & 0xff);
+                entry = twoDCodes[entry] & 0xff;
 
                 // Get the code and the number of bits used up
                 code = (entry & 0x78) >>> 3;

Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java?rev=1902007&r1=1902006&r2=1902007&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java (original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java Fri Jun 17 09:51:56 2022
@@ -117,7 +117,7 @@ public class PipelineFactory {
         //Choose best pipeline
         if (candidates.length > 0) {
             Arrays.sort(candidates, new PipelineComparator());
-            ImageProviderPipeline pipeline = (ImageProviderPipeline)candidates[0];
+            ImageProviderPipeline pipeline = candidates[0];
             if (pipeline != null && log.isDebugEnabled()) {
                 log.debug("Pipeline: " + pipeline
                         + " with penalty " + pipeline.getConversionPenalty());



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