src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -165,11 +165,11 @@
         }
         if ((getCompressionTypes() != null) &&
             (getCompressionType() == null)) {
             throw new IllegalStateException("No compression type set!");
         }
-        return (String[])qualityDescs.clone();
+        return qualityDescs.clone();
     }
 
     public float[] getCompressionQualityValues() {
         if (getCompressionMode() != MODE_EXPLICIT) {
             throw new IllegalStateException

@@ -177,11 +177,11 @@
         }
         if ((getCompressionTypes() != null) &&
             (getCompressionType() == null)) {
             throw new IllegalStateException("No compression type set!");
         }
-        return (float[])qualityVals.clone();
+        return qualityVals.clone();
     }
     /**
      * Returns <code>true</code> if tables are currently set.
      *
      * @return <code>true</code> if tables are present.

@@ -220,13 +220,13 @@
             (DCHuffmanTables.length > 4) ||
             (ACHuffmanTables.length > 4) ||
             (DCHuffmanTables.length != ACHuffmanTables.length)) {
                 throw new IllegalArgumentException("Invalid JPEG table arrays");
         }
-        this.qTables = (JPEGQTable[])qTables.clone();
-        this.DCHuffmanTables = (JPEGHuffmanTable[])DCHuffmanTables.clone();
-        this.ACHuffmanTables = (JPEGHuffmanTable[])ACHuffmanTables.clone();
+        this.qTables = qTables.clone();
+        this.DCHuffmanTables = DCHuffmanTables.clone();
+        this.ACHuffmanTables = ACHuffmanTables.clone();
     }
 
     /**
      * Removes any quantization and Huffman tables that are currently
      * set.

@@ -248,11 +248,11 @@
      * <code>null</code>.
      *
      * @see #setEncodeTables
      */
     public JPEGQTable[] getQTables() {
-        return (qTables != null) ? (JPEGQTable[])qTables.clone() : null;
+        return (qTables != null) ? qTables.clone() : null;
     }
 
     /**
      * Returns a copy of the array of DC Huffman tables set on the
      * most recent call to <code>setEncodeTables</code>, or

@@ -263,11 +263,11 @@
      *
      * @see #setEncodeTables
      */
     public JPEGHuffmanTable[] getDCHuffmanTables() {
         return (DCHuffmanTables != null)
-            ? (JPEGHuffmanTable[])DCHuffmanTables.clone()
+            ? DCHuffmanTables.clone()
             : null;
     }
 
     /**
      * Returns a copy of the array of AC Huffman tables set on the

@@ -279,11 +279,11 @@
      *
      * @see #setEncodeTables
      */
     public JPEGHuffmanTable[] getACHuffmanTables() {
         return (ACHuffmanTables != null)
-            ? (JPEGHuffmanTable[])ACHuffmanTables.clone()
+            ? ACHuffmanTables.clone()
             : null;
     }
 
     /**
      * Tells the writer to generate optimized Huffman tables