Skip to content

Instantly share code, notes, and snippets.

@alexkasko
Created June 18, 2013 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkasko/5805147 to your computer and use it in GitHub Desktop.
Save alexkasko/5805147 to your computer and use it in GitHub Desktop.
Diff for "openjdk" directory files different between icedtea 1.12.5 "make patch" and "make and abort build"
diff --git a/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh b/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh
new file mode 100644
index 0000000..1fd79d6
--- /dev/null
+++ b/hotspot/test/serviceability/SDTProbesGNULinuxTest.sh
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2012, Red Hat, Inc.
+# 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.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test SDTProbesGNULinuxTest.sh
+# @bug 7170638
+# @summary Test SDT probes available on GNU/Linux when DTRACE_ENABLED
+# @run shell SDTProbesGNULinuxTest.sh
+
+# This test only matters on GNU/Linux, others trivially PASS.
+OS=`uname -s`
+case "$OS" in
+ Linux )
+ ;;
+ *)
+ echo "Not testing on anything but GNU/Linux. PASSED"
+ exit 0;
+ ;;
+esac
+
+# Where is our java (parent) directory?
+if [ "${TESTJAVA}" = "" ]; then
+ PARENT=$(dirname $(readlink -f $(which java)))
+ TESTJAVA=`dirname ${PARENT}`
+ echo "TESTJAVA directory not set, using " ${TESTJAVA}
+fi
+
+# This test only matters when build with DTRACE_ENABLED.
+${TESTJAVA}/bin/java -XX:+ExtendedDTraceProbes -version
+if [ "$?" != "0" ]; then
+ echo "Not build using DTRACE_ENABLED. PASSED"
+ exit 0
+fi
+
+# Test all available libjvm.so variants
+for libjvm in $(find ${TESTJAVA} -name libjvm.so); do
+ echo "Testing ${libjvm}"
+ # Check whether the SDT probes are compiled in.
+ readelf -S ${libjvm} | grep '.note.stapsdt'
+ if [ "$?" != "0" ]; then
+ echo "Failed: ${libjvm} doesn't contain SDT probes."
+ exit 1
+ fi
+ # We could iterate over all SDT probes and test them individually
+ # with readelf -n, but older readelf versions don't understand them.
+done
+
+echo "Passed."
+exit 0
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java
new file mode 100644
index 0000000..fa8b86e
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/ImageFormatException.java
@@ -0,0 +1,51 @@
+/* ImageFormatException.java
+ * Copyright (C) 2007 Matthew Flaschen
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * This file is part of IcedTea
+ *
+ * IcedTea is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * IcedTea is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Classpath; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * Linking this library statically or dynamically with other modules is
+ * making a combined work based on this library. Thus, the terms and
+ * conditions of the GNU General Public License cover the whole
+ * combination.
+ *
+ * As a special exception, the copyright holders of this library give you
+ * permission to link this library with independent modules to produce an
+ * executable, regardless of the license terms of these independent
+ * modules, and to copy and distribute the resulting executable under
+ * terms of your choice, provided that you also meet, for each linked
+ * independent module, the terms and conditions of the license of that
+ * module. An independent module is a module which is not derived from
+ * or based on this library. If you modify this library, you may extend
+ * this exception to your version of the library, but you are not
+ * obligated to do so. If you do not wish to do so, delete this
+ * exception statement from your version.
+ */
+
+package com.sun.image.codec.jpeg;
+
+public class ImageFormatException extends RuntimeException {
+
+ public ImageFormatException() {
+ super();
+ }
+
+ public ImageFormatException(String s) {
+ super(s);
+ }
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java
new file mode 100644
index 0000000..5119e32
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGCodec.java
@@ -0,0 +1,193 @@
+/* JPEGCodec.java --
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2007 Matthew Flaschen
+ *
+ * This file is part of GNU Classpath.
+ *
+ * GNU Classpath is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Classpath is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Classpath; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * Linking this library statically or dynamically with other modules is
+ * making a combined work based on this library. Thus, the terms and
+ * conditions of the GNU General Public License cover the whole
+ * combination.
+ *
+ * As a special exception, the copyright holders of this library give you
+ * permission to link this library with independent modules to produce an
+ * executable, regardless of the license terms of these independent
+ * modules, and to copy and distribute the resulting executable under
+ * terms of your choice, provided that you also meet, for each linked
+ * independent module, the terms and conditions of the license of that
+ * module. An independent module is a module which is not derived from
+ * or based on this library. If you modify this library, you may extend
+ * this exception to your version of the library, but you are not
+ * obligated to do so. If you do not wish to do so, delete this
+ * exception statement from your version.
+ */
+
+package com.sun.image.codec.jpeg;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+
+import sun.awt.image.codec.JPEGImageDecoderImpl;
+import sun.awt.image.codec.JPEGImageEncoderImpl;
+import sun.awt.image.codec.JPEGParam;
+
+/**
+ * This class is a factory for implementations of the JPEG Image
+ * Decoder/Encoder.
+ */
+public class JPEGCodec {
+
+ private JPEGCodec() {}
+
+ /**
+ * This creates an instance of a JPEGImageDecoder that can be used to decode
+ * JPEG Data streams.
+ *
+ * @param src
+ * @return
+ */
+ public static JPEGImageDecoder createJPEGDecoder(InputStream src) {
+ return new JPEGImageDecoderImpl(src);
+ }
+
+ /**
+ * This creates an instance of a JPEGImageDecoder that can be used to decode
+ * JPEG Data streams.
+ *
+ * @param src
+ * @param jdp
+ * @return
+ */
+ public static JPEGImageDecoder createJPEGDecoder(InputStream src,
+ JPEGDecodeParam jdp) {
+ return new JPEGImageDecoderImpl(src, jdp);
+ }
+
+ /**
+ * This creates an instance of a JPEGImageEncoder that can be used to encode
+ * image data as JPEG Data streams.
+ *
+ * @param os
+ * @return
+ */
+ public static JPEGImageEncoder createJPEGEncoder(OutputStream os) {
+ return new JPEGImageEncoderImpl(os);
+ }
+
+ /**
+ * This creates an instance of a JPEGImageEncoder that can be used to encode
+ * image data as JPEG Data streams.
+ *
+ * @param dest
+ * @param jep
+ * @return
+ */
+ public static JPEGImageEncoder createJPEGEncoder(OutputStream dest,
+ JPEGEncodeParam jep) {
+ return new JPEGImageEncoderImpl(dest, jep);
+ }
+
+ /**
+ * This is a factory method for creating JPEGEncodeParam objects.
+ *
+ * @param bi
+ * @return
+ */
+ public static JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi) {
+ return getDefaultJPEGEncodeParam(bi.getRaster(),
+ getDefaultColorID(bi.getColorModel()));
+ }
+
+ /**
+ * This is a factory method for creating JPEGEncodeParam objects.
+ *
+ * @param numBands
+ * @param colorID
+ * @return
+ */
+ public static JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands,
+ int colorID) {
+ return new JPEGParam(colorID, numBands);
+ }
+
+ /**
+ * This is a factory method for creating a JPEGEncodeParam from a
+ * JPEGDecodeParam.
+ *
+ * @param jdp
+ * @return
+ */
+ public static JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam jdp) {
+ return new JPEGParam(jdp);
+ }
+
+ /**
+ * This is a factory method for creating JPEGEncodeParam objects.
+ *
+ * @param ras
+ * @param colorID
+ * @return
+ */
+ public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras,
+ int colorID) {
+ return getDefaultJPEGEncodeParam(ras.getNumBands(), colorID);
+ }
+
+ private static int getDefaultColorID(ColorModel cm) {
+ ColorSpace cs = cm.getColorSpace();
+ int type = cs.getType();
+ int id = -1;
+ switch (type) {
+ case ColorSpace.TYPE_GRAY:
+ id = JPEGEncodeParam.COLOR_ID_GRAY;
+ break;
+
+ case ColorSpace.TYPE_RGB:
+ id = cm.hasAlpha() ? JPEGEncodeParam.COLOR_ID_RGBA
+ : JPEGEncodeParam.COLOR_ID_RGB;
+
+ case ColorSpace.TYPE_YCbCr:
+ try {
+ if (cs == ColorSpace.getInstance(ColorSpace.CS_PYCC)) {
+ id = cm.hasAlpha() ? JPEGEncodeParam.COLOR_ID_PYCCA
+ : JPEGEncodeParam.COLOR_ID_PYCC;
+ }
+ } catch (IllegalArgumentException e) {
+ /* We know it isn't PYCC type, nothing to handle */
+ }
+ if (id == -1) {
+ id = cm.hasAlpha() ? JPEGEncodeParam.COLOR_ID_YCbCrA
+ : JPEGEncodeParam.COLOR_ID_YCbCr;
+ }
+ break;
+
+ case ColorSpace.TYPE_CMYK:
+ id = JPEGEncodeParam.COLOR_ID_CMYK;
+ break;
+
+ default:
+ id = JPEGEncodeParam.COLOR_ID_UNKNOWN;
+ }
+
+ return id;
+ }
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java
new file mode 100644
index 0000000..924ab0c
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGDecodeParam.java
@@ -0,0 +1,390 @@
+/* JPEGImageDecoder.java --
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2007 Matthew Flaschen
+ *
+ * This file is part of GNU Classpath.
+ *
+ * GNU Classpath is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GNU Classpath is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Classpath; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * Linking this library statically or dynamically with other modules is
+ * making a combined work based on this library. Thus, the terms and
+ * conditions of the GNU General Public License cover the whole
+ * combination.
+ *
+ * As a special exception, the copyright holders of this library give you
+ * permission to link this library with independent modules to produce an
+ * executable, regardless of the license terms of these independent
+ * modules, and to copy and distribute the resulting executable under
+ * terms of your choice, provided that you also meet, for each linked
+ * independent module, the terms and conditions of the license of that
+ * module. An independent module is a module which is not derived from
+ * or based on this library. If you modify this library, you may extend
+ * this exception to your version of the library, but you are not
+ * obligated to do so. If you do not wish to do so, delete this
+ * exception statement from your version.
+ */
+
+package com.sun.image.codec.jpeg;
+
+/**
+ * <p>
+ * JPEGDecodeParam encapsulates tables and options necessary to control decoding
+ * JPEG data streams. Parameters are either set explicitly by the application
+ * for encoding, or read from the JPEG header for decoding. In the case of
+ * decoding abbreviated data streams the application may need to set some/all of
+ * the values it's self.
+ * </p>
+ * <p>
+ * When working with BufferedImages (@see JPEGImageDecoder.decodeBufferedImage),
+ * the codec will attempt to generate an appropriate ColorModel for the JPEG
+ * COLOR_ID. This is not always possible (example mappings are listed below) .
+ * In cases where unsupported conversions are required, or unknown encoded
+ * COLOR_ID's are in use, the user must request the data as a Raster and perform
+ * the transformations themselves. When decoding into a raster (@see
+ * JPEGImageDecoder.decodeRaster) no ColorSpace adjustments are made. Note: The
+ * color ids described herein are simply enumerated values that influence data
+ * processing by the JPEG codec. JPEG compression is by definition color blind.
+ * These values are used as hints when decompressing JPEG data. Of particular
+ * interest is the default conversion from YCbCr to sRGB when decoding buffered
+ * Images.
+ * </p>
+ * <p>
+ * Note: because JPEG is mostly color-blind color fidelity can not be
+ * guaranteed. This will hopefully be rectified in the near future by the wide
+ * spread inclusion of ICC-profiles in the JPEG data stream (as a special
+ * marker). The following is an example of the conversions that take place. This
+ * is only a guide to the types of conversions that are allowed. This list is
+ * likely to change in the future so it is strongly recommended that you check
+ * for thrown ImageFormatExceptions and check the actual ColorModel associated
+ * with the BufferedImage returned rather than make assumptions.
+ * </p>
+ * DECODING:
+ *
+ * <pre>
+ * JPEG (Encoded) Color ID BufferedImage ColorSpace
+ * ======================= ========================
+ * COLOR_ID_UNKNOWN ** Invalid **
+ * COLOR_ID_GRAY CS_GRAY
+ * COLOR_ID_RGB CS_sRGB
+ * COLOR_ID_YCbCr CS_sRGB
+ * COLOR_ID_CMYK ** Invalid **
+ * COLOR_ID_PYCC CS_PYCC
+ * COLOR_ID_RGBA CS_sRGB (w/ alpha)
+ * COLOR_ID_YCbCrA CS_sRGB (w/ alpha)
+ * COLOR_ID_RGBA_INVERTED ** Invalid **
+ * COLOR_ID_YCbCrA_INVERTED ** Invalid **
+ * COLOR_ID_PYCCA CS_PYCC (w/ alpha)
+ * COLOR_ID_YCCK ** Invalid **
+ * </pre>
+ * <p>
+ * If the user needs better control over conversion, the user must request the
+ * data as a Raster and handle the conversion of the image data themselves. When
+ * decoding JFIF files the encoded COLOR_ID will always be one of:
+ * COLOR_ID_UNKNOWN, COLOR_ID_GRAY, COLOR_ID_RGB, COLOR_ID_YCbCr, COLOR_ID_CMYK,
+ * or COLOR_ID_YCCK
+ * </p>
+ * <p>
+ * Note that the classes in the com.sun.image.codec.jpeg package are not part of
+ * the core Java APIs. They are a part of Sun's JDK and JRE distributions.
+ * Although other licensees may choose to distribute these classes, developers
+ * cannot depend on their availability in non-Sun implementations. We expect
+ * that equivalent functionality will eventually be available in a core API or
+ * standard extension.
+ * </p>
+ */
+public interface JPEGDecodeParam extends Cloneable {
+
+ /** APP0 marker - JFIF info */
+ public static final int APP0_MARKER = 0xE0;
+ /** APP1 marker */
+ public static final int APP1_MARKER = 0xE1;
+ /** APP2 marker */
+ public static final int APP2_MARKER = 0xE2;
+ /** APP3 marker */
+ public static final int APP3_MARKER = 0xE3;
+ /** APP4 marker */
+ public static final int APP4_MARKER = 0xE4;
+ /** APP5 marker */
+ public static final int APP5_MARKER = 0xE5;
+ /** APP6 marker */
+ public static final int APP6_MARKER = 0xE6;
+ /** APP7 marker */
+ public static final int APP7_MARKER = 0xE7;
+ /** APP8 marker */
+ public static final int APP8_MARKER = 0xE8;
+ /** APP9 marker */
+ public static final int APP9_MARKER = 0xE9;
+ /** APPA marker */
+ public static final int APPA_MARKER = 0xEA;
+ /** APPB marker */
+ public static final int APPB_MARKER = 0xEB;
+ /** APPC marker */
+ public static final int APPC_MARKER = 0xEC;
+ /** APPD marker */
+ public static final int APPD_MARKER = 0xED;
+ /** APPE marker - Adobe info */
+ public static final int APPE_MARKER = 0xEE;
+ /** APPF marker */
+ public static final int APPF_MARKER = 0xEF;
+ /** Adobe marker indicates presence/need for Adobe marker. */
+ public static final int COMMENT_MARKER = 0XFE;
+
+ /* Color ID values */
+ public static final int COLOR_ID_UNKNOWN = 0;
+ public static final int COLOR_ID_GRAY = 1;
+ public static final int COLOR_ID_RGB = 2;
+ public static final int COLOR_ID_YCbCr = 3;
+ public static final int COLOR_ID_CMYK = 4;
+ public static final int COLOR_ID_PYCC = 5;
+ public static final int COLOR_ID_RGBA = 6;
+ public static final int COLOR_ID_YCbCrA = 7;
+ public static final int COLOR_ID_RGBA_INVERTED = 8;
+ public static final int COLOR_ID_YCbCrA_INVERTED = 9;
+ public static final int COLOR_ID_PYCCA = 10;
+ public static final int COLOR_ID_YCCK = 11;
+ public static final int NUM_COLOR_ID = 12;
+
+ /** Number of allowed Huffman and Quantization Tables */
+ public static final int NUM_TABLES = 4;
+
+ /** The X and Y units simply indicate the aspect ratio of the pixels. */
+ public static final int DENSITY_UNIT_ASPECT_RATIO = 0;
+ /** Pixel density is in pixels per inch. */
+ public static final int DENSITY_UNIT_DOTS_INCH = 1;
+ /** Pixel density is in pixels per centimeter. */
+ public static final int DENSITY_UNIT_DOTS_CM = 2;
+ /** The max known value for DENSITY_UNIT */
+ public static final int NUM_DENSITY_UNIT = 3;
+
+ public Object clone();
+
+ /**
+ * Get the image width.
+ *
+ * @return int the width of the image data in pixels.
+ */
+ public int getWidth();
+
+ /**
+ * Get the image height.
+ *
+ * @return The height of the image data in pixels.
+ */
+ public int getHeight();
+
+ /**
+ * Return the Horizontal subsampling factor for requested Component. The
+ * Subsample factor is the number of input pixels that contribute to each
+ * output pixel. This is distinct from the way the JPEG to each output
+ * pixel. This is distinct from the way the JPEG standard defines this
+ * quantity, because fractional subsampling factors are not allowed.
+ *
+ * @param component
+ * The component of the encoded image to return the subsampling
+ * factor for.
+ * @return The subsample factor.
+ */
+ public int getHorizontalSubsampling(int component);
+
+ /**
+ * Return the Vertical subsampling factor for requested Component. The
+ * Subsample factor is the number of input pixels that contribute to each
+ * output pixel. This is distinct from the way the JPEG to each output
+ * pixel. This is distinct from the way the JPEG standard defines this
+ * quantity, because fractional subsampling factors are not allowed.
+ *
+ * @param component
+ * The component of the encoded image to return the subsampling
+ * factor for.
+ * @return The subsample factor.
+ */
+ public int getVerticalSubsampling(int component);
+
+ /**
+ * Returns the coefficient quantization tables or NULL if not defined.
+ * tableNum must range in value from 0 - 3.
+ *
+ * @param tableNum
+ * the index of the table to be returned.
+ * @return Quantization table stored at index tableNum.
+ */
+ public JPEGQTable getQTable(int tableNum);
+
+ /**
+ * Returns the Quantization table for the requested component.
+ *
+ * @param component
+ * the image component of interest.
+ * @return Quantization table associated with component
+ */
+ public JPEGQTable getQTableForComponent(int component);
+
+ /**
+ * Returns the DC Huffman coding table requested or null if not defined
+ *
+ * @param tableNum
+ * the index of the table to be returned.
+ * @return Huffman table stored at index tableNum.
+ */
+ public JPEGHuffmanTable getDCHuffmanTable(int tableNum);
+
+ /**
+ * Returns the DC Huffman coding table for the requested component.
+ *
+ * @param component
+ * the image component of interest.
+ * @return Huffman table associated with component
+ */
+ public JPEGHuffmanTable getDCHuffmanTableForComponent(int component);
+
+ /**
+ * Returns the AC Huffman coding table requested or null if not defined
+ *
+ * @param tableNum
+ * the index of the table to be returned.
+ * @return Huffman table stored at index tableNum.
+ */
+ public JPEGHuffmanTable getACHuffmanTable(int tableNum);
+
+ /**
+ * Returns the AC Huffman coding table for the requested component.
+ *
+ * @param component
+ * the image component of interest.
+ * @return Huffman table associated with component
+ */
+ public JPEGHuffmanTable getACHuffmanTableForComponent(int component);
+
+ /**
+ * Get the number of the DC Huffman table that will be used for a particular
+ * component.
+ *
+ * @param component
+ * The Component of interest.
+ * @return The table number of the DC Huffman table for component.
+ */
+ public int getDCHuffmanComponentMapping(int component);
+
+ /**
+ * Get the number of the AC Huffman table that will be used for a particular
+ * component.
+ *
+ * @param component
+ * The Component of interest.
+ * @return The table number of the AC Huffman table for component.
+ */
+ public int getACHuffmanComponentMapping(int component);
+
+ /**
+ * Get the number of the quantization table that will be used for a
+ * particular component.
+ *
+ * @param component
+ * The Component of interest.
+ * @return The table number of the Quantization table for component.
+ */
+ public int getQTableComponentMapping(int component);
+
+ /**
+ * Returns true if the image information in the ParamBlock is currently
+ * valid. This indicates if image data was read from the stream for decoding
+ * and weather image data should be written when encoding.
+ */
+ public boolean isImageInfoValid();
+
+ /**
+ * Returns true if the tables in the ParamBlock are currently valid. This
+ * indicates that tables were read from the stream for decoding. When
+ * encoding this indicates whether tables should be written to the stream.
+ */
+ public boolean isTableInfoValid();
+
+ /**
+ * Returns true if at least one instance of the marker is present in the
+ * Parameter object. For encoding returns true if there is at least one
+ * instance of the marker to be written.
+ *
+ * @param marker
+ * The marker of interest.
+ */
+ public boolean getMarker(int marker);
+
+ /**
+ * Returns a 'byte[][]' associated with the requested marker in the
+ * parameter object. Each entry in the 'byte[][]' is the data associated
+ * with one instance of the marker (each marker can theoretically appear any
+ * number of times in a stream).
+ *
+ * @param marker
+ * The marker of interest.
+ * @return The 'byte[][]' for this marker or null if none available.
+ */
+ public byte[][] getMarkerData(int marker);
+
+ /**
+ * Returns the JPEG Encoded color id. This is generally speaking only used
+ * if you are decoding into Rasters. Note that when decoding into a Raster
+ * no color conversion is performed.
+ *
+ * @return The value of the JPEG encoded data's color id.
+ */
+ public int getEncodedColorID();
+
+ /**
+ * Returns the number of components for the current encoding COLOR_ID.
+ *
+ * @return the number of Components
+ */
+ public int getNumComponents();
+
+ /**
+ * Get the MCUs per restart marker.
+ *
+ * @return The number of MCUs between restart markers.
+ */
+ public int getRestartInterval();
+
+ /**
+ * Get the code for pixel size units This value is copied from the APP0
+ * marker. It isn't used by the JPEG codec. If the APP0 marker wasn't
+ * present then you can not rely on this value.
+ *
+ * @return Value indicating the density unit one of the DENSITY_UNIT_*
+ * constants.
+ */
+ public int getDensityUnit();
+
+ /**
+ * Get the horizontal pixel density This value is copied from the APP0
+ * marker. It isn't used by the JPEG code. If the APP0 marker wasn't present
+ * then you can not rely on this value.
+ *
+ * @return The horizontal pixel density, in units described by
+ * @see #getDensityUnit()
+ */
+ public int getXDensity();
+
+ /**
+ * Get the vertical pixel density This value is copied into the APP0 marker.
+ * It isn't used by the JPEG code. If the APP0 marker wasn't present then
+ * you can not rely on this value.
+ *
+ * @return The vertical pixel density, in units described by
+ * @see #getDensityUnit()
+ */
+ public int getYDensity();
+
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java
new file mode 100644
index 0000000..3f83424
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGEncodeParam.java
@@ -0,0 +1,307 @@
+/* JPEGEncodeParam.java --
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+/**
+ * <p>
+ * JPEGEncodeParam encapsulates tables and options necessary to control encoding
+ * of JPEG data streams. Parameters are either set explicitly by the application
+ * for encoding, or read from another JPEG header.
+ * </p>
+ * <p>
+ * When working with BufferedImages, the codec will attempt to match the encoded
+ * JPEG COLOR_ID with the ColorModel in the BufferedImage. This is not always
+ * possible (the default mappings are listed below). In cases where unsupported
+ * conversions are required (or odd image colorspaces are in use) the user must
+ * either convert the image data to a known ColorSpace or encode the data from a
+ * raster. When encoding rasters no colorspace adjustments are made, so the user
+ * must do any conversions required to get to the encoded COLOR_ID. The COLOR_ID
+ * for the encoded images is used to control the JPEG codec's inital values for
+ * Huffman and Quantization Tables as well as subsampling factors. It is also
+ * used to determine what color conversion should be performed to obtain the
+ * best encoding.
+ * </p>
+ * <p>
+ * Note: The color ids described herein are simply enumerated values that
+ * influence data processing by the JPEG codec. JPEG compression is, by
+ * definition, color blind. These values are used as hints when compressing JPEG
+ * data. Through these values the JPEG codec can perform some default rotation
+ * of data into spaces that will aid in getting better compression ratios.
+ * </p>
+ * <p>
+ * Example behavior is described below. Since these mappings are likely to
+ * change in the future it is strongly recommended that you make use of the @see
+ * JPEGImageEncoder.getDefaultParamBlock calls and check the encodedColorID for
+ * your particular BufferedImage. In extreme cases is may be necessary for the
+ * user to convert the image to the desired colorspace, and encode it from a
+ * Raster. In this case the API programmer must specify the colorID of the data
+ * in the Raster and no color conversion will take place.
+ * </p>
+ *
+ * ENCODING:
+ *
+ * <pre>
+ * BufferedImage Type/Instance JPEG (Encoded) Color ID
+ * =========================== =======================
+ * TYPE_GRAY COLOR_ID_GRAYSCALE
+ * TYPE_RGB COLOR_ID_YCbCr
+ * TYPE_YCbCr COLOR_ID_YCbCr
+ * TYPE_YCbCr/CS_PYCC COLOR_ID_PYCC
+ * TYPE_CMYK COLOR_ID_CMYK
+ * TYPE_RGB (w/ alpha) COLOR_ID_YCbCrA
+ * TYPE_YCbCr (w/ alpha) COLOR_ID_YCbCrA
+ * TYPE_YCbCr/CS_PYCC (w/ alpha) COLOR_ID_PYCCA
+ * ** Any Other ** COLOR_ID_UNKNOWN
+ * </pre>
+ * <p>
+ * When the user wants more control than the BufferedImage conversions provide,
+ * the user must encode the data from a Raster. In this case the data undergoes
+ * no color conversion at all. It is the user's responsibility to perform the
+ * desired conversions. If you intend to write a JFIF image (by including the
+ * APP0_MARKER) the encoded COLOR_ID must be one of: COLOR_ID_UNKNOWN,
+ * COLOR_ID_GRAYSCALE, COLOR_ID_YCbCr, or COLOR_ID_CMYK. In all other instances
+ * an ImageformatException will be thrown.
+ * </p>
+ * <p>
+ * IMPORTANT: an Alpha RGB BufferedImage will not map to a valid JFIF stream,
+ * you must strip off the alpha prior to encoding if you want a JFIF file. If
+ * the APP0 marker is set and you do not strip off the Alpha, an
+ * ImageFormatException will be thrown.
+ * </p>
+ * <p>
+ * Note that the classes in the com.sun.image.codec.jpeg package are not part of
+ * the core Java APIs. They are a part of Sun's JDK and JRE distributions.
+ * Although other licensees may choose to distribute these classes, developers
+ * cannot depend on their availability in non-Sun implementations. We expect
+ * that equivalent functionality will eventually be available in a core API or
+ * standard extension.
+ * </p>
+ */
+public interface JPEGEncodeParam extends JPEGDecodeParam {
+
+ /**
+ * Set the horizontal subsample factor for the given component. Note that
+ * the subsample factor is the number of input pixels that contribute to
+ * each output pixel (usually 2 for YCC).
+ *
+ * @param component
+ * The component being specified.
+ * @param subsample
+ * The subsampling factor being specified.
+ */
+ public void setHorizontalSubsampling(int component, int subsample);
+
+ /**
+ * Set the vertical subsample factor for the given component. Note that the
+ * subsample factor is the number of input pixels that contribute to each
+ * output pixel (usually 2 for YCC).
+ *
+ * @param component
+ * The component being specified.
+ * @param subsample
+ * The subsampling factor being specified.
+ */
+ public void setVerticalSubsampling(int component, int subsample);
+
+ /**
+ * Sets the coefficient quantization tables at index passed. tableNum must
+ * range in value from 0 - 3.
+ *
+ * @param qtable
+ * that will be used.
+ * @param tableNum
+ * the index of the table to be set.
+ */
+ public void setQTable(int tableNum, JPEGQTable qTable);
+
+ /**
+ * Sets the DC Huffman coding table at index to the table provided.
+ *
+ * @param huffTable
+ * JPEGHuffmanTable that will be assigned to index tableNum.
+ * @param tableNum
+ * - the index of the table to be set.
+ * @exception IllegalArgumentException
+ * - thrown if the tableNum is out of range. Index must range
+ * in value from 0 - 3.
+ */
+ public void setDCHuffmanTable(int tableNum, JPEGHuffmanTable huffTable);
+
+ /**
+ * Sets the AC Huffman coding table at index to the table provided.
+ *
+ * @param huffTable
+ * JPEGHuffmanTable that will be assigned to index tableNum.
+ * @param tableNum
+ * - the index of the table to be set.
+ * @exception IllegalArgumentException
+ * - thrown if the tableNum is out of range. Index must range
+ * in value from 0 - 3.
+ */
+ public void setACHuffmanTable(int tableNum, JPEGHuffmanTable huffTable);
+
+ /**
+ * Sets the mapping between a component and it's DC Huffman Table.
+ *
+ * @param component
+ * The component to set the mapping for
+ * @param table
+ * The DC Huffman table to use for component
+ */
+ public void setDCHuffmanComponentMapping(int component, int table);
+
+ /**
+ * Sets the mapping between a component and it's AC Huffman Table.
+ *
+ * @param component
+ * The component to set the mapping for
+ * @param table
+ * The AC Huffman table to use for component
+ */
+ public void setACHuffmanComponentMapping(int component, int table);
+
+ /**
+ * Sets the mapping between a component and it's Quantization Table.
+ *
+ * @param component
+ * The component to set the mapping for
+ * @param table
+ * The Quantization Table to use for component
+ */
+ public void setQTableComponentMapping(int component, int table);
+
+ /**
+ * Set the flag indicating the validity of the table information in the
+ * ParamBlock. This is used to indicate if tables should be included when
+ * encoding.
+ */
+ public void setImageInfoValid(boolean flag);
+
+ /**
+ * Set the flag indicating the validity of the image information in the
+ * ParamBlock. This is used to indicates if image data should be written
+ * when encoding.
+ */
+ public void setTableInfoValid(boolean flag);
+
+ /**
+ * Sets the marker data to be written to the output data stream. This
+ * removes any existing marker data in the JPEParm object. This can be used
+ * to remove the default APP0 marker by calling it with data set to null.
+ *
+ * @param marker
+ * The marker to set the data for.
+ * @param data
+ * the new set of data to be written.
+ */
+ public void setMarkerData(int marker, byte[][] data);
+
+ /**
+ * Appends 'data' to the array of byte[] associated with marker. This will
+ * result in additional instance of the marker being written (one for each
+ * byte[] in the array.).
+ *
+ * @param marker
+ * The marker to add and instance of.
+ * @param data
+ * the data to be written.
+ */
+ public void addMarkerData(int marker, byte[] data);
+
+ /**
+ * Set the MCUs per restart, or 0 for no restart markers.
+ *
+ * @param restartInterval
+ * number MCUs per restart marker.
+ */
+ public void setRestartInterval(int restartInterval);
+
+ /**
+ * Set the pixel size units This value is copied into the APP0 marker (if
+ * that marker is written). This value isn't used by the JPEG code.
+ *
+ * @param unit
+ * One of the DENSITY_UNIT_* values.
+ */
+ public void setDensityUnit(int unit);
+
+ /**
+ * Set the horizontal pixel density. This value is written into the APP0
+ * marker. It isn't used by the JPEG code.
+ *
+ * @param density
+ * the horizontal pixel density, in units described by @see
+ * JPEGParam.getDensityUnit.
+ */
+ public void setXDensity(int density);
+
+ /**
+ * Set the vertical pixel density. This value is copied into the JFIF APP0
+ * marker. It isn't used by the JPEG code.
+ *
+ * @param density
+ * The vertical pixel density, in units described by @see
+ * JPEGParam.getDensityUnit.
+ */
+ public void setYDensity(int density);
+
+ /**
+ * This creates new Quantization tables that replace the currently installed
+ * Quantization tables. It also updates the Component QTable mapping to the
+ * default for the current encoded COLOR_ID.
+ *
+ * The Created Quantization table varies from very high compression, very
+ * low quality, (0.0) to low compression, very high quality (1.0) based on
+ * the quality parameter.
+ *
+ * At a quality level of 1.0 the table will be all 1's which will lead to no
+ * loss of data due to quantization (however chrominance subsampling, if
+ * used, and roundoff error in the DCT will still degrade the image some
+ * what).
+ *
+ * This is a linear manipulation of the standard chrominance Q-Table.
+ *
+ * Some guidelines: 0.75 high quality 0.5 medium quality 0.25 low quality
+ *
+ * @param quality
+ * 0.0-1.0 setting of desired quality level.
+ * @param forceBaseline
+ * force baseline quantization table
+ */
+ public void setQuality(float quality, boolean forceBaseline);
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGHuffmanTable.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGHuffmanTable.java
new file mode 100644
index 0000000..ddaf562
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGHuffmanTable.java
@@ -0,0 +1,129 @@
+/* JPEGHuffmanTable.java -- Huffman table implementation for JPEG.
+Copyright (C) 2011 Red Hat
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+package com.sun.image.codec.jpeg;
+
+/**
+ * A class to encapsulate a JPEG Huffman table.
+ */
+public class JPEGHuffmanTable {
+
+ /**
+ * The standard DC luminance Huffman table.
+ */
+ public static final JPEGHuffmanTable StdDCLuminance;
+
+ /**
+ * The standard DC chrominance Huffman table.
+ */
+ public static final JPEGHuffmanTable StdDCChrominance;
+
+ /**
+ * The standard AC luminance Huffman table.
+ */
+ public static final JPEGHuffmanTable StdACLuminance;
+
+ /**
+ * The standard AC chrominance Huffman table.
+ */
+ public static final JPEGHuffmanTable StdACChrominance;
+
+ private short[] lengths;
+
+ private short[] symbols;
+
+ static {
+ javax.imageio.plugins.jpeg.JPEGHuffmanTable temp;
+
+ temp = javax.imageio.plugins.jpeg.JPEGHuffmanTable.StdDCLuminance;
+ StdDCLuminance = new JPEGHuffmanTable(temp.getLengths(),
+ temp.getValues());
+
+ temp = javax.imageio.plugins.jpeg.JPEGHuffmanTable.StdDCChrominance;
+ StdDCChrominance = new JPEGHuffmanTable(temp.getLengths(),
+ temp.getValues());
+
+ temp = javax.imageio.plugins.jpeg.JPEGHuffmanTable.StdACLuminance;
+ StdACLuminance = new JPEGHuffmanTable(temp.getLengths(),
+ temp.getValues());
+
+ temp = javax.imageio.plugins.jpeg.JPEGHuffmanTable.StdACChrominance;
+ StdACChrominance = new JPEGHuffmanTable(temp.getLengths(),
+ temp.getValues());
+ }
+
+ /**
+ * Creates a Huffman table and initializes it. The input arrays are copied.
+ * The arrays must describe a possible Huffman table. For example, 3 codes
+ * cannot be expressed with a single bit.
+ *
+ * @param lengths
+ * an array of {@code short}s where <code>lengths[k]</code> is
+ * equal to the number of values with corresponding codes of
+ * length <code>k + 1</code> bits.
+ * @param values
+ * an array of shorts containing the values in order of
+ * increasing code length.
+ * @throws IllegalArgumentException
+ * if <code>lengths</code> or <code>values</code> are null, the
+ * length of <code>lengths</code> is greater than 16, the length
+ * of <code>values</code> is greater than 256, if any value in
+ * <code>lengths</code> or <code>values</code> is less than
+ * zero, or if the arrays do not describe a valid Huffman table.
+ */
+ public JPEGHuffmanTable(short lengths[], short symbols[]) {
+ if (lengths == null)
+ throw new IllegalArgumentException("lengths array can not be null.");
+ if (symbols == null)
+ throw new IllegalArgumentException("symbols array can not be null.");
+ if (lengths.length > 17)
+ throw new IllegalArgumentException("lengths array can not be longer than 17.");
+ if (symbols.length > 256)
+ throw new IllegalArgumentException("symbols array can not be longer than 256.");
+ for (int a = 0; a < lengths.length; ++a)
+ if (lengths[a] < 0)
+ throw new IllegalArgumentException("length " + a + " is smaller than zero.");
+ for (int a = 0; a < symbols.length; ++a)
+ if (symbols[a] < 0)
+ throw new IllegalArgumentException("symbol " + a + " is smaller than zero.");
+ this.lengths = lengths;
+ this.symbols = symbols;
+ }
+
+ /**
+ * Return an array containing the number of symbols for each length in
+ * the Huffman table.
+ *
+ * @return A short array where length[a] is equal to the number of symbols
+ * in the Huffman table of length a. The first element (length[0])
+ * is unused.
+ */
+ public short[] getLengths() {
+ return lengths;
+ }
+
+ /**
+ * Return an array containing the Huffman symbols arranged by increasing
+ * length. To make use of this array you must refer to the lengths array.
+ *
+ * @return A short array of Huffman symbols
+ */
+ public short[] getSymbols() {
+ return symbols;
+ }
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java
new file mode 100644
index 0000000..2c8499f
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageDecoder.java
@@ -0,0 +1,102 @@
+/* JPEGImageDecoder.java --
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Matthew Flaschen
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+
+import java.io.InputStream;
+import java.io.IOException;
+
+public interface JPEGImageDecoder {
+
+ /**
+ * Decodes the current JPEG data stream. The result of decoding this
+ * InputStream is a BufferedImage the ColorModel associated with this
+ * BufferedImage is determined based on the encoded COLOR_ID of the
+ * JPEGDecodeParam object. For a tables only stream this will return null.
+ *
+ * @return BufferedImage containing the image data.
+ * @throws ImageFormatException
+ * If irregularities in the JPEG stream or an unknown condition
+ * is encountered.
+ * @throws IOException
+ */
+ public BufferedImage decodeAsBufferedImage() throws IOException,
+ ImageFormatException;
+
+ /**
+ * Decode the JPEG stream that was passed as part of construction. The JPEG
+ * decompression will be performed according to the current settings of the
+ * JPEGDecodeParam object. For a tables only stream this will return null.
+ *
+ * @return Raster containg the image data. Colorspace and other pertinent
+ * information can be obtained from the JPEGDecodeParam object.
+ * @throws ImageFormatException
+ * If irregularities in the JPEG stream or an unknown condition
+ * is encountered.
+ * @throws IOException
+ */
+ public Raster decodeAsRaster() throws IOException, ImageFormatException;
+
+ /**
+ * Get the input stream that decoding will occur from.
+ *
+ * @return The stream that the decoder is currently associated with.
+ */
+ public InputStream getInputStream();
+
+ /**
+ * Returns the JPEGDecodeParam object that resulted from the most recent
+ * decoding event.
+ *
+ * @return
+ */
+ public JPEGDecodeParam getJPEGDecodeParam();
+
+ /**
+ * Sets the JPEGDecodeParam object used to determine the features of the
+ * decompression performed on the JPEG encoded data. This is usually only
+ * needed for decoding abbreviated JPEG data streams.
+ *
+ * @param jdp
+ * JPEGDecodeParam object
+ */
+ public void setJPEGDecodeParam(JPEGDecodeParam jdp);
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java
new file mode 100644
index 0000000..1cd46ce
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGImageEncoder.java
@@ -0,0 +1,208 @@
+/* JPEGImageEncoder.java --
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+import java.io.OutputStream;
+import java.io.IOException;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+
+public interface JPEGImageEncoder {
+ /**
+ * This is a factory method for creating JPEGEncodeParam objects. The
+ * returned object will do a credible job of encoding the given
+ * BufferedImage.
+ *
+ * @param bi
+ * @return
+ * @throws ImageFormatException
+ */
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
+ throws ImageFormatException;
+
+ /**
+ * This is a factory method for creating JPEGEncodeParam objects. It is the
+ * users responsibility to match the colorID with the given number of bands,
+ * which should match the data being encoded. Failure to do so may lead to
+ * poor compression and/or poor image quality. If you don't understand much
+ * about JPEG it is strongly recommended that you stick to the BufferedImage
+ * interface.
+ *
+ * @param numBands
+ * the number of bands that will be encoded (max of four).
+ * @param colorID
+ * the COLOR_ID for the encoded data. This is used to set
+ * reasonable defaults in the parameter object. This must match
+ * the number of bands given.
+ * @return
+ * @throws ImageFormatException
+ */
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands, int colorID)
+ throws ImageFormatException;
+
+ /**
+ * This is a factory method for creating a JPEGEncodeParam from a
+ * JPEGDecodeParam. This will return a new JPEGEncodeParam object that is
+ * initialized from the JPEGDecodeParam object. All major pieces of
+ * information will be initialized from the DecodeParam (Markers, Tables,
+ * mappings).
+ *
+ * @param d
+ * The JPEGDecodeParam object to copy.
+ * @return
+ * @throws ImageFormatException
+ */
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam d)
+ throws ImageFormatException;
+
+ /**
+ * This is a factory method for creating JPEGEncodeParam objects. It is the
+ * users responsiblity to match the colorID with the data contained in the
+ * Raster. Failure to do so may lead to either poor compression or poor
+ * image quality. If you don't understand much about JPEG it is strongly
+ * reccomended that you stick to the BufferedImage interfaces.
+ *
+ * @param ras
+ * @param colorID
+ * @return
+ * @throws ImageFormatException
+ */
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras, int colorID)
+ throws ImageFormatException;
+
+ public JPEGEncodeParam getJPEGEncodeParam() throws ImageFormatException;
+
+ /**
+ * Set the JPEGEncodeParam object that is to be used for future encoding
+ * operations. 'p' is copied so changes will not be tracked, unless you call
+ * this method again.
+ *
+ * @param p
+ * The JPEGEncodeParam object to use for future encodings.
+ */
+ public void setJPEGEncodeParam(JPEGEncodeParam p);
+
+ /**
+ * Return the stream the Encoder is current associated with.
+ *
+ * @return
+ */
+ public OutputStream getOutputStream();
+
+ /**
+ * Encode a BufferedImage as a JPEG data stream. Note, some color
+ * conversions may takes place. The jep's encoded COLOR_ID should match the
+ * value returned by getDefaultColorID when given the BufferedImage's
+ * ColorModel. This call also sets the current JPEGEncodeParam object. The
+ * given JPEGEncodeParam object will be used for this and future encodings.
+ * If p is null then a new JPEGEncodeParam object will be created by calling
+ * getDefaultJPEGEncodeParam with bi.
+ *
+ * @param bi
+ * The BufferedImage to encode.
+ * @param p
+ * The JPEGEncodeParam object used to control the encoding.
+ * @throws IOException
+ * @throws ImageFormatException
+ */
+ public void encode(BufferedImage bi, JPEGEncodeParam p) throws IOException,
+ ImageFormatException;
+
+ /**
+ * Encode a Raster as a JPEG data stream. Note that no color conversion
+ * takes place. It is required that you match the Raster to the encoded
+ * COLOR_ID contained in the current JPEGEncodeParam object. If no
+ * JPEGEncodeParam object has been provided yet a new JPEGEncodeParam object
+ * will be created by calling getDefaultJPEGEncodeParam with ras and
+ * COLOR_ID_UNKNOWN.
+ *
+ * @param ras
+ * The Raster to encode.
+ * @throws IOException
+ * @throws ImageFormatException
+ */
+ public void encode(Raster ras) throws IOException, ImageFormatException;
+
+ /**
+ * Encode a BufferedImage as a JPEG data stream. Note, some color
+ * conversions may takes place. The current JPEGEncodeParam's encoded
+ * COLOR_ID should match the value returned by getDefaultColorID when given
+ * the BufferedImage's ColorModel. If no JPEGEncodeParam object has been
+ * provided yet a default one will be created by calling
+ * getDefaultJPEGEncodeParam with bi.
+ *
+ * @param bi
+ * The BufferedImage to encode.
+ * @throws IOException
+ * @throws ImageFormatException
+ */
+ public void encode(BufferedImage bi) throws IOException,
+ ImageFormatException;
+
+ /**
+ * Encode a Raster as a JPEG data stream. Note that no color conversion
+ * takes place. It is required that you match the Raster to the encoded
+ * COLOR_ID contained in the JPEGEncodeParam object. If p is null a new
+ * JPEGEncodeParam object will be created by calling
+ * getDefaultJPEGEncodeParam with ras and COLOR_ID_UNKNOWN.
+ *
+ * @param ras
+ * The Raster to encode.
+ * @param p
+ * The JPEGEncodeParam object used to control the encoding.
+ * @throws IOException
+ * @throws ImageFormatException
+ */
+ public void encode(Raster ras, JPEGEncodeParam p) throws IOException,
+ ImageFormatException;
+
+ /**
+ * Returns the 'default' encoded COLOR_ID for a given ColorModel. This
+ * method is not needed in the simple case of encoding Buffered Images (the
+ * library will figure things out for you). It can be useful for encoding
+ * Rasters. To determine what needs to be done to the image prior to
+ * encoding.
+ *
+ * @param cm
+ * The ColorModel to map to an jpeg encoded COLOR_ID.
+ * @return
+ */
+ public int getDefaultColorId(ColorModel cm);
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java
new file mode 100644
index 0000000..128af5a
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/JPEGQTable.java
@@ -0,0 +1,118 @@
+/* JPEGQTable.java --
+ Copyright (C) 2011 Red Hat
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Matthew Flaschen
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+import java.util.Arrays;
+
+/**
+ * Class to encapsulate the JPEG quantization tables.
+ *
+ * Note: The tables K1Luminance, K1Div2Luminance, K2Chrominance,
+ * K2Div2Chrominance is an instance of the superclass.
+ *
+ * @author Andrew Su (asu@redhat.com)
+ *
+ */
+public class JPEGQTable {
+
+ /**
+ * Luminance quantization table (in zig-zag order).
+ */
+ public static final JPEGQTable StdLuminance;
+
+ /**
+ * Chromninance quantization table (in zig-zag order).
+ */
+ public static final JPEGQTable StdChrominance;
+
+ static {
+ /* table for luminance values in zig-zag order */
+ int[] table1 = { 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16,
+ 19, 24, 40, 26, 24, 22, 22, 24, 49, 35, 37, 29, 40, 58, 51, 61,
+ 60, 57, 51, 56, 55, 64, 72, 92, 78, 64, 68, 87, 69, 55, 56, 80,
+ 109, 81, 87, 95, 98, 103, 104, 103, 62, 77, 113, 121, 112, 100,
+ 120, 92, 101, 103, 99 };
+
+ StdLuminance = new JPEGQTable(table1);
+
+ /* table for chrominance values in zig-zag order */
+ int[] table2 = { 17, 18, 18, 24, 21, 24, 47, 26, 26, 47, 99, 66, 56,
+ 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99 };
+ StdChrominance = new JPEGQTable(table2);
+ }
+
+ private int[] table;
+
+ /**
+ * Constructs an quantization table from the array that was passed. The
+ * coefficients must be in zig-zag order. The array must be of length 64.
+ * The table will be copied.
+ *
+ * @param table
+ * the quantization table, as an int array.
+ * @throws IllegalArgumentException
+ * if table is null or table.length is not equal to 64.
+ */
+ public JPEGQTable(int[] table) {
+ /* Table must be 8x8 thus 64 entries */
+ if (table == null || table.length != 64) {
+ throw new IllegalArgumentException("Not a valid table.");
+ }
+ this.table = Arrays.copyOf(table, table.length);
+ }
+
+ public int[] getTable() {
+ return Arrays.copyOf(table, table.length);
+ }
+
+ public JPEGQTable getScaledInstance(float scaleFactor, boolean forceBaseline) {
+ int limit = (forceBaseline) ? 255 : 32767;
+ int[] newTable = new int[table.length];
+ for (int i = 0; i < table.length; i++) {
+ int newValue = Math.round(table[i] * scaleFactor);
+ newTable[i] = (newValue < 1) ? 1 : (newValue > limit) ? limit : newValue;
+ }
+ return new JPEGQTable(newTable);
+ }
+
+}
diff --git a/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java b/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java
new file mode 100644
index 0000000..faec0d9
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/image/codec/jpeg/TruncatedFileException.java
@@ -0,0 +1,92 @@
+/* TruncatedFileException.java
+ Copyright (C) 2007 Matthew Flaschen
+ Copyright (C) 2011 Red Hat, Inc.
+
+ This file is part of IcedTea
+
+ IcedTea is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ IcedTea is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+
+public class TruncatedFileException extends RuntimeException {
+
+ private final BufferedImage bufferedImage;
+
+ private final Raster raster;
+
+ /**
+ * Creates a new exception with the specified {@link BufferedImage}
+ * containing the partially read image data.
+ *
+ * @param bufferedImage the partially decoded image (may be null).
+ */
+ public TruncatedFileException(BufferedImage bufferedImage) {
+ this.bufferedImage = bufferedImage;
+ this.raster = null;
+ }
+
+ /**
+ * Creates a new exception with the specified {@link Raster}
+ * containing the partially read image data.
+ *
+ * @param raster the partially decoded image (may be null).
+ */
+ public TruncatedFileException(Raster raster) {
+ this.raster = raster;
+ this.bufferedImage = null;
+ }
+
+ /**
+ * Returns the partially read data as a {@link BufferedImage}
+ * if available, or {@code null} if not.
+ *
+ * @return the partially read data.
+ */
+ public BufferedImage getBufferedImage() {
+ return bufferedImage;
+ }
+
+ /**
+ * Returns the partially read data as a {@link Raster}
+ * if available, or {@code null} if not.
+ *
+ * @return the partially read data.
+ */
+ public Raster getRaster() {
+ return raster;
+ }
+
+}
diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java
index 2db3c41..2f81f77 100644
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java
@@ -1154,7 +1154,7 @@ public abstract class OpenConverter {
Set<BitSet> getterIndexSets = newSet();
for (Constructor<?> constr : annotatedConstrList) {
String[] propertyNames =
- constr.getAnnotation(propertyNamesClass).value();
+ ((ConstructorProperties)constr.getAnnotation(propertyNamesClass)).value();
Type[] paramTypes = constr.getGenericParameterTypes();
if (paramTypes.length != propertyNames.length) {
diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java
index d9cad53..f83ba59 100644
--- a/jdk/src/share/classes/java/beans/MetaData.java
+++ b/jdk/src/share/classes/java/beans/MetaData.java
@@ -1604,7 +1604,7 @@ class MetaData {
}
private static String[] getAnnotationValue(Constructor<?> constructor) {
- ConstructorProperties annotation = constructor.getAnnotation(ConstructorProperties.class);
+ ConstructorProperties annotation = ((ConstructorProperties) constructor.getAnnotation(ConstructorProperties.class));
return (annotation != null)
? annotation.value()
: null;
diff --git a/jdk/src/share/classes/java/beans/MetaData.java.orig b/jdk/src/share/classes/java/beans/MetaData.java.orig
new file mode 100644
index 0000000..d9cad53
--- /dev/null
+++ b/jdk/src/share/classes/java/beans/MetaData.java.orig
@@ -0,0 +1,1716 @@
+/*
+ * Copyright (c) 2000, 2009, 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.beans;
+
+import java.awt.AWTKeyStroke;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.KeyEvent;
+import java.awt.font.TextAttribute;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import java.sql.Timestamp;
+
+import java.util.*;
+
+import javax.swing.Box;
+import javax.swing.JLayeredPane;
+import javax.swing.border.MatteBorder;
+import javax.swing.plaf.ColorUIResource;
+
+import sun.swing.PrintColorUIResource;
+
+/*
+ * Like the <code>Intropector</code>, the <code>MetaData</code> class
+ * contains <em>meta</em> objects that describe the way
+ * classes should express their state in terms of their
+ * own public APIs.
+ *
+ * @see java.beans.Intropector
+ *
+ * @author Philip Milne
+ * @author Steve Langley
+ */
+
+class NullPersistenceDelegate extends PersistenceDelegate {
+ // Note this will be called by all classes when they reach the
+ // top of their superclass chain.
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ }
+ protected Expression instantiate(Object oldInstance, Encoder out) { return null; }
+
+ public void writeObject(Object oldInstance, Encoder out) {
+ // System.out.println("NullPersistenceDelegate:writeObject " + oldInstance);
+ }
+}
+
+/**
+ * The persistence delegate for <CODE>enum</CODE> classes.
+ *
+ * @author Sergey A. Malenkov
+ */
+class EnumPersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance == newInstance;
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Enum e = (Enum) oldInstance;
+ return new Expression(e, Enum.class, "valueOf", new Object[]{e.getClass(), e.name()});
+ }
+}
+
+class PrimitivePersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, oldInstance.getClass(),
+ "new", new Object[]{oldInstance.toString()});
+ }
+}
+
+class ArrayPersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return (newInstance != null &&
+ oldInstance.getClass() == newInstance.getClass() && // Also ensures the subtype is correct.
+ Array.getLength(oldInstance) == Array.getLength(newInstance));
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ // System.out.println("instantiate: " + type + " " + oldInstance);
+ Class oldClass = oldInstance.getClass();
+ return new Expression(oldInstance, Array.class, "newInstance",
+ new Object[]{oldClass.getComponentType(),
+ new Integer(Array.getLength(oldInstance))});
+ }
+
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ int n = Array.getLength(oldInstance);
+ for (int i = 0; i < n; i++) {
+ Object index = new Integer(i);
+ // Expression oldGetExp = new Expression(Array.class, "get", new Object[]{oldInstance, index});
+ // Expression newGetExp = new Expression(Array.class, "get", new Object[]{newInstance, index});
+ Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
+ Expression newGetExp = new Expression(newInstance, "get", new Object[]{index});
+ try {
+ Object oldValue = oldGetExp.getValue();
+ Object newValue = newGetExp.getValue();
+ out.writeExpression(oldGetExp);
+ if (!MetaData.equals(newValue, out.get(oldValue))) {
+ // System.out.println("Not equal: " + newGetExp + " != " + actualGetExp);
+ // invokeStatement(Array.class, "set", new Object[]{oldInstance, index, oldValue}, out);
+ DefaultPersistenceDelegate.invokeStatement(oldInstance, "set", new Object[]{index, oldValue}, out);
+ }
+ }
+ catch (Exception e) {
+ // System.err.println("Warning:: failed to write: " + oldGetExp);
+ out.getExceptionListener().exceptionThrown(e);
+ }
+ }
+ }
+}
+
+class ProxyPersistenceDelegate extends PersistenceDelegate {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Class type = oldInstance.getClass();
+ java.lang.reflect.Proxy p = (java.lang.reflect.Proxy)oldInstance;
+ // This unappealing hack is not required but makes the
+ // representation of EventHandlers much more concise.
+ java.lang.reflect.InvocationHandler ih = java.lang.reflect.Proxy.getInvocationHandler(p);
+ if (ih instanceof EventHandler) {
+ EventHandler eh = (EventHandler)ih;
+ Vector args = new Vector();
+ args.add(type.getInterfaces()[0]);
+ args.add(eh.getTarget());
+ args.add(eh.getAction());
+ if (eh.getEventPropertyName() != null) {
+ args.add(eh.getEventPropertyName());
+ }
+ if (eh.getListenerMethodName() != null) {
+ args.setSize(4);
+ args.add(eh.getListenerMethodName());
+ }
+ return new Expression(oldInstance,
+ EventHandler.class,
+ "create",
+ args.toArray());
+ }
+ return new Expression(oldInstance,
+ java.lang.reflect.Proxy.class,
+ "newProxyInstance",
+ new Object[]{type.getClassLoader(),
+ type.getInterfaces(),
+ ih});
+ }
+}
+
+// Strings
+class java_lang_String_PersistenceDelegate extends PersistenceDelegate {
+ protected Expression instantiate(Object oldInstance, Encoder out) { return null; }
+
+ public void writeObject(Object oldInstance, Encoder out) {
+ // System.out.println("NullPersistenceDelegate:writeObject " + oldInstance);
+ }
+}
+
+// Classes
+class java_lang_Class_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Class c = (Class)oldInstance;
+ // As of 1.3 it is not possible to call Class.forName("int"),
+ // so we have to generate different code for primitive types.
+ // This is needed for arrays whose subtype may be primitive.
+ if (c.isPrimitive()) {
+ Field field = null;
+ try {
+ field = ReflectionUtils.typeToClass(c).getDeclaredField("TYPE");
+ } catch (NoSuchFieldException ex) {
+ System.err.println("Unknown primitive type: " + c);
+ }
+ return new Expression(oldInstance, field, "get", new Object[]{null});
+ }
+ else if (oldInstance == String.class) {
+ return new Expression(oldInstance, "", "getClass", new Object[]{});
+ }
+ else if (oldInstance == Class.class) {
+ return new Expression(oldInstance, String.class, "getClass", new Object[]{});
+ }
+ else {
+ return new Expression(oldInstance, Class.class, "forName", new Object[]{c.getName()});
+ }
+ }
+}
+
+// Fields
+class java_lang_reflect_Field_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Field f = (Field)oldInstance;
+ return new Expression(oldInstance,
+ f.getDeclaringClass(),
+ "getField",
+ new Object[]{f.getName()});
+ }
+}
+
+// Methods
+class java_lang_reflect_Method_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Method m = (Method)oldInstance;
+ return new Expression(oldInstance,
+ m.getDeclaringClass(),
+ "getMethod",
+ new Object[]{m.getName(), m.getParameterTypes()});
+ }
+}
+
+// Dates
+
+/**
+ * The persistence delegate for <CODE>java.util.Date</CODE> classes.
+ * Do not extend DefaultPersistenceDelegate to improve performance and
+ * to avoid problems with <CODE>java.sql.Date</CODE>,
+ * <CODE>java.sql.Time</CODE> and <CODE>java.sql.Timestamp</CODE>.
+ *
+ * @author Sergey A. Malenkov
+ */
+class java_util_Date_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ if (!super.mutatesTo(oldInstance, newInstance)) {
+ return false;
+ }
+ Date oldDate = (Date)oldInstance;
+ Date newDate = (Date)newInstance;
+
+ return oldDate.getTime() == newDate.getTime();
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Date date = (Date)oldInstance;
+ return new Expression(date, date.getClass(), "new", new Object[] {date.getTime()});
+ }
+}
+
+/**
+ * The persistence delegate for <CODE>java.sql.Timestamp</CODE> classes.
+ * It supports nanoseconds.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_sql_Timestamp_PersistenceDelegate extends java_util_Date_PersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ Timestamp oldTime = (Timestamp)oldInstance;
+ Timestamp newTime = (Timestamp)newInstance;
+
+ int nanos = oldTime.getNanos();
+ if (nanos != newTime.getNanos()) {
+ out.writeStatement(new Statement(oldTime, "setNanos", new Object[] {nanos}));
+ }
+ }
+}
+
+// Collections
+
+/*
+The Hashtable and AbstractMap classes have no common ancestor yet may
+be handled with a single persistence delegate: one which uses the methods
+of the Map insterface exclusively. Attatching the persistence delegates
+to the interfaces themselves is fraught however since, in the case of
+the Map, both the AbstractMap and HashMap classes are declared to
+implement the Map interface, leaving the obvious implementation prone
+to repeating their initialization. These issues and questions around
+the ordering of delegates attached to interfaces have lead us to
+ignore any delegates attached to interfaces and force all persistence
+delegates to be registered with concrete classes.
+*/
+
+/**
+ * The base class for persistence delegates for inner classes
+ * that can be created using {@link Collections}.
+ *
+ * @author Sergey A. Malenkov
+ */
+abstract class java_util_Collections extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ if (!super.mutatesTo(oldInstance, newInstance)) {
+ return false;
+ }
+ if ((oldInstance instanceof List) || (oldInstance instanceof Set) || (oldInstance instanceof Map)) {
+ return oldInstance.equals(newInstance);
+ }
+ Collection oldC = (Collection) oldInstance;
+ Collection newC = (Collection) newInstance;
+ return (oldC.size() == newC.size()) && oldC.containsAll(newC);
+ }
+
+ static final class EmptyList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, Collections.class, "emptyList", null);
+ }
+ }
+
+ static final class EmptySet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, Collections.class, "emptySet", null);
+ }
+ }
+
+ static final class EmptyMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, Collections.class, "emptyMap", null);
+ }
+ }
+
+ static final class SingletonList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = (List) oldInstance;
+ return new Expression(oldInstance, Collections.class, "singletonList", new Object[]{list.get(0)});
+ }
+ }
+
+ static final class SingletonSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Set set = (Set) oldInstance;
+ return new Expression(oldInstance, Collections.class, "singleton", new Object[]{set.iterator().next()});
+ }
+ }
+
+ static final class SingletonMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Map map = (Map) oldInstance;
+ Object key = map.keySet().iterator().next();
+ return new Expression(oldInstance, Collections.class, "singletonMap", new Object[]{key, map.get(key)});
+ }
+ }
+
+ static final class UnmodifiableCollection_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = new ArrayList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableCollection", new Object[]{list});
+ }
+ }
+
+ static final class UnmodifiableList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = new LinkedList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list});
+ }
+ }
+
+ static final class UnmodifiableRandomAccessList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = new ArrayList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list});
+ }
+ }
+
+ static final class UnmodifiableSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Set set = new HashSet((Set) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableSet", new Object[]{set});
+ }
+ }
+
+ static final class UnmodifiableSortedSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ SortedSet set = new TreeSet((SortedSet) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableSortedSet", new Object[]{set});
+ }
+ }
+
+ static final class UnmodifiableMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Map map = new HashMap((Map) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableMap", new Object[]{map});
+ }
+ }
+
+ static final class UnmodifiableSortedMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ SortedMap map = new TreeMap((SortedMap) oldInstance);
+ return new Expression(oldInstance, Collections.class, "unmodifiableSortedMap", new Object[]{map});
+ }
+ }
+
+ static final class SynchronizedCollection_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = new ArrayList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedCollection", new Object[]{list});
+ }
+ }
+
+ static final class SynchronizedList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = new LinkedList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list});
+ }
+ }
+
+ static final class SynchronizedRandomAccessList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ List list = new ArrayList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list});
+ }
+ }
+
+ static final class SynchronizedSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Set set = new HashSet((Set) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedSet", new Object[]{set});
+ }
+ }
+
+ static final class SynchronizedSortedSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ SortedSet set = new TreeSet((SortedSet) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedSortedSet", new Object[]{set});
+ }
+ }
+
+ static final class SynchronizedMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Map map = new HashMap((Map) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedMap", new Object[]{map});
+ }
+ }
+
+ static final class SynchronizedSortedMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ SortedMap map = new TreeMap((SortedMap) oldInstance);
+ return new Expression(oldInstance, Collections.class, "synchronizedSortedMap", new Object[]{map});
+ }
+ }
+
+ static final class CheckedCollection_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+ List list = new ArrayList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedCollection", new Object[]{list, type});
+ }
+ }
+
+ static final class CheckedList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+ List list = new LinkedList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
+ }
+ }
+
+ static final class CheckedRandomAccessList_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+ List list = new ArrayList((Collection) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
+ }
+ }
+
+ static final class CheckedSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+ Set set = new HashSet((Set) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedSet", new Object[]{set, type});
+ }
+ }
+
+ static final class CheckedSortedSet_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+ SortedSet set = new TreeSet((SortedSet) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedSortedSet", new Object[]{set, type});
+ }
+ }
+
+ static final class CheckedMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object keyType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
+ Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
+ Map map = new HashMap((Map) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedMap", new Object[]{map, keyType, valueType});
+ }
+ }
+
+ static final class CheckedSortedMap_PersistenceDelegate extends java_util_Collections {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Object keyType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
+ Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
+ SortedMap map = new TreeMap((SortedMap) oldInstance);
+ return new Expression(oldInstance, Collections.class, "checkedSortedMap", new Object[]{map, keyType, valueType});
+ }
+ }
+}
+
+/**
+ * The persistence delegate for <CODE>java.util.EnumMap</CODE> classes.
+ *
+ * @author Sergey A. Malenkov
+ */
+class java_util_EnumMap_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return super.mutatesTo(oldInstance, newInstance) && (getType(oldInstance) == getType(newInstance));
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, EnumMap.class, "new", new Object[] {getType(oldInstance)});
+ }
+
+ private static Object getType(Object instance) {
+ return MetaData.getPrivateFieldValue(instance, "java.util.EnumMap.keyType");
+ }
+}
+
+/**
+ * The persistence delegate for <CODE>java.util.EnumSet</CODE> classes.
+ *
+ * @author Sergey A. Malenkov
+ */
+class java_util_EnumSet_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return super.mutatesTo(oldInstance, newInstance) && (getType(oldInstance) == getType(newInstance));
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, EnumSet.class, "noneOf", new Object[] {getType(oldInstance)});
+ }
+
+ private static Object getType(Object instance) {
+ return MetaData.getPrivateFieldValue(instance, "java.util.EnumSet.elementType");
+ }
+}
+
+// Collection
+class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ java.util.Collection oldO = (java.util.Collection)oldInstance;
+ java.util.Collection newO = (java.util.Collection)newInstance;
+
+ if (newO.size() != 0) {
+ invokeStatement(oldInstance, "clear", new Object[]{}, out);
+ }
+ for (Iterator i = oldO.iterator(); i.hasNext();) {
+ invokeStatement(oldInstance, "add", new Object[]{i.next()}, out);
+ }
+ }
+}
+
+// List
+class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ java.util.List oldO = (java.util.List)oldInstance;
+ java.util.List newO = (java.util.List)newInstance;
+ int oldSize = oldO.size();
+ int newSize = (newO == null) ? 0 : newO.size();
+ if (oldSize < newSize) {
+ invokeStatement(oldInstance, "clear", new Object[]{}, out);
+ newSize = 0;
+ }
+ for (int i = 0; i < newSize; i++) {
+ Object index = new Integer(i);
+
+ Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
+ Expression newGetExp = new Expression(newInstance, "get", new Object[]{index});
+ try {
+ Object oldValue = oldGetExp.getValue();
+ Object newValue = newGetExp.getValue();
+ out.writeExpression(oldGetExp);
+ if (!MetaData.equals(newValue, out.get(oldValue))) {
+ invokeStatement(oldInstance, "set", new Object[]{index, oldValue}, out);
+ }
+ }
+ catch (Exception e) {
+ out.getExceptionListener().exceptionThrown(e);
+ }
+ }
+ for (int i = newSize; i < oldSize; i++) {
+ invokeStatement(oldInstance, "add", new Object[]{oldO.get(i)}, out);
+ }
+ }
+}
+
+
+// Map
+class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ // System.out.println("Initializing: " + newInstance);
+ java.util.Map oldMap = (java.util.Map)oldInstance;
+ java.util.Map newMap = (java.util.Map)newInstance;
+ // Remove the new elements.
+ // Do this first otherwise we undo the adding work.
+ if (newMap != null) {
+ for ( Object newKey : newMap.keySet() ) {
+ // PENDING: This "key" is not in the right environment.
+ if (!oldMap.containsKey(newKey)) {
+ invokeStatement(oldInstance, "remove", new Object[]{newKey}, out);
+ }
+ }
+ }
+ // Add the new elements.
+ for ( Object oldKey : oldMap.keySet() ) {
+ Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{oldKey});
+ // Pending: should use newKey.
+ Expression newGetExp = new Expression(newInstance, "get", new Object[]{oldKey});
+ try {
+ Object oldValue = oldGetExp.getValue();
+ Object newValue = newGetExp.getValue();
+ out.writeExpression(oldGetExp);
+ if (!MetaData.equals(newValue, out.get(oldValue))) {
+ invokeStatement(oldInstance, "put", new Object[]{oldKey, oldValue}, out);
+ } else if ((newValue == null) && !newMap.containsKey(oldKey)) {
+ // put oldValue(=null?) if oldKey is absent in newMap
+ invokeStatement(oldInstance, "put", new Object[]{oldKey, oldValue}, out);
+ }
+ }
+ catch (Exception e) {
+ out.getExceptionListener().exceptionThrown(e);
+ }
+ }
+ }
+}
+
+class java_util_AbstractCollection_PersistenceDelegate extends java_util_Collection_PersistenceDelegate {}
+class java_util_AbstractList_PersistenceDelegate extends java_util_List_PersistenceDelegate {}
+class java_util_AbstractMap_PersistenceDelegate extends java_util_Map_PersistenceDelegate {}
+class java_util_Hashtable_PersistenceDelegate extends java_util_Map_PersistenceDelegate {}
+
+
+// Beans
+class java_beans_beancontext_BeanContextSupport_PersistenceDelegate extends java_util_Collection_PersistenceDelegate {}
+
+// AWT
+
+/**
+ * The persistence delegate for {@link Dimension}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because all getters have return types that differ from parameter types
+ * of the constructor {@link Dimension#Dimension(int, int)}.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_Dimension_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Dimension dimension = (Dimension) oldInstance;
+ Object[] args = new Object[] {
+ dimension.width,
+ dimension.height,
+ };
+ return new Expression(dimension, dimension.getClass(), "new", args);
+ }
+}
+
+/**
+ * The persistence delegate for {@link GridBagConstraints}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because this class does not have any properties.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_GridBagConstraints_PersistenceDelegate extends PersistenceDelegate {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ GridBagConstraints gbc = (GridBagConstraints) oldInstance;
+ Object[] args = new Object[] {
+ gbc.gridx,
+ gbc.gridy,
+ gbc.gridwidth,
+ gbc.gridheight,
+ gbc.weightx,
+ gbc.weighty,
+ gbc.anchor,
+ gbc.fill,
+ gbc.insets,
+ gbc.ipadx,
+ gbc.ipady,
+ };
+ return new Expression(gbc, gbc.getClass(), "new", args);
+ }
+}
+
+/**
+ * The persistence delegate for {@link Insets}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because this class does not have any properties.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_Insets_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Insets insets = (Insets) oldInstance;
+ Object[] args = new Object[] {
+ insets.top,
+ insets.left,
+ insets.bottom,
+ insets.right,
+ };
+ return new Expression(insets, insets.getClass(), "new", args);
+ }
+}
+
+/**
+ * The persistence delegate for {@link Point}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because all getters have return types that differ from parameter types
+ * of the constructor {@link Point#Point(int, int)}.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_Point_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Point point = (Point) oldInstance;
+ Object[] args = new Object[] {
+ point.x,
+ point.y,
+ };
+ return new Expression(point, point.getClass(), "new", args);
+ }
+}
+
+/**
+ * The persistence delegate for {@link Rectangle}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because all getters have return types that differ from parameter types
+ * of the constructor {@link Rectangle#Rectangle(int, int, int, int)}.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_Rectangle_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Rectangle rectangle = (Rectangle) oldInstance;
+ Object[] args = new Object[] {
+ rectangle.x,
+ rectangle.y,
+ rectangle.width,
+ rectangle.height,
+ };
+ return new Expression(rectangle, rectangle.getClass(), "new", args);
+ }
+}
+
+/**
+ * The persistence delegate for {@link Font}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because size of the font can be float value.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Font font = (Font) oldInstance;
+
+ int count = 0;
+ String family = null;
+ int style = Font.PLAIN;
+ int size = 12;
+
+ Map basic = font.getAttributes();
+ Map clone = new HashMap(basic.size());
+ for (Object key : basic.keySet()) {
+ Object value = basic.get(key);
+ if (value != null) {
+ clone.put(key, value);
+ }
+ if (key == TextAttribute.FAMILY) {
+ if (value instanceof String) {
+ count++;
+ family = (String) value;
+ }
+ }
+ else if (key == TextAttribute.WEIGHT) {
+ if (TextAttribute.WEIGHT_REGULAR.equals(value)) {
+ count++;
+ } else if (TextAttribute.WEIGHT_BOLD.equals(value)) {
+ count++;
+ style |= Font.BOLD;
+ }
+ }
+ else if (key == TextAttribute.POSTURE) {
+ if (TextAttribute.POSTURE_REGULAR.equals(value)) {
+ count++;
+ } else if (TextAttribute.POSTURE_OBLIQUE.equals(value)) {
+ count++;
+ style |= Font.ITALIC;
+ }
+ } else if (key == TextAttribute.SIZE) {
+ if (value instanceof Number) {
+ Number number = (Number) value;
+ size = number.intValue();
+ if (size == number.floatValue()) {
+ count++;
+ }
+ }
+ }
+ }
+ Class type = font.getClass();
+ if (count == clone.size()) {
+ return new Expression(font, type, "new", new Object[]{family, style, size});
+ }
+ if (type == Font.class) {
+ return new Expression(font, type, "getFont", new Object[]{clone});
+ }
+ return new Expression(font, type, "new", new Object[]{Font.getFont(clone)});
+ }
+}
+
+/**
+ * The persistence delegate for {@link AWTKeyStroke}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because this class have no public constructor.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class java_awt_AWTKeyStroke_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ AWTKeyStroke key = (AWTKeyStroke) oldInstance;
+
+ char ch = key.getKeyChar();
+ int code = key.getKeyCode();
+ int mask = key.getModifiers();
+ boolean onKeyRelease = key.isOnKeyRelease();
+
+ Object[] args = null;
+ if (ch == KeyEvent.CHAR_UNDEFINED) {
+ args = !onKeyRelease
+ ? new Object[]{code, mask}
+ : new Object[]{code, mask, onKeyRelease};
+ } else if (code == KeyEvent.VK_UNDEFINED) {
+ if (!onKeyRelease) {
+ args = (mask == 0)
+ ? new Object[]{ch}
+ : new Object[]{ch, mask};
+ } else if (mask == 0) {
+ args = new Object[]{ch, onKeyRelease};
+ }
+ }
+ if (args == null) {
+ throw new IllegalStateException("Unsupported KeyStroke: " + key);
+ }
+ Class type = key.getClass();
+ String name = type.getName();
+ // get short name of the class
+ int index = name.lastIndexOf('.') + 1;
+ if (index > 0) {
+ name = name.substring(index);
+ }
+ return new Expression( key, type, "get" + name, args );
+ }
+}
+
+class StaticFieldsPersistenceDelegate extends PersistenceDelegate {
+ protected void installFields(Encoder out, Class<?> cls) {
+ Field fields[] = cls.getFields();
+ for(int i = 0; i < fields.length; i++) {
+ Field field = fields[i];
+ // Don't install primitives, their identity will not be preserved
+ // by wrapping.
+ if (Object.class.isAssignableFrom(field.getType())) {
+ out.writeExpression(new Expression(field, "get", new Object[]{null}));
+ }
+ }
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ throw new RuntimeException("Unrecognized instance: " + oldInstance);
+ }
+
+ public void writeObject(Object oldInstance, Encoder out) {
+ if (out.getAttribute(this) == null) {
+ out.setAttribute(this, Boolean.TRUE);
+ installFields(out, oldInstance.getClass());
+ }
+ super.writeObject(oldInstance, out);
+ }
+}
+
+// SystemColor
+class java_awt_SystemColor_PersistenceDelegate extends StaticFieldsPersistenceDelegate {}
+
+// TextAttribute
+class java_awt_font_TextAttribute_PersistenceDelegate extends StaticFieldsPersistenceDelegate {}
+
+// MenuShortcut
+class java_awt_MenuShortcut_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance;
+ return new Expression(oldInstance, m.getClass(), "new",
+ new Object[]{new Integer(m.getKey()), Boolean.valueOf(m.usesShiftModifier())});
+ }
+}
+
+// Component
+class java_awt_Component_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ java.awt.Component c = (java.awt.Component)oldInstance;
+ java.awt.Component c2 = (java.awt.Component)newInstance;
+ // The "background", "foreground" and "font" properties.
+ // The foreground and font properties of Windows change from
+ // null to defined values after the Windows are made visible -
+ // special case them for now.
+ if (!(oldInstance instanceof java.awt.Window)) {
+ String[] fieldNames = new String[]{"background", "foreground", "font"};
+ for(int i = 0; i < fieldNames.length; i++) {
+ String name = fieldNames[i];
+ Object oldValue = ReflectionUtils.getPrivateField(oldInstance, java.awt.Component.class, name, out.getExceptionListener());
+ Object newValue = (newInstance == null) ? null : ReflectionUtils.getPrivateField(newInstance, java.awt.Component.class, name, out.getExceptionListener());
+ if (oldValue != null && !oldValue.equals(newValue)) {
+ invokeStatement(oldInstance, "set" + NameGenerator.capitalize(name), new Object[]{oldValue}, out);
+ }
+ }
+ }
+
+ // Bounds
+ java.awt.Container p = c.getParent();
+ if (p == null || p.getLayout() == null) {
+ // Use the most concise construct.
+ boolean locationCorrect = c.getLocation().equals(c2.getLocation());
+ boolean sizeCorrect = c.getSize().equals(c2.getSize());
+ if (!locationCorrect && !sizeCorrect) {
+ invokeStatement(oldInstance, "setBounds", new Object[]{c.getBounds()}, out);
+ }
+ else if (!locationCorrect) {
+ invokeStatement(oldInstance, "setLocation", new Object[]{c.getLocation()}, out);
+ }
+ else if (!sizeCorrect) {
+ invokeStatement(oldInstance, "setSize", new Object[]{c.getSize()}, out);
+ }
+ }
+ }
+}
+
+// Container
+class java_awt_Container_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ // Ignore the children of a JScrollPane.
+ // Pending(milne) find a better way to do this.
+ if (oldInstance instanceof javax.swing.JScrollPane) {
+ return;
+ }
+ java.awt.Container oldC = (java.awt.Container)oldInstance;
+ java.awt.Component[] oldChildren = oldC.getComponents();
+ java.awt.Container newC = (java.awt.Container)newInstance;
+ java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();
+
+ BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
+ ? ( BorderLayout )oldC.getLayout()
+ : null;
+
+ JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
+ ? (JLayeredPane) oldInstance
+ : null;
+
+ // Pending. Assume all the new children are unaltered.
+ for(int i = newChildren.length; i < oldChildren.length; i++) {
+ Object[] args = ( layout != null )
+ ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
+ : (oldLayeredPane != null)
+ ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
+ : new Object[] {oldChildren[i]};
+
+ invokeStatement(oldInstance, "add", args, out);
+ }
+ }
+}
+
+// Choice
+class java_awt_Choice_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ java.awt.Choice m = (java.awt.Choice)oldInstance;
+ java.awt.Choice n = (java.awt.Choice)newInstance;
+ for (int i = n.getItemCount(); i < m.getItemCount(); i++) {
+ invokeStatement(oldInstance, "add", new Object[]{m.getItem(i)}, out);
+ }
+ }
+}
+
+// Menu
+class java_awt_Menu_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ java.awt.Menu m = (java.awt.Menu)oldInstance;
+ java.awt.Menu n = (java.awt.Menu)newInstance;
+ for (int i = n.getItemCount(); i < m.getItemCount(); i++) {
+ invokeStatement(oldInstance, "add", new Object[]{m.getItem(i)}, out);
+ }
+ }
+}
+
+// MenuBar
+class java_awt_MenuBar_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ java.awt.MenuBar m = (java.awt.MenuBar)oldInstance;
+ java.awt.MenuBar n = (java.awt.MenuBar)newInstance;
+ for (int i = n.getMenuCount(); i < m.getMenuCount(); i++) {
+ invokeStatement(oldInstance, "add", new Object[]{m.getMenu(i)}, out);
+ }
+ }
+}
+
+// List
+class java_awt_List_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ java.awt.List m = (java.awt.List)oldInstance;
+ java.awt.List n = (java.awt.List)newInstance;
+ for (int i = n.getItemCount(); i < m.getItemCount(); i++) {
+ invokeStatement(oldInstance, "add", new Object[]{m.getItem(i)}, out);
+ }
+ }
+}
+
+
+// LayoutManagers
+
+// BorderLayout
+class java_awt_BorderLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance,
+ Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ String[] locations = {"north", "south", "east", "west", "center"};
+ String[] names = {java.awt.BorderLayout.NORTH, java.awt.BorderLayout.SOUTH,
+ java.awt.BorderLayout.EAST, java.awt.BorderLayout.WEST,
+ java.awt.BorderLayout.CENTER};
+ for(int i = 0; i < locations.length; i++) {
+ Object oldC = ReflectionUtils.getPrivateField(oldInstance,
+ java.awt.BorderLayout.class,
+ locations[i],
+ out.getExceptionListener());
+ Object newC = ReflectionUtils.getPrivateField(newInstance,
+ java.awt.BorderLayout.class,
+ locations[i],
+ out.getExceptionListener());
+ // Pending, assume any existing elements are OK.
+ if (oldC != null && newC == null) {
+ invokeStatement(oldInstance, "addLayoutComponent",
+ new Object[]{oldC, names[i]}, out);
+ }
+ }
+ }
+}
+
+// CardLayout
+class java_awt_CardLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance,
+ Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ Hashtable tab = (Hashtable)ReflectionUtils.getPrivateField(oldInstance,
+ java.awt.CardLayout.class,
+ "tab",
+ out.getExceptionListener());
+ if (tab != null) {
+ for(Enumeration e = tab.keys(); e.hasMoreElements();) {
+ Object child = e.nextElement();
+ invokeStatement(oldInstance, "addLayoutComponent",
+ new Object[]{child, (String)tab.get(child)}, out);
+ }
+ }
+ }
+}
+
+// GridBagLayout
+class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance,
+ Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ Hashtable comptable = (Hashtable)ReflectionUtils.getPrivateField(oldInstance,
+ java.awt.GridBagLayout.class,
+ "comptable",
+ out.getExceptionListener());
+ if (comptable != null) {
+ for(Enumeration e = comptable.keys(); e.hasMoreElements();) {
+ Object child = e.nextElement();
+ invokeStatement(oldInstance, "addLayoutComponent",
+ new Object[]{child, comptable.get(child)}, out);
+ }
+ }
+ }
+}
+
+// Swing
+
+// JFrame (If we do this for Window instead of JFrame, the setVisible call
+// will be issued before we have added all the children to the JFrame and
+// will appear blank).
+class javax_swing_JFrame_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ java.awt.Window oldC = (java.awt.Window)oldInstance;
+ java.awt.Window newC = (java.awt.Window)newInstance;
+ boolean oldV = oldC.isVisible();
+ boolean newV = newC.isVisible();
+ if (newV != oldV) {
+ // false means: don't execute this statement at write time.
+ boolean executeStatements = out.executeStatements;
+ out.executeStatements = false;
+ invokeStatement(oldInstance, "setVisible", new Object[]{Boolean.valueOf(oldV)}, out);
+ out.executeStatements = executeStatements;
+ }
+ }
+}
+
+// Models
+
+// DefaultListModel
+class javax_swing_DefaultListModel_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ // Note, the "size" property will be set here.
+ super.initialize(type, oldInstance, newInstance, out);
+ javax.swing.DefaultListModel m = (javax.swing.DefaultListModel)oldInstance;
+ javax.swing.DefaultListModel n = (javax.swing.DefaultListModel)newInstance;
+ for (int i = n.getSize(); i < m.getSize(); i++) {
+ invokeStatement(oldInstance, "add", // Can also use "addElement".
+ new Object[]{m.getElementAt(i)}, out);
+ }
+ }
+}
+
+// DefaultComboBoxModel
+class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ javax.swing.DefaultComboBoxModel m = (javax.swing.DefaultComboBoxModel)oldInstance;
+ for (int i = 0; i < m.getSize(); i++) {
+ invokeStatement(oldInstance, "addElement", new Object[]{m.getElementAt(i)}, out);
+ }
+ }
+}
+
+
+// DefaultMutableTreeNode
+class javax_swing_tree_DefaultMutableTreeNode_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object
+ newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ javax.swing.tree.DefaultMutableTreeNode m =
+ (javax.swing.tree.DefaultMutableTreeNode)oldInstance;
+ javax.swing.tree.DefaultMutableTreeNode n =
+ (javax.swing.tree.DefaultMutableTreeNode)newInstance;
+ for (int i = n.getChildCount(); i < m.getChildCount(); i++) {
+ invokeStatement(oldInstance, "add", new
+ Object[]{m.getChildAt(i)}, out);
+ }
+ }
+}
+
+// ToolTipManager
+class javax_swing_ToolTipManager_PersistenceDelegate extends PersistenceDelegate {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, javax.swing.ToolTipManager.class,
+ "sharedInstance", new Object[]{});
+ }
+}
+
+// JTabbedPane
+class javax_swing_JTabbedPane_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ javax.swing.JTabbedPane p = (javax.swing.JTabbedPane)oldInstance;
+ for (int i = 0; i < p.getTabCount(); i++) {
+ invokeStatement(oldInstance, "addTab",
+ new Object[]{
+ p.getTitleAt(i),
+ p.getIconAt(i),
+ p.getComponentAt(i)}, out);
+ }
+ }
+}
+
+// Box
+class javax_swing_Box_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return super.mutatesTo(oldInstance, newInstance) && getAxis(oldInstance).equals(getAxis(newInstance));
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ return new Expression(oldInstance, oldInstance.getClass(), "new", new Object[] {getAxis(oldInstance)});
+ }
+
+ private Integer getAxis(Object object) {
+ Box box = (Box) object;
+ return (Integer) MetaData.getPrivateFieldValue(box.getLayout(), "javax.swing.BoxLayout.axis");
+ }
+}
+
+// JMenu
+// Note that we do not need to state the initialiser for
+// JMenuItems since the getComponents() method defined in
+// Container will return all of the sub menu items that
+// need to be added to the menu item.
+// Not so for JMenu apparently.
+class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ javax.swing.JMenu m = (javax.swing.JMenu)oldInstance;
+ java.awt.Component[] c = m.getMenuComponents();
+ for (int i = 0; i < c.length; i++) {
+ invokeStatement(oldInstance, "add", new Object[]{c[i]}, out);
+ }
+ }
+}
+
+/**
+ * The persistence delegate for {@link MatteBorder}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because this class does not have writable properties.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class javax_swing_border_MatteBorder_PersistenceDelegate extends PersistenceDelegate {
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ MatteBorder border = (MatteBorder) oldInstance;
+ Insets insets = border.getBorderInsets();
+ Object object = border.getTileIcon();
+ if (object == null) {
+ object = border.getMatteColor();
+ }
+ Object[] args = new Object[] {
+ insets.top,
+ insets.left,
+ insets.bottom,
+ insets.right,
+ object,
+ };
+ return new Expression(border, border.getClass(), "new", args);
+ }
+}
+
+/* XXX - doens't seem to work. Debug later.
+class javax_swing_JMenu_PersistenceDelegate extends DefaultPersistenceDelegate {
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ super.initialize(type, oldInstance, newInstance, out);
+ javax.swing.JMenu m = (javax.swing.JMenu)oldInstance;
+ javax.swing.JMenu n = (javax.swing.JMenu)newInstance;
+ for (int i = n.getItemCount(); i < m.getItemCount(); i++) {
+ invokeStatement(oldInstance, "add", new Object[]{m.getItem(i)}, out);
+ }
+ }
+}
+*/
+
+/**
+ * The persistence delegate for {@link PrintColorUIResource}.
+ * It is impossible to use {@link DefaultPersistenceDelegate}
+ * because this class has special rule for serialization:
+ * it should be converted to {@link ColorUIResource}.
+ *
+ * @see PrintColorUIResource#writeReplace
+ *
+ * @author Sergey A. Malenkov
+ */
+final class sun_swing_PrintColorUIResource_PersistenceDelegate extends PersistenceDelegate {
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ return oldInstance.equals(newInstance);
+ }
+
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Color color = (Color) oldInstance;
+ Object[] args = new Object[] {color.getRGB()};
+ return new Expression(color, ColorUIResource.class, "new", args);
+ }
+}
+
+class MetaData {
+ private static final Map<String,Field> fields = Collections.synchronizedMap(new WeakHashMap<String, Field>());
+ private static Hashtable internalPersistenceDelegates = new Hashtable();
+ private static Hashtable transientProperties = new Hashtable();
+
+ private static PersistenceDelegate nullPersistenceDelegate = new NullPersistenceDelegate();
+ private static PersistenceDelegate enumPersistenceDelegate = new EnumPersistenceDelegate();
+ private static PersistenceDelegate primitivePersistenceDelegate = new PrimitivePersistenceDelegate();
+ private static PersistenceDelegate defaultPersistenceDelegate = new DefaultPersistenceDelegate();
+ private static PersistenceDelegate arrayPersistenceDelegate;
+ private static PersistenceDelegate proxyPersistenceDelegate;
+
+ static {
+
+// Constructors.
+
+ // beans
+
+ registerConstructor("java.beans.Statement", new String[]{"target", "methodName", "arguments"});
+ registerConstructor("java.beans.Expression", new String[]{"target", "methodName", "arguments"});
+ registerConstructor("java.beans.EventHandler", new String[]{"target", "action", "eventPropertyName", "listenerMethodName"});
+
+ // awt
+
+ registerConstructor("java.awt.Color", new String[]{"red", "green", "blue", "alpha"});
+ registerConstructor("java.awt.Cursor", new String[]{"type"});
+ registerConstructor("java.awt.ScrollPane", new String[]{"scrollbarDisplayPolicy"});
+
+ // swing
+
+ registerConstructor("javax.swing.plaf.ColorUIResource", new String[]{"red", "green", "blue"});
+
+ registerConstructor("javax.swing.tree.DefaultTreeModel", new String[]{"root"});
+ registerConstructor("javax.swing.JTree", new String[]{"model"});
+ registerConstructor("javax.swing.tree.TreePath", new String[]{"path"});
+
+ registerConstructor("javax.swing.OverlayLayout", new String[]{"target"});
+ registerConstructor("javax.swing.BoxLayout", new String[]{"target", "axis"});
+ registerConstructor("javax.swing.Box$Filler", new String[]{"minimumSize", "preferredSize",
+ "maximumSize"});
+ registerConstructor("javax.swing.DefaultCellEditor", new String[]{"component"});
+
+ /*
+ This is required because the JSplitPane reveals a private layout class
+ called BasicSplitPaneUI$BasicVerticalLayoutManager which changes with
+ the orientation. To avoid the necessity for instantiating it we cause
+ the orientation attribute to get set before the layout manager - that
+ way the layout manager will be changed as a side effect. Unfortunately,
+ the layout property belongs to the superclass and therefore precedes
+ the orientation property. PENDING - we need to allow this kind of
+ modification. For now, put the property in the constructor.
+ */
+ registerConstructor("javax.swing.JSplitPane", new String[]{"orientation"});
+ // Try to synthesize the ImageIcon from its description.
+ registerConstructor("javax.swing.ImageIcon", new String[]{"description"});
+ // JButton's "text" and "actionCommand" properties are related,
+ // use the text as a constructor argument to ensure that it is set first.
+ // This remove the benign, but unnecessary, manipulation of actionCommand
+ // property in the common case.
+ registerConstructor("javax.swing.JButton", new String[]{"text"});
+
+ // borders
+
+ registerConstructor("javax.swing.border.BevelBorder", new String[]{"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"});
+ registerConstructor("javax.swing.plaf.BorderUIResource$BevelBorderUIResource", new String[]{"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"});
+ registerConstructor("javax.swing.border.CompoundBorder", new String[]{"outsideBorder", "insideBorder"});
+ registerConstructor("javax.swing.plaf.BorderUIResource$CompoundBorderUIResource", new String[]{"outsideBorder", "insideBorder"});
+ registerConstructor("javax.swing.border.EmptyBorder", new String[]{"borderInsets"});
+ registerConstructor("javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new String[]{"borderInsets"});
+ registerConstructor("javax.swing.border.EtchedBorder", new String[]{"etchType", "highlightColor", "shadowColor"});
+ registerConstructor("javax.swing.plaf.BorderUIResource$EtchedBorderUIResource", new String[]{"etchType", "highlightColor", "shadowColor"});
+ registerConstructor("javax.swing.border.LineBorder", new String[]{"lineColor", "thickness", "roundedCorners"});
+ registerConstructor("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new String[]{"lineColor", "thickness"});
+ registerConstructor("javax.swing.border.SoftBevelBorder", new String[]{"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"});
+ // registerConstructorWithBadEqual("javax.swing.plaf.BorderUIResource$SoftBevelBorderUIResource", new String[]{"bevelType", "highlightOuter", "highlightInner", "shadowOuter", "shadowInner"});
+ registerConstructor("javax.swing.border.TitledBorder", new String[]{"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"});
+ registerConstructor("javax.swing.plaf.BorderUIResource$TitledBorderUIResource", new String[]{"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"});
+
+ internalPersistenceDelegates.put("java.net.URI",
+ new PrimitivePersistenceDelegate());
+
+ // it is possible because MatteBorder is assignable from MatteBorderUIResource
+ internalPersistenceDelegates.put("javax.swing.plaf.BorderUIResource$MatteBorderUIResource",
+ new javax_swing_border_MatteBorder_PersistenceDelegate());
+
+ // it is possible because FontUIResource is supported by java_awt_Font_PersistenceDelegate
+ internalPersistenceDelegates.put("javax.swing.plaf.FontUIResource",
+ new java_awt_Font_PersistenceDelegate());
+
+ // it is possible because KeyStroke is supported by java_awt_AWTKeyStroke_PersistenceDelegate
+ internalPersistenceDelegates.put("javax.swing.KeyStroke",
+ new java_awt_AWTKeyStroke_PersistenceDelegate());
+
+ internalPersistenceDelegates.put("java.sql.Date", new java_util_Date_PersistenceDelegate());
+ internalPersistenceDelegates.put("java.sql.Time", new java_util_Date_PersistenceDelegate());
+
+ internalPersistenceDelegates.put("java.util.JumboEnumSet", new java_util_EnumSet_PersistenceDelegate());
+ internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate());
+
+// Transient properties
+
+ // awt
+
+ // Infinite graphs.
+ removeProperty("java.awt.geom.RectangularShape", "frame");
+ // removeProperty("java.awt.Rectangle2D", "frame");
+ // removeProperty("java.awt.Rectangle", "frame");
+
+ removeProperty("java.awt.Rectangle", "bounds");
+ removeProperty("java.awt.Dimension", "size");
+ removeProperty("java.awt.Point", "location");
+
+ // The color and font properties in Component need special treatment, see above.
+ removeProperty("java.awt.Component", "foreground");
+ removeProperty("java.awt.Component", "background");
+ removeProperty("java.awt.Component", "font");
+
+ // The visible property of Component needs special treatment because of Windows.
+ removeProperty("java.awt.Component", "visible");
+
+ // This property throws an exception if accessed when there is no child.
+ removeProperty("java.awt.ScrollPane", "scrollPosition");
+
+ // 4917458 this should be removed for XAWT since it may throw
+ // an unsupported exception if there isn't any input methods.
+ // This shouldn't be a problem since these are added behind
+ // the scenes automatically.
+ removeProperty("java.awt.im.InputContext", "compositionEnabled");
+
+ // swing
+
+ // The size properties in JComponent need special treatment, see above.
+ removeProperty("javax.swing.JComponent", "minimumSize");
+ removeProperty("javax.swing.JComponent", "preferredSize");
+ removeProperty("javax.swing.JComponent", "maximumSize");
+
+ // These properties have platform specific implementations
+ // and should not appear in archives.
+ removeProperty("javax.swing.ImageIcon", "image");
+ removeProperty("javax.swing.ImageIcon", "imageObserver");
+
+ // This property unconditionally throws a "not implemented" exception.
+ removeProperty("javax.swing.JMenuBar", "helpMenu");
+
+ // The scrollBars in a JScrollPane are dynamic and should not
+ // be archived. The row and columns headers are changed by
+ // components like JTable on "addNotify".
+ removeProperty("javax.swing.JScrollPane", "verticalScrollBar");
+ removeProperty("javax.swing.JScrollPane", "horizontalScrollBar");
+ removeProperty("javax.swing.JScrollPane", "rowHeader");
+ removeProperty("javax.swing.JScrollPane", "columnHeader");
+
+ removeProperty("javax.swing.JViewport", "extentSize");
+
+ // Renderers need special treatment, since their properties
+ // change during rendering.
+ removeProperty("javax.swing.table.JTableHeader", "defaultRenderer");
+ removeProperty("javax.swing.JList", "cellRenderer");
+
+ removeProperty("javax.swing.JList", "selectedIndices");
+
+ // The lead and anchor selection indexes are best ignored.
+ // Selection is rarely something that should persist from
+ // development to deployment.
+ removeProperty("javax.swing.DefaultListSelectionModel", "leadSelectionIndex");
+ removeProperty("javax.swing.DefaultListSelectionModel", "anchorSelectionIndex");
+
+ // The selection must come after the text itself.
+ removeProperty("javax.swing.JComboBox", "selectedIndex");
+
+ // All selection information should come after the JTabbedPane is built
+ removeProperty("javax.swing.JTabbedPane", "selectedIndex");
+ removeProperty("javax.swing.JTabbedPane", "selectedComponent");
+
+ // PENDING: The "disabledIcon" property is often computed from the icon property.
+ removeProperty("javax.swing.AbstractButton", "disabledIcon");
+ removeProperty("javax.swing.JLabel", "disabledIcon");
+
+ // The caret property throws errors when it it set beyond
+ // the extent of the text. We could just set it after the
+ // text, but this is probably not something we want to archive anyway.
+ removeProperty("javax.swing.text.JTextComponent", "caret");
+ removeProperty("javax.swing.text.JTextComponent", "caretPosition");
+ // The selectionStart must come after the text itself.
+ removeProperty("javax.swing.text.JTextComponent", "selectionStart");
+ removeProperty("javax.swing.text.JTextComponent", "selectionEnd");
+ }
+
+ /*pp*/ static boolean equals(Object o1, Object o2) {
+ return (o1 == null) ? (o2 == null) : o1.equals(o2);
+ }
+
+ public synchronized static PersistenceDelegate getPersistenceDelegate(Class type) {
+ if (type == null) {
+ return nullPersistenceDelegate;
+ }
+ if (Enum.class.isAssignableFrom(type)) {
+ return enumPersistenceDelegate;
+ }
+ if (ReflectionUtils.isPrimitive(type)) {
+ return primitivePersistenceDelegate;
+ }
+ // The persistence delegate for arrays is non-trivial; instantiate it lazily.
+ if (type.isArray()) {
+ if (arrayPersistenceDelegate == null) {
+ arrayPersistenceDelegate = new ArrayPersistenceDelegate();
+ }
+ return arrayPersistenceDelegate;
+ }
+ // Handle proxies lazily for backward compatibility with 1.2.
+ try {
+ if (java.lang.reflect.Proxy.isProxyClass(type)) {
+ if (proxyPersistenceDelegate == null) {
+ proxyPersistenceDelegate = new ProxyPersistenceDelegate();
+ }
+ return proxyPersistenceDelegate;
+ }
+ }
+ catch(Exception e) {}
+ // else if (type.getDeclaringClass() != null) {
+ // return new DefaultPersistenceDelegate(new String[]{"this$0"});
+ // }
+
+ String typeName = type.getName();
+
+ // Check to see if there are properties that have been lazily registered for removal.
+ if (getBeanAttribute(type, "transient_init") == null) {
+ Vector tp = (Vector)transientProperties.get(typeName);
+ if (tp != null) {
+ for(int i = 0; i < tp.size(); i++) {
+ setPropertyAttribute(type, (String)tp.get(i), "transient", Boolean.TRUE);
+ }
+ }
+ setBeanAttribute(type, "transient_init", Boolean.TRUE);
+ }
+
+ PersistenceDelegate pd = (PersistenceDelegate)getBeanAttribute(type, "persistenceDelegate");
+ if (pd == null) {
+ pd = (PersistenceDelegate)internalPersistenceDelegates.get(typeName);
+ if (pd != null) {
+ return pd;
+ }
+ internalPersistenceDelegates.put(typeName, defaultPersistenceDelegate);
+ try {
+ String name = type.getName();
+ Class c = Class.forName("java.beans." + name.replace('.', '_')
+ + "_PersistenceDelegate");
+ pd = (PersistenceDelegate)c.newInstance();
+ internalPersistenceDelegates.put(typeName, pd);
+ }
+ catch (ClassNotFoundException e) {
+ String[] properties = getConstructorProperties(type);
+ if (properties != null) {
+ pd = new DefaultPersistenceDelegate(properties);
+ internalPersistenceDelegates.put(typeName, pd);
+ }
+ }
+ catch (Exception e) {
+ System.err.println("Internal error: " + e);
+ }
+ }
+
+ return (pd != null) ? pd : defaultPersistenceDelegate;
+ }
+
+ private static String[] getConstructorProperties(Class type) {
+ String[] names = null;
+ int length = 0;
+ for (Constructor<?> constructor : type.getConstructors()) {
+ String[] value = getAnnotationValue(constructor);
+ if ((value != null) && (length < value.length) && isValid(constructor, value)) {
+ names = value;
+ length = value.length;
+ }
+ }
+ return names;
+ }
+
+ private static String[] getAnnotationValue(Constructor<?> constructor) {
+ ConstructorProperties annotation = constructor.getAnnotation(ConstructorProperties.class);
+ return (annotation != null)
+ ? annotation.value()
+ : null;
+ }
+
+ private static boolean isValid(Constructor<?> constructor, String[] names) {
+ Class[] parameters = constructor.getParameterTypes();
+ if (names.length != parameters.length) {
+ return false;
+ }
+ for (String name : names) {
+ if (name == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // Wrapper for Introspector.getBeanInfo to handle exception handling.
+ // Note: this relys on new 1.4 Introspector semantics which cache the BeanInfos
+ public static BeanInfo getBeanInfo(Class type) {
+ BeanInfo info = null;
+ try {
+ info = Introspector.getBeanInfo(type);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ return info;
+ }
+
+ private static PropertyDescriptor getPropertyDescriptor(Class type, String propertyName) {
+ BeanInfo info = getBeanInfo(type);
+ PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
+ // System.out.println("Searching for: " + propertyName + " in " + type);
+ for(int i = 0; i < propertyDescriptors.length; i++) {
+ PropertyDescriptor pd = propertyDescriptors[i];
+ if (propertyName.equals(pd.getName())) {
+ return pd;
+ }
+ }
+ return null;
+ }
+
+ private static void setPropertyAttribute(Class type, String property, String attribute, Object value) {
+ PropertyDescriptor pd = getPropertyDescriptor(type, property);
+ if (pd == null) {
+ System.err.println("Warning: property " + property + " is not defined on " + type);
+ return;
+ }
+ pd.setValue(attribute, value);
+ }
+
+ private static void setBeanAttribute(Class type, String attribute, Object value) {
+ getBeanInfo(type).getBeanDescriptor().setValue(attribute, value);
+ }
+
+ private static Object getBeanAttribute(Class type, String attribute) {
+ return getBeanInfo(type).getBeanDescriptor().getValue(attribute);
+ }
+
+ // MetaData registration
+
+ private synchronized static void registerConstructor(String typeName,
+ String[] constructor) {
+ internalPersistenceDelegates.put(typeName,
+ new DefaultPersistenceDelegate(constructor));
+ }
+
+ private static void removeProperty(String typeName, String property) {
+ Vector tp = (Vector)transientProperties.get(typeName);
+ if (tp == null) {
+ tp = new Vector();
+ transientProperties.put(typeName, tp);
+ }
+ tp.add(property);
+ }
+
+ static Object getPrivateFieldValue(Object instance, String name) {
+ Field field = fields.get(name);
+ if (field == null) {
+ int index = name.lastIndexOf('.');
+ final String className = name.substring(0, index);
+ final String fieldName = name.substring(1 + index);
+ field = AccessController.doPrivileged(new PrivilegedAction<Field>() {
+ public Field run() {
+ try {
+ Field field = Class.forName(className).getDeclaredField(fieldName);
+ field.setAccessible(true);
+ return field;
+ }
+ catch (ClassNotFoundException exception) {
+ throw new IllegalStateException("Could not find class", exception);
+ }
+ catch (NoSuchFieldException exception) {
+ throw new IllegalStateException("Could not find field", exception);
+ }
+ }
+ });
+ fields.put(name, field);
+ }
+ try {
+ return field.get(instance);
+ }
+ catch (IllegalAccessException exception) {
+ throw new IllegalStateException("Could not get value of the field", exception);
+ }
+ }
+}
diff --git a/jdk/src/share/classes/sun/awt/image/codec/JPEGImageDecoderImpl.java b/jdk/src/share/classes/sun/awt/image/codec/JPEGImageDecoderImpl.java
new file mode 100644
index 0000000..77b4619
--- /dev/null
+++ b/jdk/src/share/classes/sun/awt/image/codec/JPEGImageDecoderImpl.java
@@ -0,0 +1,108 @@
+/* JPEGImageDecoderImpl.java -- JPEG decoder implementation
+Copyright (C) 2011 Red Hat
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package sun.awt.image.codec;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+
+import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.plugins.jpeg.JPEGHuffmanTable;
+import javax.imageio.plugins.jpeg.JPEGImageReadParam;
+import javax.imageio.plugins.jpeg.JPEGQTable;
+import javax.imageio.stream.MemoryCacheImageInputStream;
+
+import com.sun.image.codec.jpeg.ImageFormatException;
+import com.sun.image.codec.jpeg.JPEGDecodeParam;
+import com.sun.image.codec.jpeg.JPEGImageDecoder;
+import com.sun.imageio.plugins.jpeg.JPEGImageReader;
+
+/**
+ * This class provides the implementation for a JPEG decoder.
+ */
+public class JPEGImageDecoderImpl implements JPEGImageDecoder {
+ private static final String JPGMime = "image/jpeg";
+
+ private JPEGImageReader JPGReader;
+ private InputStream in;
+ private JPEGDecodeParam param;
+
+ public JPEGImageDecoderImpl(InputStream in) {
+ this(in, null);
+ }
+
+ public JPEGImageDecoderImpl(InputStream in, JPEGDecodeParam param) {
+ this.in = in;
+ setJPEGDecodeParam(param);
+
+ Iterator<ImageReader> JPGReaderIter = ImageIO
+ .getImageReadersByMIMEType(JPGMime);
+ if (JPGReaderIter.hasNext()) {
+ JPGReader = (JPEGImageReader) JPGReaderIter.next();
+ }
+
+ JPGReader.setInput(new MemoryCacheImageInputStream(in));
+ }
+
+ public BufferedImage decodeAsBufferedImage() throws IOException,
+ ImageFormatException {
+ JPEGImageReadParam irp = null;
+
+ if (param != null) {
+ // We should do more than this, but it's a start.
+ JPEGQTable[] qTables = new JPEGQTable[4];
+ JPEGHuffmanTable[] DCHuffmanTables = new JPEGHuffmanTable[4];
+ JPEGHuffmanTable[] ACHuffmanTables = new JPEGHuffmanTable[4];
+
+ for (int i = 0; i < 4; i++) {
+ qTables[i] = new JPEGQTable(param.getQTable(i).getTable());
+ com.sun.image.codec.jpeg.JPEGHuffmanTable dcHuffman = param.getDCHuffmanTable(i);
+ com.sun.image.codec.jpeg.JPEGHuffmanTable acHuffman = param.getACHuffmanTable(i);
+ DCHuffmanTables[i] = new JPEGHuffmanTable(dcHuffman.getLengths(),
+ dcHuffman.getSymbols());
+ ACHuffmanTables[i] = new JPEGHuffmanTable(acHuffman.getLengths(),
+ dcHuffman.getSymbols());
+ }
+
+ irp = new JPEGImageReadParam();
+ irp.setDecodeTables(qTables, DCHuffmanTables, ACHuffmanTables);
+ }
+
+ return JPGReader.read(0, irp);
+ }
+
+ public Raster decodeAsRaster() throws IOException, ImageFormatException {
+ return JPGReader.readRaster(0, null);
+ }
+
+ public InputStream getInputStream() {
+ return in;
+ }
+
+ public JPEGDecodeParam getJPEGDecodeParam() {
+ if (param == null) return null;
+ return (JPEGDecodeParam) param.clone();
+ }
+
+ public void setJPEGDecodeParam(JPEGDecodeParam jdp) {
+ param = jdp;
+ }
+}
diff --git a/jdk/src/share/classes/sun/awt/image/codec/JPEGImageEncoderImpl.java b/jdk/src/share/classes/sun/awt/image/codec/JPEGImageEncoderImpl.java
new file mode 100644
index 0000000..52fa3c5
--- /dev/null
+++ b/jdk/src/share/classes/sun/awt/image/codec/JPEGImageEncoderImpl.java
@@ -0,0 +1,183 @@
+/* JPEGImageEncoder.java -- JPEG encoder implementation
+Copyright (C) 2011 Red Hat
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package sun.awt.image.codec;
+
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
+import javax.imageio.stream.MemoryCacheImageOutputStream;
+
+import com.sun.image.codec.jpeg.ImageFormatException;
+import com.sun.image.codec.jpeg.JPEGCodec;
+import com.sun.image.codec.jpeg.JPEGDecodeParam;
+import com.sun.image.codec.jpeg.JPEGEncodeParam;
+import com.sun.image.codec.jpeg.JPEGImageEncoder;
+import com.sun.imageio.plugins.jpeg.JPEG;
+
+/**
+ * This class provides the implementation for encoding JPEG images.
+ *
+ */
+public class JPEGImageEncoderImpl implements JPEGImageEncoder {
+ private static final String JPGMime = "image/jpeg";
+
+ private ImageWriter JPGWriter;
+ private JPEGEncodeParam param;
+ private OutputStream out;
+
+ public JPEGImageEncoderImpl(OutputStream os) {
+ this(os, null);
+ }
+
+ public JPEGImageEncoderImpl(OutputStream out, JPEGEncodeParam newParam) {
+ this.out = out;
+ setJPEGEncodeParam(newParam);
+
+ Iterator<ImageWriter> JPGWriterIter = ImageIO
+ .getImageWritersByMIMEType(JPGMime);
+ if (JPGWriterIter.hasNext()) {
+ JPGWriter = JPGWriterIter.next();
+ }
+
+ JPGWriter.setOutput(new MemoryCacheImageOutputStream(out));
+ }
+
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
+ throws ImageFormatException {
+ return JPEGCodec.getDefaultJPEGEncodeParam(bi);
+ }
+
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands, int colorID)
+ throws ImageFormatException {
+ return JPEGCodec.getDefaultJPEGEncodeParam(numBands, colorID);
+ }
+
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam d)
+ throws ImageFormatException {
+ return JPEGCodec.getDefaultJPEGEncodeParam(d);
+ }
+
+ public JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras, int colorID)
+ throws ImageFormatException {
+ return JPEGCodec.getDefaultJPEGEncodeParam(ras, colorID);
+ }
+
+ public JPEGEncodeParam getJPEGEncodeParam() throws ImageFormatException {
+ if (param == null)
+ return null;
+ return (JPEGEncodeParam) param.clone();
+ }
+
+ public void setJPEGEncodeParam(JPEGEncodeParam p) {
+ param = p;
+ }
+
+ public OutputStream getOutputStream() {
+ return out;
+ }
+
+ private void encode(IIOImage img) throws IOException, ImageFormatException {
+ if (JPGWriter == null)
+ throw new ImageFormatException(
+ "JPEG writer code not implemented in ImageIO");
+
+ JPEGImageWriteParam jiwp = new JPEGImageWriteParam(null);
+ ;
+ jiwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
+ if (param != null && param instanceof JPEGParam) {
+ JPEGParam jp = (JPEGParam) param;
+ jiwp.setCompressionQuality(jp.getQuality());
+ } else {
+ jiwp.setCompressionQuality(JPEG.DEFAULT_QUALITY);
+ }
+
+ JPGWriter.write(null, img, jiwp);
+ }
+
+ public void encode(BufferedImage bi, JPEGEncodeParam writeParam)
+ throws IOException, ImageFormatException {
+ setJPEGEncodeParam(writeParam);
+ encode(new IIOImage(bi, new ArrayList<BufferedImage>(), null));
+ }
+
+ public void encode(Raster rs, JPEGEncodeParam writeParam)
+ throws IOException, ImageFormatException {
+ setJPEGEncodeParam(writeParam);
+ encode(new IIOImage(rs, new ArrayList<BufferedImage>(), null));
+ }
+
+ public void encode(BufferedImage bi) throws IOException,
+ ImageFormatException {
+ encode(bi, null);
+ }
+
+ public void encode(Raster rs) throws IOException, ImageFormatException {
+ encode(rs, null);
+ }
+
+ @Override
+ public int getDefaultColorId(ColorModel cm) {
+ ColorSpace cs = cm.getColorSpace();
+ int type = cs.getType();
+ int id = -1;
+ switch (type) {
+ case ColorSpace.TYPE_GRAY:
+ id = JPEGEncodeParam.COLOR_ID_GRAY;
+ break;
+
+ case ColorSpace.TYPE_RGB:
+ id = cm.hasAlpha() ? JPEGEncodeParam.COLOR_ID_RGBA
+ : JPEGEncodeParam.COLOR_ID_RGB;
+
+ case ColorSpace.TYPE_YCbCr:
+ try {
+ if (cs == ColorSpace.getInstance(ColorSpace.CS_PYCC)) {
+ id = cm.hasAlpha() ? JPEGEncodeParam.COLOR_ID_PYCCA
+ : JPEGEncodeParam.COLOR_ID_PYCC;
+ }
+ } catch (IllegalArgumentException e) {
+ /* We know it isn't PYCC type, nothing to handle */
+ }
+ if (id == -1) {
+ id = cm.hasAlpha() ? JPEGEncodeParam.COLOR_ID_YCbCrA
+ : JPEGEncodeParam.COLOR_ID_YCbCr;
+ }
+ break;
+
+ case ColorSpace.TYPE_CMYK:
+ id = JPEGEncodeParam.COLOR_ID_CMYK;
+ break;
+
+ default:
+ id = JPEGEncodeParam.COLOR_ID_UNKNOWN;
+ }
+
+ return id;
+ }
+}
diff --git a/jdk/src/share/classes/sun/awt/image/codec/JPEGParam.java b/jdk/src/share/classes/sun/awt/image/codec/JPEGParam.java
new file mode 100644
index 0000000..4436c48
--- /dev/null
+++ b/jdk/src/share/classes/sun/awt/image/codec/JPEGParam.java
@@ -0,0 +1,750 @@
+/* JPEGParam.java -- keeps track of encode and decode parameters for JPEG.
+ * Copyright (C) 2011 Red Hat
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package sun.awt.image.codec;
+
+import java.util.Arrays;
+
+import com.sun.image.codec.jpeg.JPEGDecodeParam;
+import com.sun.image.codec.jpeg.JPEGEncodeParam;
+import com.sun.image.codec.jpeg.JPEGHuffmanTable;
+import com.sun.image.codec.jpeg.JPEGQTable;
+import com.sun.imageio.plugins.jpeg.JPEG;
+
+/**
+ * This class encapsulates the information about encoding and decoding the JPEG
+ * image.
+ *
+ * @author Andrew Su (asu@redhat.com)
+ *
+ */
+public class JPEGParam implements JPEGEncodeParam {
+ /*
+ * NOTE: bands mean the same thing as components, trying to keep it
+ * Consistent with the documentation
+ *
+ * NOTE: subsampling is not done implementing.
+ */
+
+ private float quality = JPEG.DEFAULT_QUALITY;
+ private int colorID = -1;
+ private int width;
+ private int height;
+ private int numBands;
+ private boolean imageInfoValid = false;
+ private boolean tableInfoValid = false;
+ private JPEGQTable[] qTable = new JPEGQTable[NUM_TABLES];
+ private JPEGHuffmanTable[] acHuffmanTable = new JPEGHuffmanTable[NUM_TABLES];
+ private JPEGHuffmanTable[] dcHuffmanTable = new JPEGHuffmanTable[NUM_TABLES];
+
+ private int restartInterval = 0;
+ private int[] horizontalSubsampleComponents;
+ private int[] verticalSubsampleComponents;
+
+ /* [marker between 0xE0 to 0xEF minus 0xE0 to get index][data] */
+ private byte[][][] markers = new byte[16][][];
+ private byte[][] commentMarker = null;
+
+ /* number of components each color id has (color id from JPEGDecodeParam) */
+ private static int[] components = { 0, 1, 3, 3, 4, 3, 4, 4, 4, 4, 4, 4, };
+ private int[] qTableComponentMapping;
+ private int[] acHuffmanComponentMapping;
+ private int[] dcHuffmanComponentMapping;
+
+ /*
+ * Breakdown for marker bytes
+ * 5 for name.
+ * 2 for version.
+ * 1 for density type.
+ * 2 for x density.
+ * 2 for y density.
+ * 2 for thumbnail.
+ */
+ private byte APP0_MARKER_NUM_BYTES = 14;
+
+ public JPEGParam(JPEGEncodeParam param) {
+ this((JPEGDecodeParam) param);
+ }
+
+ public JPEGParam(JPEGDecodeParam param) {
+ this(param.getEncodedColorID(), param.getNumComponents());
+
+ setTableInfoValid(param.isTableInfoValid());
+ setImageInfoValid(param.isImageInfoValid());
+ setRestartInterval(param.getRestartInterval());
+
+ // Copy the Q tables and Huffman tables.
+ for (int i = 0; i < NUM_TABLES; i++) {
+ qTable[i] = param.getQTable(i);
+ acHuffmanTable[i] = param.getACHuffmanTable(i);
+ dcHuffmanTable[i] = param.getDCHuffmanTable(i);
+ }
+
+ // Next we want to copy the component mappings.
+ for (int i = 0; i < getNumComponents(); i++) {
+ setQTableComponentMapping(i, param.getQTableComponentMapping(i));
+ setACHuffmanComponentMapping(i,
+ param.getACHuffmanComponentMapping(i));
+ setDCHuffmanComponentMapping(i,
+ param.getDCHuffmanComponentMapping(i));
+ }
+
+ // Copy all the marker data.
+ for (int i = APP0_MARKER; i < APPF_MARKER; i++) {
+ byte[][] markerData = param.getMarkerData(i);
+ byte[][] copyMarkerData = null;
+ if (markerData != null) {
+ copyMarkerData = new byte[markerData.length][];
+ for (int j = 0; j < markerData.length; j++) {
+ copyMarkerData[j] = Arrays.copyOf(markerData[j],
+ markerData[j].length);
+ }
+ }
+ setMarkerData(i, copyMarkerData);
+ }
+
+ byte[][] commentData = param.getMarkerData(COMMENT_MARKER);
+ byte[][] copyCommentData = null;
+ if (commentData != null) {
+ copyCommentData = new byte[commentData.length][];
+ for (int i = 0; i < commentData.length; i++) {
+ copyCommentData[i] = Arrays.copyOf(commentData[i],
+ commentData[i].length);
+ }
+ setMarkerData(COMMENT_MARKER, copyCommentData);
+ }
+ }
+
+ public JPEGParam(int colorID) {
+ this(colorID, components[colorID]);
+ }
+
+ public JPEGParam(int colorID, int numBands) {
+ // We were given an invalid color id, or the number of bands given to us
+ // did not match requirements.
+ if (colorID < 0
+ || colorID >= JPEGDecodeParam.NUM_COLOR_ID
+ || (colorID != COLOR_ID_UNKNOWN && numBands != components[colorID])) {
+ throw new IllegalArgumentException();
+ }
+ this.colorID = colorID;
+ this.numBands = numBands;
+
+ initialize();
+ }
+
+ private void initialize() {
+
+ qTable[0] = JPEGQTable.StdLuminance;
+ qTable[1] = JPEGQTable.StdChrominance;
+
+ acHuffmanTable[0] = JPEGHuffmanTable.StdACLuminance;
+ acHuffmanTable[1] = JPEGHuffmanTable.StdACChrominance;
+
+ dcHuffmanTable[0] = JPEGHuffmanTable.StdDCLuminance;
+ dcHuffmanTable[1] = JPEGHuffmanTable.StdDCChrominance;
+
+ qTableComponentMapping = new int[getNumComponents()];
+ acHuffmanComponentMapping = new int[getNumComponents()];
+ dcHuffmanComponentMapping = new int[getNumComponents()];
+
+ horizontalSubsampleComponents = new int[getNumComponents()];
+ verticalSubsampleComponents = new int[getNumComponents()];
+
+ /*
+ * we can just set these to true since they are using default values
+ * right now
+ */
+ setTableInfoValid(true);
+ setImageInfoValid(true);
+
+ setMarkerData(APP0_MARKER,
+ arrayAdd(getMarkerData(APP0_MARKER), createAPP0MarkerData()));
+
+ }
+
+ private byte[] createAPP0MarkerData() {
+ byte[] data = null;
+ // Create JFIF APP0 Marker if compatible.
+ // By compatible, it must be one of the following cases.
+ // Reference:
+ // http://www.jpeg.org/public/jfif.pdf
+ // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JFIF.html
+ switch (colorID) {
+ case COLOR_ID_UNKNOWN:
+ case COLOR_ID_GRAY:
+ case COLOR_ID_RGB:
+ case COLOR_ID_YCbCr:
+ case COLOR_ID_CMYK:
+ data = new byte[APP0_MARKER_NUM_BYTES];
+
+ // Null terminated JFIF string. [5 bytes]
+ data[0] = 'J';
+ data[1] = 'F';
+ data[2] = 'I';
+ data[3] = 'F';
+ data[4] = 0x0;
+
+ // Version number [2 bytes]
+ data[5] = 1;
+ data[6] = 2;
+
+ // Density unit [1 byte]
+ data[7] = DENSITY_UNIT_ASPECT_RATIO;
+
+ // X density [2 bytes]
+ data[8] = 0;
+ data[9] = 1;
+
+ // Y density [2 bytes]
+ data[10] = 0;
+ data[11] = 1;
+
+ // Thumbnail [2 bytes]
+ data[12] = 0;
+ data[13] = 0;
+ break;
+ }
+
+ return data;
+ }
+
+ public void setQuality(float quality, boolean forceBaseline) {
+ if (quality < 0.0) {
+ quality = 0.00f;
+ } else if (quality > 1.0) {
+ quality = 1.0f;
+ }
+
+ this.quality = quality; // preserve original.
+
+ /*
+ * Since quality value of 1 is the lowest compression, we want our
+ * QTable to contain as much 1s as possible. Since scaling is by a
+ * factor, we want to invert the selection such that highest quality is
+ * 0 and lowest is 1.
+ */
+ quality = 1 - quality;
+
+ // We will scale our QTables to match the quality value given to us.
+ for (int i = 0; i < NUM_TABLES; i++) {
+ if (qTable[i] != null) {
+ qTable[i] = qTable[i].getScaledInstance(quality, forceBaseline);
+ }
+ }
+ }
+
+ public Object clone() {
+ JPEGParam c = new JPEGParam(this);
+ return c;
+ }
+
+ @Override
+ public int getWidth() {
+ return width;
+ }
+
+ @Override
+ public int getHeight() {
+ return height;
+ }
+
+ @Override
+ public int getHorizontalSubsampling(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ return horizontalSubsampleComponents[component];
+ }
+
+ @Override
+ public int getVerticalSubsampling(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ return verticalSubsampleComponents[component];
+ }
+
+ @Override
+ public JPEGQTable getQTable(int tableNum) {
+ if (tableNum < 0 || tableNum > NUM_TABLES)
+ throw new IllegalArgumentException("tableNum must be [0-"
+ + (NUM_TABLES - 1) + "]");
+ return qTable[tableNum];
+ }
+
+ @Override
+ public JPEGQTable getQTableForComponent(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ return qTable[qTableComponentMapping[component]];
+ }
+
+ @Override
+ public JPEGHuffmanTable getDCHuffmanTable(int tableNum) {
+ if (tableNum < 0 || tableNum > NUM_TABLES)
+ throw new IllegalArgumentException("tableNum must be [0-"
+ + (NUM_TABLES - 1) + "]");
+ return dcHuffmanTable[tableNum];
+ }
+
+ @Override
+ public JPEGHuffmanTable getDCHuffmanTableForComponent(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ return dcHuffmanTable[dcHuffmanComponentMapping[component]];
+ }
+
+ @Override
+ public JPEGHuffmanTable getACHuffmanTable(int tableNum) {
+ if (tableNum < 0 || tableNum > NUM_TABLES)
+ throw new IllegalArgumentException("tableNum must be [0-"
+ + (NUM_TABLES - 1) + "]");
+ return acHuffmanTable[tableNum];
+ }
+
+ @Override
+ public JPEGHuffmanTable getACHuffmanTableForComponent(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ return acHuffmanTable[acHuffmanComponentMapping[component]];
+ }
+
+ @Override
+ public int getDCHuffmanComponentMapping(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+ return dcHuffmanComponentMapping[component];
+ }
+
+ @Override
+ public int getACHuffmanComponentMapping(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+ return acHuffmanComponentMapping[component];
+ }
+
+ @Override
+ public int getQTableComponentMapping(int component) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+ return qTableComponentMapping[component];
+ }
+
+ @Override
+ public boolean isImageInfoValid() {
+ return imageInfoValid;
+ }
+
+ @Override
+ public boolean isTableInfoValid() {
+ return tableInfoValid;
+ }
+
+ @Override
+ public boolean getMarker(int marker) {
+ byte[][] data = null;
+ switch (marker) {
+ case APP0_MARKER:
+ case APP1_MARKER:
+ case APP2_MARKER:
+ case APP3_MARKER:
+ case APP4_MARKER:
+ case APP5_MARKER:
+ case APP6_MARKER:
+ case APP7_MARKER:
+ case APP8_MARKER:
+ case APP9_MARKER:
+ case APPA_MARKER:
+ case APPB_MARKER:
+ case APPC_MARKER:
+ case APPD_MARKER:
+ case APPE_MARKER:
+ case APPF_MARKER:
+ data = markers[marker - APP0_MARKER];
+ break;
+ case COMMENT_MARKER:
+ data = commentMarker;
+ break;
+ default:
+ throw new IllegalArgumentException("Marker provided is invalid");
+ }
+
+ return data != null && data.length > 0;
+ }
+
+ @Override
+ public byte[][] getMarkerData(int marker) {
+ byte[][] data = null;
+
+ switch (marker) {
+ case APP0_MARKER:
+ case APP1_MARKER:
+ case APP2_MARKER:
+ case APP3_MARKER:
+ case APP4_MARKER:
+ case APP5_MARKER:
+ case APP6_MARKER:
+ case APP7_MARKER:
+ case APP8_MARKER:
+ case APP9_MARKER:
+ case APPA_MARKER:
+ case APPB_MARKER:
+ case APPC_MARKER:
+ case APPD_MARKER:
+ case APPE_MARKER:
+ case APPF_MARKER:
+ data = markers[marker - APP0_MARKER];
+ break;
+ case COMMENT_MARKER:
+ // TODO: Add stuff for comment marker
+ break;
+ default:
+ throw new IllegalArgumentException("Marker provided is invalid");
+ }
+ return data;
+ }
+
+ @Override
+ public int getEncodedColorID() {
+ return colorID;
+ }
+
+ @Override
+ public int getNumComponents() {
+ return numBands;
+ }
+
+ @Override
+ public int getRestartInterval() {
+ return restartInterval;
+ }
+
+ @Override
+ public int getDensityUnit() {
+ if (!getMarker(APP0_MARKER))
+ throw new IllegalArgumentException("APP0 Marker not found.");
+ byte[] data = getValidAPP0Marker();
+
+ if (data == null)
+ throw new IllegalArgumentException("No valid APP0 Marker found");
+
+ return data[7];
+ }
+
+ @Override
+ public int getXDensity() {
+ if (!getMarker(APP0_MARKER))
+ throw new IllegalArgumentException("APP0 Marker not found.");
+ byte[] data = getValidAPP0Marker();
+
+ if (data == null)
+ throw new IllegalArgumentException("No valid APP0 Marker found");
+
+ // data[8] is the upper portion of the density value
+ // data[9] is the lower portion of the density value
+ int upper = data[8] << 8; // Shift it so we can merge with lower value.
+ int lower = data[9] & 0xFF; // Keep it in bounds 0 - 256
+ return upper | lower; // Merge
+
+ }
+
+ @Override
+ public int getYDensity() {
+ if (!getMarker(APP0_MARKER))
+ throw new IllegalArgumentException("APP0 Marker not found.");
+ byte[] data = getValidAPP0Marker();
+
+ if (data == null)
+ throw new IllegalArgumentException("No valid APP0 Marker found");
+
+ // data[10] is the upper portion of the density value
+ // data[11] is the lower portion of the density value
+ int upper = data[10] << 8; // Shift it so we can merge with lower value.
+ int lower = data[11] & 0xFF;// Keep it in bounds 0 - 256
+ return upper | lower; // merge
+ }
+
+ @Override
+ public void setHorizontalSubsampling(int component, int subsample) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ horizontalSubsampleComponents[component] = subsample;
+ }
+
+ @Override
+ public void setVerticalSubsampling(int component, int subsample) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component");
+ }
+
+ verticalSubsampleComponents[component] = subsample;
+ }
+
+ @Override
+ public void setQTable(int tableNum, JPEGQTable qTable) {
+ if (tableNum < 0 || tableNum > NUM_TABLES)
+ throw new IllegalArgumentException("tableNum must be [0-"
+ + (NUM_TABLES - 1) + "]");
+
+ this.qTable[tableNum] = qTable;
+ }
+
+ @Override
+ public void setDCHuffmanTable(int tableNum, JPEGHuffmanTable huffTable) {
+ if (tableNum < 0 || tableNum > NUM_TABLES)
+ throw new IllegalArgumentException("tableNum must be [0-"
+ + (NUM_TABLES - 1) + "]");
+
+ dcHuffmanTable[tableNum] = huffTable;
+ }
+
+ @Override
+ public void setACHuffmanTable(int tableNum, JPEGHuffmanTable huffTable) {
+ if (tableNum < 0 || tableNum > NUM_TABLES)
+ throw new IllegalArgumentException("tableNum must be [0-"
+ + (NUM_TABLES - 1) + "]");
+ acHuffmanTable[tableNum] = huffTable;
+ }
+
+ @Override
+ public void setACHuffmanComponentMapping(int component, int table) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component specified.");
+ } else if (table < 0 || table > NUM_TABLES) {
+ throw new IllegalArgumentException("Invalid table specified");
+ }
+
+ acHuffmanComponentMapping[component] = table;
+ }
+
+ @Override
+ public void setDCHuffmanComponentMapping(int component, int table) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component specified.");
+ } else if (table < 0 || table > NUM_TABLES) {
+ throw new IllegalArgumentException("Invalid table specified");
+ }
+
+ dcHuffmanComponentMapping[component] = table;
+ }
+
+ @Override
+ public void setQTableComponentMapping(int component, int table) {
+ if (component < 0 || component > getNumComponents()) {
+ throw new IllegalArgumentException("Invalid component specified.");
+ } else if (table < 0 || table > NUM_TABLES) {
+ throw new IllegalArgumentException("Invalid table specified");
+ }
+
+ qTableComponentMapping[component] = table;
+ }
+
+ @Override
+ public void setImageInfoValid(boolean flag) {
+ imageInfoValid = flag;
+ }
+
+ @Override
+ public void setTableInfoValid(boolean flag) {
+ tableInfoValid = flag;
+ }
+
+ @Override
+ public void setMarkerData(int marker, byte[][] data) {
+ if (data == null) {
+ return;
+ }
+
+ switch (marker) {
+ case APP0_MARKER:
+ case APP1_MARKER:
+ case APP2_MARKER:
+ case APP3_MARKER:
+ case APP4_MARKER:
+ case APP5_MARKER:
+ case APP6_MARKER:
+ case APP7_MARKER:
+ case APP8_MARKER:
+ case APP9_MARKER:
+ case APPA_MARKER:
+ case APPB_MARKER:
+ case APPC_MARKER:
+ case APPD_MARKER:
+ case APPE_MARKER:
+ case APPF_MARKER:
+ markers[marker - APP0_MARKER] = data;
+ break;
+ case COMMENT_MARKER:
+ commentMarker = data;
+ break;
+ default:
+ throw new IllegalArgumentException("Marker provided is invalid");
+ }
+ }
+
+ @Override
+ public void addMarkerData(int marker, byte[] data) {
+ if (data == null) {
+ return;
+ }
+ switch (marker) {
+ case APP0_MARKER:
+ case APP1_MARKER:
+ case APP2_MARKER:
+ case APP3_MARKER:
+ case APP4_MARKER:
+ case APP5_MARKER:
+ case APP6_MARKER:
+ case APP7_MARKER:
+ case APP8_MARKER:
+ case APP9_MARKER:
+ case APPA_MARKER:
+ case APPB_MARKER:
+ case APPC_MARKER:
+ case APPD_MARKER:
+ case APPE_MARKER:
+ case APPF_MARKER:
+ markers[marker - APP0_MARKER] = arrayAdd(markers[marker
+ - APP0_MARKER], data);
+ break;
+ case COMMENT_MARKER:
+ commentMarker = arrayAdd(commentMarker, data);
+ break;
+ default:
+ throw new IllegalArgumentException("Marker provided is invalid");
+ }
+ }
+
+ @Override
+ public void setRestartInterval(int restartInterval) {
+ this.restartInterval = restartInterval;
+ }
+
+ @Override
+ public void setDensityUnit(int unit) {
+ if (unit < 0 || unit > NUM_DENSITY_UNIT) {
+ throw new IllegalArgumentException("Invalid density unit.");
+ }
+
+ byte[] data = getValidAPP0Marker();
+ if (data == null) { // We will create one now.
+ data = createAPP0MarkerData();
+ // markers[0] = array of APP0_MARKER
+ markers[0] = arrayAdd(markers[0], data);
+ }
+
+ data[7] = (byte) unit;
+ }
+
+ @Override
+ public void setXDensity(int density) {
+ byte[] data = getValidAPP0Marker();
+ if (data == null) { // We will create one now.
+ data = createAPP0MarkerData();
+ // markers[0] = array of APP0_MARKER
+ markers[0] = arrayAdd(markers[0], data);
+ }
+
+ byte upper = (byte) (density >>> 8 & 0xFF); // unsigned shift to keep it
+ // positive
+ byte lower = (byte) (density & 0xFF);
+ data[8] = upper;
+ data[9] = lower;
+ }
+
+ @Override
+ public void setYDensity(int density) {
+ byte[] data = getValidAPP0Marker();
+ if (data == null) { // We will create one now.
+ data = createAPP0MarkerData();
+ // markers[0] = array of APP0_MARKER
+ markers[0] = arrayAdd(markers[0], data);
+ }
+
+ byte upper = (byte) (density >>> 8 & 0xFF); // unsigned shift to keep it
+ // positive
+ byte lower = (byte) (density & 0xFF);
+ data[10] = upper;
+ data[11] = lower;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ /**
+ * get the quality value.
+ *
+ * @return currently set quality value.
+ */
+ public float getQuality() {
+ return quality;
+ }
+
+ /**
+ * Appends new data to original array
+ *
+ * @param origArr
+ * @param newArr
+ * @return
+ */
+ private byte[][] arrayAdd(byte[][] origArr, byte[] newArr) {
+ byte[][] newData;
+ if (origArr != null) {
+ newData = Arrays.copyOf(origArr, origArr.length + 1);
+ newData[origArr.length] = Arrays.copyOf(newArr, newArr.length);
+ } else {
+ newData = new byte[1][];
+ newData[0] = Arrays.copyOf(newArr, newArr.length);
+ }
+
+ return newData;
+ }
+
+ private byte[] getValidAPP0Marker() {
+ byte[][] app0Markers = getMarkerData(APP0_MARKER);
+ for (int i = 0; i < app0Markers.length; i++) {
+ byte[] data = app0Markers[i];
+ if (data[0] == 'J' && data[1] == 'F' && data[2] == 'I'
+ && data[3] == 'F' && data[4] == 0x0) {
+ if (data[5] <= 1) { // version is 1 or below.
+ // We have a valid JFIF header.
+ return data;
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png
new file mode 100644
index 0000000..98dcd0f
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png
new file mode 100644
index 0000000..5e5acae
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png
new file mode 100644
index 0000000..9d92b96
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png
new file mode 100644
index 0000000..9615364
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png
new file mode 100644
index 0000000..f543f65
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png
new file mode 100644
index 0000000..753a2ad
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png
new file mode 100644
index 0000000..9ea41d4
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png
new file mode 100644
index 0000000..b619966
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png
new file mode 100644
index 0000000..8dd91a9
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png
new file mode 100644
index 0000000..0a3205f
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png
new file mode 100644
index 0000000..6e17867
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png differ
diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png
new file mode 100644
index 0000000..fcbfd7f
Binary files /dev/null and b/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png differ
diff --git a/jdk/src/windows/native/sun/windows/security_warning.ico b/jdk/src/windows/native/sun/windows/security_warning.ico
new file mode 100644
index 0000000..67793ed
Binary files /dev/null and b/jdk/src/windows/native/sun/windows/security_warning.ico differ
diff --git a/jdk/src/windows/native/sun/windows/security_warning_bw.ico b/jdk/src/windows/native/sun/windows/security_warning_bw.ico
new file mode 100644
index 0000000..68a1824
Binary files /dev/null and b/jdk/src/windows/native/sun/windows/security_warning_bw.ico differ
diff --git a/jdk/src/windows/native/sun/windows/security_warning_int.ico b/jdk/src/windows/native/sun/windows/security_warning_int.ico
new file mode 100644
index 0000000..d773dca
Binary files /dev/null and b/jdk/src/windows/native/sun/windows/security_warning_int.ico differ
diff --git a/jdk/test/closed/sun/security/rsa/keystore.bad b/jdk/test/closed/sun/security/rsa/keystore.bad
new file mode 100644
index 0000000..4fc2f74
Binary files /dev/null and b/jdk/test/closed/sun/security/rsa/keystore.bad differ
diff --git a/jdk/test/closed/sun/security/rsa/keystore.good b/jdk/test/closed/sun/security/rsa/keystore.good
new file mode 100644
index 0000000..c1d3d64
Binary files /dev/null and b/jdk/test/closed/sun/security/rsa/keystore.good differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/x00n0g01.png b/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/x00n0g01.png
new file mode 100644
index 0000000..db3a5fd
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/x00n0g01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/xcrn0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/xcrn0g04.png
new file mode 100644
index 0000000..5bce9f3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/xcrn0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/xlfn0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/xlfn0g04.png
new file mode 100644
index 0000000..1fd104b
--- /dev/null
+++ b/jdk/test/javax/imageio/plugins/png/PngReader/broken_images/xlfn0g04.png
@@ -0,0 +1,13 @@
+�PNG
+
+
+
+
+
+IHDR ���)�IDATx�]��
+�0 P*@��#�
+
+#T��10lPF`ؠF=���IQ�*��u�`%qk�
+H�񚈩�m����ߟ э=,�f�OK
+
+���t��(������F ;�P����{xp�]9�/p�*$(�*�y�Ճ�������@�C�  c�q��N�U#�)11�.��r��f�0���gh(��t���E���kIEND�B`�
\ No newline at end of file
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g01.png
new file mode 100644
index 0000000..556fa72
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g02.png
new file mode 100644
index 0000000..ce09821
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g04.png
new file mode 100644
index 0000000..3853273
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g08.png
new file mode 100644
index 0000000..faed8be
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g16.png
new file mode 100644
index 0000000..a9f2816
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi2c08.png
new file mode 100644
index 0000000..2aab44d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi2c16.png
new file mode 100644
index 0000000..cd7e50f
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p01.png
new file mode 100644
index 0000000..00a7cea
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p02.png
new file mode 100644
index 0000000..bb16b44
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p04.png
new file mode 100644
index 0000000..b4e888e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p08.png
new file mode 100644
index 0000000..50a6d1c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi4a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi4a08.png
new file mode 100644
index 0000000..398132b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi4a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi4a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi4a16.png
new file mode 100644
index 0000000..51192e7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi4a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi6a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi6a08.png
new file mode 100644
index 0000000..aecb32e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi6a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi6a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi6a16.png
new file mode 100644
index 0000000..4181533
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basi6a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g01.png
new file mode 100644
index 0000000..1d72242
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g02.png
new file mode 100644
index 0000000..5083324
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g04.png
new file mode 100644
index 0000000..0bf3687
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g08.png
new file mode 100644
index 0000000..23c8237
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g16.png
new file mode 100644
index 0000000..e7c82f7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn2c08.png
new file mode 100644
index 0000000..db5ad15
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn2c16.png
new file mode 100644
index 0000000..50c1cb9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p01.png
new file mode 100644
index 0000000..b145c2b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p02.png
new file mode 100644
index 0000000..8985b3d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p04.png
new file mode 100644
index 0000000..0fbf9e8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p08.png
new file mode 100644
index 0000000..0ddad07
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn4a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn4a08.png
new file mode 100644
index 0000000..3e13052
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn4a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn4a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn4a16.png
new file mode 100644
index 0000000..8243644
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn4a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn6a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn6a08.png
new file mode 100644
index 0000000..e608738
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn6a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn6a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn6a16.png
new file mode 100644
index 0000000..984a995
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/basn6a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgai4a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgai4a08.png
new file mode 100644
index 0000000..398132b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgai4a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgai4a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgai4a16.png
new file mode 100644
index 0000000..51192e7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgai4a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgan6a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgan6a08.png
new file mode 100644
index 0000000..e608738
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgan6a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgan6a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgan6a16.png
new file mode 100644
index 0000000..984a995
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgan6a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgbn4a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgbn4a08.png
new file mode 100644
index 0000000..7cbefc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgbn4a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bggn4a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bggn4a16.png
new file mode 100644
index 0000000..13fd85b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bggn4a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgwn6a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgwn6a08.png
new file mode 100644
index 0000000..a67ff20
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgwn6a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgyn6a16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgyn6a16.png
new file mode 100644
index 0000000..ae3e9be
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/bgyn6a16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ccwn2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ccwn2c08.png
new file mode 100644
index 0000000..47c2481
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ccwn2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ccwn3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ccwn3p08.png
new file mode 100644
index 0000000..8bb2c10
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ccwn3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdfn2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdfn2c08.png
new file mode 100644
index 0000000..559e526
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdfn2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdhn2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdhn2c08.png
new file mode 100644
index 0000000..3e07e8e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdhn2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdsn2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdsn2c08.png
new file mode 100644
index 0000000..076c32c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdsn2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdun2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdun2c08.png
new file mode 100644
index 0000000..846033b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cdun2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ch1n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ch1n3p04.png
new file mode 100644
index 0000000..17cd12d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ch1n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ch2n3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ch2n3p08.png
new file mode 100644
index 0000000..25c1798
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ch2n3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm0n0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm0n0g04.png
new file mode 100644
index 0000000..9fba5db
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm0n0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm7n0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm7n0g04.png
new file mode 100644
index 0000000..f7dc46e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm7n0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm9n0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm9n0g04.png
new file mode 100644
index 0000000..dd70911
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cm9n0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs3n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs3n2c16.png
new file mode 100644
index 0000000..bf5fd20
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs3n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs3n3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs3n3p08.png
new file mode 100644
index 0000000..f4a6623
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs3n3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs5n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs5n2c08.png
new file mode 100644
index 0000000..40f947c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs5n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs5n3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs5n3p08.png
new file mode 100644
index 0000000..dfd6e6e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs5n3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs8n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs8n2c08.png
new file mode 100644
index 0000000..8e01d32
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs8n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs8n3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs8n3p08.png
new file mode 100644
index 0000000..a44066e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/cs8n3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ct0n0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ct0n0g04.png
new file mode 100644
index 0000000..40d1e06
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ct0n0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ct1n0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ct1n0g04.png
new file mode 100644
index 0000000..3ba110a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ct1n0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ctzn0g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ctzn0g04.png
new file mode 100644
index 0000000..b4401c9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ctzn0g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f00n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f00n0g08.png
new file mode 100644
index 0000000..45a0075
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f00n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f00n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f00n2c08.png
new file mode 100644
index 0000000..d6a1fff
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f00n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f01n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f01n0g08.png
new file mode 100644
index 0000000..4a1107b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f01n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f01n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f01n2c08.png
new file mode 100644
index 0000000..26fee95
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f01n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f02n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f02n0g08.png
new file mode 100644
index 0000000..bfe410c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f02n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f02n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f02n2c08.png
new file mode 100644
index 0000000..e590f12
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f02n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f03n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f03n0g08.png
new file mode 100644
index 0000000..ed01e29
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f03n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f03n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f03n2c08.png
new file mode 100644
index 0000000..7581150
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f03n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f04n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f04n0g08.png
new file mode 100644
index 0000000..663fdae
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f04n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f04n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f04n2c08.png
new file mode 100644
index 0000000..3c8b511
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/f04n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n0g16.png
new file mode 100644
index 0000000..41083ca
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n2c08.png
new file mode 100644
index 0000000..a9354db
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n3p04.png
new file mode 100644
index 0000000..60396c9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g03n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n0g16.png
new file mode 100644
index 0000000..32395b7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n2c08.png
new file mode 100644
index 0000000..a652b0c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n3p04.png
new file mode 100644
index 0000000..5661cc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g04n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n0g16.png
new file mode 100644
index 0000000..70b37f0
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n2c08.png
new file mode 100644
index 0000000..932c136
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n3p04.png
new file mode 100644
index 0000000..9619930
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g05n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n0g16.png
new file mode 100644
index 0000000..d6a47c2
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n2c08.png
new file mode 100644
index 0000000..5973464
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n3p04.png
new file mode 100644
index 0000000..c73fb61
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g07n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n0g16.png
new file mode 100644
index 0000000..85f2c95
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n2c08.png
new file mode 100644
index 0000000..b303997
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n3p04.png
new file mode 100644
index 0000000..1b6a6be
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g10n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n0g16.png
new file mode 100644
index 0000000..a9f6787
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n2c08.png
new file mode 100644
index 0000000..03f505a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n3p04.png
new file mode 100644
index 0000000..4f943c6
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/g25n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi1n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi1n0g16.png
new file mode 100644
index 0000000..e7c82f7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi1n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi1n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi1n2c16.png
new file mode 100644
index 0000000..50c1cb9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi1n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi2n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi2n0g16.png
new file mode 100644
index 0000000..14d64c5
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi2n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi2n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi2n2c16.png
new file mode 100644
index 0000000..4c2e3e3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi2n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi4n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi4n0g16.png
new file mode 100644
index 0000000..69e73ed
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi4n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi4n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi4n2c16.png
new file mode 100644
index 0000000..93691e3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi4n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi9n0g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi9n0g16.png
new file mode 100644
index 0000000..9248413
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi9n0g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi9n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi9n2c16.png
new file mode 100644
index 0000000..f0512e4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/oi9n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pngsuite_logo.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pngsuite_logo.png
new file mode 100644
index 0000000..205460d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pngsuite_logo.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pp0n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pp0n2c16.png
new file mode 100644
index 0000000..8f2aad7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pp0n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pp0n6a08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pp0n6a08.png
new file mode 100644
index 0000000..4ed7a30
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/pp0n6a08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps1n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps1n0g08.png
new file mode 100644
index 0000000..2053df2
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps1n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps1n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps1n2c16.png
new file mode 100644
index 0000000..b03ecfc
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps1n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps2n0g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps2n0g08.png
new file mode 100644
index 0000000..beeab8f
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps2n0g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps2n2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps2n2c16.png
new file mode 100644
index 0000000..c256f90
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/ps2n2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s01i3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s01i3p01.png
new file mode 100644
index 0000000..6c0fad1
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s01i3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s01n3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s01n3p01.png
new file mode 100644
index 0000000..cb2c8c7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s01n3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s02i3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s02i3p01.png
new file mode 100644
index 0000000..2defaed
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s02i3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s02n3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s02n3p01.png
new file mode 100644
index 0000000..2b1b669
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s02n3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s03i3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s03i3p01.png
new file mode 100644
index 0000000..c23fdc4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s03i3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s03n3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s03n3p01.png
new file mode 100644
index 0000000..6d96ee4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s03n3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s04i3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s04i3p01.png
new file mode 100644
index 0000000..0e710c2
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s04i3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s04n3p01.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s04n3p01.png
new file mode 100644
index 0000000..956396c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s04n3p01.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s05i3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s05i3p02.png
new file mode 100644
index 0000000..d14cbd3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s05i3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s05n3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s05n3p02.png
new file mode 100644
index 0000000..bf940f0
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s05n3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s06i3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s06i3p02.png
new file mode 100644
index 0000000..456ada3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s06i3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s06n3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s06n3p02.png
new file mode 100644
index 0000000..501064d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s06n3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s07i3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s07i3p02.png
new file mode 100644
index 0000000..44b66ba
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s07i3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s07n3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s07n3p02.png
new file mode 100644
index 0000000..6a58259
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s07n3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s08i3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s08i3p02.png
new file mode 100644
index 0000000..acf74f3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s08i3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s08n3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s08n3p02.png
new file mode 100644
index 0000000..b7094e1
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s08n3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s09i3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s09i3p02.png
new file mode 100644
index 0000000..0bfae8e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s09i3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s09n3p02.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s09n3p02.png
new file mode 100644
index 0000000..711ab82
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s09n3p02.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s32i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s32i3p04.png
new file mode 100644
index 0000000..0841910
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s32i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s32n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s32n3p04.png
new file mode 100644
index 0000000..fa58e3e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s32n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s33i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s33i3p04.png
new file mode 100644
index 0000000..ab0dc14
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s33i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s33n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s33n3p04.png
new file mode 100644
index 0000000..764f1a3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s33n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s34i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s34i3p04.png
new file mode 100644
index 0000000..bd99039
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s34i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s34n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s34n3p04.png
new file mode 100644
index 0000000..9cbc68b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s34n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s35i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s35i3p04.png
new file mode 100644
index 0000000..e2a5e0a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s35i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s35n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s35n3p04.png
new file mode 100644
index 0000000..90b892e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s35n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s36i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s36i3p04.png
new file mode 100644
index 0000000..eb61b6f
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s36i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s36n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s36n3p04.png
new file mode 100644
index 0000000..b38d179
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s36n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s37i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s37i3p04.png
new file mode 100644
index 0000000..6e2b1e9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s37i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s37n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s37n3p04.png
new file mode 100644
index 0000000..4d3054d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s37n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s38i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s38i3p04.png
new file mode 100644
index 0000000..a0a8a14
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s38i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s38n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s38n3p04.png
new file mode 100644
index 0000000..1233ed0
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s38n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s39i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s39i3p04.png
new file mode 100644
index 0000000..04fee93
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s39i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s39n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s39n3p04.png
new file mode 100644
index 0000000..c750100
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s39n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s40i3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s40i3p04.png
new file mode 100644
index 0000000..68f358b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s40i3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s40n3p04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s40n3p04.png
new file mode 100644
index 0000000..864b6b9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/s40n3p04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn1g04.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn1g04.png
new file mode 100644
index 0000000..fc80020
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn1g04.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn2c16.png
new file mode 100644
index 0000000..5abfbbb
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn3p08.png
new file mode 100644
index 0000000..4210d16
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbbn3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbgn2c16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbgn2c16.png
new file mode 100644
index 0000000..236c81d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbgn2c16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbgn3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbgn3p08.png
new file mode 100644
index 0000000..42db232
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbgn3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbrn2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbrn2c08.png
new file mode 100644
index 0000000..8c21474
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbrn2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbwn1g16.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbwn1g16.png
new file mode 100644
index 0000000..dba2cbb
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbwn1g16.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbwn3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbwn3p08.png
new file mode 100644
index 0000000..7922135
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbwn3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbyn3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbyn3p08.png
new file mode 100644
index 0000000..5b2c6cb
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tbyn3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n1g08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n1g08.png
new file mode 100644
index 0000000..caad31d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n1g08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n2c08.png
new file mode 100644
index 0000000..f26be44
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n3p08.png
new file mode 100644
index 0000000..4d6cf9e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp0n3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp1n3p08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp1n3p08.png
new file mode 100644
index 0000000..6c5fd6e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/tp1n3p08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z00n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z00n2c08.png
new file mode 100644
index 0000000..7669eb8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z00n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z03n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z03n2c08.png
new file mode 100644
index 0000000..bfb10de
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z03n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z06n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z06n2c08.png
new file mode 100644
index 0000000..b90ebc1
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z06n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z09n2c08.png b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z09n2c08.png
new file mode 100644
index 0000000..5f191a7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/good_images/z09n2c08.png differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g01.pam
new file mode 100644
index 0000000..ebd5030
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g02.pam
new file mode 100644
index 0000000..a5e8756
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g04.pam
new file mode 100644
index 0000000..fd7444e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g08.pam
new file mode 100644
index 0000000..d237cf8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g16.pam
new file mode 100644
index 0000000..d2ae4ce
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi2c08.pam
new file mode 100644
index 0000000..1e4e623
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p01.pam
new file mode 100644
index 0000000..ba04297
--- /dev/null
+++ b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p01.pam
@@ -0,0 +1,7 @@
+P7
+WIDTH 32
+HEIGHT 32
+DEPTH 4
+MAXVAL 255
+ENDHDR
+��"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"���"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"���"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"���"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�
\ No newline at end of file
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p02.pam
new file mode 100644
index 0000000..9beeff3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p04.pam
new file mode 100644
index 0000000..8d72fc8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p08.pam
new file mode 100644
index 0000000..c47d4d4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi4a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi4a08.pam
new file mode 100644
index 0000000..4a4c708
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi4a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi4a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi4a16.pam
new file mode 100644
index 0000000..f8537ea
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi4a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi6a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi6a08.pam
new file mode 100644
index 0000000..2739287
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi6a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi6a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi6a16.pam
new file mode 100644
index 0000000..1db6bc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basi6a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g01.pam
new file mode 100644
index 0000000..ebd5030
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g02.pam
new file mode 100644
index 0000000..a5e8756
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g04.pam
new file mode 100644
index 0000000..fd7444e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g08.pam
new file mode 100644
index 0000000..d237cf8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g16.pam
new file mode 100644
index 0000000..d2ae4ce
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn2c08.pam
new file mode 100644
index 0000000..1e4e623
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p01.pam
new file mode 100644
index 0000000..ba04297
--- /dev/null
+++ b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p01.pam
@@ -0,0 +1,7 @@
+P7
+WIDTH 32
+HEIGHT 32
+DEPTH 4
+MAXVAL 255
+ENDHDR
+��"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"���"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"���"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"���"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f��"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�"f��"f��"f��"f����"���"���"���"�
\ No newline at end of file
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p02.pam
new file mode 100644
index 0000000..9beeff3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p04.pam
new file mode 100644
index 0000000..8d72fc8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p08.pam
new file mode 100644
index 0000000..c47d4d4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn4a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn4a08.pam
new file mode 100644
index 0000000..4a4c708
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn4a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn4a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn4a16.pam
new file mode 100644
index 0000000..f8537ea
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn4a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn6a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn6a08.pam
new file mode 100644
index 0000000..2739287
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn6a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn6a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn6a16.pam
new file mode 100644
index 0000000..1db6bc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/basn6a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgai4a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgai4a08.pam
new file mode 100644
index 0000000..4a4c708
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgai4a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgai4a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgai4a16.pam
new file mode 100644
index 0000000..f8537ea
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgai4a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgan6a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgan6a08.pam
new file mode 100644
index 0000000..2739287
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgan6a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgan6a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgan6a16.pam
new file mode 100644
index 0000000..1db6bc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgan6a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgbn4a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgbn4a08.pam
new file mode 100644
index 0000000..4a4c708
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgbn4a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bggn4a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bggn4a16.pam
new file mode 100644
index 0000000..f8537ea
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bggn4a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgwn6a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgwn6a08.pam
new file mode 100644
index 0000000..2739287
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgwn6a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgyn6a16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgyn6a16.pam
new file mode 100644
index 0000000..1db6bc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/bgyn6a16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ccwn2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ccwn2c08.pam
new file mode 100644
index 0000000..cab2027
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ccwn2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ccwn3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ccwn3p08.pam
new file mode 100644
index 0000000..4dab77e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ccwn3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdfn2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdfn2c08.pam
new file mode 100644
index 0000000..9f3ba90
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdfn2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdhn2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdhn2c08.pam
new file mode 100644
index 0000000..9766322
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdhn2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdsn2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdsn2c08.pam
new file mode 100644
index 0000000..61d6ee2
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdsn2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdun2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdun2c08.pam
new file mode 100644
index 0000000..c486b9d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cdun2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ch1n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ch1n3p04.pam
new file mode 100644
index 0000000..8d72fc8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ch1n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ch2n3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ch2n3p08.pam
new file mode 100644
index 0000000..c47d4d4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ch2n3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm0n0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm0n0g04.pam
new file mode 100644
index 0000000..1a7de85
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm0n0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm7n0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm7n0g04.pam
new file mode 100644
index 0000000..1a7de85
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm7n0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm9n0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm9n0g04.pam
new file mode 100644
index 0000000..1a7de85
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cm9n0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs3n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs3n2c16.pam
new file mode 100644
index 0000000..2cc29e8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs3n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs3n3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs3n3p08.pam
new file mode 100644
index 0000000..dbce0be
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs3n3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs5n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs5n2c08.pam
new file mode 100644
index 0000000..9910129
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs5n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs5n3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs5n3p08.pam
new file mode 100644
index 0000000..9910129
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs5n3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs8n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs8n2c08.pam
new file mode 100644
index 0000000..c7c3bb6
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs8n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs8n3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs8n3p08.pam
new file mode 100644
index 0000000..c7c3bb6
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/cs8n3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ct0n0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ct0n0g04.pam
new file mode 100644
index 0000000..1a7de85
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ct0n0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ct1n0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ct1n0g04.pam
new file mode 100644
index 0000000..1a7de85
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ct1n0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ctzn0g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ctzn0g04.pam
new file mode 100644
index 0000000..1a7de85
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ctzn0g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f00n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f00n0g08.pam
new file mode 100644
index 0000000..30e5752
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f00n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f00n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f00n2c08.pam
new file mode 100644
index 0000000..d439d7c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f00n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f01n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f01n0g08.pam
new file mode 100644
index 0000000..6332ad7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f01n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f01n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f01n2c08.pam
new file mode 100644
index 0000000..57a5da7
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f01n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f02n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f02n0g08.pam
new file mode 100644
index 0000000..18dd221
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f02n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f02n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f02n2c08.pam
new file mode 100644
index 0000000..a99a8b4
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f02n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f03n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f03n0g08.pam
new file mode 100644
index 0000000..e66aa5c
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f03n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f03n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f03n2c08.pam
new file mode 100644
index 0000000..1b37bc3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f03n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f04n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f04n0g08.pam
new file mode 100644
index 0000000..963738d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f04n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f04n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f04n2c08.pam
new file mode 100644
index 0000000..498c488
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/f04n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n0g16.pam
new file mode 100644
index 0000000..5d0bf94
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n2c08.pam
new file mode 100644
index 0000000..ffcbe31
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n3p04.pam
new file mode 100644
index 0000000..62e4a00
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g03n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n0g16.pam
new file mode 100644
index 0000000..a5e682e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n2c08.pam
new file mode 100644
index 0000000..8bea8d3
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n3p04.pam
new file mode 100644
index 0000000..e28921e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g04n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n0g16.pam
new file mode 100644
index 0000000..02fa9ae
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n2c08.pam
new file mode 100644
index 0000000..571010f
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n3p04.pam
new file mode 100644
index 0000000..b711084
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g05n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n0g16.pam
new file mode 100644
index 0000000..220ac03
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n2c08.pam
new file mode 100644
index 0000000..4df1735
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n3p04.pam
new file mode 100644
index 0000000..9a563dd
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g07n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n0g16.pam
new file mode 100644
index 0000000..0ad1791
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n2c08.pam
new file mode 100644
index 0000000..4a1eb7d
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n3p04.pam
new file mode 100644
index 0000000..f8ec554
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g10n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n0g16.pam
new file mode 100644
index 0000000..7117439
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n2c08.pam
new file mode 100644
index 0000000..e7e91bd
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n3p04.pam
new file mode 100644
index 0000000..2c46f05
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/g25n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi1n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi1n0g16.pam
new file mode 100644
index 0000000..d2ae4ce
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi1n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi1n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi1n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi1n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi2n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi2n0g16.pam
new file mode 100644
index 0000000..d2ae4ce
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi2n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi2n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi2n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi2n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi4n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi4n0g16.pam
new file mode 100644
index 0000000..d2ae4ce
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi4n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi4n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi4n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi4n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi9n0g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi9n0g16.pam
new file mode 100644
index 0000000..d2ae4ce
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi9n0g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi9n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi9n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/oi9n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pngsuite_logo.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pngsuite_logo.pam
new file mode 100644
index 0000000..942e719
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pngsuite_logo.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pp0n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pp0n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pp0n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pp0n6a08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pp0n6a08.pam
new file mode 100644
index 0000000..c91e4c8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/pp0n6a08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps1n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps1n0g08.pam
new file mode 100644
index 0000000..d237cf8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps1n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps1n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps1n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps1n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps2n0g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps2n0g08.pam
new file mode 100644
index 0000000..d237cf8
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps2n0g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps2n2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps2n2c16.pam
new file mode 100644
index 0000000..de6412b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/ps2n2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s01i3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s01i3p01.pam
new file mode 100644
index 0000000..3709a13
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s01i3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s01n3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s01n3p01.pam
new file mode 100644
index 0000000..3709a13
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s01n3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s02i3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s02i3p01.pam
new file mode 100644
index 0000000..dc8e963
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s02i3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s02n3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s02n3p01.pam
new file mode 100644
index 0000000..dc8e963
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s02n3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s03i3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s03i3p01.pam
new file mode 100644
index 0000000..9c0af5e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s03i3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s03n3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s03n3p01.pam
new file mode 100644
index 0000000..9c0af5e
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s03n3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s04i3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s04i3p01.pam
new file mode 100644
index 0000000..ea319fe
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s04i3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s04n3p01.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s04n3p01.pam
new file mode 100644
index 0000000..ea319fe
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s04n3p01.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s05i3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s05i3p02.pam
new file mode 100644
index 0000000..db2804a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s05i3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s05n3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s05n3p02.pam
new file mode 100644
index 0000000..db2804a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s05n3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s06i3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s06i3p02.pam
new file mode 100644
index 0000000..5d87070
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s06i3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s06n3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s06n3p02.pam
new file mode 100644
index 0000000..5d87070
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s06n3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s07i3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s07i3p02.pam
new file mode 100644
index 0000000..0b0d539
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s07i3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s07n3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s07n3p02.pam
new file mode 100644
index 0000000..0b0d539
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s07n3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s08i3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s08i3p02.pam
new file mode 100644
index 0000000..ad17855
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s08i3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s08n3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s08n3p02.pam
new file mode 100644
index 0000000..ad17855
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s08n3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s09i3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s09i3p02.pam
new file mode 100644
index 0000000..19bc998
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s09i3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s09n3p02.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s09n3p02.pam
new file mode 100644
index 0000000..19bc998
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s09n3p02.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s32i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s32i3p04.pam
new file mode 100644
index 0000000..01ad22a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s32i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s32n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s32n3p04.pam
new file mode 100644
index 0000000..01ad22a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s32n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s33i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s33i3p04.pam
new file mode 100644
index 0000000..be0d3e0
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s33i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s33n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s33n3p04.pam
new file mode 100644
index 0000000..be0d3e0
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s33n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s34i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s34i3p04.pam
new file mode 100644
index 0000000..b702c03
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s34i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s34n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s34n3p04.pam
new file mode 100644
index 0000000..b702c03
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s34n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s35i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s35i3p04.pam
new file mode 100644
index 0000000..c34792a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s35i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s35n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s35n3p04.pam
new file mode 100644
index 0000000..c34792a
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s35n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s36i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s36i3p04.pam
new file mode 100644
index 0000000..ea51284
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s36i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s36n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s36n3p04.pam
new file mode 100644
index 0000000..ea51284
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s36n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s37i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s37i3p04.pam
new file mode 100644
index 0000000..8015177
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s37i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s37n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s37n3p04.pam
new file mode 100644
index 0000000..8015177
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s37n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s38i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s38i3p04.pam
new file mode 100644
index 0000000..8cbf5ef
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s38i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s38n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s38n3p04.pam
new file mode 100644
index 0000000..8cbf5ef
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s38n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s39i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s39i3p04.pam
new file mode 100644
index 0000000..0e6d770
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s39i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s39n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s39n3p04.pam
new file mode 100644
index 0000000..0e6d770
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s39n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s40i3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s40i3p04.pam
new file mode 100644
index 0000000..7e5d7e1
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s40i3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s40n3p04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s40n3p04.pam
new file mode 100644
index 0000000..7e5d7e1
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/s40n3p04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn1g04.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn1g04.pam
new file mode 100644
index 0000000..c34fceb
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn1g04.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn2c16.pam
new file mode 100644
index 0000000..390bc6b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn3p08.pam
new file mode 100644
index 0000000..3235fe9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbbn3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbgn2c16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbgn2c16.pam
new file mode 100644
index 0000000..390bc6b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbgn2c16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbgn3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbgn3p08.pam
new file mode 100644
index 0000000..3235fe9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbgn3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbrn2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbrn2c08.pam
new file mode 100644
index 0000000..3235fe9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbrn2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbwn1g16.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbwn1g16.pam
new file mode 100644
index 0000000..0932833
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbwn1g16.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbwn3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbwn3p08.pam
new file mode 100644
index 0000000..3235fe9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbwn3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbyn3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbyn3p08.pam
new file mode 100644
index 0000000..3235fe9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tbyn3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n1g08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n1g08.pam
new file mode 100644
index 0000000..075584b
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n1g08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n2c08.pam
new file mode 100644
index 0000000..f9c0549
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n3p08.pam
new file mode 100644
index 0000000..f9c0549
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp0n3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp1n3p08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp1n3p08.pam
new file mode 100644
index 0000000..3235fe9
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/tp1n3p08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z00n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z00n2c08.pam
new file mode 100644
index 0000000..718ab88
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z00n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z03n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z03n2c08.pam
new file mode 100644
index 0000000..718ab88
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z03n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z06n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z06n2c08.pam
new file mode 100644
index 0000000..718ab88
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z06n2c08.pam differ
diff --git a/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z09n2c08.pam b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z09n2c08.pam
new file mode 100644
index 0000000..718ab88
Binary files /dev/null and b/jdk/test/javax/imageio/plugins/png/PngReader/pam_images/z09n2c08.pam differ
diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/crisubn.jks b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/crisubn.jks
new file mode 100644
index 0000000..aee7d9f
Binary files /dev/null and b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/crisubn.jks differ
diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/trusted.jks b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/trusted.jks
new file mode 100644
index 0000000..0202bec
Binary files /dev/null and b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnection/trusted.jks differ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment