src/share/classes/java/awt/image/ComponentSampleModel.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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

@@ -145,11 +145,11 @@
                                 int bandOffsets[]) {
         super(dataType, w, h, bandOffsets.length);
         this.dataType = dataType;
         this.pixelStride = pixelStride;
         this.scanlineStride  = scanlineStride;
-        this.bandOffsets = (int[])bandOffsets.clone();
+        this.bandOffsets = bandOffsets.clone();
         numBands = this.bandOffsets.length;
         if (pixelStride < 0) {
             throw new IllegalArgumentException("Pixel stride must be >= 0");
         }
         // TODO - bug 4296691 - remove this check

@@ -209,12 +209,12 @@
                                 int bandOffsets[]) {
         super(dataType, w, h, bandOffsets.length);
         this.dataType = dataType;
         this.pixelStride = pixelStride;
         this.scanlineStride  = scanlineStride;
-        this.bandOffsets = (int[])bandOffsets.clone();
-        this.bankIndices = (int[]) bankIndices.clone();
+        this.bandOffsets = bandOffsets.clone();
+        this.bankIndices = bankIndices.clone();
         if (pixelStride < 0) {
             throw new IllegalArgumentException("Pixel stride must be >= 0");
         }
         // TODO - bug 4296691 - remove this check
         if (scanlineStride < 0) {

@@ -524,18 +524,18 @@
 
     /** Returns the bank indices for all bands.
      *  @return the bank indices for all bands.
      */
     public final int [] getBankIndices() {
-        return (int[]) bankIndices.clone();
+        return bankIndices.clone();
     }
 
     /** Returns the band offset for all bands.
      *  @return the band offsets for all bands.
      */
     public final int [] getBandOffsets() {
-        return (int[])bandOffsets.clone();
+        return bandOffsets.clone();
     }
 
     /** Returns the scanline stride of this ComponentSampleModel.
      *  @return the scanline stride of this <code>ComponentSampleModel</code>.
      */