# HG changeset patch
# User zmajo
# Date 1457974285 -3600
# Node ID 59b58343d3587dc5c0ece790cacf9beb0dd062e4
# Parent e9c073b0c19e1a9578d926aff71e816f41494274# Parent 03a6f39ebb7379de1fbc76c419372c33b2a4aa61
Merge
diff -r e9c073b0c19e -r 59b58343d358 .hgtags
--- a/.hgtags Mon Mar 14 12:35:52 2016 +0300
+++ b/.hgtags Mon Mar 14 17:51:25 2016 +0100
@@ -351,3 +351,4 @@
6c644cca3f3fc2763e2ff7d669849a75d34543ba jdk-9+106
1c076468bf7dad5b8f2ee5dcf66e2279caa3e208 jdk-9+107
257b579d813201682931d6b42f0445ffe5b4210d jdk-9+108
+c870cb782aca71093d2584376f27f0cfbfec0e3a jdk-9+109
diff -r e9c073b0c19e -r 59b58343d358 .hgtags-top-repo
--- a/.hgtags-top-repo Mon Mar 14 12:35:52 2016 +0300
+++ b/.hgtags-top-repo Mon Mar 14 17:51:25 2016 +0100
@@ -351,3 +351,4 @@
54575d8783b3a39a2d710c28cda675d44261f9d9 jdk-9+106
4d65eba233a8730f913734a6804910b842d2cb54 jdk-9+107
c7be2a78c31b3b6132f2f5e9e4b3d3bb1c20245c jdk-9+108
+1787bdaabb2b6f4193406e25a50cb0419ea8e8f3 jdk-9+109
diff -r e9c073b0c19e -r 59b58343d358 common/autoconf/generated-configure.sh
--- a/common/autoconf/generated-configure.sh Mon Mar 14 12:35:52 2016 +0300
+++ b/common/autoconf/generated-configure.sh Mon Mar 14 17:51:25 2016 +0100
@@ -4005,7 +4005,7 @@
devkit)
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
openjdk)
- PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
+ PKGHANDLER_COMMAND="sudo apt-get install openjdk-8-jdk" ;;
alsa)
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
cups)
@@ -4026,7 +4026,7 @@
devkit)
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
openjdk)
- PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
+ PKGHANDLER_COMMAND="sudo yum install java-1.8.0-openjdk-devel" ;;
alsa)
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
cups)
@@ -4862,7 +4862,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1456136781
+DATE_WHEN_GENERATED=1457684806
###############################################################################
#
@@ -15118,6 +15118,10 @@
REQUIRED_OS_NAME=Darwin
REQUIRED_OS_VERSION=11.2
fi
+ if test "x$OPENJDK_TARGET_OS" = "xaix"; then
+ REQUIRED_OS_NAME=AIX
+ REQUIRED_OS_VERSION=7.1
+ fi
diff -r e9c073b0c19e -r 59b58343d358 common/autoconf/help.m4
--- a/common/autoconf/help.m4 Mon Mar 14 12:35:52 2016 +0300
+++ b/common/autoconf/help.m4 Mon Mar 14 17:51:25 2016 +0100
@@ -106,7 +106,7 @@
devkit)
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
openjdk)
- PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
+ PKGHANDLER_COMMAND="sudo apt-get install openjdk-8-jdk" ;;
alsa)
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
cups)
@@ -127,7 +127,7 @@
devkit)
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
openjdk)
- PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
+ PKGHANDLER_COMMAND="sudo yum install java-1.8.0-openjdk-devel" ;;
alsa)
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
cups)
diff -r e9c073b0c19e -r 59b58343d358 common/autoconf/platform.m4
--- a/common/autoconf/platform.m4 Mon Mar 14 12:35:52 2016 +0300
+++ b/common/autoconf/platform.m4 Mon Mar 14 17:51:25 2016 +0100
@@ -406,6 +406,10 @@
REQUIRED_OS_NAME=Darwin
REQUIRED_OS_VERSION=11.2
fi
+ if test "x$OPENJDK_TARGET_OS" = "xaix"; then
+ REQUIRED_OS_NAME=AIX
+ REQUIRED_OS_VERSION=7.1
+ fi
AC_SUBST(REQUIRED_OS_NAME)
AC_SUBST(REQUIRED_OS_VERSION)
diff -r e9c073b0c19e -r 59b58343d358 common/bin/compare_exceptions.sh.incl
--- a/common/bin/compare_exceptions.sh.incl Mon Mar 14 12:35:52 2016 +0300
+++ b/common/bin/compare_exceptions.sh.incl Mon Mar 14 17:51:25 2016 +0100
@@ -185,7 +185,6 @@
./lib/amd64/libjava.so
./lib/amd64/libjawt.so
./lib/amd64/libjdwp.so
- ./lib/amd64/libjfr.so
./lib/amd64/libjpeg.so
./lib/amd64/libjsdt.so
./lib/amd64/libjsound.so
@@ -321,7 +320,6 @@
./lib/sparcv9/libjava.so
./lib/sparcv9/libjawt.so
./lib/sparcv9/libjdwp.so
- ./lib/sparcv9/libjfr.so
./lib/sparcv9/libjpeg.so
./lib/sparcv9/libjsdt.so
./lib/sparcv9/libjsound.so
diff -r e9c073b0c19e -r 59b58343d358 common/bin/unshuffle_list.txt
--- a/common/bin/unshuffle_list.txt Mon Mar 14 12:35:52 2016 +0300
+++ b/common/bin/unshuffle_list.txt Mon Mar 14 17:51:25 2016 +0100
@@ -1293,12 +1293,8 @@
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/j2secmod_md.h : jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
-jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent/package.html : jdk/src/macosx/classes/com/apple/concurrent/package.html
-jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent : jdk/src/macosx/classes/com/apple/concurrent
-jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
-jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
-jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
-jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
+jdk/src/java.desktop/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
+jdk/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof
jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver : jdk/src/share/classes/com/sun/net/httpserver
jdk/src/jdk.httpserver/share/classes/sun/net/httpserver : jdk/src/share/classes/sun/net/httpserver
diff -r e9c073b0c19e -r 59b58343d358 corba/.hgtags
--- a/corba/.hgtags Mon Mar 14 12:35:52 2016 +0300
+++ b/corba/.hgtags Mon Mar 14 17:51:25 2016 +0100
@@ -351,3 +351,4 @@
8ec4f97943fe56f93e4621f622b56b7144c0181a jdk-9+106
49202432b69445164a42be7cbdf74ed5fce98157 jdk-9+107
84f2862a25eb3232ff36c376b4e2bf2a83dfced3 jdk-9+108
+b75afa17aefe480c23c616a6a2497063312f7189 jdk-9+109
diff -r e9c073b0c19e -r 59b58343d358 hotspot/.hgtags
--- a/hotspot/.hgtags Mon Mar 14 12:35:52 2016 +0300
+++ b/hotspot/.hgtags Mon Mar 14 17:51:25 2016 +0100
@@ -511,3 +511,4 @@
7232de4c17c37f60aecec4f3191090bd3d41d334 jdk-9+106
c5146d4da417f76edfc43097d2e2ced042a65b4e jdk-9+107
934f6793f5f7dca44f69b4559d525fa64b31840d jdk-9+108
+7e7e50ac4faf19899fc811569e32cfa478759ebb jdk-9+109
diff -r e9c073b0c19e -r 59b58343d358 jaxp/.hgtags
--- a/jaxp/.hgtags Mon Mar 14 12:35:52 2016 +0300
+++ b/jaxp/.hgtags Mon Mar 14 17:51:25 2016 +0100
@@ -351,3 +351,4 @@
65d615f71e81bae46dcb4d053e590582e5705879 jdk-9+106
781b83dadcae89b8ae7545bb4044ddc62c6fa006 jdk-9+107
3b9fa8b1491479f7ae18131a34036b58b647493e jdk-9+108
+24e247ee1fffaa625d480b2a4eef2d3a8a59f5cb jdk-9+109
diff -r e9c073b0c19e -r 59b58343d358 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/DOM.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/DOM.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/DOM.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -17,9 +17,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * $Id: DOM.java,v 1.2.4.1 2005/08/31 10:18:49 pvedula Exp $
- */
package com.sun.org.apache.xalan.internal.xsltc;
@@ -102,4 +99,5 @@
public int getDocument();
public String getUnparsedEntityURI(String name);
public Map
- *
- * but does not allocate memory (it does NOT have the special
- * case Turkish rules).
- *
- * @param s a String to compute the hashcode on.
- * @return a hash code value for this object.
- */
- public static int lowerCaseHashCode(String s) {
- int h = 0;
- int len = s.length();
-
- for (int i = 0; i < len; i++) {
- h = 31*h + toLower(s.charAt(i));
- }
-
- return h;
- }
-
- /* If java.util.regex.ASCII ever becomes public or sun.*, use its code instead:*/
- static boolean isLower(int ch) {
- return ((ch-'a')|('z'-ch)) >= 0;
- }
-
- static boolean isUpper(int ch) {
- return ((ch-'A')|('Z'-ch)) >= 0;
- }
-
- static int toLower(int ch) {
- return isUpper(ch) ? (ch + 0x20) : ch;
- }
-
- static int toUpper(int ch) {
- return isLower(ch) ? (ch - 0x20) : ch;
- }
-}
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java
--- a/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java Mon Mar 14 17:51:25 2016 +0100
@@ -26,7 +26,7 @@
package sun.nio.ch;
import java.nio.ByteBuffer;
-import jdk.internal.ref.Cleaner;
+import jdk.internal.ref.CleanerFactory;
/**
@@ -101,7 +101,7 @@
}
if (wrapper == null) {
wrapper = new IOVecWrapper(size);
- Cleaner.create(wrapper, new Deallocator(wrapper.vecArray));
+ CleanerFactory.cleaner().register(wrapper, new Deallocator(wrapper.vecArray));
cached.set(wrapper);
}
return wrapper;
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.base/share/classes/sun/nio/ch/Util.java
--- a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java Mon Mar 14 17:51:25 2016 +0100
@@ -33,7 +33,6 @@
import java.security.PrivilegedAction;
import java.util.*;
import jdk.internal.misc.Unsafe;
-import jdk.internal.ref.Cleaner;
import sun.security.action.GetPropertyAction;
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java
--- a/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java Mon Mar 14 17:51:25 2016 +0100
@@ -71,8 +71,8 @@
return size;
}
- Cleaner cleaner() {
- return cleaner;
+ void free() {
+ cleaner.clean();
}
// not synchronized; only safe for use by thread-local caches
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java
--- a/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java Mon Mar 14 17:51:25 2016 +0100
@@ -107,14 +107,14 @@
for (int i=0; i The parameters The parameters {@code compressionTagValue} and
+ * {@code isCompressionLossless} are provided to accomodate
* compression types which are unknown. A compression type is
* "known" if it is either among those already supported by the
* TIFF writer (see {@link TIFFImageWriteParam}), or is listed in
* the TIFF 6.0 specification but not supported. If the compression
- * type is unknown, the Decompressors may be written with various levels of complexity.
* The most complex decompressors will override the
- * Less ambitious decompressors may override the
- * Slightly more ambitious decompressors may override
- * The pixels in the source region to be copied are
- * those with X coordinates of the form The pixels in the source region to be copied are
- * those with Y coordinates of the form The active source width will always be equal to
- * The active source height will always be equal to
- * If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param reader the current If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param metadata the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1258,9 +1258,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1271,13 +1271,13 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param planar If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1299,9 +1299,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1314,9 +1314,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1330,9 +1330,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1346,14 +1346,14 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
* @param colorMap the color map to apply to the source data,
- * as an array of If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param stream the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1388,9 +1388,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1403,9 +1403,9 @@
// Region of the file image represented in the stream
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1418,9 +1418,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1433,9 +1433,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1447,9 +1447,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1463,9 +1463,9 @@
// First source pixel to be read
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1477,9 +1477,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1491,9 +1491,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1505,9 +1505,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1521,15 +1521,15 @@
// Subsampling to be performed
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
* @param subsampleX the horizontal subsampling factor.
*
- * @throws IllegalArgumentException if If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
* @param subsampleY the vertical subsampling factor.
*
- * @throws IllegalArgumentException if If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param sourceBands an array of If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param destinationBands an array of If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
- * @param image the destination If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1620,9 +1620,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1634,9 +1634,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1647,9 +1647,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1662,9 +1662,9 @@
// Active source region
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1676,9 +1676,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1690,9 +1690,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1703,9 +1703,9 @@
}
/**
- * Sets the value of the If this method is called, the If this method is called, the {@code beginDecoding}
* method must be called prior to calling any of the decode
* methods.
*
@@ -1716,23 +1716,23 @@
}
/**
- * Sets the The default implementation calls
- * The default implementation calls The default implementation calls {@code decodeRaw(byte[] b,
+ * ...)} and copies the resulting data into {@code s}.
*
- * @param s a The default implementation calls The default implementation calls {@code decodeRaw(byte[] b,
+ * ...)} and copies the resulting data into {@code i}.
*
- * @param i an The default implementation calls The default implementation calls {@code decodeRaw(byte[] b,
+ * ...)} and copies the resulting data into {@code f}.
*
- * @param f a The default implementation calls The default implementation calls {@code decodeRaw(byte[] b,
+ * ...)} and copies the resulting data into {@code f}.
*
- * @param f a The default implementation computes tables used by the
- * The default implementation analyzes the destination image
* to determine if it is suitable as the destination for the
- * The precise responsibilities of this routine are as
* follows. The input bit stream is defined by the instance
- * variables The source data is required to be subsampling, starting at
- * the Pixels are copied into the destination with an addition shift of
- * ( The inverse mapping, from destination to source coordinates,
* is one-to-one:
@@ -2292,9 +2292,9 @@
*
*
* The region of the destination image to be updated is given
- * by the instance variables It is possible that not all of the source data being read
* will contribute to the destination image. For example, the
@@ -2303,32 +2303,32 @@
* convenience, the bounds of the active source region (that is,
* the region of the strip or tile being read that actually
* contributes to the destination image, taking clipping into
- * account) are available as The sequence of source bands given by
- * Some standard tag information is provided the instance
- * variables In practice, unless there is a significant performance
* advantage to be gained by overriding this routine, most users
* will prefer to use the default implementation of this routine,
- * and instead override the The implementation in this class also sets local options
* from the FILL_ORDER field if it exists.30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
30D
+
+
+
+
5
+
+
6
+
+
s.toLowerCase(Locale.US).hashCode();
true
should also
+ * A subclass which sets this to {@code true} should also
* initialized {@link #JPEGStreamMetadata}.
*/
protected boolean writeAbbreviatedStream = false;
/**
* Stream metadata equivalent to a tables-only stream such as in
- * the JPEGTables
. Default value is null
.
+ * the {@code JPEGTables}. Default value is {@code null}.
* This should be set by any subclass which sets
- * {@link writeAbbreviatedStream} to true
.
+ * {@link writeAbbreviatedStream} to {@code true}.
*/
protected IIOMetadata JPEGStreamMetadata = null;
@@ -108,15 +108,15 @@
/**
* Removes nonessential nodes from a JPEG native image metadata tree.
* All nodes derived from JPEG marker segments other than DHT, DQT,
- * SOF, SOS segments are removed unless pruneTables
is
- * true
in which case the nodes derived from the DHT and
+ * SOF, SOS segments are removed unless {@code pruneTables} is
+ * {@code true} in which case the nodes derived from the DHT and
* DQT marker segments are also removed.
*
* @param tree A javax_imageio_jpeg_image_1.0 tree.
* @param pruneTables Whether to prune Huffman and quantization tables.
- * @throws NullPointerException if tree
is
- * null
.
- * @throws IllegalArgumentException if tree
is not the root
+ * @throws NullPointerException if {@code tree} is
+ * {@code null}.
+ * @throws IllegalArgumentException if {@code tree} is not the root
* of a JPEG native image metadata tree.
*/
private static void pruneNodes(Node tree, boolean pruneTables) {
@@ -182,8 +182,8 @@
}
/**
- * A ByteArrayOutputStream
which allows writing to an
- * ImageOutputStream
.
+ * A {@code ByteArrayOutputStream} which allows writing to an
+ * {@code ImageOutputStream}.
*/
private static class IIOByteArrayOutputStream extends ByteArrayOutputStream {
IIOByteArrayOutputStream() {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFColorConverter.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFColorConverter.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFColorConverter.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -31,39 +31,39 @@
public abstract class TIFFColorConverter {
/**
- * Constructs an instance of a TIFFColorConverter
.
+ * Constructs an instance of a {@code TIFFColorConverter}.
*/
public TIFFColorConverter() {}
/**
* Converts an RGB triple into the native color space of this
* TIFFColorConverter, and stores the result in the first three
- * entries of the result
array.
+ * entries of the {@code result} array.
*
* @param r the red value.
* @param g the green value.
* @param b the blue value.
- * @param result an array of float
s containing three elements.
- * @throws NullPointerException if result
is
- * null
.
+ * @param result an array of {@code float}s containing three elements.
+ * @throws NullPointerException if {@code result} is
+ * {@code null}.
* @throws ArrayIndexOutOfBoundsException if
- * result.length < 3
.
+ * {@code result.length < 3}.
*/
public abstract void fromRGB(float r, float g, float b, float[] result);
/**
* Converts a triple in the native color space of this
* TIFFColorConverter into an RGB triple, and stores the result in
- * the first three entries of the rgb
array.
+ * the first three entries of the {@code rgb} array.
*
* @param x0 the value of channel 0.
* @param x1 the value of channel 1.
* @param x2 the value of channel 2.
- * @param rgb an array of float
s containing three elements.
- * @throws NullPointerException if rgb
is
- * null
.
+ * @param rgb an array of {@code float}s containing three elements.
+ * @throws NullPointerException if {@code rgb} is
+ * {@code null}.
* @throws ArrayIndexOutOfBoundsException if
- * rgb.length < 3
.
+ * {@code rgb.length < 3}.
*/
public abstract void toRGB(float x0, float x1, float x2, float[] rgb);
}
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFCompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFCompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFCompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -35,13 +35,13 @@
public abstract class TIFFCompressor {
/**
- * The ImageWriter
calling this
- * TIFFCompressor
.
+ * The {@code ImageWriter} calling this
+ * {@code TIFFCompressor}.
*/
protected ImageWriter writer;
/**
- * The IIOMetadata
object containing metadata for the
+ * The {@code IIOMetadata} object containing metadata for the
* current image.
*/
protected IIOMetadata metadata;
@@ -63,7 +63,7 @@
protected boolean isCompressionLossless;
/**
- * The ImageOutputStream
to be written.
+ * The {@code ImageOutputStream} to be written.
*/
protected ImageOutputStream stream;
@@ -75,26 +75,26 @@
* to provide the implementation of the compression algorithm of an
* unsupported compression type.
*
- * compressionTagValue
and
- * isCompressionLossless
are provided to accomodate
+ * compressionTagValue
and
- * isCompressionLossless
parameters are ignored.compressionType
is a known type.
+ * {@code compressionType} is a known type.
* @param isCompressionLossless Whether the compression is lossless;
- * ignored if compressionType
is a known type.
+ * ignored if {@code compressionType} is a known type.
*
- * @throws NullPointerException if compressionType
is
- * null
.
- * @throws IllegalArgumentException if compressionTagValue
is
- * less 1
.
+ * @throws NullPointerException if {@code compressionType} is
+ * {@code null}.
+ * @throws IllegalArgumentException if {@code compressionTagValue} is
+ * less {@code 1}.
*/
public TIFFCompressor(String compressionType,
int compressionTagValue,
@@ -163,9 +163,9 @@
}
/**
- * Sets the ImageOutputStream
to be written.
+ * Sets the {@code ImageOutputStream} to be written.
*
- * @param stream an ImageOutputStream
to be written.
+ * @param stream an {@code ImageOutputStream} to be written.
*
* @see #getStream
*/
@@ -174,9 +174,9 @@
}
/**
- * Returns the ImageOutputStream
that will be written.
+ * Returns the {@code ImageOutputStream} that will be written.
*
- * @return an ImageOutputStream
.
+ * @return an {@code ImageOutputStream}.
*
* @see #setStream(ImageOutputStream)
*/
@@ -185,9 +185,9 @@
}
/**
- * Sets the value of the writer
field.
+ * Sets the value of the {@code writer} field.
*
- * @param writer the current ImageWriter
.
+ * @param writer the current {@code ImageWriter}.
*
* @see #getWriter()
*/
@@ -196,9 +196,9 @@
}
/**
- * Returns the current ImageWriter
.
+ * Returns the current {@code ImageWriter}.
*
- * @return an ImageWriter
.
+ * @return an {@code ImageWriter}.
*
* @see #setWriter(ImageWriter)
*/
@@ -207,9 +207,9 @@
}
/**
- * Sets the value of the metadata
field.
+ * Sets the value of the {@code metadata} field.
*
- * @param metadata the IIOMetadata
object for the
+ * @param metadata the {@code IIOMetadata} object for the
* image being written.
*
* @see #getMetadata()
@@ -219,9 +219,9 @@
}
/**
- * Returns the current IIOMetadata
object.
+ * Returns the current {@code IIOMetadata} object.
*
- * @return the IIOMetadata
object for the image being
+ * @return the {@code IIOMetadata} object for the image being
* written.
*
* @see #setMetadata(IIOMetadata)
@@ -232,15 +232,15 @@
/**
* Encodes the supplied image data, writing to the currently set
- * ImageOutputStream
.
+ * {@code ImageOutputStream}.
*
- * @param b an array of byte
s containing the packed
+ * @param b an array of {@code byte}s containing the packed
* but uncompressed image data.
* @param off the starting offset of the data to be written in the
- * array b
.
+ * array {@code b}.
* @param width the width of the rectangle of pixels to be written.
* @param height the height of the rectangle of pixels to be written.
- * @param bitsPerSample an array of int
s indicting
+ * @param bitsPerSample an array of {@code int}s indicting
* the number of bits used to represent each image sample within
* a pixel.
* @param scanlineStride the number of bytes separating each
@@ -249,7 +249,7 @@
* @return the number of bytes written.
*
* @throws IOException if the supplied data cannot be encoded by
- * this TIFFCompressor
, or if any I/O error occurs
+ * this {@code TIFFCompressor}, or if any I/O error occurs
* during writing.
*/
public abstract int encode(byte[] b, int off,
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -81,7 +81,7 @@
*
* decode
method, and will perform all the work of
+ * {@code decode} method, and will perform all the work of
* decoding, subsampling, offsetting, clipping, and format conversion.
* This approach may be the most efficient, since it is possible to
* avoid the use of extra image buffers, and it may be possible to
@@ -89,35 +89,35 @@
* the destination.
*
* decodeRaw
method, which is responsible for
+ * {@code decodeRaw} method, which is responsible for
* decompressing the entire tile or strip into a byte array (or other
* appropriate datatype). The default implementation of
- * decode
will perform all necessary setup of buffers,
- * call decodeRaw
to perform the actual decoding, perform
+ * {@code decode} will perform all necessary setup of buffers,
+ * call {@code decodeRaw} to perform the actual decoding, perform
* subsampling, and copy the results into the final destination image.
* Where possible, it will pass the real image buffer to
- * decodeRaw
in order to avoid making an extra copy.
+ * {@code decodeRaw} in order to avoid making an extra copy.
*
* decodeRaw
, but avoid writing pixels that will be
+ * {@code decodeRaw}, but avoid writing pixels that will be
* discarded in the subsampling phase.
*/
public abstract class TIFFDecompressor {
/**
- * The ImageReader
calling this
- * TIFFDecompressor
.
+ * The {@code ImageReader} calling this
+ * {@code TIFFDecompressor}.
*/
protected ImageReader reader;
/**
- * The IIOMetadata
object containing metadata for the
+ * The {@code IIOMetadata} object containing metadata for the
* current image.
*/
protected IIOMetadata metadata;
/**
- * The value of the PhotometricInterpretation
tag.
+ * The value of the {@code PhotometricInterpretation} tag.
* Legal values are {@link
* BaselineTIFFTagSet#PHOTOMETRIC_INTERPRETATION_WHITE_IS_ZERO },
* {@link
@@ -135,7 +135,7 @@
protected int photometricInterpretation;
/**
- * The value of the Compression
tag. Legal values are
+ * The value of the {@code Compression} tag. Legal values are
* {@link BaselineTIFFTagSet#COMPRESSION_NONE}, {@link
* BaselineTIFFTagSet#COMPRESSION_CCITT_RLE}, {@link
* BaselineTIFFTagSet#COMPRESSION_CCITT_T_4}, {@link
@@ -151,23 +151,23 @@
protected int compression;
/**
- * true
if the image is encoded using separate planes.
+ * {@code true} if the image is encoded using separate planes.
*/
protected boolean planar;
/**
- * The value of the SamplesPerPixel
tag.
+ * The value of the {@code SamplesPerPixel} tag.
*/
protected int samplesPerPixel;
/**
- * The value of the BitsPerSample
tag.
+ * The value of the {@code BitsPerSample} tag.
*
*/
protected int[] bitsPerSample;
/**
- * The value of the SampleFormat
tag. Legal values
+ * The value of the {@code SampleFormat} tag. Legal values
* are {@link BaselineTIFFTagSet#SAMPLE_FORMAT_UNSIGNED_INTEGER},
* {@link BaselineTIFFTagSet#SAMPLE_FORMAT_SIGNED_INTEGER}, {@link
* BaselineTIFFTagSet#SAMPLE_FORMAT_FLOATING_POINT}, {@link
@@ -178,7 +178,7 @@
new int[] {BaselineTIFFTagSet.SAMPLE_FORMAT_UNSIGNED_INTEGER};
/**
- * The value of the ExtraSamples
tag. Legal values
+ * The value of the {@code ExtraSamples} tag. Legal values
* are {@link BaselineTIFFTagSet#EXTRA_SAMPLES_UNSPECIFIED},
* {@link BaselineTIFFTagSet#EXTRA_SAMPLES_ASSOCIATED_ALPHA},
* {@link BaselineTIFFTagSet#EXTRA_SAMPLES_UNASSOCIATED_ALPHA},
@@ -187,7 +187,7 @@
protected int[] extraSamples;
/**
- * The value of the ColorMap
tag.
+ * The value of the {@code ColorMap} tag.
*
*/
protected char[] colorMap;
@@ -195,20 +195,20 @@
// Region of input stream containing the data
/**
- * The ImageInputStream
containing the TIFF source
+ * The {@code ImageInputStream} containing the TIFF source
* data.
*/
protected ImageInputStream stream;
/**
- * The offset in the source ImageInputStream
of the
+ * The offset in the source {@code ImageInputStream} of the
* start of the data to be decompressed.
*/
protected long offset;
/**
* The number of bytes of data from the source
- * ImageInputStream
to be decompressed.
+ * {@code ImageInputStream} to be decompressed.
*/
protected int byteCount;
@@ -244,15 +244,15 @@
// Subsampling to be performed
/**
- * The source X offset used, along with dstXOffset
- * and subsampleX
, to map between horizontal source
+ * The source X offset used, along with {@code dstXOffset}
+ * and {@code subsampleX}, to map between horizontal source
* and destination pixel coordinates.
*/
protected int sourceXOffset;
/**
* The horizontal destination offset used, along with
- * sourceXOffset
and subsampleX
, to map
+ * {@code sourceXOffset} and {@code subsampleX}, to map
* between horizontal source and destination pixel coordinates.
* See the comment for {@link #sourceXOffset sourceXOffset} for
* the mapping equations.
@@ -260,15 +260,15 @@
protected int dstXOffset;
/**
- * The source Y offset used, along with dstYOffset
- * and subsampleY
, to map between vertical source and
+ * The source Y offset used, along with {@code dstYOffset}
+ * and {@code subsampleY}, to map between vertical source and
* destination pixel coordinates.
*/
protected int sourceYOffset;
/**
* The vertical destination offset used, along with
- * sourceYOffset
and subsampleY
, to map
+ * {@code sourceYOffset} and {@code subsampleY}, to map
* between horizontal source and destination pixel coordinates.
* See the comment for {@link #sourceYOffset sourceYOffset} for
* the mapping equations.
@@ -305,7 +305,7 @@
// Destination for decodeRaw
/**
- * A BufferedImage
for the decodeRaw
+ * A {@code BufferedImage} for the {@code decodeRaw}
* method to write into.
*/
protected BufferedImage rawImage;
@@ -345,15 +345,15 @@
* The X coordinate of the upper-left source pixel that will
* actually be copied into the destination image, taking into
* account all subsampling, offsetting, and clipping. That is,
- * the pixel at (activeSrcMinX
,
- * activeSrcMinY
) is to be copied into the
- * destination pixel at (dstMinX
,
- * dstMinY
).
+ * the pixel at ({@code activeSrcMinX},
+ * {@code activeSrcMinY}) is to be copied into the
+ * destination pixel at ({@code dstMinX},
+ * {@code dstMinY}).
*
* activeSrcMinX +
- * k*subsampleX
, where k
is an integer such
- * that 0 ≤ k < dstWidth
.
+ * those with X coordinates of the form {@code activeSrcMinX +
+ * k*subsampleX}, where {@code k} is an integer such
+ * that {@code 0 ≤ k < dstWidth}.
*/
protected int activeSrcMinX;
@@ -363,9 +363,9 @@
* all subsampling, offsetting, and clipping.
*
* activeSrcMinY +
- * k*subsampleY
, where k
is an integer such
- * that 0 ≤ k < dstHeight
.
+ * those with Y coordinates of the form {@code activeSrcMinY +
+ * k*subsampleY}, where {@code k} is an integer such
+ * that {@code 0 ≤ k < dstHeight}.
*/
protected int activeSrcMinY;
@@ -375,7 +375,7 @@
* susbampling, offsetting, and clipping.
*
* (dstWidth - 1)*subsampleX + 1
.
+ * {@code (dstWidth - 1)*subsampleX + 1}.
*/
protected int activeSrcWidth;
@@ -385,13 +385,13 @@
* susbampling, offsetting, and clipping.
*
* (dstHeight - 1)*subsampleY + 1
.
+ * {@code (dstHeight - 1)*subsampleY + 1}.
*/
protected int activeSrcHeight;
/**
- * A TIFFColorConverter
object describing the color space of
- * the encoded pixel data, or null
.
+ * A {@code TIFFColorConverter} object describing the color space of
+ * the encoded pixel data, or {@code null}.
*/
protected TIFFColorConverter colorConverter;
@@ -420,13 +420,13 @@
// to exactly those dest pixels that are present in the source region.
/**
- * Create a PixelInterleavedSampleModel
for use in creating
- * an ImageTypeSpecifier
. Its dimensions will be 1x1 and
+ * Create a {@code PixelInterleavedSampleModel} for use in creating
+ * an {@code ImageTypeSpecifier}. Its dimensions will be 1x1 and
* it will have ascending band offsets as {0, 1, 2, ..., numBands}.
*
* @param dataType The data type (DataBuffer.TYPE_*).
* @param numBands The number of bands.
- * @return A PixelInterleavedSampleModel
.
+ * @return A {@code PixelInterleavedSampleModel}.
*/
static SampleModel createInterleavedSM(int dataType,
int numBands) {
@@ -443,8 +443,8 @@
}
/**
- * Create a ComponentColorModel
for use in creating
- * an ImageTypeSpecifier
.
+ * Create a {@code ComponentColorModel} for use in creating
+ * an {@code ImageTypeSpecifier}.
*/
// This code was copied from javax.imageio.ImageTypeSpecifier.
static ColorModel createComponentCM(ColorSpace colorSpace,
@@ -518,8 +518,8 @@
}
/**
- * Return the number of bits occupied by dataType
- * which must be one of the DataBuffer
TYPE
s.
+ * Return the number of bits occupied by {@code dataType}
+ * which must be one of the {@code DataBuffer} {@code TYPE}s.
*/
private static int getDataTypeSize(int dataType) throws IIOException {
int dataTypeSize = 0;
@@ -578,7 +578,7 @@
}
/**
- * Determines whether the DataBuffer
is filled without
+ * Determines whether the {@code DataBuffer} is filled without
* any interspersed padding bits.
*/
private static boolean isDataBufferBitContiguous(SampleModel sm)
@@ -678,8 +678,8 @@
}
/**
- * Reformats bit-discontiguous data into the DataBuffer
- * of the supplied WritableRaster
.
+ * Reformats bit-discontiguous data into the {@code DataBuffer}
+ * of the supplied {@code WritableRaster}.
*/
private static void reformatDiscontiguousData(byte[] buf,
int stride,
@@ -715,21 +715,21 @@
/**
* A utility method that returns an
- * ImageTypeSpecifier
suitable for decoding an image
+ * {@code ImageTypeSpecifier} suitable for decoding an image
* with the given parameters.
*
* @param photometricInterpretation the value of the
- * PhotometricInterpretation
field.
- * @param compression the value of the Compression
field.
+ * {@code PhotometricInterpretation} field.
+ * @param compression the value of the {@code Compression} field.
* @param samplesPerPixel the value of the
- * SamplesPerPixel
field.
- * @param bitsPerSample the value of the BitsPerSample
field.
- * @param sampleFormat the value of the SampleFormat
field.
- * @param extraSamples the value of the ExtraSamples
field.
- * @param colorMap the value of the ColorMap
field.
+ * {@code SamplesPerPixel} field.
+ * @param bitsPerSample the value of the {@code BitsPerSample} field.
+ * @param sampleFormat the value of the {@code SampleFormat} field.
+ * @param extraSamples the value of the {@code ExtraSamples} field.
+ * @param colorMap the value of the {@code ColorMap} field.
*
- * @return a suitable ImageTypeSpecifier
, or
- * null
if it is not possible to create one.
+ * @return a suitable {@code ImageTypeSpecifier}, or
+ * {@code null} if it is not possible to create one.
*/
public static ImageTypeSpecifier
getRawImageTypeSpecifier(int photometricInterpretation,
@@ -1216,26 +1216,26 @@
}
/**
- * Sets the value of the reader
field.
+ * Sets the value of the {@code reader} field.
*
- * beginDecoding
+ * ImageReader
.
+ * @param reader the current {@code ImageReader}.
*/
public void setReader(ImageReader reader) {
this.reader = reader;
}
/**
- * Sets the value of the metadata
field.
+ * Sets the value of the {@code metadata} field.
*
- * beginDecoding
+ * IIOMetadata
object for the
+ * @param metadata the {@code IIOMetadata} object for the
* image being read.
*/
public void setMetadata(IIOMetadata metadata) {
@@ -1243,10 +1243,10 @@
}
/**
- * Sets the value of the photometricInterpretation
+ * Sets the value of the {@code photometricInterpretation}
* field.
*
- * beginDecoding
+ * compression
field.
+ * Sets the value of the {@code compression} field.
*
- * beginDecoding
+ * planar
field.
+ * Sets the value of the {@code planar} field.
*
- * beginDecoding
+ * true
if the image to be decoded is
+ * @param planar {@code true} if the image to be decoded is
* stored in planar format.
*/
public void setPlanar(boolean planar) {
@@ -1285,9 +1285,9 @@
}
/**
- * Sets the value of the samplesPerPixel
field.
+ * Sets the value of the {@code samplesPerPixel} field.
*
- * beginDecoding
+ * bitsPerSample
field.
+ * Sets the value of the {@code bitsPerSample} field.
*
- * beginDecoding
+ * sampleFormat
field.
+ * Sets the value of the {@code sampleFormat} field.
*
- * beginDecoding
+ * extraSamples
field.
+ * Sets the value of the {@code extraSamples} field.
*
- * beginDecoding
+ * colorMap
field.
+ * Sets the value of the {@code colorMap} field.
*
- * beginDecoding
+ * char
s.
+ * as an array of {@code char}s.
*/
public void setColorMap(char[] colorMap) {
this.colorMap = colorMap == null ?
@@ -1361,22 +1361,22 @@
}
/**
- * Sets the value of the stream
field.
+ * Sets the value of the {@code stream} field.
*
- * beginDecoding
+ * ImageInputStream
to be read.
+ * @param stream the {@code ImageInputStream} to be read.
*/
public void setStream(ImageInputStream stream) {
this.stream = stream;
}
/**
- * Sets the value of the offset
field.
+ * Sets the value of the {@code offset} field.
*
- * beginDecoding
+ * byteCount
field.
+ * Sets the value of the {@code byteCount} field.
*
- * beginDecoding
+ * srcMinX
field.
+ * Sets the value of the {@code srcMinX} field.
*
- * beginDecoding
+ * srcMinY
field.
+ * Sets the value of the {@code srcMinY} field.
*
- * beginDecoding
+ * srcWidth
field.
+ * Sets the value of the {@code srcWidth} field.
*
- * beginDecoding
+ * srcHeight
field.
+ * Sets the value of the {@code srcHeight} field.
*
- * beginDecoding
+ * sourceXOffset
field.
+ * Sets the value of the {@code sourceXOffset} field.
*
- * beginDecoding
+ * dstXOffset
field.
+ * Sets the value of the {@code dstXOffset} field.
*
- * beginDecoding
+ * sourceYOffset
.
+ * Sets the value of the {@code sourceYOffset}.
*
- * beginDecoding
+ * dstYOffset
field.
+ * Sets the value of the {@code dstYOffset} field.
*
- * beginDecoding
+ * subsampleX
field.
+ * Sets the value of the {@code subsampleX} field.
*
- * beginDecoding
+ * subsampleX
is
+ * @throws IllegalArgumentException if {@code subsampleX} is
* less than or equal to 0.
*/
public void setSubsampleX(int subsampleX) {
@@ -1540,15 +1540,15 @@
}
/**
- * Sets the value of the subsampleY
field.
+ * Sets the value of the {@code subsampleY} field.
*
- * beginDecoding
+ * subsampleY
is
+ * @throws IllegalArgumentException if {@code subsampleY} is
* less than or equal to 0.
*/
public void setSubsampleY(int subsampleY) {
@@ -1561,13 +1561,13 @@
// Band subsetting/rearrangement
/**
- * Sets the value of the sourceBands
field.
+ * Sets the value of the {@code sourceBands} field.
*
- * beginDecoding
+ * int
s
+ * @param sourceBands an array of {@code int}s
* specifying the source bands to be read.
*/
public void setSourceBands(int[] sourceBands) {
@@ -1576,13 +1576,13 @@
}
/**
- * Sets the value of the destinationBands
field.
+ * Sets the value of the {@code destinationBands} field.
*
- * beginDecoding
+ * int
s
+ * @param destinationBands an array of {@code int}s
* specifying the destination bands to be written.
*/
public void setDestinationBands(int[] destinationBands) {
@@ -1593,22 +1593,22 @@
// Destination image and region
/**
- * Sets the value of the image
field.
+ * Sets the value of the {@code image} field.
*
- * beginDecoding
+ * BufferedImage
.
+ * @param image the destination {@code BufferedImage}.
*/
public void setImage(BufferedImage image) {
this.image = image;
}
/**
- * Sets the value of the dstMinX
field.
+ * Sets the value of the {@code dstMinX} field.
*
- * beginDecoding
+ * dstMinY
field.
+ * Sets the value of the {@code dstMinY} field.
*
- * beginDecoding
+ * dstWidth
field.
+ * Sets the value of the {@code dstWidth} field.
*
- * beginDecoding
+ * dstHeight
field.
+ * Sets the value of the {@code dstHeight} field.
*
- * beginDecoding
+ * activeSrcMinX
field.
+ * Sets the value of the {@code activeSrcMinX} field.
*
- * beginDecoding
+ * activeSrcMinY
field.
+ * Sets the value of the {@code activeSrcMinY} field.
*
- * beginDecoding
+ * activeSrcWidth
field.
+ * Sets the value of the {@code activeSrcWidth} field.
*
- * beginDecoding
+ * activeSrcHeight
field.
+ * Sets the value of the {@code activeSrcHeight} field.
*
- * beginDecoding
+ * TIFFColorConverter
object describing the color
+ * Sets the {@code TIFFColorConverter} object describing the color
* space of the encoded data in the input stream. If no
- * TIFFColorConverter
is set, no conversion will be performed.
+ * {@code TIFFColorConverter} is set, no conversion will be performed.
*
- * @param colorConverter a TIFFColorConverter
object, or
- * null
.
+ * @param colorConverter a {@code TIFFColorConverter} object, or
+ * {@code null}.
*/
public void setColorConverter(TIFFColorConverter colorConverter) {
this.colorConverter = colorConverter;
}
/**
- * Returns an ImageTypeSpecifier
describing an image
+ * Returns an {@code ImageTypeSpecifier} describing an image
* whose underlying data array has the same format as the raw
* source pixel data.
*
- * @return an ImageTypeSpecifier
.
+ * @return an {@code ImageTypeSpecifier}.
*/
public ImageTypeSpecifier getRawImageType() {
ImageTypeSpecifier its =
@@ -1747,18 +1747,18 @@
}
/**
- * Creates a BufferedImage
whose underlying data
+ * Creates a {@code BufferedImage} whose underlying data
* array will be suitable for holding the raw decoded output of
- * the decodeRaw
method.
+ * the {@code decodeRaw} method.
*
* getRawImageType
, and calls the resulting
- * ImageTypeSpecifier
's
- * createBufferedImage
method.
+ * {@code getRawImageType}, and calls the resulting
+ * {@code ImageTypeSpecifier}'s
+ * {@code createBufferedImage} method.
*
- * @return a BufferedImage
whose underlying data
+ * @return a {@code BufferedImage} whose underlying data
* array has the same format as the raw source pixel data, or
- * null
if it is not possible to create such an
+ * {@code null} if it is not possible to create such an
* image.
*/
public BufferedImage createRawImage() {
@@ -1811,22 +1811,22 @@
}
/**
- * Decodes the source data into the provided byte
- * array b
, starting at the offset given by
- * dstOffset
. Each pixel occupies
- * bitsPerPixel
bits, with no padding between pixels.
- * Scanlines are separated by scanlineStride
- * byte
s.
+ * Decodes the source data into the provided {@code byte}
+ * array {@code b}, starting at the offset given by
+ * {@code dstOffset}. Each pixel occupies
+ * {@code bitsPerPixel} bits, with no padding between pixels.
+ * Scanlines are separated by {@code scanlineStride}
+ * {@code byte}s.
*
- * @param b a byte
array to be written.
- * @param dstOffset the starting offset in b
to be
+ * @param b a {@code byte} array to be written.
+ * @param dstOffset the starting offset in {@code b} to be
* written.
* @param bitsPerPixel the number of bits for each pixel.
- * @param scanlineStride the number of byte
s to
+ * @param scanlineStride the number of {@code byte}s to
* advance between that starting pixels of each scanline.
*
* @throws IOException if an error occurs reading from the source
- * ImageInputStream
.
+ * {@code ImageInputStream}.
*/
public abstract void decodeRaw(byte[] b,
int dstOffset,
@@ -1834,25 +1834,25 @@
int scanlineStride) throws IOException;
/**
- * Decodes the source data into the provided short
- * array s
, starting at the offset given by
- * dstOffset
. Each pixel occupies
- * bitsPerPixel
bits, with no padding between pixels.
- * Scanlines are separated by scanlineStride
- * short
s
+ * Decodes the source data into the provided {@code short}
+ * array {@code s}, starting at the offset given by
+ * {@code dstOffset}. Each pixel occupies
+ * {@code bitsPerPixel} bits, with no padding between pixels.
+ * Scanlines are separated by {@code scanlineStride}
+ * {@code short}s
*
- * decodeRaw(byte[] b,
- * ...)
and copies the resulting data into s
.
+ * short
array to be written.
- * @param dstOffset the starting offset in s
to be
+ * @param s a {@code short} array to be written.
+ * @param dstOffset the starting offset in {@code s} to be
* written.
* @param bitsPerPixel the number of bits for each pixel.
- * @param scanlineStride the number of short
s to
+ * @param scanlineStride the number of {@code short}s to
* advance between that starting pixels of each scanline.
*
* @throws IOException if an error occurs reading from the source
- * ImageInputStream
.
+ * {@code ImageInputStream}.
*/
public void decodeRaw(short[] s,
int dstOffset,
@@ -1891,25 +1891,25 @@
}
/**
- * Decodes the source data into the provided int
- * array i
, starting at the offset given by
- * dstOffset
. Each pixel occupies
- * bitsPerPixel
bits, with no padding between pixels.
- * Scanlines are separated by scanlineStride
- * int
s.
+ * Decodes the source data into the provided {@code int}
+ * array {@code i}, starting at the offset given by
+ * {@code dstOffset}. Each pixel occupies
+ * {@code bitsPerPixel} bits, with no padding between pixels.
+ * Scanlines are separated by {@code scanlineStride}
+ * {@code int}s.
*
- * decodeRaw(byte[] b,
- * ...)
and copies the resulting data into i
.
+ * int
array to be written.
- * @param dstOffset the starting offset in i
to be
+ * @param i an {@code int} array to be written.
+ * @param dstOffset the starting offset in {@code i} to be
* written.
* @param bitsPerPixel the number of bits for each pixel.
- * @param scanlineStride the number of int
s to
+ * @param scanlineStride the number of {@code int}s to
* advance between that starting pixels of each scanline.
*
* @throws IOException if an error occurs reading from the source
- * ImageInputStream
.
+ * {@code ImageInputStream}.
*/
public void decodeRaw(int[] i,
int dstOffset,
@@ -1953,25 +1953,25 @@
}
/**
- * Decodes the source data into the provided float
- * array f
, starting at the offset given by
- * dstOffset
. Each pixel occupies
- * bitsPerPixel
bits, with no padding between pixels.
- * Scanlines are separated by scanlineStride
- * float
s.
+ * Decodes the source data into the provided {@code float}
+ * array {@code f}, starting at the offset given by
+ * {@code dstOffset}. Each pixel occupies
+ * {@code bitsPerPixel} bits, with no padding between pixels.
+ * Scanlines are separated by {@code scanlineStride}
+ * {@code float}s.
*
- * decodeRaw(byte[] b,
- * ...)
and copies the resulting data into f
.
+ * float
array to be written.
- * @param dstOffset the starting offset in f
to be
+ * @param f a {@code float} array to be written.
+ * @param dstOffset the starting offset in {@code f} to be
* written.
* @param bitsPerPixel the number of bits for each pixel.
- * @param scanlineStride the number of float
s to
+ * @param scanlineStride the number of {@code float}s to
* advance between that starting pixels of each scanline.
*
* @throws IOException if an error occurs reading from the source
- * ImageInputStream
.
+ * {@code ImageInputStream}.
*/
public void decodeRaw(float[] f,
int dstOffset,
@@ -2017,25 +2017,25 @@
}
/**
- * Decodes the source data into the provided double
- * array f
, starting at the offset given by
- * dstOffset
. Each pixel occupies
- * bitsPerPixel
bits, with no padding between pixels.
- * Scanlines are separated by scanlineStride
- * double
s.
+ * Decodes the source data into the provided {@code double}
+ * array {@code f}, starting at the offset given by
+ * {@code dstOffset}. Each pixel occupies
+ * {@code bitsPerPixel} bits, with no padding between pixels.
+ * Scanlines are separated by {@code scanlineStride}
+ * {@code double}s.
*
- * decodeRaw(byte[] b,
- * ...)
and copies the resulting data into f
.
+ * double
array to be written.
- * @param dstOffset the starting offset in f
to be
+ * @param f a {@code double} array to be written.
+ * @param dstOffset the starting offset in {@code f} to be
* written.
* @param bitsPerPixel the number of bits for each pixel.
- * @param scanlineStride the number of double
s to
+ * @param scanlineStride the number of {@code double}s to
* advance between that starting pixels of each scanline.
*
* @throws IOException if an error occurs reading from the source
- * ImageInputStream
.
+ * {@code ImageInputStream}.
*/
public void decodeRaw(double[] d,
int dstOffset,
@@ -2104,16 +2104,16 @@
/**
* This routine is called prior to a sequence of calls to the
- * decode
method, in order to allow any necessary
+ * {@code decode} method, in order to allow any necessary
* tables or other structures to be initialized based on metadata
* values. This routine is guaranteed to be called any time the
* metadata values have changed.
*
* decode
method to rescale components to different
+ * {@code decode} method to rescale components to different
* bit depths. Thus, if this method is overridden, it is
- * important for the subclass method to call super()
,
- * unless it overrides decode
as well.
+ * important for the subclass method to call {@code super()},
+ * unless it overrides {@code decode} as well.
*/
public void beginDecoding() {
// Note: This method assumes that sourceBands, destinationBands,
@@ -2242,35 +2242,35 @@
/**
* Decodes the input bit stream (located in the
- * ImageInputStream
stream
, at offset
- * offset
, and continuing for byteCount
- * bytes) into the output BufferedImage
- * image
.
+ * {@code ImageInputStream} {@code stream}, at offset
+ * {@code offset}, and continuing for {@code byteCount}
+ * bytes) into the output {@code BufferedImage}
+ * {@code image}.
*
* decodeRaw
method. If not, a suitable image is
- * created. Next, decodeRaw
is called to perform the
+ * {@code decodeRaw} method. If not, a suitable image is
+ * created. Next, {@code decodeRaw} is called to perform the
* actual decoding, and the results are copied into the
* destination image if necessary. Subsampling and offsetting are
* performed automatically.
*
* stream
, offset
, and
- * byteCount
. These bits contain the data for the
- * region of the source image defined by srcMinX
,
- * srcMinY
, srcWidth
, and
- * srcHeight
.
+ * variables {@code stream}, {@code offset}, and
+ * {@code byteCount}. These bits contain the data for the
+ * region of the source image defined by {@code srcMinX},
+ * {@code srcMinY}, {@code srcWidth}, and
+ * {@code srcHeight}.
*
* sourceXOffset
th column and including
- * every subsampleX
th pixel thereafter (and similarly
- * for sourceYOffset
and
- * subsampleY
).
+ * the {@code sourceXOffset}th column and including
+ * every {@code subsampleX}th pixel thereafter (and similarly
+ * for {@code sourceYOffset} and
+ * {@code subsampleY}).
*
* dstXOffset
, dstYOffset
). The complete
+ * ({@code dstXOffset}, {@code dstYOffset}). The complete
* set of formulas relating the source and destination coordinate spaces
* are:
*
@@ -2279,9 +2279,9 @@
* dy = (sy - sourceYOffset)/subsampleY + dstYOffset;
*
*
- * Only source pixels such that (sx - sourceXOffset) %
- * subsampleX == 0
and (sy - sourceYOffset) %
- * subsampleY == 0
are copied.
+ * Only source pixels such that {@code (sx - sourceXOffset) %
+ * subsampleX == 0} and {@code (sy - sourceYOffset) %
+ * subsampleY == 0} are copied.
*
* dstMinX
,
- * dstMinY
, dstWidth
, and
- * dstHeight
.
+ * by the instance variables {@code dstMinX},
+ * {@code dstMinY}, {@code dstWidth}, and
+ * {@code dstHeight}.
*
* activeSrcMinX
,
- * activeSrcMinY
, activeSrcWidth
and
- * activeSrcHeight
. Thus, the source pixel at
- * (activeSrcMinX
, activeSrcMinY
) will
- * map to the destination pixel (dstMinX
,
- * dstMinY
).
+ * account) are available as {@code activeSrcMinX},
+ * {@code activeSrcMinY}, {@code activeSrcWidth} and
+ * {@code activeSrcHeight}. Thus, the source pixel at
+ * ({@code activeSrcMinX}, {@code activeSrcMinY}) will
+ * map to the destination pixel ({@code dstMinX},
+ * {@code dstMinY}).
*
* sourceBands
are to be copied into the sequence of
+ * {@code sourceBands} are to be copied into the sequence of
* bands in the destination given by
- * destinationBands
.
+ * {@code destinationBands}.
*
* photometricInterpretation
,
- * compression
, samplesPerPixel
,
- * bitsPerSample
, sampleFormat
,
- * extraSamples
, and colorMap
.
+ * variables {@code photometricInterpretation},
+ * {@code compression}, {@code samplesPerPixel},
+ * {@code bitsPerSample}, {@code sampleFormat},
+ * {@code extraSamples}, and {@code colorMap}.
*
* decodeRaw
and/or
- * getRawImageType
methods.
+ * and instead override the {@code decodeRaw} and/or
+ * {@code getRawImageType} methods.
*
* @exception IOException if an error occurs in
- * decodeRaw
.
+ * {@code decodeRaw}.
*/
public void decode() throws IOException {
byte[] byteData = null;
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFExifJPEGCompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFExifJPEGCompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFExifJPEGCompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -29,7 +29,7 @@
import javax.imageio.plugins.tiff.BaselineTIFFTagSet;
/**
- * A TIFFCompressor
for the JPEG variant of Exif.
+ * A {@code TIFFCompressor} for the JPEG variant of Exif.
*/
public class TIFFExifJPEGCompressor extends TIFFBaseJPEGCompressor {
public TIFFExifJPEGCompressor(ImageWriteParam param) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFaxCompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFaxCompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFaxCompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -232,12 +232,12 @@
}
/**
- * Sets the value of the metadata
field.
+ * Sets the value of the {@code metadata} field.
*
* IIOMetadata
object for the
+ * @param metadata the {@code IIOMetadata} object for the
* image being written.
*
* @see #getMetadata()
@@ -253,8 +253,8 @@
}
/**
- * Return min of maxOffset
or offset of first pixel
- * different from pixel at bitOffset
.
+ * Return min of {@code maxOffset} or offset of first pixel
+ * different from pixel at {@code bitOffset}.
*/
public int nextState(byte[] data,
int base,
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFieldNode.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFieldNode.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFieldNode.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -34,12 +34,12 @@
import javax.imageio.plugins.tiff.TIFFTagSet;
/**
- * The Node
representation of a TIFFField
+ * The {@code Node} representation of a {@code TIFFField}
* wherein the child node is procedural rather than buffered.
*/
public class TIFFFieldNode extends IIOMetadataNode {
private static String getNodeName(TIFFField f) {
- return f.getData() instanceof TIFFDirectory ?
+ return (f.hasDirectory() || f.getData() instanceof TIFFDirectory) ?
"TIFFIFD" : "TIFFField";
}
@@ -52,7 +52,8 @@
public TIFFFieldNode(TIFFField field) {
super(getNodeName(field));
- isIFD = field.getData() instanceof TIFFDirectory;
+ isIFD = field.hasDirectory() ||
+ field.getData() instanceof TIFFDirectory;
this.field = field;
@@ -68,7 +69,8 @@
setAttribute("parentTagName", tagName);
}
- TIFFDirectory dir = (TIFFDirectory)field.getData();
+ TIFFDirectory dir = field.hasDirectory() ?
+ field.getDirectory() : (TIFFDirectory)field.getData();
TIFFTagSet[] tagSets = dir.getTagSets();
if(tagSets != null) {
StringBuilder tagSetNames = new StringBuilder();
@@ -90,7 +92,8 @@
if(isInitialized) return;
if(isIFD) {
- TIFFDirectory dir = (TIFFDirectory)field.getData();
+ TIFFDirectory dir = field.hasDirectory() ?
+ field.getDirectory() : (TIFFDirectory)field.getData();
TIFFField[] fields = dir.getTIFFFields();
if(fields != null) {
TIFFTagSet[] tagSets = dir.getTagSets();
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -153,7 +153,7 @@
}
/**
- * Returns an Iterator
over the TIFF fields. The
+ * Returns an {@code Iterator} over the TIFF fields. The
* traversal is in the order of increasing tag number.
*/
// Note: the sort is guaranteed for low fields by the use of an
@@ -164,7 +164,7 @@
}
/**
- * Read the value of a field. The data
parameter should be
+ * Read the value of a field. The {@code data} parameter should be
* an array of length 1 of Object.
*
* @param stream the input stream
@@ -762,8 +762,8 @@
}
/**
- * Returns a TIFFIFD
wherein all fields from the
- * BaselineTIFFTagSet
are copied by value and all other
+ * Returns a {@code TIFFIFD} wherein all fields from the
+ * {@code BaselineTIFFTagSet} are copied by value and all other
* fields copied by reference.
*/
public TIFFIFD getShallowClone() {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageMetadata.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -1620,8 +1620,8 @@
}
/**
- * Returns a TIFFImageMetadata
wherein all fields in the
- * root IFD from the BaselineTIFFTagSet
are copied by value
+ * Returns a {@code TIFFImageMetadata} wherein all fields in the
+ * root IFD from the {@code BaselineTIFFTagSet} are copied by value
* and all other fields copied by reference.
*/
public TIFFImageMetadata getShallowClone() {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -83,7 +83,7 @@
// Metadata for image at 'currIndex', or null.
private TIFFImageMetadata imageMetadata = null;
- // A List
of Long
s indicating the stream
+ // A {@code List} of {@code Long}s indicating the stream
// positions of the start of the IFD for each image. Entries
// are added as needed.
private List
The canWriteTiles
and
- * canWriteCompressed
methods will return
- * true
; the canOffsetTiles
and
- * canWriteProgressive
methods will return
- * false
.
The {@code canWriteTiles} and + * {@code canWriteCompressed} methods will return + * {@code true}; the {@code canOffsetTiles} and + * {@code canWriteProgressive} methods will return + * {@code false}.
* * If tiles are being written, then each of their dimensions will be
* rounded to the nearest multiple of 16 per the TIFF specification. If
@@ -140,10 +140,10 @@
public class TIFFImageWriteParam extends ImageWriteParam {
/**
- * Constructs a TIFFImageWriteParam
instance
- * for a given Locale
.
+ * Constructs a {@code TIFFImageWriteParam} instance
+ * for a given {@code Locale}.
*
- * @param locale the Locale
for which messages
+ * @param locale the {@code Locale} for which messages
* should be localized.
*/
public TIFFImageWriteParam(Locale locale) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -221,11 +221,11 @@
* relative to a given tile grid layout specified by its X offset
* and tile width.
*
- *
If tileWidth < 0
, the results of this method
- * are undefined. If tileWidth == 0
, an
- * ArithmeticException
will be thrown.
+ *
If {@code tileWidth < 0}, the results of this method
+ * are undefined. If {@code tileWidth == 0}, an
+ * {@code ArithmeticException} will be thrown.
*
- * @throws ArithmeticException If tileWidth == 0
.
+ * @throws ArithmeticException If {@code tileWidth == 0}.
*/
public static int XToTileX(int x, int tileGridXOffset, int tileWidth) {
x -= tileGridXOffset;
@@ -240,11 +240,11 @@
* relative to a given tile grid layout specified by its Y offset
* and tile height.
*
- *
If tileHeight < 0
, the results of this method
- * are undefined. If tileHeight == 0
, an
- * ArithmeticException
will be thrown.
+ *
If {@code tileHeight < 0}, the results of this method
+ * are undefined. If {@code tileHeight == 0}, an
+ * {@code ArithmeticException} will be thrown.
*
- * @throws ArithmeticException If tileHeight == 0
.
+ * @throws ArithmeticException If {@code tileHeight == 0}.
*/
public static int YToTileY(int y, int tileGridYOffset, int tileHeight) {
y -= tileGridYOffset;
@@ -424,17 +424,17 @@
}
/**
- * Converts a standard javax_imageio_1.0
tree to a
- * TIFFImageMetadata
object.
+ * Converts a standard {@code javax_imageio_1.0} tree to a
+ * {@code TIFFImageMetadata} object.
*
* @param inData The metadata object.
- * @return a TIFFImageMetadata
or null
if
- * the standard tree derived from the input object is null
.
- * @throws IllegalArgumentException if inData
is
- * null
.
- * @throws IllegalArgumentException if inData
does not support
+ * @return a {@code TIFFImageMetadata} or {@code null} if
+ * the standard tree derived from the input object is {@code null}.
+ * @throws IllegalArgumentException if {@code inData} is
+ * {@code null}.
+ * @throws IllegalArgumentException if {@code inData} does not support
* the standard metadata format.
- * @throws IIOInvalidTreeException if inData
generates an
+ * @throws IIOInvalidTreeException if {@code inData} generates an
* invalid standard metadata tree.
*/
private TIFFImageMetadata convertStandardImageMetadata(IIOMetadata inData)
@@ -463,15 +463,15 @@
/**
* Converts a native
- * javax_imageio_tiff_image_1.0
tree to a
- * TIFFImageMetadata
object.
+ * {@code javax_imageio_tiff_image_1.0} tree to a
+ * {@code TIFFImageMetadata} object.
*
* @param inData The metadata object.
- * @return a TIFFImageMetadata
or null
if
- * the native tree derived from the input object is null
.
- * @throws IllegalArgumentException if inData
is
- * null
or does not support the native metadata format.
- * @throws IIOInvalidTreeException if inData
generates an
+ * @return a {@code TIFFImageMetadata} or {@code null} if
+ * the native tree derived from the input object is {@code null}.
+ * @throws IllegalArgumentException if {@code inData} is
+ * {@code null} or does not support the native metadata format.
+ * @throws IIOInvalidTreeException if {@code inData} generates an
* invalid native metadata tree.
*/
private TIFFImageMetadata convertNativeImageMetadata(IIOMetadata inData)
@@ -504,8 +504,8 @@
* as needed. The destination image dimensions are provided as parameters
* because these might differ from those of the source due to subsampling.
*
- * @param cm The ColorModel
of the image being written.
- * @param sm The SampleModel
of the image being written.
+ * @param cm The {@code ColorModel} of the image being written.
+ * @param sm The {@code SampleModel} of the image being written.
* @param destWidth The width of the written image after subsampling.
* @param destHeight The height of the written image after subsampling.
*/
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -102,14 +102,14 @@
}
/**
- * Sets the value of the metadata
field.
+ * Sets the value of the {@code metadata} field.
*
*
The implementation in this class also adds the TIFF fields * JPEGTables, YCbCrSubSampling, YCbCrPositioning, and * ReferenceBlackWhite superseding any prior settings of those * fields.
* - * @param metadata theIIOMetadata
object for the
+ * @param metadata the {@code IIOMetadata} object for the
* image being written.
*
* @see #getMetadata()
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -245,7 +245,7 @@
}
/**
- * Append newString
to the end of oldString
.
+ * Append {@code newString} to the end of {@code oldString}.
*/
public byte[] composeString(byte oldString[], byte newString) {
int length = oldString.length;
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWUtil.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWUtil.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWUtil.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -188,7 +188,7 @@
}
/**
- * Append newString
to the end of oldString
.
+ * Append {@code newString} to the end of {@code oldString}.
*/
public byte[] composeString(byte oldString[], byte newString) {
int length = oldString.length;
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFNullDecompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFNullDecompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFNullDecompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -34,16 +34,16 @@
*/
private boolean isReadActiveOnly = false;
- /** The original value of srcMinX
. */
+ /** The original value of {@code srcMinX}. */
private int originalSrcMinX;
- /** The original value of srcMinY
. */
+ /** The original value of {@code srcMinY}. */
private int originalSrcMinY;
- /** The original value of srcWidth
. */
+ /** The original value of {@code srcWidth}. */
private int originalSrcWidth;
- /** The original value of srcHeight
. */
+ /** The original value of {@code srcHeight}. */
private int originalSrcHeight;
public TIFFNullDecompressor() {}
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -34,7 +34,7 @@
import javax.imageio.plugins.tiff.TIFFField;
/**
- * TIFFDecompressor
for "Old JPEG" compression.
+ * {@code TIFFDecompressor} for "Old JPEG" compression.
*/
public class TIFFOldJPEGDecompressor extends TIFFJPEGDecompressor {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFRLECompressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFRLECompressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFRLECompressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -42,8 +42,8 @@
* CCITT RLE (Run Lenth Encoding).
*
* @param data The row of data to compress.
- * @param rowOffset Starting index in data
.
- * @param colOffset Bit offset within first data[rowOffset]
.
+ * @param rowOffset Starting index in {@code data}.
+ * @param colOffset Bit offset within first {@code data[rowOffset]}.
* @param rowLength Number of bits in the row.
* @param compData The compressed data.
*
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFRenderedImage.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFRenderedImage.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFRenderedImage.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -85,15 +85,15 @@
}
/**
- * Creates a copy of param
. The source subsampling and
+ * Creates a copy of {@code param}. The source subsampling and
* and bands settings and the destination bands and offset settings
- * are copied. If param
is a TIFFImageReadParam
- * then the TIFFDecompressor
and
- * TIFFColorConverter
settings are also copied; otherwise
- * they are explicitly set to null
.
+ * are copied. If {@code param} is a {@code TIFFImageReadParam}
+ * then the {@code TIFFDecompressor} and
+ * {@code TIFFColorConverter} settings are also copied; otherwise
+ * they are explicitly set to {@code null}.
*
* @param param the parameters to be copied.
- * @param copyTagSets whether the TIFFTagSet
settings
+ * @param copyTagSets whether the {@code TIFFTagSet} settings
* should be copied if set.
* @return copied parameters.
*/
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFT4Compressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFT4Compressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFT4Compressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -41,13 +41,13 @@
}
/**
- * Sets the value of the metadata
field.
+ * Sets the value of the {@code metadata} field.
*
* The implementation in this class also sets local options * from the T4_OPTIONS field if it exists, and if it doesn't, adds * it with default values.
* - * @param metadata theIIOMetadata
object for the
+ * @param metadata the {@code IIOMetadata} object for the
* image being written.
*
* @see #getMetadata()
@@ -86,7 +86,7 @@
* @param isEOLAligned Whether EOL bit sequences should be padded.
* @param data The row of data to compress.
* @param lineStride Byte step between the same sample in different rows.
- * @param colOffset Bit offset within first data[rowOffset]
.
+ * @param colOffset Bit offset within first {@code data[rowOffset]}.
* @param width Number of bits in the row.
* @param height Number of rows in the buffer.
* @param compData The compressed data.
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFT6Compressor.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFT6Compressor.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFT6Compressor.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -42,7 +42,7 @@
*
* @param data The row of data to compress.
* @param lineStride Byte step between the same sample in different rows.
- * @param colOffset Bit offset within first data[rowOffset]
.
+ * @param colOffset Bit offset within first {@code data[rowOffset]}.
* @param width Number of bits in the row.
* @param height Number of rows in the buffer.
* @param compData The compressed data.
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileReader.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, 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
@@ -26,11 +26,11 @@
package com.sun.media.sound;
import java.io.DataInputStream;
-import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFileFormat.Type;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
@@ -49,11 +49,6 @@
throws UnsupportedAudioFileException, IOException {
DataInputStream dis = new DataInputStream(stream);
- // assumes a stream at the beginning of the file which has already
- // passed the magic number test...
- // leaves the input stream at the beginning of the audio data
- int fileRead = 0;
- int dataLength = 0;
AudioFormat format = null;
// Read the magic number
@@ -65,9 +60,9 @@
throw new UnsupportedAudioFileException("not an AIFF file");
}
+ int frameLength = 0;
int length = dis.readInt();
int iffType = dis.readInt();
- fileRead += 12;
int totallength;
if(length <= 0 ) {
@@ -91,7 +86,6 @@
// Read the chunk name
int chunkName = dis.readInt();
int chunkLen = dis.readInt();
- fileRead += 8;
int chunkRead = 0;
@@ -112,7 +106,13 @@
if (channels <= 0) {
throw new UnsupportedAudioFileException("Invalid number of channels");
}
- dis.readInt(); // numSampleFrames
+ frameLength = dis.readInt(); // numSampleFrames
+ if (frameLength < 0) {
+ // AiffFileFormat uses int, unlike AIS which uses long
+ //TODO this (negative) value should be passed as long to AIS
+ frameLength = AudioSystem.NOT_SPECIFIED;
+ }
+
int sampleSizeInBits = dis.readUnsignedShort();
if (sampleSizeInBits < 1 || sampleSizeInBits > 32) {
throw new UnsupportedAudioFileException("Invalid AIFF/COMM sampleSize");
@@ -149,38 +149,17 @@
break;
case AiffFileFormat.SSND_MAGIC:
// Data chunk.
- // we are getting *weird* numbers for chunkLen sometimes;
- // this really should be the size of the data chunk....
- int dataOffset = dis.readInt();
- int blocksize = dis.readInt();
+ int dataOffset = dis.readInt(); // for now unused in javasound
+ int blocksize = dis.readInt(); // for now unused in javasound
chunkRead += 8;
-
- // okay, now we are done reading the header. we need to set the size
- // of the data segment. we know that sometimes the value we get for
- // the chunksize is absurd. this is the best i can think of:if the
- // value seems okay, use it. otherwise, we get our value of
- // length by assuming that everything left is the data segment;
- // its length should be our original length (for all AIFF data chunks)
- // minus what we've read so far.
- // $$kk: we should be able to get length for the data chunk right after
- // we find "SSND." however, some aiff files give *weird* numbers. what
- // is going on??
-
- if (chunkLen < length) {
- dataLength = chunkLen - chunkRead;
- } else {
- // $$kk: 11.03.98: this seems dangerous!
- dataLength = length - (fileRead + chunkRead);
- }
ssndFound = true;
break;
} // switch
- fileRead += chunkRead;
// skip the remainder of this chunk
if (!ssndFound) {
int toSkip = chunkLen - chunkRead;
if (toSkip > 0) {
- fileRead += dis.skipBytes(toSkip);
+ dis.skipBytes(toSkip);
}
}
} // while
@@ -188,36 +167,12 @@
if (format == null) {
throw new UnsupportedAudioFileException("missing COMM chunk");
}
- AudioFileFormat.Type type = aifc?AudioFileFormat.Type.AIFC:AudioFileFormat.Type.AIFF;
+ Type type = aifc ? Type.AIFC : Type.AIFF;
- return new AiffFileFormat(type, totallength, format, dataLength / format.getFrameSize());
+ return new AiffFileFormat(type, totallength, format, frameLength);
}
// HELPER METHODS
- /** write_ieee_extended(DataOutputStream dos, double f) throws IOException {
- * Extended precision IEEE floating-point conversion routine.
- * @argument DataOutputStream
- * @argument double
- * @return void
- * @exception IOException
- */
- private void write_ieee_extended(DataOutputStream dos, double f) throws IOException {
-
- int exponent = 16398;
- double highMantissa = f;
-
- // For now write the integer portion of f
- // $$jb: 03.30.99: stay in synch with JMF on this!!!!
- while (highMantissa < 44000) {
- highMantissa *= 2;
- exponent--;
- }
- dos.writeShort(exponent);
- dos.writeInt( ((int) highMantissa) << 16);
- dos.writeInt(0); // low Mantissa
- }
-
-
/**
* read_ieee_extended
* Extended precision IEEE floating-point conversion routine.
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java Mon Mar 14 17:51:25 2016 +0100
@@ -59,7 +59,6 @@
super(new AudioFileFormat.Type[]{AudioFileFormat.Type.AIFF});
}
-
// METHODS TO IMPLEMENT AudioFileWriter
@Override
@@ -83,7 +82,6 @@
return new AudioFileFormat.Type[0];
}
-
@Override
public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException {
Objects.requireNonNull(stream);
@@ -102,11 +100,9 @@
throw new IOException("stream length not specified");
}
- int bytesWritten = writeAiffFile(stream, aiffFileFormat, out);
- return bytesWritten;
+ return writeAiffFile(stream, aiffFileFormat, out);
}
-
@Override
public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException {
Objects.requireNonNull(stream);
@@ -129,12 +125,15 @@
// $$kk: 10.22.99: jan: please either implement this or throw an exception!
// $$fb: 2001-07-13: done. Fixes Bug 4479981
- int ssndBlockSize = (aiffFileFormat.getFormat().getChannels() * aiffFileFormat.getFormat().getSampleSizeInBits());
+ int channels = aiffFileFormat.getFormat().getChannels();
+ int sampleSize = aiffFileFormat.getFormat().getSampleSizeInBits();
+ int ssndBlockSize = channels * ((sampleSize + 7) / 8);
int aiffLength=bytesWritten;
int ssndChunkSize=aiffLength-aiffFileFormat.getHeaderSize()+16;
long dataSize=ssndChunkSize-16;
- int numFrames=(int) (dataSize*8/ssndBlockSize);
+ //TODO possibly incorrect round
+ int numFrames = (int) (dataSize / ssndBlockSize);
RandomAccessFile raf=new RandomAccessFile(out, "rw");
// skip FORM magic
@@ -173,12 +172,7 @@
AudioFormat streamFormat = stream.getFormat();
AudioFormat.Encoding streamEncoding = streamFormat.getEncoding();
-
- float sampleRate;
int sampleSizeInBits;
- int channels;
- int frameSize;
- float frameRate;
int fileSize;
boolean convert8to16 = false;
@@ -235,7 +229,6 @@
return fileFormat;
}
-
private int writeAiffFile(InputStream in, AiffFileFormat aiffFileFormat, OutputStream out) throws IOException {
int bytesRead = 0;
@@ -275,25 +268,20 @@
AudioFormat.Encoding encoding = null;
//$$fb a little bit nicer handling of constants
-
- //int headerSize = 54;
int headerSize = aiffFileFormat.getHeaderSize();
-
//int fverChunkSize = 0;
int fverChunkSize = aiffFileFormat.getFverChunkSize();
- //int commChunkSize = 26;
int commChunkSize = aiffFileFormat.getCommChunkSize();
int aiffLength = -1;
int ssndChunkSize = -1;
- //int ssndOffset = headerSize - 16;
int ssndOffset = aiffFileFormat.getSsndChunkOffset();
short channels = (short) format.getChannels();
short sampleSize = (short) format.getSampleSizeInBits();
- int ssndBlockSize = (channels * sampleSize);
- int numFrames = aiffFileFormat.getFrameLength();
- long dataSize = -1;
+ int ssndBlockSize = channels * ((sampleSize + 7) / 8);
+ int numFrames = aiffFileFormat.getFrameLength();
+ long dataSize = -1;
if( numFrames != AudioSystem.NOT_SPECIFIED) {
- dataSize = (long) numFrames * ssndBlockSize / 8;
+ dataSize = (long) numFrames * ssndBlockSize;
ssndChunkSize = (int)dataSize + 16;
aiffLength = (int)dataSize+headerSize;
}
@@ -403,9 +391,6 @@
}
-
-
-
// HELPER METHODS
private static final int DOUBLE_MANTISSA_LENGTH = 52;
@@ -452,6 +437,4 @@
dos.writeShort(extendedBits79To64);
dos.writeLong(extendedBits63To0);
}
-
-
}
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java Mon Mar 14 17:51:25 2016 +0100
@@ -255,16 +255,17 @@
public AudioInputStream getAudioInputStream(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
- AudioFileFormat format = getAudioFileFormat(stream);
+ final AudioFileFormat format = getAudioFileFormat(stream);
// we've got everything, the stream is supported and it is at the
// beginning of the header, so find the data chunk again and return an
// AudioInputStream
- RIFFReader riffiterator = new RIFFReader(stream);
+ final RIFFReader riffiterator = new RIFFReader(stream);
while (riffiterator.hasNextChunk()) {
RIFFReader chunk = riffiterator.nextChunk();
if (chunk.getFormat().equals("data")) {
- return new AudioInputStream(chunk, format.getFormat(), chunk
- .getSize());
+ final AudioFormat af = format.getFormat();
+ final long length = chunk.getSize() / af.getFrameSize();
+ return new AudioInputStream(chunk, af, length);
}
}
throw new UnsupportedAudioFileException();
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java Mon Mar 14 17:51:25 2016 +0100
@@ -95,16 +95,17 @@
public AudioInputStream getAudioInputStream(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
- AudioFileFormat format = getAudioFileFormat(stream);
+ final AudioFileFormat format = getAudioFileFormat(stream);
// we've got everything, the stream is supported and it is at the
// beginning of the header, so find the data chunk again and return an
// AudioInputStream
- RIFFReader riffiterator = new RIFFReader(stream);
+ final RIFFReader riffiterator = new RIFFReader(stream);
while (riffiterator.hasNextChunk()) {
RIFFReader chunk = riffiterator.nextChunk();
if (chunk.getFormat().equals("data")) {
- return new AudioInputStream(chunk, format.getFormat(),
- chunk.getSize());
+ final AudioFormat af = format.getFormat();
+ final long length = chunk.getSize() / af.getFrameSize();
+ return new AudioInputStream(chunk, af, length);
}
}
throw new UnsupportedAudioFileException();
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java
--- a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java Mon Mar 14 17:51:25 2016 +0100
@@ -231,7 +231,9 @@
// Before all the checks below we first see if it's an FTP provider or a focus cycle root.
// If it's the case just go down cycle (if it's set to "implicit").
Component comp = getComponentDownCycle(aComponent, FORWARD_TRAVERSAL);
- if (comp != null) {
+ // Check if aComponent is focus-cycle-root's default Component, i.e.
+ // focus cycle root & focus-cycle-root's default Component is same.
+ if (comp != null && comp != aComponent) {
return comp;
}
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/java/beans/EventHandler.java
--- a/jdk/src/java.desktop/share/classes/java/beans/EventHandler.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/java/beans/EventHandler.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -526,8 +526,11 @@
* @throws NullPointerException if {@code listenerInterface} is null
* @throws NullPointerException if {@code target} is null
* @throws NullPointerException if {@code action} is null
- *
+ * @throws IllegalArgumentException if creating a Proxy for
+ * {@code listenerInterface} fails for any of the restrictions
+ * specified by {@link Proxy#newProxyInstance}
* @see #create(Class, Object, String, String)
+ * @see Proxy#newProxyInstance
*/
public static BaselineTIFFTagSet
.
+ * Returns a shared instance of a {@code BaselineTIFFTagSet}.
*
- * @return a BaselineTIFFTagSet
instance.
+ * @return a {@code BaselineTIFFTagSet} instance.
*/
public synchronized static BaselineTIFFTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -51,7 +51,7 @@
/**
* A value to be used with the "GPSVersionID" tag to indicate GPS version
* 2.2. The value equals the US-ASCII encoding of the byte array
- * {'2', '2', '0', '0'}
.
+ * {@code {'2', '2', '0', '0'}}.
*
* @see #TAG_GPS_VERSION_ID
*/
@@ -711,9 +711,9 @@
}
/**
- * Returns a shared instance of an ExifGPSTagSet
.
+ * Returns a shared instance of an {@code ExifGPSTagSet}.
*
- * @return an ExifGPSTagSet
instance.
+ * @return an {@code ExifGPSTagSet} instance.
*/
public synchronized static ExifGPSTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -88,9 +88,9 @@
/**
* Returns the shared instance of
- * ExifInteroperabilityTagSet
.
+ * {@code ExifInteroperabilityTagSet}.
*
- * @return the ExifInteroperabilityTagSet
instance.
+ * @return the {@code ExifInteroperabilityTagSet} instance.
*/
public synchronized static ExifInteroperabilityTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -80,9 +80,9 @@
}
/**
- * Returns a shared instance of an ExifParentTIFFTagSet
.
+ * Returns a shared instance of an {@code ExifParentTIFFTagSet}.
*
- * @return an ExifParentTIFFTagSet
instance.
+ * @return an {@code ExifParentTIFFTagSet} instance.
*/
public synchronized static ExifParentTIFFTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -33,7 +33,7 @@
* standard for annotating images used by most digital camera
* manufacturers. The Exif specification may be found at
*
- * http://www.exif.org/Exif2-2.PDF
+ * {@code http://www.exif.org/Exif2-2.PDF}
* .
*
* The definitions of the data types referenced by the field
@@ -67,7 +67,7 @@
/**
* A value to be used with the "ExifVersion" tag to indicate Exif version
* 2.1. The value equals the US-ASCII encoding of the byte array
- * {'0', '2', '1', '0'}
.
+ * {@code {'0', '2', '1', '0'}}.
*
* @see #TAG_EXIF_VERSION
*/
@@ -78,7 +78,7 @@
/**
* A value to be used with the "ExifVersion" tag to indicate Exif version
* 2.2. The value equals the US-ASCII encoding of the byte array
- * {'0', '2', '2', '0'}
.
+ * {@code {'0', '2', '2', '0'}}.
*
* @see #TAG_EXIF_VERSION
*/
@@ -94,7 +94,7 @@
/**
* A tag indicating the color space information (type SHORT). The
- * legal values are given by the COLOR_SPACE_*
+ * legal values are given by the {@code COLOR_SPACE_*}
* constants.
*
* @see #COLOR_SPACE_SRGB
@@ -1256,7 +1256,7 @@
static class ExifVersion extends TIFFTag {
public ExifVersion() {
- super("Exifversion",
+ super("ExifVersion",
TAG_EXIF_VERSION,
1 << TIFFTag.TIFF_UNDEFINED,
4);
@@ -1992,9 +1992,9 @@
}
/**
- * Returns a shared instance of an ExifTIFFTagSet
.
+ * Returns a shared instance of an {@code ExifTIFFTagSet}.
*
- * @return an ExifTIFFTagSet
instance.
+ * @return an {@code ExifTIFFTagSet} instance.
*/
public synchronized static ExifTIFFTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -131,9 +131,9 @@
}
/**
- * Returns a shared instance of a FaxTIFFTagSet
.
+ * Returns a shared instance of a {@code FaxTIFFTagSet}.
*
- * @return a FaxTIFFTagSet
instance.
+ * @return a {@code FaxTIFFTagSet} instance.
*/
public synchronized static FaxTIFFTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -32,7 +32,7 @@
* standard for annotating georeferenced or geocoded raster imagery.
* The GeoTIFF specification may be found at
- * http://www.remotesensing.org/geotiff/spec/geotiffhome.html
+ * {@code http://www.remotesensing.org/geotiff/spec/geotiffhome.html}
* . This class does not handle the GeoKeys referenced
* from a GeoKeyDirectoryTag as those are not TIFF tags per se.
*
@@ -63,7 +63,7 @@
/** A tag used to store the GeoKey directory. */
public static final int TAG_GEO_KEY_DIRECTORY = 34735;
- /** A tag used to store all double
-values GeoKeys. */
+ /** A tag used to store all {@code double}-values GeoKeys. */
public static final int TAG_GEO_DOUBLE_PARAMS = 34736;
/** A tag used to store all ASCII-values GeoKeys. */
@@ -97,7 +97,7 @@
static class GeoKeyDirectory extends TIFFTag {
public GeoKeyDirectory() {
- super("GeoKeyDirectory",
+ super("GeoKeyDirectoryTag",
TAG_GEO_KEY_DIRECTORY,
1 << TIFFTag.TIFF_SHORT);
}
@@ -105,7 +105,7 @@
static class GeoDoubleParams extends TIFFTag {
public GeoDoubleParams() {
- super("GeoDoubleParams",
+ super("GeoDoubleParamsTag",
TAG_GEO_DOUBLE_PARAMS,
1 << TIFFTag.TIFF_DOUBLE);
}
@@ -113,7 +113,7 @@
static class GeoAsciiParams extends TIFFTag {
public GeoAsciiParams() {
- super("GeoAsciiParams",
+ super("GeoAsciiParamsTag",
TAG_GEO_ASCII_PARAMS,
1 << TIFFTag.TIFF_ASCII);
}
@@ -137,9 +137,9 @@
}
/**
- * Returns a shared instance of a GeoTIFFTagSet
.
+ * Returns a shared instance of a {@code GeoTIFFTagSet}.
*
- * @return a GeoTIFFTagSet
instance.
+ * @return a {@code GeoTIFFTagSet} instance.
*/
public synchronized static GeoTIFFTagSet getInstance() {
if (theInstance == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFDirectory.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -41,58 +41,58 @@
* image metadata. A TIFF image metadata tree represents an Image File
* Directory (IFD) from a TIFF 6.0 stream. An IFD consists of a number of
* IFD Entries each of which associates an identifying tag number with
- * a compatible value. A TIFFDirectory
instance corresponds
+ * a compatible value. A {@code TIFFDirectory} instance corresponds
* to an IFD and contains a set of {@link TIFFField}s each of which
* corresponds to an IFD Entry in the IFD.
*
- *
When reading, a TIFFDirectory
may be created by passing
+ *
When reading, a {@code TIFFDirectory} may be created by passing * the value returned by {@link javax.imageio.ImageReader#getImageMetadata * ImageReader.getImageMetadata()} to {@link #createFromMetadata * createFromMetadata()}. The {@link TIFFField}s in the directory may then * be obtained using the accessor methods provided in this class.
* *When writing, an {@link IIOMetadata} object for use by one of the
- * write()
methods of {@link javax.imageio.ImageWriter} may be
- * created from a TIFFDirectory
by {@link #getAsMetadata()}.
- * The TIFFDirectory
itself may be created by construction or
- * from the IIOMetadata
object returned by
+ * {@code write()} methods of {@link javax.imageio.ImageWriter} may be
+ * created from a {@code TIFFDirectory} by {@link #getAsMetadata()}.
+ * The {@code TIFFDirectory} itself may be created by construction or
+ * from the {@code IIOMetadata} object returned by
* {@link javax.imageio.ImageWriter#getDefaultImageMetadata
- * ImageWriter.getDefaultImageMetadata()}. The TIFFField
s in the
+ * ImageWriter.getDefaultImageMetadata()}. The {@code TIFFField}s in the
* directory may be set using the mutator methods provided in this class.
A TIFFDirectory
is aware of the tag numbers in the
+ *
A {@code TIFFDirectory} is aware of the tag numbers in the
* group of {@link TIFFTagSet}s associated with it. When
- * a TIFFDirectory
is created from a native image metadata
+ * a {@code TIFFDirectory} is created from a native image metadata
* object, these tag sets are derived from the tagSets attribute
* of the TIFFIFD node.
A TIFFDirectory
might also have a parent {@link TIFFTag}.
+ *
A {@code TIFFDirectory} might also have a parent {@link TIFFTag}.
* This will occur if the directory represents an IFD other than the root
* IFD of the image. The parent tag is the tag of the IFD Entry which is a
- * pointer to the IFD represented by this TIFFDirectory
. The
- * {@link TIFFTag#isIFDPointer} method of this parent TIFFTag
- * must return true
. When a TIFFDirectory
is
+ * pointer to the IFD represented by this {@code TIFFDirectory}. The
+ * {@link TIFFTag#isIFDPointer} method of this parent {@code TIFFTag}
+ * must return {@code true}. When a {@code TIFFDirectory} is
* created from a native image metadata object, the parent tag set is set
* from the parentTagName attribute of the corresponding
- * TIFFIFD node. Note that a TIFFDirectory
instance
- * which has a non-null
parent tag will be contained in the
- * data field of a TIFFField
instance which has a tag field
+ * TIFFIFD node. Note that a {@code TIFFDirectory} instance
+ * which has a non-{@code null} parent tag will be contained in the
+ * data field of a {@code TIFFField} instance which has a tag field
* equal to the contained directory's parent tag.
As an example consider an Exif image. The TIFFDirectory
+ *
As an example consider an Exif image. The {@code TIFFDirectory}
* instance corresponding to the Exif IFD in the Exif stream would have parent
* tag {@link ExifParentTIFFTagSet#TAG_EXIF_IFD_POINTER TAG_EXIF_IFD_POINTER}
* and would include {@link ExifTIFFTagSet} in its group of known tag sets.
- * The TIFFDirectory
corresponding to this Exif IFD will be
- * contained in the data field of a TIFFField
which will in turn
- * be contained in the TIFFDirectory
corresponding to the primary
- * IFD of the Exif image which will itself have a null
-valued
+ * The {@code TIFFDirectory} corresponding to this Exif IFD will be
+ * contained in the data field of a {@code TIFFField} which will in turn
+ * be contained in the {@code TIFFDirectory} corresponding to the primary
+ * IFD of the Exif image which will itself have a {@code null}-valued
* parent tag.
Note that this implementation is not synchronized. If multiple
- * threads use a TIFFDirectory
instance concurrently, and at
+ * threads use a {@code TIFFDirectory} instance concurrently, and at
* least one of the threads modifies the directory, for example, by adding
- * or removing TIFFField
s or TIFFTagSet
s, it
+ * or removing {@code TIFFField}s or {@code TIFFTagSet}s, it
* must be synchronized externally.
TIFFTagSets
associated with this directory. */
+ /** The {@code TIFFTagSets} associated with this directory. */
private ListTIFFTag
of this directory. */
+ /** The parent {@code TIFFTag} of this directory. */
private TIFFTag parentTag;
/**
@@ -123,13 +123,13 @@
private int numLowFields = 0;
/**
- * A mapping of Integer
tag numbers to TIFFField
s
+ * A mapping of {@code Integer} tag numbers to {@code TIFFField}s
* for fields which are not low tag numbered.
*/
private MapTIFFDirectory
instance from the contents of
+ * Creates a {@code TIFFDirectory} instance from the contents of
* an image metadata object. The supplied object must support an image
* metadata format supported by the TIFF {@link javax.imageio.ImageWriter}
* plug-in. This will usually be either the TIFF native image metadata
@@ -139,12 +139,12 @@
* @param tiffImageMetadata A metadata object which supports a compatible
* image metadata format.
*
- * @return A TIFFDirectory
populated from the contents of
+ * @return A {@code TIFFDirectory} populated from the contents of
* the supplied metadata object.
*
- * @throws NullPointerException if tiffImageMetadata
- * is null
.
- * @throws IllegalArgumentException if tiffImageMetadata
+ * @throws NullPointerException if {@code tiffImageMetadata}
+ * is {@code null}.
+ * @throws IllegalArgumentException if {@code tiffImageMetadata}
* does not support a compatible image metadata format.
* @throws IIOInvalidTreeException if the supplied metadata object
* cannot be parsed.
@@ -204,7 +204,7 @@
}
/**
- * Converts a TIFFDirectory
to a TIFFIFD
.
+ * Converts a {@code TIFFDirectory} to a {@code TIFFIFD}.
*/
private static TIFFIFD getDirectoryAsIFD(TIFFDirectory dir) {
if(dir instanceof TIFFIFD) {
@@ -219,27 +219,39 @@
TIFFField f = fields[i];
TIFFTag tag = f.getTag();
if(tag.isIFDPointer()) {
- TIFFDirectory subIFD =
- getDirectoryAsIFD((TIFFDirectory)f.getData());
- f = new TIFFField(tag, f.getType(), (long)f.getCount(), subIFD);
+ TIFFDirectory subDir = null;
+ if (f.hasDirectory()) {
+ subDir = f.getDirectory();
+ } else if (f.getData() instanceof TIFFDirectory) {
+ subDir = (TIFFDirectory)f.getData();
+ }
+ if (subDir != null) {
+ TIFFDirectory subIFD = getDirectoryAsIFD(subDir);
+ f = new TIFFField(tag, f.getType(), (long)f.getCount(),
+ subIFD);
+ } else {
+ f = null;
+ }
}
- ifd.addTIFFField(f);
+ if (f != null) {
+ ifd.addTIFFField(f);
+ }
}
return ifd;
}
/**
- * Constructs a TIFFDirectory
which is aware of a given
+ * Constructs a {@code TIFFDirectory} which is aware of a given
* group of {@link TIFFTagSet}s. An optional parent {@link TIFFTag}
* may also be specified.
*
- * @param tagSets The TIFFTagSets
associated with this
+ * @param tagSets The {@code TIFFTagSets} associated with this
* directory.
- * @param parentTag The parent TIFFTag
of this directory;
- * may be null
.
- * @throws NullPointerException if tagSets
is
- * null
.
+ * @param parentTag The parent {@code TIFFTag} of this directory;
+ * may be {@code null}.
+ * @throws NullPointerException if {@code tagSets} is
+ * {@code null}.
*/
public TIFFDirectory(TIFFTagSet[] tagSets, TIFFTag parentTag) {
if(tagSets == null) {
@@ -256,8 +268,8 @@
/**
* Returns the {@link TIFFTagSet}s of which this directory is aware.
*
- * @return The TIFFTagSet
s associated with this
- * TIFFDirectory
.
+ * @return The {@code TIFFTagSet}s associated with this
+ * {@code TIFFDirectory}.
*/
public TIFFTagSet[] getTagSets() {
return tagSets.toArray(new TIFFTagSet[tagSets.size()]);
@@ -267,9 +279,9 @@
* Adds an element to the group of {@link TIFFTagSet}s of which this
* directory is aware.
*
- * @param tagSet The TIFFTagSet
to add.
- * @throws NullPointerException if tagSet
is
- * null
.
+ * @param tagSet The {@code TIFFTagSet} to add.
+ * @throws NullPointerException if {@code tagSet} is
+ * {@code null}.
*/
public void addTagSet(TIFFTagSet tagSet) {
if(tagSet == null) {
@@ -285,9 +297,9 @@
* Removes an element from the group of {@link TIFFTagSet}s of which this
* directory is aware.
*
- * @param tagSet The TIFFTagSet
to remove.
- * @throws NullPointerException if tagSet
is
- * null
.
+ * @param tagSet The {@code TIFFTagSet} to remove.
+ * @throws NullPointerException if {@code tagSet} is
+ * {@code null}.
*/
public void removeTagSet(TIFFTagSet tagSet) {
if(tagSet == null) {
@@ -301,10 +313,10 @@
/**
* Returns the parent {@link TIFFTag} of this directory if one
- * has been defined or null
otherwise.
+ * has been defined or {@code null} otherwise.
*
- * @return The parent TIFFTag
of this
- * TIFFDiectory
or null
.
+ * @return The parent {@code TIFFTag} of this
+ * {@code TIFFDiectory} or {@code null}.
*/
public TIFFTag getParentTag() {
return parentTag;
@@ -312,12 +324,12 @@
/**
* Returns the {@link TIFFTag} which has tag number equal to
- * tagNumber
or null
if no such tag
+ * {@code tagNumber} or {@code null} if no such tag
* exists in the {@link TIFFTagSet}s associated with this
* directory.
*
* @param tagNumber The tag number of interest.
- * @return The corresponding TIFFTag
or null
.
+ * @return The corresponding {@code TIFFTag} or {@code null}.
*/
public TIFFTag getTag(int tagNumber) {
return TIFFIFD.getTag(tagNumber, tagSets);
@@ -326,8 +338,8 @@
/**
* Returns the number of {@link TIFFField}s in this directory.
*
- * @return The number of TIFFField
s in this
- * TIFFDirectory
.
+ * @return The number of {@code TIFFField}s in this
+ * {@code TIFFDirectory}.
*/
public int getNumTIFFFields() {
return numLowFields + highFields.size();
@@ -339,7 +351,7 @@
*
* @param tagNumber The tag number.
* @return Whether a {@link TIFFTag} with tag number equal to
- * tagNumber
is present in this TIFFDirectory
.
+ * {@code tagNumber} is present in this {@code TIFFDirectory}.
*/
public boolean containsTIFFField(int tagNumber) {
return (tagNumber >= 0 && tagNumber <= MAX_LOW_FIELD_TAG_NUM &&
@@ -351,7 +363,7 @@
* Adds a TIFF field to the directory.
*
* @param f The field to add.
- * @throws NullPointerException if f
is null
.
+ * @throws NullPointerException if {@code f} is {@code null}.
*/
public void addTIFFField(TIFFField f) {
if(f == null) {
@@ -372,8 +384,8 @@
* Retrieves a TIFF field from the directory.
*
* @param tagNumber The tag number of the tag associated with the field.
- * @return A TIFFField
with the requested tag number of
- * null
if no such field is present.
+ * @return A {@code TIFFField} with the requested tag number of
+ * {@code null} if no such field is present.
*/
public TIFFField getTIFFField(int tagNumber) {
TIFFField f;
@@ -444,7 +456,7 @@
* Converts the directory to a metadata object.
*
* @return A metadata instance initialized from the contents of this
- * TIFFDirectory
.
+ * {@code TIFFDirectory}.
*/
public IIOMetadata getAsMetadata() {
return new TIFFImageMetadata(getDirectoryAsIFD(this));
@@ -453,7 +465,7 @@
/**
* Clones the directory and all the fields contained therein.
*
- * @return A clone of this TIFFDirectory
.
+ * @return A clone of this {@code TIFFDirectory}.
* @throws CloneNotSupportedException if the instance cannot be cloned.
*/
@Override
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFField.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -35,7 +35,7 @@
*
* A field in a TIFF Image File Directory (IFD) is defined as a
* tag number accompanied by a sequence of values of identical data type.
- * TIFF 6.0 defines 12 data types; a 13th type IFD
is
+ * TIFF 6.0 defines 12 data types; a 13th type {@code IFD} is
* defined in TIFF Tech Note 1 of TIFF Specification Supplement 1. These
* TIFF data types are referred to by Java constants and mapped internally
* onto Java language data types and type names as follows:
@@ -68,10 +68,10 @@
* {@link TIFFTag#TIFF_BYTE}
*
*
byte
+ * {@code byte}
* "Byte"
+ * {@code "Byte"}
* String
+ * {@code String}
* "Ascii"
+ * {@code "Ascii"}
* char
+ * {@code char}
* "Short"
+ * {@code "Short"}
* long
+ * {@code long}
* "Long"
+ * {@code "Long"}
* long[2]
{numerator, denominator}
+ * {@code long[2]} {numerator, denominator}
* "Rational"
+ * {@code "Rational"}
* byte
+ * {@code byte}
* "SByte"
+ * {@code "SByte"}
* byte
+ * {@code byte}
* "Undefined"
+ * {@code "Undefined"}
* short
+ * {@code short}
* "SShort"
+ * {@code "SShort"}
* int
+ * {@code int}
* "SLong"
+ * {@code "SLong"}
* int[2]
{numerator, denominator}
+ * {@code int[2]} {numerator, denominator}
* "SRational"
+ * {@code "SRational"}
* float
+ * {@code float}
* "Float"
+ * {@code "Float"}
* double
+ * {@code double}
* "Double"
+ * {@code "Double"}
* long
+ * {@code long}
* "IFDPointer"
+ * {@code "IFDPointer"}
* TIFFField
from a TIFF native image
+ * Creates a {@code TIFFField} from a TIFF native image
* metadata node. If the value of the "tagNumber" attribute
- * of the node is not found in tagSet
then a new
- * TIFFTag
with name TIFFTag.UNKNOWN_TAG_NAME
+ * of the node is not found in {@code tagSet} then a new
+ * {@code TIFFTag} with name {@code TIFFTag.UNKNOWN_TAG_NAME}
* will be created and assigned to the field.
*
- * @param tagSet The TIFFTagSet
to which the
- * TIFFTag
of the field belongs.
- * @param node A native TIFF image metadata TIFFField
node.
- * @throws NullPointerException if node
is
- * null
.
+ * @param tagSet The {@code TIFFTagSet} to which the
+ * {@code TIFFTag} of the field belongs.
+ * @param node A native TIFF image metadata {@code TIFFField} node.
+ * @throws NullPointerException if {@code node} is
+ * {@code null}.
* @throws IllegalArgumentException if the name of the node is not
- * "TIFFField"
.
+ * {@code "TIFFField"}.
* @return A new {@code TIFFField}.
*/
public static TIFFField createFromMetadataNode(TIFFTagSet tagSet,
@@ -487,14 +487,14 @@
}
/**
- * Constructs a TIFFField
with arbitrary data. The
- * type
parameter must be a value for which
+ * Constructs a {@code TIFFField} with arbitrary data. The
+ * {@code type} parameter must be a value for which
* {@link TIFFTag#isDataTypeOK tag.isDataTypeOK()}
- * returns true
. The data
parameter must
+ * returns {@code true}. The {@code data} parameter must
* be an array of a Java type appropriate for the type of the TIFF
* field.
*
- * Note that the value (data) of the TIFFField
+ *
Note that the value (data) of the {@code TIFFField}
* will always be the actual field value regardless of the number of
* bytes required for that value. This is the case despite the fact
* that the TIFF IFD Entry corresponding to the field may
@@ -503,24 +503,29 @@
* value fits into 4 bytes). In other words, the value of the
* field will already have been read from the TIFF stream. (An exception
* to this case may occur when the field represents the contents of a
- * non-baseline IFD. In that case the data will be a long[]
- * containing the offset to the IFD and the TIFFDirectory
+ * non-baseline IFD. In that case the data will be a {@code long[]}
+ * containing the offset to the IFD and the {@code TIFFDirectory}
* returned by {@link #getDirectory()} will be its contents.)
*
* @param tag The tag to associated with this field.
- * @param type One of the TIFFTag.TIFF_*
constants
+ * @param type One of the {@code TIFFTag.TIFF_*} constants
* indicating the data type of the field as written to the TIFF stream.
* @param count The number of data values.
* @param data The actual data content of the field.
*
- * @throws NullPointerException if tag == null
.
- * @throws IllegalArgumentException if type
is not
- * one of the TIFFTag.TIFF_*
data type constants.
- * @throws IllegalArgumentException if type
is an unacceptable
- * data type for the supplied TIFFTag
.
- * @throws IllegalArgumentException if count < 0
.
- * @throws NullPointerException if data == null
.
- * @throws IllegalArgumentException if data
is an instance of
+ * @throws NullPointerException if {@code tag == null}.
+ * @throws IllegalArgumentException if {@code type} is not
+ * one of the {@code TIFFTag.TIFF_*} data type constants.
+ * @throws IllegalArgumentException if {@code type} is an unacceptable
+ * data type for the supplied {@code TIFFTag}.
+ * @throws IllegalArgumentException if {@code count < 0}.
+ * @throws IllegalArgumentException if {@code count < 1}
+ * and {@code type} is {@code TIFF_RATIONAL} or
+ * {@code TIFF_SRATIONAL}.
+ * @throws IllegalArgumentException if {@code count ≠ 1}
+ * and {@code type} is {@code TIFF_IFD_POINTER}.
+ * @throws NullPointerException if {@code data == null}.
+ * @throws IllegalArgumentException if {@code data} is an instance of
* a class incompatible with the specified type.
* @throws IllegalArgumentException if the size of the data array is wrong.
*/
@@ -534,6 +539,14 @@
+ " for " + tag.getName() + " tag");
} else if(count < 0) {
throw new IllegalArgumentException("count < 0!");
+ } else if((type == TIFFTag.TIFF_RATIONAL
+ || type == TIFFTag.TIFF_SRATIONAL)
+ && count < 1) {
+ throw new IllegalArgumentException
+ ("Type is TIFF_RATIONAL or TIFF_SRATIONAL and count < 1");
+ } else if (type == TIFFTag.TIFF_IFD_POINTER && count != 1) {
+ throw new IllegalArgumentException
+ ("Type is TIFF_IFD_POINTER count != 1");
} else if(data == null) {
throw new NullPointerException("data == null!");
}
@@ -612,15 +625,15 @@
* parameters and the created array.
*
* @param tag The tag to associated with this field.
- * @param type One of the TIFFTag.TIFF_*
constants
+ * @param type One of the {@code TIFFTag.TIFF_*} constants
* indicating the data type of the field as written to the TIFF stream.
* @param count The number of data values.
- * @throws NullPointerException if tag == null
.
- * @throws IllegalArgumentException if type
is not
- * one of the TIFFTag.TIFF_*
data type constants.
- * @throws IllegalArgumentException if type
is an unacceptable
- * data type for the supplied TIFFTag
.
- * @throws IllegalArgumentException if count < 0
.
+ * @throws NullPointerException if {@code tag == null}.
+ * @throws IllegalArgumentException if {@code type} is not
+ * one of the {@code TIFFTag.TIFF_*} data type constants.
+ * @throws IllegalArgumentException if {@code type} is an unacceptable
+ * data type for the supplied {@code TIFFTag}.
+ * @throws IllegalArgumentException if {@code count < 0}.
* @see #TIFFField(TIFFTag,int,int,Object)
*/
public TIFFField(TIFFTag tag, int type, int count) {
@@ -628,20 +641,20 @@
}
/**
- * Constructs a TIFFField
with a single non-negative integral
+ * Constructs a {@code TIFFField} with a single non-negative integral
* value.
* The field will have type
* {@link TIFFTag#TIFF_SHORT TIFF_SHORT} if
- * val < 65536
and type
+ * {@code val < 65536} and type
* {@link TIFFTag#TIFF_LONG TIFF_LONG} otherwise. The count
* of the field will be unity.
*
* @param tag The tag to associate with this field.
* @param value The value to associate with this field.
- * @throws NullPointerException if tag == null
.
+ * @throws NullPointerException if {@code tag == null}.
* @throws IllegalArgumentException if the derived type is unacceptable
- * for the supplied TIFFTag
.
- * @throws IllegalArgumentException if value < 0
.
+ * for the supplied {@code TIFFTag}.
+ * @throws IllegalArgumentException if {@code value < 0}.
*/
public TIFFField(TIFFTag tag, int value) {
if(tag == null) {
@@ -677,24 +690,24 @@
}
/**
- * Constructs a TIFFField
with an IFD offset and contents.
+ * Constructs a {@code TIFFField} with an IFD offset and contents.
* The offset will be stored as the data of this field as
- * long[] {offset}
. The directory will not be cloned. The count
+ * {@code long[] {offset}}. The directory will not be cloned. The count
* of the field will be unity.
*
* @param tag The tag to associated with this field.
- * @param type One of the constants TIFFTag.TIFF_LONG
or
- * TIFFTag.TIFF_IFD_POINTER
.
+ * @param type One of the constants {@code TIFFTag.TIFF_LONG} or
+ * {@code TIFFTag.TIFF_IFD_POINTER}.
* @param offset The IFD offset.
* @param dir The directory.
*
- * @throws NullPointerException if tag == null
.
- * @throws IllegalArgumentException if type
is neither
- * TIFFTag.TIFF_LONG
nor TIFFTag.TIFF_IFD_POINTER
.
- * @throws IllegalArgumentException if type
is an unacceptable
- * data type for the supplied TIFFTag
.
- * @throws IllegalArgumentException if offset
is non-positive.
- * @throws NullPointerException if dir == null
.
+ * @throws NullPointerException if {@code tag == null}.
+ * @throws IllegalArgumentException if {@code type} is neither
+ * {@code TIFFTag.TIFF_LONG} nor {@code TIFFTag.TIFF_IFD_POINTER}.
+ * @throws IllegalArgumentException if {@code type} is an unacceptable
+ * data type for the supplied {@code TIFFTag}.
+ * @throws IllegalArgumentException if {@code offset} is non-positive.
+ * @throws NullPointerException if {@code dir == null}.
*
* @see #TIFFField(TIFFTag,int,int,Object)
*/
@@ -715,14 +728,14 @@
/**
* Retrieves the tag associated with this field.
*
- * @return The associated TIFFTag
.
+ * @return The associated {@code TIFFTag}.
*/
public TIFFTag getTag() {
return tag;
}
/**
- * Retrieves the tag number in the range [0, 65535]
.
+ * Retrieves the tag number in the range {@code [0, 65535]}.
*
* @return The tag number.
*/
@@ -732,7 +745,7 @@
/**
* Returns the type of the data stored in the field. For a TIFF 6.0
- * stream, the value will equal one of the TIFFTag.TIFF_*
+ * stream, the value will equal one of the {@code TIFFTag.TIFF_*}
* constants. For future revisions of TIFF, higher values are possible.
*
* @return The data type of the field value.
@@ -744,11 +757,11 @@
/**
* Returns the name of the supplied data type constant.
*
- * @param dataType One of the TIFFTag.TIFF_*
constants
+ * @param dataType One of the {@code TIFFTag.TIFF_*} constants
* indicating the data type of the field as written to the TIFF stream.
* @return The type name corresponding to the supplied type constant.
- * @throws IllegalArgumentException if dataType
is not
- * one of the TIFFTag.TIFF_*
data type constants.
+ * @throws IllegalArgumentException if {@code dataType} is not
+ * one of the {@code TIFFTag.TIFF_*} data type constants.
*/
public static String getTypeName(int dataType) {
if (dataType < TIFFTag.MIN_DATATYPE ||
@@ -761,11 +774,11 @@
/**
* Returns the data type constant corresponding to the supplied data
- * type name. If the name is unknown -1
will be returned.
+ * type name. If the name is unknown {@code -1} will be returned.
*
* @param typeName The type name.
- * @return One of the TIFFTag.TIFF_*
constants or
- * -1
if the name is not recognized.
+ * @return One of the {@code TIFFTag.TIFF_*} constants or
+ * {@code -1} if the name is not recognized.
*/
public static int getTypeByName(String typeName) {
for (int i = TIFFTag.MIN_DATATYPE; i <= TIFFTag.MAX_DATATYPE; i++) {
@@ -780,14 +793,14 @@
/**
* Creates an array appropriate for the indicated data type.
*
- * @param dataType One of the TIFFTag.TIFF_*
data type
+ * @param dataType One of the {@code TIFFTag.TIFF_*} data type
* constants.
* @param count The number of values in the array.
* @return An array appropriate for the specified data type.
*
- * @throws IllegalArgumentException if dataType
is not
- * one of the TIFFTag.TIFF_*
data type constants.
- * @throws IllegalArgumentException if count < 0
.
+ * @throws IllegalArgumentException if {@code dataType} is not
+ * one of the {@code TIFFTag.TIFF_*} data type constants.
+ * @throws IllegalArgumentException if {@code count < 0}.
*/
public static Object createArrayForType(int dataType, int count) {
if(count < 0) {
@@ -823,15 +836,15 @@
}
/**
- * Returns the TIFFField
as a node named either
+ * Returns the {@code TIFFField} as a node named either
* "TIFFField" or "TIFFIFD" as described in the
* TIFF native image metadata specification. The node will be named
* "TIFFIFD" if and only if the field's data object is an
* instance of {@link TIFFDirectory} or equivalently
* {@link TIFFTag#isIFDPointer getTag.isIFDPointer()} returns
- * true
.
+ * {@code true}.
*
- * @return a Node
named "TIFFField" or
+ * @return a {@code Node} named "TIFFField" or
* "TIFFIFD".
*/
public Node getAsNativeNode() {
@@ -850,8 +863,8 @@
/**
* Returns the number of data items present in the field. For
- * TIFFTag.TIFF_ASCII
fields, the value returned is the
- * number of String
s, not the total length of the
+ * {@code TIFFTag.TIFF_ASCII} fields, the value returned is the
+ * number of {@code String}s, not the total length of the
* data as in the file representation.
*
* @return The number of data items present in the field.
@@ -871,17 +884,17 @@
/**
* Returns the data as an uninterpreted array of
- * byte
s. The type of the field must be one of
- * TIFFTag.TIFF_BYTE
, TIFF_SBYTE
, or
- * TIFF_UNDEFINED
.
+ * {@code byte}s. The type of the field must be one of
+ * {@code TIFFTag.TIFF_BYTE}, {@code TIFF_SBYTE}, or
+ * {@code TIFF_UNDEFINED}.
*
- *
For data in TIFFTag.TIFF_BYTE
format, the application
+ *
For data in {@code TIFFTag.TIFF_BYTE} format, the application
* must take care when promoting the data to longer integral types
* to avoid sign extension.
*
* @throws ClassCastException if the field is not of type
- * TIFF_BYTE
, TIFF_SBYTE
, or
- * TIFF_UNDEFINED
.
+ * {@code TIFF_BYTE}, {@code TIFF_SBYTE}, or
+ * {@code TIFF_UNDEFINED}.
* @return The data as an uninterpreted array of bytes.
*/
public byte[] getAsBytes() {
@@ -889,11 +902,11 @@
}
/**
- * Returns TIFFTag.TIFF_SHORT
data as an array of
- * char
s (unsigned 16-bit integers).
+ * Returns {@code TIFFTag.TIFF_SHORT} data as an array of
+ * {@code char}s (unsigned 16-bit integers).
*
* @throws ClassCastException if the field is not of type
- * TIFF_SHORT
.
+ * {@code TIFF_SHORT}.
* @return The data as an array of {@code char}s.
*/
public char[] getAsChars() {
@@ -901,11 +914,11 @@
}
/**
- * Returns TIFFTag.TIFF_SSHORT
data as an array of
- * short
s (signed 16-bit integers).
+ * Returns {@code TIFFTag.TIFF_SSHORT} data as an array of
+ * {@code short}s (signed 16-bit integers).
*
* @throws ClassCastException if the field is not of type
- * TIFF_SSHORT
.
+ * {@code TIFF_SSHORT}.
* @return The data as an array of {@code short}s.
*/
public short[] getAsShorts() {
@@ -913,12 +926,12 @@
}
/**
- * Returns TIFFTag.TIFF_SLONG
data as an array of
- * int
s (signed 32-bit integers).
+ * Returns {@code TIFFTag.TIFF_SLONG} data as an array of
+ * {@code int}s (signed 32-bit integers).
*
* @throws ClassCastException if the field is not of type
- * TIFF_SHORT
, TIFF_SSHORT
, or
- * TIFF_SLONG
.
+ * {@code TIFF_SHORT}, {@code TIFF_SSHORT}, or
+ * {@code TIFF_SLONG}.
* @return The data as an array of {@code int}s.
*/
public int[] getAsInts() {
@@ -944,12 +957,12 @@
}
/**
- * Returns TIFFTag.TIFF_LONG
or
- * TIFF_IFD_POINTER
data as an array of
- * long
s (signed 64-bit integers).
+ * Returns {@code TIFFTag.TIFF_LONG} or
+ * {@code TIFF_IFD_POINTER} data as an array of
+ * {@code long}s (signed 64-bit integers).
*
* @throws ClassCastException if the field is not of type
- * TIFF_LONG
or TIFF_IFD_POINTER
.
+ * {@code TIFF_LONG} or {@code TIFF_IFD_POINTER}.
* @return The data as an array of {@code long}s.
*/
public long[] getAsLongs() {
@@ -957,11 +970,11 @@
}
/**
- * Returns TIFFTag.TIFF_FLOAT
data as an array of
- * float
s (32-bit floating-point values).
+ * Returns {@code TIFFTag.TIFF_FLOAT} data as an array of
+ * {@code float}s (32-bit floating-point values).
*
* @throws ClassCastException if the field is not of type
- * TIFF_FLOAT
.
+ * {@code TIFF_FLOAT}.
* @return The data as an array of {@code float}s.
*/
public float[] getAsFloats() {
@@ -969,11 +982,11 @@
}
/**
- * Returns TIFFTag.TIFF_DOUBLE
data as an array of
- * double
s (64-bit floating-point values).
+ * Returns {@code TIFFTag.TIFF_DOUBLE} data as an array of
+ * {@code double}s (64-bit floating-point values).
*
* @throws ClassCastException if the field is not of type
- * TIFF_DOUBLE
.
+ * {@code TIFF_DOUBLE}.
* @return The data as an array of {@code double}s.
*/
public double[] getAsDoubles() {
@@ -981,11 +994,11 @@
}
/**
- * Returns TIFFTag.TIFF_SRATIONAL
data as an array of
- * 2-element arrays of int
s.
+ * Returns {@code TIFFTag.TIFF_SRATIONAL} data as an array of
+ * 2-element arrays of {@code int}s.
*
* @throws ClassCastException if the field is not of type
- * TIFF_SRATIONAL
.
+ * {@code TIFF_SRATIONAL}.
* @return The data as an array of signed rationals.
*/
public int[][] getAsSRationals() {
@@ -993,11 +1006,11 @@
}
/**
- * Returns TIFFTag.TIFF_RATIONAL
data as an array of
- * 2-element arrays of long
s.
+ * Returns {@code TIFFTag.TIFF_RATIONAL} data as an array of
+ * 2-element arrays of {@code long}s.
*
* @throws ClassCastException if the field is not of type
- * TIFF_RATIONAL
.
+ * {@code TIFF_RATIONAL}.
* @return The data as an array of unsigned rationals.
*/
public long[][] getAsRationals() {
@@ -1005,30 +1018,30 @@
}
/**
- * Returns data in any format as an int
.
+ * Returns data in any format as an {@code int}.
*
- *
TIFFTag.TIFF_BYTE
values are treated as unsigned; that
+ *
{@code TIFFTag.TIFF_BYTE} values are treated as unsigned; that
* is, no sign extension will take place and the returned value
- * will be in the range [0, 255]. TIFF_SBYTE
data
+ * will be in the range [0, 255]. {@code TIFF_SBYTE} data
* will be returned in the range [-128, 127].
*
- *
A TIFF_UNDEFINED
value is treated as though
- * it were a TIFF_BYTE
.
+ *
A {@code TIFF_UNDEFINED} value is treated as though + * it were a {@code TIFF_BYTE}. * - *
Data in TIFF_SLONG
, TIFF_LONG
,
- * TIFF_FLOAT
, TIFF_DOUBLE
or
- * TIFF_IFD_POINTER
format are simply cast to
- * int
and may suffer from truncation.
+ *
Data in {@code TIFF_SLONG}, {@code TIFF_LONG}, + * {@code TIFF_FLOAT}, {@code TIFF_DOUBLE} or + * {@code TIFF_IFD_POINTER} format are simply cast to + * {@code int} and may suffer from truncation. * - *
Data in TIFF_SRATIONAL
or
- * TIFF_RATIONAL
format are evaluated by dividing the
+ *
Data in {@code TIFF_SRATIONAL} or
+ * {@code TIFF_RATIONAL} format are evaluated by dividing the
* numerator into the denominator using double-precision
- * arithmetic and then casting to int
. Loss of
+ * arithmetic and then casting to {@code int}. Loss of
* precision and truncation may occur.
*
- *
Data in TIFF_ASCII
format will be parsed as by
- * the Double.parseDouble
method, with the result
- * case to int
.
+ *
Data in {@code TIFF_ASCII} format will be parsed as by
+ * the {@code Double.parseDouble} method, with the result
+ * case to {@code int}.
*
* @param index The index of the data.
* @return The data at the given index as an {@code int}.
@@ -1068,17 +1081,17 @@
}
/**
- * Returns data in any format as a long
.
+ * Returns data in any format as a {@code long}.
*
- *
TIFFTag.TIFF_BYTE
and TIFF_UNDEFINED
data
+ *
{@code TIFFTag.TIFF_BYTE} and {@code TIFF_UNDEFINED} data
* are treated as unsigned; that is, no sign extension will take
* place and the returned value will be in the range [0, 255].
- * TIFF_SBYTE
data will be returned in the range
+ * {@code TIFF_SBYTE} data will be returned in the range
* [-128, 127].
*
- *
Data in TIFF_ASCII
format will be parsed as by
- * the Double.parseDouble
method, with the result
- * cast to long
.
+ *
Data in {@code TIFF_ASCII} format will be parsed as by
+ * the {@code Double.parseDouble} method, with the result
+ * cast to {@code long}.
*
* @param index The index of the data.
* @return The data at the given index as a {@code long}.
@@ -1114,27 +1127,27 @@
}
/**
- * Returns data in any format as a float
.
+ * Returns data in any format as a {@code float}.
*
- *
TIFFTag.TIFF_BYTE
and TIFF_UNDEFINED
data
+ *
{@code TIFFTag.TIFF_BYTE} and {@code TIFF_UNDEFINED} data
* are treated as unsigned; that is, no sign extension will take
* place and the returned value will be in the range [0, 255].
- * TIFF_SBYTE
data will be returned in the range
+ * {@code TIFF_SBYTE} data will be returned in the range
* [-128, 127].
*
- *
Data in TIFF_SLONG
, TIFF_LONG
,
- * TIFF_DOUBLE
, or TIFF_IFD_POINTER
format are
- * simply cast to float
and may suffer from
+ *
Data in {@code TIFF_SLONG}, {@code TIFF_LONG}, + * {@code TIFF_DOUBLE}, or {@code TIFF_IFD_POINTER} format are + * simply cast to {@code float} and may suffer from * truncation. * - *
Data in TIFF_SRATIONAL
or
- * TIFF_RATIONAL
format are evaluated by dividing the
+ *
Data in {@code TIFF_SRATIONAL} or
+ * {@code TIFF_RATIONAL} format are evaluated by dividing the
* numerator into the denominator using double-precision
- * arithmetic and then casting to float
.
+ * arithmetic and then casting to {@code float}.
*
- *
Data in TIFF_ASCII
format will be parsed as by
- * the Double.parseDouble
method, with the result
- * cast to float
.
+ *
Data in {@code TIFF_ASCII} format will be parsed as by
+ * the {@code Double.parseDouble} method, with the result
+ * cast to {@code float}.
*
* @param index The index of the data.
* @return The data at the given index as a {@code float}.
@@ -1174,21 +1187,21 @@
}
/**
- * Returns data in any format as a double
.
+ * Returns data in any format as a {@code double}.
*
- *
TIFFTag.TIFF_BYTE
and TIFF_UNDEFINED
data
+ *
{@code TIFFTag.TIFF_BYTE} and {@code TIFF_UNDEFINED} data
* are treated as unsigned; that is, no sign extension will take
* place and the returned value will be in the range [0, 255].
- * TIFF_SBYTE
data will be returned in the range
+ * {@code TIFF_SBYTE} data will be returned in the range
* [-128, 127].
*
- *
Data in TIFF_SRATIONAL
or
- * TIFF_RATIONAL
format are evaluated by dividing the
+ *
Data in {@code TIFF_SRATIONAL} or + * {@code TIFF_RATIONAL} format are evaluated by dividing the * numerator into the denominator using double-precision * arithmetic. * - *
Data in TIFF_ASCII
format will be parsed as by
- * the Double.parseDouble
method.
+ *
Data in {@code TIFF_ASCII} format will be parsed as by
+ * the {@code Double.parseDouble} method.
*
* @param index The index of the data.
* @return The data at the given index as a {@code double}.
@@ -1228,11 +1241,11 @@
}
/**
- * Returns a TIFFTag.TIFF_ASCII
value as a
- * String
.
+ * Returns a {@code TIFFTag.TIFF_ASCII} value as a
+ * {@code String}.
*
* @throws ClassCastException if the field is not of type
- * TIFF_ASCII
.
+ * {@code TIFF_ASCII}.
*
* @param index The index of the data.
* @return The data at the given index as a {@code String}.
@@ -1242,13 +1255,13 @@
}
/**
- * Returns a TIFFTag.TIFF_SRATIONAL
data item as a
- * two-element array of int
s.
+ * Returns a {@code TIFFTag.TIFF_SRATIONAL} data item as a
+ * two-element array of {@code int}s.
*
* @param index The index of the data.
* @return The data at the given index as a signed rational.
* @throws ClassCastException if the field is not of type
- * TIFF_SRATIONAL
.
+ * {@code TIFF_SRATIONAL}.
*/
public int[] getAsSRational(int index) {
return ((int[][])data)[index];
@@ -1261,7 +1274,7 @@
* @param index The index of the data.
* @return The data at the given index as an unsigned rational.
* @throws ClassCastException if the field is not of type
- * TIFF_RATIONAL
.
+ * {@code TIFF_RATIONAL}.
*/
public long[] getAsRational(int index) {
return ((long[][])data)[index];
@@ -1269,11 +1282,11 @@
/**
- * Returns a String
containing a human-readable
+ * Returns a {@code String} containing a human-readable
* version of the data item. Data of type
- * TIFFTag.TIFF_RATIONAL
or TIFF_SRATIONAL
are
+ * {@code TIFFTag.TIFF_RATIONAL} or {@code TIFF_SRATIONAL} are
* represented as a pair of integers separated by a
- * '/'
character.
+ * {@code '/'} character.
*
* @param index The index of the data.
* @return The data at the given index as a {@code String}.
@@ -1342,7 +1355,7 @@
}
/**
- * Returns whether the field has a TIFFDirectory
.
+ * Returns whether the field has a {@code TIFFDirectory}.
*
* @return true if and only if getDirectory() returns non-null.
*/
@@ -1351,8 +1364,8 @@
}
/**
- * Returns the associated TIFFDirectory
, if available. If no
- * directory is set, then null
will be returned.
+ * Returns the associated {@code TIFFDirectory}, if available. If no
+ * directory is set, then {@code null} will be returned.
*
* @return the TIFFDirectory instance or null.
*/
@@ -1363,7 +1376,7 @@
/**
* Clones the field and all the information contained therein.
*
- * @return A clone of this TIFFField
.
+ * @return A clone of this {@code TIFFField}.
* @throws CloneNotSupportedException if the instance cannot be cloned.
*/
@Override
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFImageReadParam.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -39,11 +39,11 @@
* be provided by this interface.
*
*
Additional TIFF tags must be organized into
- * If there are mnemonic names to be associated with the legal
* data values for the tag, {@link #addValueName(int, String)
@@ -183,18 +183,18 @@
}
/**
- * Constructs a Many TIFF extensions use the IFD mechanism in order to limit the
* number of new tags that may appear in the root IFD. This class and its subclasses are responsible for mapping
- * between raw tag numbers and The returned object is unmodifiable and contains the tag
- * numbers of all The returned object is unmodifiable and contains the tag
- * names of all TIFFTagSet
s. A TIFFTagSet
may be
+ * {@code TIFFTagSet}s. A {@code TIFFTagSet} may be
* provided to the reader by means of the
- * addAllowedTagSet
method. By default, the tag sets
- * BaselineTIFFTagSet
, FaxTIFFTagSet
,
- * ExifParentTIFFTagSet
, and GeoTIFFTagSet
+ * {@code addAllowedTagSet} method. By default, the tag sets
+ * {@code BaselineTIFFTagSet}, {@code FaxTIFFTagSet},
+ * {@code ExifParentTIFFTagSet}, and {@code GeoTIFFTagSet}
* are included.
*
* @since 9
@@ -53,10 +53,10 @@
private ListTIFFImageReadParam
. Tags defined by
- * the TIFFTagSet
s BaselineTIFFTagSet
,
- * FaxTIFFTagSet
, ExifParentTIFFTagSet
, and
- * GeoTIFFTagSet
will be supported.
+ * Constructs a {@code TIFFImageReadParam}. Tags defined by
+ * the {@code TIFFTagSet}s {@code BaselineTIFFTagSet},
+ * {@code FaxTIFFTagSet}, {@code ExifParentTIFFTagSet}, and
+ * {@code GeoTIFFTagSet} will be supported.
*
* @see BaselineTIFFTagSet
* @see FaxTIFFTagSet
@@ -71,13 +71,13 @@
}
/**
- * Adds a TIFFTagSet
object to the list of allowed
+ * Adds a {@code TIFFTagSet} object to the list of allowed
* tag sets.
*
- * @param tagSet a TIFFTagSet
.
+ * @param tagSet a {@code TIFFTagSet}.
*
- * @throws IllegalArgumentException if tagSet
is
- * null
.
+ * @throws IllegalArgumentException if {@code tagSet} is
+ * {@code null}.
*/
public void addAllowedTagSet(TIFFTagSet tagSet) {
if (tagSet == null) {
@@ -87,15 +87,15 @@
}
/**
- * Removes a TIFFTagSet
object from the list of
- * allowed tag sets. Removal is based on the equals
- * method of the TIFFTagSet
, which is normally
+ * Removes a {@code TIFFTagSet} object from the list of
+ * allowed tag sets. Removal is based on the {@code equals}
+ * method of the {@code TIFFTagSet}, which is normally
* defined as reference equality.
*
- * @param tagSet a TIFFTagSet
.
+ * @param tagSet a {@code TIFFTagSet}.
*
- * @throws IllegalArgumentException if tagSet
is
- * null
.
+ * @throws IllegalArgumentException if {@code tagSet} is
+ * {@code null}.
*/
public void removeAllowedTagSet(TIFFTagSet tagSet) {
if (tagSet == null) {
@@ -105,10 +105,10 @@
}
/**
- * Returns a List
containing the allowed
- * TIFFTagSet
objects.
+ * Returns a {@code List} containing the allowed
+ * {@code TIFFTagSet} objects.
*
- * @return a List
of TIFFTagSet
s.
+ * @return a {@code List} of {@code TIFFTagSet}s.
*/
public ListTIFFTagSet
s known to the reader.
+ * {@code TIFFTagSet}s known to the reader.
*/
public static final String UNKNOWN_TAG_NAME = "UnknownTag";
@@ -141,12 +141,12 @@
private SortedMapTIFFTag
with a given name, tag number, set
+ * Constructs a {@code TIFFTag} with a given name, tag number, set
* of legal data types, and value count. A negative value count signifies
* that either an arbitrary number of values is legal or the required count
* is determined by the values of other fields in the IFD. A non-negative
* count specifies the number of values which an associated field must
- * contain. The tag will have no associated TIFFTagSet
.
+ * contain. The tag will have no associated {@code TIFFTagSet}.
*
* TIFFTag
with a given name, tag number and
- * TIFFTagSet
to which it refers. The legal data types are
+ * Constructs a {@code TIFFTag} with a given name, tag number and
+ * {@code TIFFTagSet} to which it refers. The legal data types are
* set to include {@link #TIFF_LONG} and {@link #TIFF_IFD_POINTER} and the
- * value count is unity. The TIFFTagSet
will
- * represent the set of TIFFTag
s which appear in the IFD
- * pointed to. A TIFFTag
represents an IFD pointer if and
- * only if tagSet
is non-null
or the data
- * type TIFF_IFD_POINTER
is legal.
+ * value count is unity. The {@code TIFFTagSet} will
+ * represent the set of {@code TIFFTag}s which appear in the IFD
+ * pointed to. A {@code TIFFTag} represents an IFD pointer if and
+ * only if {@code tagSet} is non-{@code null} or the data
+ * type {@code TIFF_IFD_POINTER} is legal.
*
* @param name the name of the tag.
* @param number the number used to represent the tag.
- * @param tagSet the TIFFTagSet
to which this tag belongs.
+ * @param tagSet the {@code TIFFTagSet} to which this tag belongs.
* @throws NullPointerException if name or tagSet is null.
* @throws IllegalArgumentException if number is negative.
*
@@ -210,9 +210,9 @@
}
/**
- * Constructs a TIFFTag
with a given name, tag number,
+ * Constructs a {@code TIFFTag} with a given name, tag number,
* and set of legal data types. The value count of the tag will be
- * undefined and it will have no associated TIFFTagSet
.
+ * undefined and it will have no associated {@code TIFFTagSet}.
*
* @param name the name of the tag.
* @param number the number used to represent the tag.
@@ -236,9 +236,9 @@
*
* @return the number of bytes used to store the given data type.
*
- * @throws IllegalArgumentException if datatype
is
- * less than MIN_DATATYPE
or greater than
- * MAX_DATATYPE
.
+ * @throws IllegalArgumentException if {@code datatype} is
+ * less than {@code MIN_DATATYPE} or greater than
+ * {@code MAX_DATATYPE}.
*/
public static int getSizeOfType(int dataType) {
if (dataType < MIN_DATATYPE ||dataType > MAX_DATATYPE) {
@@ -251,7 +251,7 @@
/**
* Returns the name of the tag, as it will appear in image metadata.
*
- * @return the tag name, as a String
.
+ * @return the tag name, as a {@code String}.
*/
public String getName() {
return name;
@@ -260,7 +260,7 @@
/**
* Returns the integer used to represent the tag.
*
- * @return the tag number, as an int
.
+ * @return the tag number, as an {@code int}.
*/
public int getNumber() {
return number;
@@ -276,7 +276,7 @@
* (1 << TIFFTag.TIFF_SHORT) | (1 << TIFFTag.TIFF_LONG)
*
*
- * @return an int
containing a bitmask encoding the
+ * @return an {@code int} containing a bitmask encoding the
* set of valid data types.
*/
public int getDataTypes() {
@@ -285,11 +285,11 @@
/**
* Returns the value count of this tag. If this value is positive, it
- * represents the required number of values for a TIFFField
+ * represents the required number of values for a {@code TIFFField}
* which has this tag. If the value is negative, the count is undefined.
* In the latter case the count may be derived, e.g., the number of values
- * of the BitsPerSample
field is SamplesPerPixel
,
- * or it may be variable as in the case of most US-ASCII
+ * of the {@code BitsPerSample} field is {@code SamplesPerPixel},
+ * or it may be variable as in the case of most {@code US-ASCII}
* fields.
*
* @return the value count of this tag.
@@ -299,18 +299,18 @@
}
/**
- * Returns true
if the given data type
+ * Returns {@code true} if the given data type
* may be used for the data associated with this tag.
*
* @param dataType the data type to be queried, one of
- * TIFF_BYTE
, TIFF_SHORT
, etc.
+ * {@code TIFF_BYTE}, {@code TIFF_SHORT}, etc.
*
- * @return a boolean
indicating whether the given
+ * @return a {@code boolean} indicating whether the given
* data type may be used with this tag.
*
- * @throws IllegalArgumentException if datatype
is
- * less than MIN_DATATYPE
or greater than
- * MAX_DATATYPE
.
+ * @throws IllegalArgumentException if {@code datatype} is
+ * less than {@code MIN_DATATYPE} or greater than
+ * {@code MAX_DATATYPE}.
*/
public boolean isDataTypeOK(int dataType) {
if (dataType < MIN_DATATYPE || dataType > MAX_DATATYPE) {
@@ -320,38 +320,38 @@
}
/**
- * Returns the TIFFTagSet
of which this tag is a part.
+ * Returns the {@code TIFFTagSet} of which this tag is a part.
*
- * @return the containing TIFFTagSet
.
+ * @return the containing {@code TIFFTagSet}.
*/
public TIFFTagSet getTagSet() {
return tagSet;
}
/**
- * Returns true
if this tag is used to point to an IFD
- * structure containing additional tags. A TIFFTag
represents
- * an IFD pointer if and only if its TIFFTagSet
is
- * non-null
or the data type TIFF_IFD_POINTER
is
+ * Returns {@code true} if this tag is used to point to an IFD
+ * structure containing additional tags. A {@code TIFFTag} represents
+ * an IFD pointer if and only if its {@code TIFFTagSet} is
+ * non-{@code null} or the data type {@code TIFF_IFD_POINTER} is
* legal. This condition will be satisfied if and only if either
- * getTagSet() != null
or
- * isDataTypeOK(TIFF_IFD_POINTER) == true
.
+ * {@code getTagSet() != null} or
+ * {@code isDataTypeOK(TIFF_IFD_POINTER) == true}.
*
* true
if this tag points to an IFD.
+ * @return {@code true} if this tag points to an IFD.
*/
public boolean isIFDPointer() {
return tagSet != null || isDataTypeOK(TIFF_IFD_POINTER);
}
/**
- * Returns true
if there are mnemonic names associated with
+ * Returns {@code true} if there are mnemonic names associated with
* the set of legal values for the data associated with this tag. Mnemonic
* names apply only to tags which have integral data type.
*
- * @return true
if mnemonic value names are available.
+ * @return {@code true} if mnemonic value names are available.
*/
public boolean hasValueNames() {
return valueNames != null;
@@ -373,14 +373,14 @@
/**
* Returns the mnemonic name associated with a particular value
- * that this tag's data may take on, or null
if
+ * that this tag's data may take on, or {@code null} if
* no name is present. Mnemonic names apply only to tags which have
* integral data type.
*
* @param value the data value.
*
* @return the mnemonic name associated with the value, as a
- * String
.
+ * {@code String}.
*/
public String getValueName(int value) {
if (valueNames == null) {
diff -r e9c073b0c19e -r 59b58343d358 jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java Mon Mar 14 12:35:52 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/TIFFTagSet.java Mon Mar 14 17:51:25 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -39,7 +39,7 @@
* specification itself).
*
* TIFFTag
objects, which
+ * between raw tag numbers and {@code TIFFTag} objects, which
* contain additional information about each tag, such as the tag's
* name, legal data types, and mnemonic names for some or all of ts
* data values.
@@ -59,15 +59,15 @@
private TIFFTagSet() {}
/**
- * Constructs a TIFFTagSet
, given a List
- * of TIFFTag
objects.
+ * Constructs a {@code TIFFTagSet}, given a {@code List}
+ * of {@code TIFFTag} objects.
*
- * @param tags a List
object containing
- * TIFFTag
objects to be added to this tag set.
+ * @param tags a {@code List} object containing
+ * {@code TIFFTag} objects to be added to this tag set.
*
- * @throws IllegalArgumentException if tags
is
- * null
, or contains objects that are not instances
- * of the TIFFTag
class.
+ * @throws IllegalArgumentException if {@code tags} is
+ * {@code null}, or contains objects that are not instances
+ * of the {@code TIFFTag} class.
*/
public TIFFTagSet(ListTIFFTag
from this set that is
- * associated with the given tag number, or null
if
+ * Returns the {@code TIFFTag} from this set that is
+ * associated with the given tag number, or {@code null} if
* no tag exists for that number.
*
* @param tagNumber the number of the tag to be retrieved.
*
- * @return the numbered TIFFTag
, or null
.
+ * @return the numbered {@code TIFFTag}, or {@code null}.
*/
public TIFFTag getTag(int tagNumber) {
return allowedTagsByNumber.get(Integer.valueOf(tagNumber));
}
/**
- * Returns the TIFFTag
having the given tag name, or
- * null
if the named tag does not belong to this tag set.
+ * Returns the {@code TIFFTag} having the given tag name, or
+ * {@code null} if the named tag does not belong to this tag set.
*
* @param tagName the name of the tag to be retrieved, as a
- * String
.
+ * {@code String}.
*
- * @return the named TIFFTag
, or null
.
+ * @return the named {@code TIFFTag}, or {@code null}.
*
- * @throws IllegalArgumentException if tagName
is
- * null
.
+ * @throws IllegalArgumentException if {@code tagName} is
+ * {@code null}.
*/
public TIFFTag getTag(String tagName) {
if (tagName == null) {
@@ -123,7 +123,7 @@
* Retrieves an unmodifiable numerically increasing set of tag numbers.
*
* TIFFTag
s in this TIFFTagSet
+ * numbers of all {@code TIFFTag}s in this {@code TIFFTagSet}
* sorted into ascending order according to
* {@link Integer#compareTo(Object)}.TIFFTag
s in this TIFFTagSet
+ * names of all {@code TIFFTag}s in this {@code TIFFTagSet}
* sorted into ascending order according to
* {@link String#compareTo(Object)}.