JSR 379: Java SE 9: Annex 1
Proposed Final Draft Specification
API Specification Change Summary
Iris Clark
2017/7/27 14:25 -0700 [40e5c853f67d]

This document describes the API specification changes made in Java SE 9 relative to Java SE 8, except for features or changes specified in related Component JSRs.

Contents

All changes to the specification made between Java SE 8 and Java SE 9, including trivial changes such as corrections of typographical errors and misspellings, are indicated in Annex 2, where insertions are conveniently shown on a light green background and deletions are shown struck through on a light red background.

Significant features, enhancements, bug fixes, and clarifications are described in the following sections of this document.

Core Libraries
 
User Interface XML Tool Interface

Core Libraries

Beans

Beans: Clarify meaning of null return value for SimpleBeanInfo.loadImage()

The specification of the return value of java.beans.SimpleBeanInfo.loadImage was updated to include the interpretation of a null return value.

Beans: Add annotations to generate BeanInfo classes at runtime

New annotations java.beans.JavaBean, java.beans.BeanProperty, and javax.swing.SwingContainer were added to allow runtime generation of java.beans.BeanInfo classes. These new annotations may be used to replace the compile-time javadoc @beaninfo tags.

The enhancements associated with this change are 4058433 and 8132973.

Beans: Specify IllegalArgumentException conditions for EventHandler.create()

The overloads of java.beans.EventHandler.create() do not support non-public interfaces. The specification of these methods was updated to describe the current long-standing behaviour. A java.lang.IllegalArgumentException will be thrown whenever there is a restriction to define the proxy class is violated. These are the affected method overloads: java.beans.EventHandler.create(Class,Object,String), java.beans.EventHandler.create(Class,Object,String,String), and java.beans.EventHandler.create(Class,Object,String,String,String).

Beans: Generify java.beans.beancontext package

Methods in package java.beans.beancontext were paramaterized with an unbounded wildcard (<?>). This change was motivated by a desire to reduce build warnings. This is the complete list of affected public methods: java.beans.beancontext.BeanContextServiceAvailableEvent.BeanContextServiceAvailableEvent, java.beans.beancontext.BeanContextServiceAvailableEvent.getCurrentServiceSelectors, java.beans.beancontext.BeanContextServiceAvailableEvent.getServiceClass, java.beans.beancontext.BeanContextServiceRevokedEvent.BeanContextServiceRevokedEvent, java.beans.beancontext.BeanContextServiceRevokedEvent.getServiceClass, java.beans.beancontext.BeanContextServiceRevokedEvent.isServiceClass, java.beans.beancontext.BeanContextServicesSupport.addService, java.beans.beancontext.BeanContextServicesSupport.hasService, java.beans.beancontext.BeanContextServicesSupport.getService, java.beans.beancontext.BeanContextServicesSupport.getCurrentServiceClasses, java.beans.beancontext.BeanContextServicesSupport.getCurrentServiceSelectors, java.beans.beancontext.BeanContextServicesSupport.revokeService, and java.beans.beancontext.BeanContextSupport.iterator.

The bug associated with this change is 8039096.

Collections

Collections: Add convenience factory methods for collections

Static factory methods were defined to conveniently create compact, unmodifiable instances of the java.util.List, java.util.Map, and java.util.Set interfaces with a small number elements. The following changes were necessary:

Additional details may be found in JEP 269 Convenience Factory Methods for Collections,

The enhancements associated with this change are 8048330, 8133977, 8144952, and 8159404.

Collections: Enhance List.spliterator for randomly accessible lists

The specification of java.util.List.spliterator was enhanced to describe how to account for java.util.List implementing java.util.RandomAccess.

The enhancement associated with this change is 8158365.

Collections: Declare unspecified behaviour for Iterator methods

The specifications of java.util.Iterator.remove, java.util.Iterator.forEachRemaining, and java.lang.Iterable.forEach were updated to explicitly declare that behaviour is unspecified if the action has a side-effect that modifies the underlying source of elements.

The bug associated with this change is 8168745.

Collections: Specify exceptional conditions for Map, HashMap, & Hashtable

The specification of the java.util.Map interface was updated to declare that mapping functions should not modify the Map during computations. If any of the compute*() or merge() methods of java.util.HashMap and java.util.Hashtable detect that mapping functions have modified the map, they will throw a java.util.ConcurrentModificationException just like the bulk operations. This is the complete list of affected methods: java.util.Map.computeIfAbsent, java.util.Map.computeIfPresent, java.util.Map.compute, java.util.Map.merge, java.util.HashMap.computeIfAbsent, java.util.HashMap.computeIfPresent, java.util.HashMap.compute, java.util.HashMap.merge, java.util.Hashtable.computeIfAbsent, java.util.Hashtable.computeIfPresent, java.util.Hashtable.compute, and java.util.Hashtable.merge.

The bug associated with this change is 8071667.

Collections: Repeat class-level warnings in Vector & Hashtable methods

All java.util.Enumerations returned by java.util.Vector and java.util.Hashtable in the presence of structural modifications are undefined as previously described in the class documentation. More explicit warnings have been provided in the class documentation and in these methods: java.util.Vector.elements, java.util.Hashtable.keys, and java.util.Hashtable.elements.

The enhancement associated with this change is 8020860.

Collections: Remove incorrect restriction from ArrayList.removeRange()

In java.util.ArrayList.removeRange, the list of conditions for throwing a java.lang.IndexOutOfBoundsException was updated to eliminate “fromIndex <= size()”.

The bug associated with this change is 8014066.

Collections: Add Enumeration.asIterator()

An adaptor method java.util.Enumeration.asIterator was added to return java.util.Iterator which wraps the Enumeration instance and forwards method invocations.

The enhancement associated with this change is 8072726.

Collections: Remove references to private fields in AbstractList.subList()

References to the names of private fields in the @implSpec of java.util.AbstractList.subList were removed.

The enhancement associated with this change is 8079136.

Collections: Declare Spliterator.CONCURRENT & Spliterator.IMMUTABLE mutually exclusive

The specification of constant java.util.Spliterator.CONCURRENT was enhanced to declare that it is mutually exclusive from java.util.Spliterator.IMMUTABLE. Prior to this change, the relationship was implied.

The enhancement associated with this change is 8032513.

Collections: Override inherited specification for Deque.addAll()

The specification of method java.util.Deque.addAll no longer simply inherited from java.util.Collection.addAll. The new, more precise documentation describes where elements are added.

The bug associated with this change is 8181334.

Collections: Override inherited specification for ArrayDeque.addAll()

The specification of method java.util.ArrayDeque.addAll no longer simply inherited from java.util.Collection.addAll. The new, more precise documentation describes where elements are added. It also removes references to java.lang.ClassCastException.

The bug associated with this change is 8167202.

Streams

Streams: Enhance specification for floating-point summation for non-finite values

The specification for the following methods was enhanced to describe how non-finite values, NaN, and infinity affect the returned value: java.util.DoubleSummaryStatistics.getAverage, java.util.DoubleSummaryStatistics.getSum, java.util.stream.DoubleStream.average, and java.util.stream.DoubleStream.sum.

The bug associated with this change is 8030942.

Streams: Add Stream.ofNullable()

A static, convenience method, java.util.stream.Stream.ofNullable, was added to return a singleton stream containing the provided element or the empty stream.

The enhancement associated with this change is 8050819.

Streams: Add Stream.{drop,take}While()

Methods to take or drop elements while a predicate operating on those elements returns true were added. The following methods were added: java.util.stream.Stream.dropWhile, java.util.stream.Stream.takeWhile, java.util.stream.IntStream.dropWhile, java.util.stream.IntStream.takeWhile, java.util.stream.LongStream.dropWhile, java.util.stream.LongStream.takeWhile, java.util.stream.DoubleStream.dropWhile, and java.util.stream.DoubleStream.takeWhile.

The enhancement associated with this change is 8071597.

Streams: Add finite Stream.iterate()

Methods accepting a predicate to determine whether the stream source terminates were added: java.util.stream.Stream.iterate, java.util.stream.IntStream.iterate, java.util.stream.LongStream.iterate, and java.util.stream.DoubleStream.iterate.

The enhancements associated with this change are 8072727 and 8164691.

Streams: Generify Stream.generate()

The parameter of method java.util.stream.Stream.generate was paramaterized with a bounded wildcard type.

The bug associated with this change is 8132097.

Streams: Modify Stream.collect()

The specification of the following methods was modified to indicate that the value of the second argument is combined into the first.

java.util.stream.Stream.collect. and java.util.stream.DoubleStream.iterate.

The bug associated with this change is 8164691.

Streams: Specify stream pipeline optimization

The class specifications of java.util.stream.Stream, java.util.stream.IntStream, java.util.stream.LongStream, and java.util.stream.DoubleStream were enhanced to indicate that a stream implementation is free to elide any number of stages in a stream pipeline as long as it can prove that doing so does not affect the computation.

The bug associated with this change is 8130023.

Streams: Update Collectors

The following changes were made to java.util.stream.Collectors.

Streams: Clarify BaseStream.spiterator()

The specification of java.util.stream.BaseStream.spliterator was clarified to indicate that characteristics of the returned value may be a sub-set of those that may be derived from the stream-pipeline.

The bug associated with this change is 8048689.

I/O & NIO

I/O & NIO: Enhance Charset*.replaceWith()

The specification of the replacement value parameter of java.nio.charset.CharsetDecoder.replaceWith and java.nio.charset.CharsetEncoder.replaceWith was enhanced to provide constraints on the replacement string. It may not be null and the String length may not be longer than the value returned by maxBytesPerChar.

The bug associated with this change is 8073692.

I/O & NIO: Remove FilePermission path name canonicalization

The path name canonicalization process in java.io.FilePermission was removed so that only the original path name argument is used in the implies(), equals(), and hashCode(). methods. The actual file system is never accessed. Specification changes were required in java.io.FilePermission, java.io.FilePermission.FilePermission, java.io.FilePermission.implies, and java.io.FilePermission.equals.

Compatibility Note: Two FilePermission objects will not be equal to each other in the following situations:

The bugs associated with this change are 8164705 and 8168979.

I/O & NIO: Specify exceptional conditions for Reader

The abstract method java.io.Reader.read did not specify pre-conditions for the parameters. The long-standing behaviour to throw a java.lang.IndexOutOfBoundsException when conditions were not met was added to Reader.read() and similar methods in all publically exported subtypes. This is the complete list of affected methods: java.io.Reader.read, java.io.CharArrayReader.read, java.io.InputStreamReader.read, java.io.PushbackReader.read, java.io.PipedReader.read, java.io.StringReader.read, java.io.FilterReader.read, java.io.BufferedReader.read, and java.io.LineNumberReader.read.

The bug associated with this change is 8029689.

I/O & NIO: Enhance *Reader.close() for multi-thread use

An unexpected java.lang.NullPointerException was thrown occasionally in a multi-threaded application. Specification for thread blocking was added to the following methods: java.io.CharArrayReader.close, java.io.PushbackReader.close, and java.io.StringReader.close.

The bug associated with this change is 8143394.

I/O & NIO: Tidy various read*() method in java.io

Three kinds of problems were addressed by this change:

The bug associated with this change is 8154183.

I/O & NIO: Document behaviour of BufferedReader.readLine() for EOF

The specification of method java.io.BufferedReader.readLine was updated to document long-standing behaviour to treat EOF as a line terminator similar to CR, LF, and CRLF.

The bug associated with this change is 8177526.

I/O & NIO: Specify exceptional conditions for Writer

The abstract methods java.io.Writer.write and java.io.Writer.write did not specify pre-conditions for their parameters. The long-standing behaviour to throw a java.lang.IndexOutOfBoundsException when conditions were not met was added to these Writer.read() methods and similar methods in all publically exported subtypes. This is the complete list of affected methods: java.io.Writer.write(char[],int.int), java.io.Writer.write(String,int,int), java.io.BufferedWriter.write(char[],int,int), java.io.BufferedWriter.write(String,int,int), java.io.CharArrayWriter.write(char[],int,int), java.io.CharArrayWriter.write(String,int,int), java.io.FilterWriter.write(char[],int,int), java.io.FilterWriter.write(String,int,int), java.io.PipedWriter.write(char[],int,int), java.io.PrintWriter.write(char[],int.int), java.io.PrintWriter.write(String,int,int), java.io.StringWriter.write(char[],int,int), and java.io.StringWriter.write(String,int,int).

The bug associated with this change is 8130679.

I/O & NIO: Add InputStream.transferTo()

A convenience method, java.io.InputStream.transferTo, was added to support transferring contents from an input stream to an output stream.

The enhancement associated with this change is 8066867.

I/O & NIO: Add InputStream.readAllBytes() & InputStream.readNBytes()

Convenience methods java.io.InputStream.readAllBytes and java.io.InputStream.readNBytes were added to support reading all remaining bytes from the input stream and reading a given number of bytes from the input stream respectively.

The enhancement associated with this change is 8080835.

I/O & NIO: Clarify exceptional conditions for InputStream.skip()

Conditions for throwing java.io.IOException in the abstract method java.io.InputStream.skip were unclear with regard to seeking. References to “seeking” were replaced with InputStream.skip() and similar methods in all publically exported subtypes. This is the complete list of affected methods: java.io.InputStream.skip, java.io.BufferedInputStream.skip, java.io.FilterInputStream.skip, and java.io.PushbackInputStream.skip.

The bug associated with this change is 8136738.

I/O & NIO: Clarify flushing behaviour in FilterOutputStream.close()

The java.io.FilterOutputStream.close method specified that it invokes java.io.FilterOutputStream.flush before closing the underlying stream; however, it is ambiguous whether flush() is always invoked, even for streams that are already closed. The specification was clarified to describe the long-standing behaviour to invoke flush() only if the stream is not closed.

The bug associated with this change is 8054565.

I/O & NIO: Clarify behaviour of FileOutputStream(String) for existing file

The specification for the java.io.FileOutputStream.FileOutputStream constructor was updated to include an @implNote describing long-standing behaviour of overwriting the content of the stream if the file exists.

The bug associated with this change is 8180353.

I/O & NIO: Enhance java.nio.file package description for null arguments

The java.nio.file package description was enhanced to state that a java.lang.NullPointerException will be thrown when a passed array contains a null element.

The enhancement associated with this change is 8062632.

I/O & NIO: Use co-variance in java.nio.Buffer & all subclasses

Many methods in java.nio.Buffer are final and cannot be overridden by subclasses to provide co-variant overrides on the return type. Thus an awkward cast was required. The final identifier was removed from the following methods: java.nio.Buffer.clear, java.nio.Buffer.flip, java.nio.Buffer.limit, java.nio.Buffer.mark, java.nio.Buffer.position, java.nio.Buffer.reset, and java.nio.Buffer.rewind. Corresponding methods with a co-variant return type were added to all public subclasses: java.nio.ByteBuffer, java.nio.CharBuffer, java.nio.DoubleBuffer, java.nio.FloatBuffer, java.nio.IntBuffer, java.nio.LongBuffer, java.nio.MappedByteBuffer, and java.nio.ShortBuffer.

The enhancement associated with this change is 4774077.

I/O & NIO: Add Buffer.{duplicate,slice}()

Since every known subclass of java.nio.Buffer defined java.nio.Buffer.duplicate and java.nio.Buffer.slice methods in exactly the same way, their specification was moved to Buffer.

The enhancement associated with this change is 8150785.

I/O & NIO: Add ByteBuffer.{alignmentOffset,alignedSlice}()

Two methods were added. java.nio.ByteBuffer.alignmentOffset queries for misalignment at a given index and unit size. java.nio.ByteBuffer.alignedSlice slices a buffer after the position and limit are rounded to align for a given unit size.

The enhancement associated with this change is 8149469.

I/O & NIO: Allow null parameter in AtomicMoveNotSupportedException

The specification for the reason parameter of the constructor, java.nio.file.AtomicMoveNotSupportedException.AtomicMoveNotSupportedException, was updated to to allow null.

The enhancement associated with this change is 8024086.

I/O & NIO: Declare some methods in Path default

Eight methods in interface java.nio.file.Path were declared default. An @implNote was added to each method describing the expected implementation. This is the complete list of affected methods: java.nio.file.Path.startsWith, java.nio.file.Path.endsWith, java.nio.file.Path.resolve, java.nio.file.Path.resolveSibling(String), java.nio.file.Path.resolveSibling(Path), java.nio.file.Path.toFile, java.nio.file.Path.register(WatchService,WatchEvent.Kind…), and java.nio.file.Path.iterator.

The enhancement associated with this change is 8030090.

I/O & NIO: Specify exceptional conditions for File

The specification for all methods in java.nio.file.Files that allow file open options to be specified was modified to throw a java.lang.IllegalArgumentException when invalid options or combinations of options are specified. The specification describing conditions to throw a java.lang.SecurityException was enhanced to indicate that it may be thrown when the file is open with the DELETE_ON_CLOSE option. This is the complete list of affected methods: java.nio.file.Files.newBufferedWriter(Path,Charset,OpenOption…), java.nio.file.Files.newBufferedWriter(Path,OpenOption…), java.nio.file.Files.write(Path,byte[],OpenOption…), java.nio.file.Files.write(Path,Iterable,Charset,OpenOption…), and java.nio.file.Files.write(Path,Iterable,OpenOption…).

The bugs associated with this change are 8062553 and 8065109.

I/O & NIO: Clarify meaning of negative return value for File.lastModified()

The specification of the return value of method java.io.File.lastModified was enhanced to describe interpretation of a negative return value. It denotes the number of milliseconds before the epoch. Also, text describing alternate means to obtain the information was moved to an @apiNote.

The enhancement associated with this change is 6791812.

I/O & NIO: Clarify behaviour for zero attributes

The specification for java.nio.file.Files.readAttributes was updated to match the long-standing behaviour. An attribute-list of zero elements throws a java.lang.IllegalArgumentException. If the list must have one more elements.

The bug associated with this change is 8064466.

I/O & NIO: Support serialization filtering

Object serialization provides a mechanism to filter classes and objects during deserialization. This will improve security and robustness. Multiple changes were necessary to support serialization filtering:

Additional details may be found in JEP 290 Filter Incoming Serialization Data.

The enhancements associated with this change are 8155760, 8169645, 8170291, and 8166739.

I/O & NIO: Revise ObjectInputStream.resolve{Proxy}?Class()

The specifications of java.io.ObjectInputStream.resolveClass and java.io.ObjectInputStream.resolveProxyClass were revised to filter the platform class loader and its ancestors rather than just the null class loader.

The bugs associated with this change are 8155977 and 8169653.

I/O & NIO: Clarify ObjectInputStream.enableResolveObject() & ObjectOutputStream.enableReplaceObject()

The method specifications of java.io.ObjectInputStream.enableResolveObject and java.io.ObjectOutputStream.enableReplaceObject were updated to provide an additional requirement for the security check to occur. Object replacement must not be enabled.

The bug associated with this change is 8066640.

java.lang

java.lang: Update the primitive wrapper classes

The following changes were made to the primitive wrapper classes:

java.lang: Update String, StringBuilder, & StringBuffer

The following changes were made to java.lang.String and related classes.

java.lang: Add StackWalker

A standard API to efficiently traverse selected frames on the execution stack was provided. It allows easy filtering of, and lazy access to stack trace information. The java.lang.StackWalker class contains methods to open a sequential stream of java.lang.StackWalker.StackFrame objects for the current thread and to examine the contents of the stack frames. java.lang.StackFramePermission controls access to the stack frame information including the class loader name. These APIs replace functionality provided by the internal method sun.reflect.Reflection.getCallerClass().

Additional details may be found in JEP 259 Stack-Walking API.

The enhancements associated with this change are 8140450 and 8153912.

java.lang: Add Runtime.Version

The static, nested, inner class java.lang.Runtime.Version was added to provide a simple API to parse, validate, and compare version-strings. The representation of the version-string contains a version number optionally followed by pre-release and build information. Access to the Runtime version is via the new static method, java.lang.Runtime.version.

Additional details may be found in JEP 223 New Version-String Scheme.

The enhancements associated with this change are 8144062, 8161236, and 8177738.

java.lang: Process API Updates

The API for controlling and managing operating-system processes was enhanced via the following changes:

Additional details may be found in JEP 102 Process API Updates.

The enhancements associated with this change are 8077350, 8133216, 8129344, 8131763, 8138566, 8003488, 8140213, 8140250, and 8178347.

java.lang: Update Process

The following changes were made to java.lang.Process.

java.lang: Deprecate Object.finalize() & all subclass implementations

The method java.lang.Object.finalize was deprecated. A description of the pitfalls of the finalization mechanism was provided. These warnings include unexpected resource leaks, deadlocks, performance issues, and no guarantee that finalization will run. Alternative approaches were described. An apiNote was provided to provide an example how classes using non-heap resources may clean up resources when they are no longer needed.

The following implementations of Object.finalize() were similarly deprecated: java.io.FileInputStream.finalize, java.io.FileOutputStream.finalize, java.util.concurrent.ThreadPoolExecutor.finalize, java.util.zip.Deflater.finalize, java.util.zip.Inflater.finalize, java.util.zip.ZipFile.finalize, java.awt.Graphics.finalize, java.awt.PrintJob.finalize, java.awt.color.ICC_Profile.finalize, java.awt.image.ColorModel.finalize, java.awt.image.IndexColorModel.finalize, javax.imageio.spi.ServiceRegistry.finalize, javax.imageio.stream.FileCacheImageInputStream.finalize, javax.imageio.stream.FileImageInputStream.finalize, javax.imageio.stream.FileImageOutputStream.finalize, javax.imageio.stream.ImageInputStreamImpl.finalize, and javax.imageio.stream.MemoryCacheImageInputStream.finalize.

Deprecation Note: While there is currently no intention to remove these APIs in a future release; use of them is strongly discouraged. An intent to remove these APIs may declared in the future.

The bug associated with this change is 8165641.

java.lang: Define behaviour of null resource name

The specification of all methods to locate a resource by name were updated to describe the long-standing behavior to throw java.lang.NullPointerException if the provided name is null. This is the complete list of affected methods: java.lang.ClassLoader.getResource java.lang.ClassLoader.getResources java.lang.ClassLoader.resources java.lang.ClassLoader.getResourceAsStream and java.net.URLClassLoader.getResourceAsStream.

The enhancement associated with this change is 8170294.

java.lang: Add ClassLoader.resources()

java.lang.ClassLoader.resources was added to support return of a java.util.stream.Stream whose elements are the URLs of all the resources with a given name.

The enhancement associated with this change is 8161230.

java.lang: Specify exceptional condition for get*Package()

The specifications of java.lang.ClassLoader.getPackage, java.lang.Package.getPackage and the new method java.lang.ClassLoader.getDefinedPackage, were updated to describe conditions for throwing a java.lang.NullPointerException.

The bug associated with this change is 8165346.

java.lang: Add ClassLoader.isRegisteredAsParallelCapable()

java.lang.ClassLoader.isRegisteredAsParallelCapable was added to return a boolean indicating whether or not the class loader can load multiple classes concurrently.

The enhancements associated with this change are 8165793 and 8169435.

java.lang: Enhanced ClassLoader with respect to loading array classes

The specification of java.lang.ClassLoader was enhanced to explicitly state that java.lang.Class.forName must be used to create java.lang.Class objects representing array classes.

The enhancement associated with this change is 6516909.

java.lang: Update ClassLoader.getSystemClassLoader()

The specification of java.lang.ClassLoader.getSystemClassLoader was updated to remove the possibility of a null return value.

The bug associated with this change is 8165563.

java.lang: Update Math & StrictMath

The following changes were made to java.lang.Math and java.lang.StrictMath.

java.lang: Declare SecurityException consistently in class loader methods

The conditions under which java.lang.SecurityException may be thrown was located in a combination of the method description and the associated @throws tag. For consistency this information was consolidated into the @throws tag. Uniform wording was used for additional clarity. This is the complete list of affected methods: java.lang.Class.forName, java.lang.Class.getClassLoader, java.lang.ClassLoader.getParent, java.lang.ClassLoader.getSystemClassLoader, and java.lang.Thread.getContextClassLoader.

The bug associated with this change is 7181225.

java.lang: Revise SecurityManager.check{TopLevelWindow,SystemClipboard,AccessAwtEventQueueAccess}

The specifications for deprecated methods java.lang.SecurityManager.checkTopLevelWindow, java.lang.SecurityManager.checkSystemClipboardAccess, and java.lang.SecurityManager.checkAwtEventQueueAccess were revised to check the target name “AllPermission” as described in the Java SE 8 Platform Specification. These methods are superseded by invocations of java.lang.SecurityManager.checkPermission with AWTPermission("showWindowWithoutWarningBanner"), AWTPermission("accessClipboard"), and AWTPermission("accessEventQueue") respectively.

The enhancement associated with this change is 8029886.

java.lang: Remove RuntimePermission("usePolicy")

The target name, “usePolicy”, was removed from java.lang.RuntimePermission. This target should have never been documented since it was part of deployment, not Java SE. (Deployment code ceased use of this target in Java SE 7 Update 21, released in 2013.)

The bug associated with this change is 8282652.

java.lang: Add Thread.onSpinWait()

Some hardware platforms may benefit from a software hint indicating that a spin loop is in progress. The java.lang.Thread.onSpinWait method was added to indicate that the caller is momentarily unable to progress until one or more actions by other activities have occurred.

Additional details may be found in JEP 285 Spin-Wait Hints.

The enhancement associated with this change is 8147832.

java.lang: Support threads that do not inherit inheritable thread-locals

Many threads created by the platform are short-lived, performing some simple asynchronous operation on behalf of the platform. These threads should not inherit inheritable thread-local variables. A new constructor, java.lang.Thread.Thread, was added to explicitly opt out of this inheritance. The specification of java.lang.InheritableThreadLocal was augmented to note that initial values may not be set at object creation.

The enhancement associated with this change is 8056152.

java.lang: Enhance Deprecated

The class specification of java.lang.Deprecated corresponding to the @Deprecated annotation was enhanced to provide more nuanced information about the life cycle of APIs. Two methods were added:

Additional details may be found in JEP 277 Enhanced Deprecation.

The enhancement associated with this change is 8145461.

java.lang: Specify behaviour of @Deprecated when applied to package declarations

The specification of java.lang.Deprecated was updated to state that is has no effect when applied to a package declaration.

The bug associated with this change is 6481080.

java.lang: Deprecate boxed primitive constructors & identify APIs which may be removed in a future release

Three kinds of deprecation have been addressed by this change.

Additional details about the API life cycle may be found in JEP 277 Enhanced Deprecation.

The enhancement associated with this change is 8145468.

java.lang: Enhance SafeVarargs

The specification of java.lang.SafeVarargs was enhanced to allow @SafeVarargs on private methods.

The enhancement associated with this change is 7196160.

java.lang: Deprecate Runtime.trace{Instruction,MethodCall}()

java.lang.Runtime.traceInstructions and java.lang.Runtime.traceMethodCalls were deprecated because they were not implemented and the intended functionality has been provided via alternative JVM-specific tracing mechanisms.

Deprecation Note: These methods have been annotated with forRemoval=true indicating a high probability that they will be removed in the next major release of the Platform.

Additional details about the API life cycle may be found in JEP 277 Enhanced Deprecation.

The bug associated with this change is 8153330.

java.lang: Deprecate Compiler

The class java.lang.Compiler was intended to control just-in-time (JIT) compilation. Unfortunately, JITs are highly specialized and the controls they need are all very implementation-specific. These APIs are ignored by almost all JIT implementations. For HotSpot, this functionality is superseded by JEP 165 Compiler Control.

Deprecation Note: These methods have been annotated with forRemoval=true indicating a high probability that they will be removed in the next major release of the Platform.

Additional details about the API life cycle may be found in JEP 277 Enhanced Deprecation.

The enhancement associated with this change is 4285505.

java.lang: Generify SecurityManager.getClassContext()

The return type of the protected java.lang.SecurityManager.getClassContext was paramaterized with an unbounded wildcard (<?>). This change was motivated by a desire to reduce build warnings.

The bug associated with this change is 8027063.

Reflection

Reflection: Update Class

Reflection: Tidy Constructor & Method classes

Three problems were addressed by this change:

The bug associated with this change is 8169479.

Reflection: Clarify Executable.getAnnotatedReceiverType()

The specification of java.lang.reflect.Executable.getAnnotatedReceiverType was clarified to indicate that it will return null for Constructors of nested static classes, top-level classes, local classes, and anonymous classes.

The bug associated with this change is 8044629.

Reflection: Add AnnotatedElement.getAnnotatedOwnerType()

The interface java.lang.reflect.AnnotatedElement did not support access to the potentially annotated owner type which retained its annotations. The java.lang.reflect.AnnotatedType.getAnnotatedOwnerType method was added to provide this functionality. Similar methods were added to AnnotatedElement’s implementing classes: java.lang.reflect.AnnotatedArrayType.getAnnotatedOwnerType, java.lang.reflect.AnnotatedParameterizedType.getAnnotatedOwnerType, java.lang.reflect.AnnotatedTypeVariable.getAnnotatedOwnerType, and java.lang.reflect.AnnotatedWildcardType.getAnnotatedOwnerType.

The bug associated with this change is 8057804.

Reflection: Clarify treatment of bounds for annotated types

The specification of the bounds for several annotated types was missing. Three problems were addressed by this change:

The bug associated with this change is 8054304.

Annotations: Adjust number of type contexts

The specification for java.lang.annotation.ElementType referred to the precise number of type contexts. A more general reference was provided to avoid the need to update this part of the specification as the language evolves.

The bug associated with this change is 8033812.

Annotations: Support serialization of AnnotationTypeMismatchException

Instances of java.lang.annotation.AnnotationTypeMismatchException could not be serialized because they contained a non-transient and non-static internal field of type java.lang.reflect.Method which not serializable. The specification for all methods containing signature elements referencing that field were modified to allow it to be null. These are the affected public members of the class: java.lang.annotation.AnnotationTypeMismatchException.AnnotationTypeMismatchException java.lang.annotation.AnnotationTypeMismatchException.element, and java.lang.annotation.AnnotationTypeMismatchException.foundType,

The bug associated with this change is 6226715.

java.lang.ref

java.lang.ref: Add Cleaner

The new memory management class, java.lang.ref.Cleaner, provides an alternative to finalization. Object references and their corresponding cleaning actions are registered. Once the Cleaner has been notified that the object has become phantom reachable, the cleaning actions are executed.

The enhancement associated with this change is 8138696.

java.lang.ref: Automatically clear PhantomReference

The specification of java.lang.ref.PhantomReference was aligned with soft and weak references which are automatically cleared by the garbage collector as they are enqueued.

The enhancement associated with this change is 8071507.

java.lang.ref: Clear referent before enqueuing

The specification of java.lang.ref.Reference.enqueue was modified to clear the reference object before it is enqueued. This aligns application code invocations of this method with the behaviour of garbage collectors.

The enhancement associated with this change is 8175797.

java.lang.ref: Add Reference.reachabilityFence()

The new static method, java.lang.ref.Reference.reachabilityFence, guarantees an ordering for strong reachability. Thus, the provided object will be strongly reachable regardless of any prior actions. Adjustments to the java.lang.ref.Reference class specification were required,

Additional details may be found in JEP 193 Variable Handles.

The enhancement associated with this change is 8133348.

java.lang.invoke

java.lang.invoke: Add Variable Handles

Support for variable handles was added. A variable handles is a typed reference to a variable which supports read and write access to the variable under a variety of modes. Multiple changes were necessary:

Additional details may be found in JEP 193 Variable Handles.

The enhancements associated with this change are 8149644, 8151198, 8151705, 8154556, 8154737, 8154755, 8157726, 8158039, 8161444, 8162106, 8162107, 8162108. and 8181104.

java.lang.invoke: Support enhanced method handles

The java.lang.invoke.MethodHandle, java.lang.invoke.MethodHandles, and java.lang.invoke.MethodHandles.Lookup classes were augmented to ease common uses cases and enable better compiler optimizations. Multiple changes were necessary:

Additional details may be found in JEP 194 Enhanced Method Handles.

The enhancements associated with this change are 8130227, 8150829, 8151179, 8158169, 8153637, 8150956, 8158171, 8167974. and 8181104.

java.lang.invoke: Remove LambadMetafactory default constructor

As described in the main specification documentation, the java.lang.invoke.LambdaMetafactory default constructor was removed.

The bug associated with this change is 8177153,

java.lang.invoke: Indify string concatenation

Methods to facilitate the creation of optimized String concatenation methods were added in java.lang.invoke.StringConcatFactory. When linkage invariants are violated, the new exception java.lang.invoke.StringConcatException, is thrown.

Additional details may be found in JEP 280 Indify String Concatenation

The enhancements associated with this change are 8085796,

java.lang.invoke: Specify behaviour for static methods

Exceptional handling for static methods in java.lang.invoke.MethodHandles.Lookup was missing. The following changes were required:

java.lang.invoke: Refine MethodHandle & MethodHandles

Several changes were applied systematically to java.lang.invoke.MethodHandle and java.lang.invoke.MethodHandles:

This is the complete list of affected methods: java.lang.invoke.MethodHandle.asCollector(Class,int), java.lang.invoke.MethodHandle.asCollector(int,Class,int), java.lang.invoke.MethodHandle.bindTo, java.lang.invoke.MethodHandles.catchException, java.lang.invoke.MethodHandles.collectArguments, java.lang.invoke.MethodHandles.filterArguments, java.lang.invoke.MethodHandles.filterReturnValue, java.lang.invoke.MethodHandles.foldArguments(MethodHandle,int,MethodHandle), java.lang.invoke.MethodHandles.foldArguments(MethodHandle,MethodHandle), java.lang.invoke.MethodHandles.guardWithTest, java.lang.invoke.MethodHandles.insertArguments, and java.lang.invoke.MethodHandles.permuteArguments.

The bugs associated with this change are 8143410 and 8150360.

java.lang.invoke: Clarify lookup context in MethodHandles

The specifications of java.lang.invoke.MethodHandles.publicLookup, java.lang.invoke.MethodHandles.Lookup.accessClass, java.lang.invoke.MethodHandles.Lookup.findClass, and java.lang.invoke.MethodHandles.Lookup.in were clarified to describe what constitutes a lookup context for a Lookup instance.

The bug associated with this change is 8150782.

java.lang.invoke: Specify exceptional conditions for MethodHandles.loop()

The specification of java.lang.invoke.MethodHandles.loop was modified to reformulate the conditions leading to java.lang.IllegalArgumentException.

The bug associated with this change is 8150635.

java.lang.invoke: Add MethodHandles.arrayConstructor()

java.lang.invoke.MethodHandles.arrayConstructor was added to create a method handle constructing arrays of the specified type.

The bug associated with this change is 8155106.

java.lang.invoke: Add MethodHandles.arrayLength()

java.lang.invoke.MethodHandles.arrayLength was added to return the length of an array.

The enhancement associated with this change is 8156915.

java.lang.invoke: Propagate errors from invokedynamic

The java.lang.invoke package specification was updated to reflect changes to the Java SE 9 Edition of the Java Virtual Machine Specification. Exceptions from invokedynamic are propagated directly from the bootstrap method. Formerly, they were wrapped by a java.lang.BootstrapMethodError.

The enhancement associated with this change is 8166974.

java.math

java.math: Add BigDecimal.sqrt()

A method returning an approximation of the square root was added: java.math.BigDecimal.sqrt.

The enhancement associated with this change is 4851777.

java.math: Add BigInteger square root methods

Two methods returning the integer square root were added. java.math.BigInteger.sqrt returns the largest integer which is less than or equal to the real square root. java.math.BigInteger.sqrtAndRemainder returns a BigInteger array of two elements. The first element in the array is the integer square root and the second is the remainder.

The enhancement associated with this change is 8032027.

java.math: Add BigInteger.TWO

The constant java.math.BigInteger.TWO equal to BigInetger.valueOf(2) was added.

The enhancement associated with this change is 8152237.

java.math: Add more byte array constructors to BigInteger

Two constructors which use sub-arrays with offset and length for the two’s complement and sign-magnitude representation of BigInteger were added: java.math.BigInteger.BigInteger(byte[],int,int) and java.math.BigInteger.BigInteger(int,byte[],int,int).

The enhancement associated with this change is 4026465.

java.math: Update BigInteger Serialized Form documentation

Inaccurate specification for the serialization of java.math.BigInteger was updated. For backwards compatibility, the integers -1, -1, -2, and -2 are the fixed values of the obsolete fields bitCount, bitLength, lowestSetBit, and firstNonzeroByteNum respectively. These obsolete fields and are retained in the serialized form for backwards compatibility.

The bug associated with this change is 8035279.

java.math: Deprecate BigDecimal rounding mode integer constants

Eight legacy constants and their uses in three BigDecimal method signatures were deprecated in favor of java.math.RoundingMode which was added by JSR 176: Java 2 SE 5.0 (Tiger) Release Contents via component JSR-13 Decimal Arithmetic Enhancements. The complete list of affected methods and fields is as follows: java.math.BigDecimal.divide(BigDecimal,int), java.math.BigDecimal.divide(BigDecimal,int,int), java.math.BigDecimal.setScale, java.math.BigDecimal.ROUND_UP, java.math.BigDecimal.ROUND_DOWN, java.math.BigDecimal.ROUND_CEILING, java.math.BigDecimal.ROUND_FLOOR, java.math.BigDecimal.ROUND_HALF_UP, java.math.BigDecimal.ROUND_HALF_DOWN, java.math.BigDecimal.ROUND_HALF_EVEN, and java.math.BigDecimal.ROUND_HALF_UNNECESSARY.

Deprecation Note: While there is currently no intention to remove these APIs in a future release; use of them is strongly discouraged. An intent to remove this API may declared in the future.

The enhancement associated with this change is 4943627.

java.time

java.time: Correct boundaries specified by ChronoField.EPOCH_DAY

The boundaries specified by java.time.temporal.ChronoField.EPOCH_DAY were corrected to match the epoch day of LocalDate.MIN.toEpochDay() and LocalDate.MAX.toEpochDay().

The bug associated with this change is 8160681.

java.time: Support date-time patterns 'v' & 'vvv'

Support for time-zone formatting of generic non-locations formats and corresponding patterns letters 'v' and 'vvv' defined by CLDR section 8 was provided. Changes to the class specification of java.time.format.DateTimeFormatter and new methods java.time.format.DateTimeFormatterBuilder.appendGenericZoneText(TextStyle) and java.time.format.DateTimeFormatterBuilder.appendGenericZoneText(TextStyle,Set) were required.

The enhancement associated with this change is 8155823.

java.time: Refine computation of time-zone name format

The specification for the computation of the time-zone format was optimized in java.time.format.DateTimeFormatterBuilder.appendZoneText(TextStyle) and java.time.format.DateTimeFormatterBuilder.appendZoneText(TextStyle,Set). If the input temporal is a java.time.chrono.ChronoLocalDateTime and it is not in the daylight savings overlap, then the DST status may be determined with the help of the Zone Id.

The enhancement associated with this change is 8154567.

java.time: Change the definition of pattern letters 'A', 'n', & 'N'

The specifications of pattern letters `A`, 'n', and 'N' in java.time.format.DateTimeFormatterBuilder.appendPattern was changed to match the specification in CLDR section 8. Prior to this change, the user was required to include pattern letters to handle the longest anticipated output value. Shorter values were zero-padded.

The bug associated with this change is 8148949.

java.time: Add pattern letter 'g'

Pattern letter `g` matching the field java.time.temporal.JulianFields.MODIFIED_JULIAN_DAY was added to java.time.format.DateTimeFormatterBuilder.appendPattern. The new pattern letter matches the specification in CLDR section 8.

The bug associated with this change is 8148949.

java.time: Add pattern letter 'DD'

Pattern letter `DD` was added to java.time.format.DateTimeFormatterBuilder.appendPattern. The new pattern letter matches the CLDR specification.

The bug associated with this change is 8079628.

java.time: Add Chronology & IsoChronology methods for epoch time conversion

The following two method overloads were added to return the number of seconds from the beginning of the epoch: java.time.chrono.Chronology.epochSecond(int,int,int,int,int,int,ZoneOffset) and java.time.chrono.Chronology.epochSecond(Era,int,int,int,int,int,intZoneOffset).

The enhancement associated with this change is 8030864.

java.time: Specify adjacent value parsing in DateTimeForamtterBuilder.appendFraction()

The specification of java.time.format.DateTimeFormatterBuilder.appendFraction was adjusted to use adjacent value parsing as described in java.time.format.DateTimeFormatterBuilder.appendValue. This allows successful parsing of fractional seconds.

The bug associated with this change is 8031085.

java.time: Specify lenient parsing for offset parsing

The specifications of java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME, java.time.format.DateTimeFormatter.BASIC_ISO_DATE, java.time.format.DateTimeFormatterBuilder.appendOffset, and java.time.format.DateTimeFormatterBuilder.appendOffsetId were modified to allow minutes and seconds to be optional via a lenient mode to offset parsing. This aligns this specification with the Date and Time Format, ISO 8601.

The bug associated with this change is 8032051.

java.time: Support parsing of a single digit hour

The specifications of java.time.format.DateTimeFormatterBuilder.appendOffset was modified to to support parsing a single digit hour in the offset. Prior to this change the the date and time needed to be parsed separately.

The enhancement associated with this change is 8066806.

java.time: Add Duration.dividedBy()

The method java.time.Duration.dividedBy was added to return the number of whole times that a Duration occurs within this Duration, e.g. how many four hour periods there are in twelve hours.

The enhancement associated with this change is 8032510.

java.time: Add JapaneseEra.getDisplayName()

An override of java.time.chrono.Era.getDisplayName, java.time.chrono.JapaneseEra.getDisplayName, was added to return the textual name identifying the era.

The bug associated with this change is 8054214.

java.time: Modify the return value of ZoneRulesProvider.getAvailableZoneIds()

The return type of java.time.zone.ZoneRulesProvider.getAvailableZoneIds was modified to return an immutable set to improve the method performance.

The bug associated with this change is 8066291.

java.time: Clarify DateTimeFormatter resolution

The specification of java.time.format.DateTimeFormatter was clarified to describe resolution when both zone and offsets are available. Since the offset has higher precedence over the zone, the zone should be ignored when forming the instant.

The bug associated with this change is 8066982.

java.time: Clarify behaviour of Chronology.isLeapYear() outside of Chronology range

The specification of java.time.chrono.Chronology.isLeapYear was clarified to allow either a best guess or false for years outside of the range of java.time.chrono.Chronology. The correct result is guaranteed within the range.

The bug associated with this change is 8067800.

java.time: Add Clock.tickMillis()

The method of java.time.Clock.tickMillis was added to return a millisecond clock. This new method follows the existing pattern of the methods java.time.Clock.tickSeconds and java.time.Clock.tickMinutes.

The enhancement associated with this change is 8071919.

java.time: Allow Clock to support precision finer than milliseconds

The @implNote in the class specification of java.time.Clock was revised to allow precision finer than milliseconds, if available.

The bug associated with this change is 8180428.

java.time: Change the return type of LocalDate.getEra()

The return type of java.time.LocalDate.getEra was changed from java.time.chrono.Era to the more specific type java.time.chrono.IsoEra which is the correct era type for the calendar system. The method specification was also updated to remove reference to non-existent java.time.chrono.IsoChronology constants.

The bug associated with this change is 8072746.

java.time: Add conditions for throwing IllegalArgumentException to ZoneOffseTransitionRule.of()

The specification of the static factory method, java.time.zone.ZoneOffsetTransitionRule.of, was modified to throw a java.lang.IllegalArgumentException when getNano() returns a non-zero value since ZoneOffsetTransitionRule does not support sub-second time resolutions.

The bug associated with this change is 8079063.

java.time: Add methods Local{Date,Time}.ofInstant

Two static methods, java.time.LocalDate.ofInstant and java.time.LocalTime.ofInstant were added to ease conversion from java.time.Instant to java.util.Date and java.time.Instant to java.time.LocalDate.

The enhancement associated with this change is 8133079.

java.time: Add methods to retrieve portions of a Duration

Convenience methods java.time.Duration.toDaysPart, java.time.Duration.toHoursPart, java.time.Duration.toMinutesPart, java.time.Duration.toSecondsPart, java.time.Duration.toMillisPart, and java.time.Duration.toNanosPart were added to extract portions of the java.time.Duration. Prior to these additions, they were computed from the existing java.time.Duration.getSeconds. Additionally, the method java.time.Duration.toSeconds was added following the existing method naming convention in this class.

The enhancement associated with this change is 8142936.

java.time: Add methods to convert to seconds since the beginning of the epoch

Epoch seconds are used in many conversions. Many java.time APIs provide toEpochSeconds methods; however, they are missing in few notable, final classes. The necessary methods were added: java.time.LocalDate.toEpochSecond, java.time.LocalTime.toEpochSecond, and java.time.OffsetTime.toEpochSecond. A constant for the beginning of the epoch (1970-1-1) was also added: java.time.LocalDate.EPOCH.

The enhancement associated with this change is 8143413.

java.time: Add support to create streams of dates

Methods returning a sequential, ordered stream of dates within a given range and were added: java.time.LocalDate.datesUntil(LocalLdate), and java.time.LocalDate.datesUntil(LocalDate,Period). The first method is expected to be frequently needed, yet tricky to implement correctly. The second method is quite difficult to implement correctly.

The enhancement associated with this change is 8146218.

java.time: Add Duration.truncatedTo()

A method, java.time.Duration.truncatedTo, that returns a copy of the instance with the smaller units set to zero was added. This method eliminates the need to perform computations using the epoch-second or nano-of-second values.

The enhancement associated with this change is 8148849.

Concurrency

Concurrency: Update Concurrency

Concurrency support was extended with an inter-operable publish-subscribe framework, enhancements in the java.util.concurrent.CompletableFuture, class, and various other improvements.

Additional details may be found in JEP 266 More Concurrency Updates

Concurrency: Specify exceptional conditions for ThreadPoolExecutor.setCorePoolSize()

The specification of java.util.concurrent.ThreadPoolExecutor.setCorePoolSize was updated to throw a java.lang.IllegalArgumentException if the provided core pool size is not between 0 and the maximum pool size.

The bug associated with this change is 7153400.

Concurrency: Improve CompletableFuture composition

The description of the relationship between the future returned by the composition methods and the future returned by the supplied function was revised. They are connected by a relay; the returned future completes when the other completes, with the same value. Confusing references to stages being “executed” was replaced with more precise text. In addition to updating the class specification of java.util.concurrent.CompletableFuture, the following methods were affected: java.util.concurrent.CompletableFuture.acceptEitherAsync, java.util.concurrent.CompletableFuture.runAfterBothAsync(CompletionStage,Runnable), java.util.concurrent.CompletableFuture.runAfterBothAsync(CompletionStage,Runnable,Executor), java.util.concurrent.CompletableFuture.thenAcceptBothAsync(CompletionStage,BiConsumer), java.util.concurrent.CompletableFuture.thenAcceptBothAsync(CompletionStage,BiConsumer,Executor), java.util.concurrent.CompletableFuture.thenApply, java.util.concurrent.CompletableFuture.thenCombineAsync(CompletionStage,BiFunction), java.util.concurrent.CompletableFuture.thenCombineAsync(CompletionStage,BiFunction,Executor), java.util.concurrent.CompletableFuture.thenCompose, java.util.concurrent.CompletableFuture.thenComposeAsync(Function), java.util.concurrent.CompletableFuture.thenComposeAsync(Function,Executor), java.util.concurrent.CompletableFuture.whenComplete, java.util.concurrent.CompletableFuture.whenCompleteAsync(BiConsumer), and java.util.concurrent.CompletableFuture.whenCompleteAsync(BiConsumer,Executor).

The bugs associated with this change are 8139927 and 8143089.

Concurrency: ForkJoinPool updates

The following changes were made to java.util.concurrent.ForkJoinPool.

Concurrency: Describe implementation requirements for atomicity guarantee

The class specification of java.util.concurrent.ConcurrentMap was enhanced to describe all required method overrides to maintain atomicity guarantees.

The bug associated with this change is 8078645.

Concurrency: Revise java.util.concurrent.atomic to use VarHandles

The package java.util.concurrent.atomic was comprehensively updated to leverage java.lang.invoke.VarHandle specification and methods. Twelve classes were affected.

The enhancement associated with this change is 8080603.

Concurrency: Specify lack of order for Priority*Queue.spliterator()

The class specifications of java.util.PriorityQueue and java.util.concurrent.PriorityBlockingQueue were updated to include splitorator() in the caveat which states that the method does not traverse the queue in a guaranteed order

The bug associated with this change is 8132964.

Concurrency: Add TimeUnit.toChronoUnit() & TimeUnit.of()

Methods java.util.concurrent.TimeUnit.toChronoUnit and java.util.concurrent.TimeUnit.of were added to convert between java.util.concurrent.TimeUnit and java.time.temporal.ChronoUnit.

The enhancement associated with this change is 8141452.

Concurrency: Deprecate Atomic*.weakCompareAndSet() & add Atomic*.weakCompareAndSetPlain()

The convention for methods in java.lang.invoke.VarHandle is that plain access is unqualified for read or write methods and volatile access is unqualified for read-modify-write methods. This means that Atomic*.weakCompareAndSet() and Atomic*.weakCompareAndSetVolatile() are inconsistently named. To reduce confusion, Atomic*.weakCompareAndSet() are deprecated: java.util.concurrent.atomic.AtomicBoolean.weakCompareAndSet, java.util.concurrent.atomic.AtomicInteger.weakCompareAndSet, java.util.concurrent.atomic.AtomicIntegerArray.weakCompareAndSet, java.util.concurrent.atomic.AtomicLong.weakCompareAndSet, java.util.concurrent.atomic.AtomicLongArray.weakCompareAndSet, java.util.concurrent.atomic.AtomicReference.weakCompareAndSet, and java.util.concurrent.atomic.AtomicReferenceArray.weakCompareAndSet.

Deprecation Note: While there is currently no intention to remove these methods in a future release; their use is strongly discouraged. An intent to remove these APIs may declared in the future.

Atomic*.weakCompareAndSetPlain are the new replacements: java.util.concurrent.atomic.AtomicBoolean.weakCompareAndSetPlain, java.util.concurrent.atomic.AtomicInteger.weakCompareAndSetPlain, java.util.concurrent.atomic.AtomicIntegerArray.weakCompareAndSetPlain, java.util.concurrent.atomic.AtomicLong.weakCompareAndSetPlain, java.util.concurrent.atomic.AtomicLongArray.weakCompareAndSetPlain, java.util.concurrent.atomic.AtomicReference.weakCompareAndSetPlain, and java.util.concurrent.atomic.AtomicReferenceArray.weakCompareAndSetPlain.

The enhancement associated with this change is 8164814.

Concurrency: Clarify Semaphore.drainPermits()

The specification of java.util.concurrent.Semaphore.drainPermits was extended to describe the behaviour when the number of permits is negative.

The bug associated with this change is 8169272.

Concurrency: Define access control context for ThreadPoolExecutor.finalize()

The specification of java.util.concurrent.ThreadPoolExecutor.finalize was enhanced to declare that the finalizer runs using the access control context captured during construction of the ThreadPoolExecutor.

Concurrency: Document null return value for ForkJoinWorkerThread.newThread()

The specification for return value of java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory.newThread was extended to expect a null when the request is rejected.

The enhancement associated with this change is 8143086.

Concurrency: Override inherited specification for LinkedBlockingDeque.addAll()

The specification of method java.util.concurrent.LinkedBlockingDeque.addAll no longer simply inherited from java.util.AbstractQueue.addAll. The new, more specific documentation declares that elements are added to the end of this deque and removes references to java.lang.ClassCastException.

The bug associated with this change is 8169748.

java.util

The following changes have been made in the java.util package, in addition to changes detailed elsewhere in this document.

java.util: Remove fail-fast guarantee from Properties collections views

java.util.Properties was partially de-synchronized. Setters and bulk operations are unchanged. Simple getter methods and legacy enumerations are now unsynchronized. Iterators returned by “collection views”, java.util.Properties.entrySet, java.util.Properties.keySet, and java.util.Properties.values, are no longer fail-fast; hence, the unchecked exception java.util.ConcurrentModificationException will not be thrown. These iterators continue to guarantee traversal exactly once; however, they are not guaranteed to reflect modifications subsequent to their construction. This modification reduces the potential for deadlock.

The bug associated with this change is 8029891.

java.util: Update Formatter

The following changes were made to java.util.Formatter.

java.util: Deprecate Observer & Observable

The java.util.Observer interface and java.util.Observable class were deprecated. Their event model was limited and under specified. Neither has been maintained or enhanced in years. The package java.beans provides a richer event model. Concurrent data structures in java.util.concurrent provides reliable and ordered messaging among threads.

Deprecation Note: While there is currently no intention to remove this method in a future release; use of it is strongly discouraged. An intent to remove this API may declared in the future.

The bug associated with this change is 8154801.

java.util: Add utility methods to check indexes & ranges

Utility methods were added for index/range bounds checking. Since these critical checks are deceptively easy; coding errors may have significant consequences. The static check index/range methods were added to java.util.Objects. Suitable constructors to *IndexOutOfBoundException that accept out of bounds values were also added. This is the complete list of new static methods and constructors: java.util.Objects.checkIndex(int,int), java.util.Objects.checkIndex(int,int,BiFunction), java.util.Objects.checkFromToIndex, java.util.Objects.checkFromIndexSize, java.lang.IndexOutOfBoundsException.IndexOutOfBoundsException(int), java.lang.ArrayIndexOutOfBoundsException.ArrayIndexOutOfBoundsException(int), and java.lang.StringIndexOutOfBoundsException.StringIndexOutOfBoundsException(int).

The enhancement associated with this change is 8135248.

java.util: Specify exceptional conditions for Properties.load()

The specification of methods java.util.Properties.load(Reader) and java.util.Properties.load(InputStream) was updated to describe the long-standing behaviour to throw java.lang.NullPointerException when the parameter is null.

The bug associated with this change is 8073214.

java.util: Clarify mutability of Properties.stringPropertyNames() return value

The specification of method java.util.Properties.stringPropertyNames was updated to declare the long-standing behaviour to return an unmodifiable set of keys.

The bug associated with this change is 8059361.

java.util: Add methods for array comparisons & mismatches

Support for comparison and identification of mismatches of arrays was provided via the addition of java.lang.Byte.compareUnsigned, java.lang.Short.compareUnsigned, and 57 static methods of the form Arrays.equal(), Arrays.compare(), Arrays.compareUnsigned(), and Arrays.mismatch() where parameters always include two arrays.

The enhancements associated with this change are 8033148 and 8141409.

java.util: Support streams in Scanner

The following new methods returning streams were added to java.util.Scanner: java.util.Scanner.findAll(String), java.util.Scanner.findAll(Pattern), java.util.Scanner.tokens.

The enhancement associated with this change is 8072722.

java.util: Add stream-returning methods to classes which only have Enumeration-returning methods

Several classes which only return java.util.Enumerations for traversal were identified. Companion methods returning streams were added. This is the complete list of new methods: java.net.NetworkInterface.inetAddresses, java.net.NetworkInterface.subInterfaces, java.net.NetworkInterface.networkInterfaces, java.security.PermissionCollection.elementsAsStream, and java.sql.DriverManager.drivers.

The specification of java.util.Collections.enumeration was clarified to say that an Iterator derived from an Enumeration does not support removal of elements.

The enhancements associated with this change are 8081678 and 8164815.

java.util: Specify late-binding for streaming methods

The specifications of java.util.BitSet.stream, java.lang.CharSequence.chars, and java.lang.CharSequence.codePoints were enhanced to declare that the source java.util.Spliterator is late-binding.

The bug associated with this change is 8169808.

java.util: Specify argument checking in selected Scanner methods

Exceptional conditions resulting in a java.lang.IllegalArgumentException when the radix is outside of range was added. This the complete list of affected methods: java.util.Scanner.hasNextBigInteger, java.util.Scanner.hasNextByte, java.util.Scanner.hasNextInt, java.util.Scanner.hasNextLong, java.util.Scanner.hasNextShort, java.util.Scanner.nextBigInteger, java.util.Scanner.nextByte, java.util.Scanner.nextInt, java.util.Scanner.nextLong, and java.util.Scanner.nextShort.

The bug associated with this change is 8166261.

java.util: Add SPI to invoke command-line tools

A general means for a application code to invoke tools in the same virtual machine was added by interface java.util.spi.ToolProvider. These service provider implementations are found using java.util.ServiceLoader.

The enhancement associated with this change is 8159855.

java.util: Document exceptional conditions in Preferences

The specifications for all put*(), get*(), and remove() methods in java.util.prefs.AbstractPreferences and java.util.prefs.Preferences were updated to prohibit the use of any key or value String containing codepoint U+000 (the null control character). If this character is detected, a java.lang.IllegalArgumentException is thrown. This affects 15 methods in each class.

The class specification of java.util.prefs.AbstractPreferences was updated to correct references to the return type of flush() and sync() methods. They return a boolean instead of the documented void.

The bugs associated with this change are 8038373 and 8075156.

java.util: Update Objects

The following changes were made to java.util.Objects.

java.util: Update Optional

The following changes were made to java.util.Optional and primitive specializations.

Logging

Logging: Support platform logging

A minimal logging API which platform classes may use to log messages, along with a service interface for consumers of those messages was defined. The following changes were required:

Additional details may be found in JEP 264 Platform Logging API & Service.

The enhancements associated with this change are 8140364, 8148568, and 8177136.

Logging: Remove selected PropertyChangeListeners

As described in the Java SE 8 Platform Specification (JSR 337), a few methods have a chain of dependencies that ultimately requires the very large java.desktop module. Any application that uses the core logging or JAR-file APIs could only run on a configuration of the Platform that includes the desktop APIs, which is clearly undesirable. These methods were removed:

The enhancement associated with this change is 8029805.

Logging: Add LogManager.*ConfigurationListener()

New methods java.util.logging.LogManager.addConfigurationListener and java.util.logging.LogManager.removeConfigurationListener were added to provide equivalent functionality as removed methods LogManager.addPropetyChangeListener() and LogManager.removePropertyChangeListener(). These new methods are the alternative for applications which can not subclass LogManager.

The enhancement associated with this change is 8043306.

Logging: Add LogManager.updateConfiguration() methods

Methods java.util.logging.LogManager.updateConfiguration and java.util.logging.LogManager.updateConfiguration were added to update the LogManager. Unlike java.util.logging.LogManager.readConfiguration these new methods do not invoke java.util.logging.LogManager.reset which always removes and closes handlers on all existing loggers. Adjustments were also made to the class specification, java.util.logging.LogManager and methods java.util.logging.LogManager.readConfiguration(), java.util.logging.LogManager.readConfiguration(InputStream), and java.util.logging.LogManager.reset.

The bug associated with this change is 8033661 and 8075810.

Logging: Deprecate LoggingMXBean and LogManager.getLoggingMXBean()

The interface java.util.logging.LoggingMXBean was deprecated in favor of java.lang.management.PlatformLoggingMXBean which supports identical attributes. The method java.util.logging.LogManager.getLoggingMXBean was deprecated because its return type is now deprecated. The method java.lang.management.ManagementFactory.getPlatformMXBean should be used instead.

Deprecation Note: While there is currently no intention to remove these API in a future release; use of them is strongly discouraged. An intent to remove these APIs may declared in the future.

The enhancement associated with this change is 8139982.

Logging: Add FileHandler constructor

A new method, java.util.logging.FileHandler.FileHandler was added to provide the ability to create logs which are bigger than 2G.

The enhancement associated with this change is 8059767.

Logging: Add <logger>.handlers.ensureCloseOnReset system property

A new system configuration property, “<logger>.handlers.ensureCloseOnReset”, was added to control whether loggers are closed on java.util.logging.LogManager.reset. Complete documentation may be found in the class specification of java.util.logging.LogManager.

The bug associated with this change is 8060132.

Logging: Add <handler-name>.maxLocks system property

A new system configuration property, “<handler-name>.maxLocks”, was added to set the maximum number of concurrent log file locks for a java.util.logging.FileHandler. The default value is 100. Complete documentation may be found in the class specification of java.util.logging.FileHandler and the new constructor, java.util.logging.FileHandler.FileHandler.

The enhancement associated with this change is 8153955.

Logging: Upgrade to nanosecond event time resolution

The resolution of time stamps in java.util.logging.LogRecord were upgraded from milliseconds to nanoseconds backed by java.time. This change was documented in the java.util.logging.LogRecord.LogRecord. The event instant may be retrieved and set via new methods java.util.logging.LogRecord.getInstant and java.util.logging.LogRecord.setInstant. The specification of existing methods java.util.logging.LogRecord.getMillis and java.util.logging.LogRecord.setMillis was enhanced with and @apiNote redirecting the user to the corresponding {get,set}Instant(). Adjustments were also required to the serialized form.

The enhancements associated with this change are 8072645 and 8144262.

Logging: Revise the Formatter.formatMessage() specification

The specification of java.util.logging.Formatter.formatMessage was revised to use java.text.MessageFormat if the string contains digits.

The bug associated with this change is 8153666.

Regular Expressions

Regular Expressions: Add two Perl regular expression constructs

The following new regular expression constructs were added to support Unicode extended grapheme clusters:

The enhancement associated with this change is 7071819.

Regular Expressions: Support Unicode name

The following new regular expression construct were added to specify a Unicode code point by name:

The set of valid name are the valid Unicode character names matched by the new method java.lang.Character.codePointOf.

The enhancement associated with this change is 8147531.

Regular Expressions: Add Matcher.appendReplacement() &Matcher.appendTail for StringBuilder

Overload methods java.util.regex.Matcher.appendReplacement and java.util.regex.Matcher.appendTail were added matching the identically named methods with a StringBuffer parameter.

The enhancement associated with this change is 8039124.

Regular Expressions: Support functional programming

New functional methods java.util.regex.Matcher.replaceAll and java.util.regex.Matcher.replaceFirst were added matching the identically named methods. java.util.regex.Matcher.results was added to return a stream of java.util.regex.MatchResult.

The enhancement associated with this change is 8071479.

Internationalization

These are the changes relating to internationalization support, primarily in the java.util and java.text packages and in java.lang.Character.

Internationalization: Support Unicode 8.0

The supported version of the Unicode standard for java.lang.Character and java.lang.String was changed from 6.2.0 to 8.0.0. Due to timing of the Unicode releases with respect to this specification, support was added in two phases, first from Unicode 6.2.0 to 7.0.0 and then from 7.0.0 to 8.0.0. As a result of the full update, four new constants were added to java.lang.Character, 42 constants were added to java.lang.Character.UnicodeBlock, 29 enums were added to java.lang.Character.UnicodeScript, and two ranges were added to java.awt.font.NumericShaper.Range. The majority of the changes occurred when updating to 7.0.0 since changes for 8.0.0 support were small.

Additional details may be found in JEP 227 Unicode 7.0 and JEP 267 Unicode 8.0.

The enhancements associated with this change are 8032446 and 8072600.

Internationalization: Update Locale

The following changes were made to java.util.Locale.

Internationalization: Use CLDR Locale data by default

The Unicode Consortium’s Common Locale Data Repository (CDLR) is the de-facto standard for local data on many platforms. The following changes were required to support CLDR:

Additional details may be found in JEP 252 Use CLDR Locale Data by Default.

.

Internationalization: Load java.{awt.im,text,util}.spi from the application’s classpath

The SPI implementations for java.awt.im.spi, java.text.spi, and java.util.spi were originally designed to load their provider implementations via the deprecated Java Extension Mechanism. They now locate these implementations on the application’s classpath. The following changes were required:

Internationalization: Provide UTF-8 property resource bundles

Support for encoding resource bundle properties in UTF-8 by default was introduced. The class file specification, java.util.PropertyResourceBundle, and the constructor specification, java.util.PropertyResourceBundle.PropertyResourceBundle, were updated to expect that the input stream is encoded in UTF-8 rather than ISO-8859-1. If an error occurs while reading, the input stream is re-read in ISO-8859-1. A new system property, “java.util.PropertyResourceBundle.encoding” may be used to explicitly set the encoding of the steam to either “ISO_8859-1” or “UTF-8”.

Additional details may be found in JEP 226 UTF-8 Property Resource Bundles.

The enhancements associated with this change are 8027607 and 8152629.

Internationalization: Load ResourceBundleControlProvider implementations from the application’s classpath

java.util.spi.ResourceBundleControlProvider is an interface for service providers to provide implementations of java.util.ResourceBundle.Control. It was originally designed to load provider implementation via the deprecated Java Extension Mechanism. It now locates SPI implementations on the application’s classpath. The following changes were required:

The bugs associated with this change are 8172365.

Internationalization: Clarify type of constant in ResourceBundle.Control

A link under the word “unmodifiable” in the specification of constants java.util.ResourceBundle.Control.FORMAT_CLASS, java.util.ResourceBundle.Control.FORMAT_DEFAULT, and java.util.ResourceBundle.Control.FORMAT_PROPERTIES, was removed to clarify that this is a general statement about the expected behaviour of the instance, not the instance itself.

The enhancement associated with this change is 8134373.

Internationalization: Clarify context sensitivity of the month pattern

The specification for the “Letter M” month pattern in the class description of java.text.SimpleDateFormat was enhanced to provide examples of the expected output in various situations.

The bug associated with this change is 8055900.

Internationalization: Specify exceptional condition for Format.parseObject()

The specification of methods java.text.Format.parseObject(String) and java.text.Format.parseObject(String,ParsePosition) was updated to describe the long-standing behaviour to throw java.lang.NullPointerException when the provided source parameter is null. A similar change was required in all subclasses of Format: java.text.DateFormat.parseObject, java.text.MessageFormat.parseObject, and java.text.NumberFormat.parseObject.

The bugs associated with this change are 8073211 and 8150702.

Internationalization: Specify exceptional conditions in Format

The specification of many methods in abstract class java.text.Format and concrete subclasses was inconsistent in declaring java.lang.NullPointerException and java.lang.IllegalArgumentException. The appropriate exceptions were added. This is the complete list of affected classes: java.text.DecimalFormat, java.text.ChoiceFormat, java.text.DateFormat, java.text.MessageFormat, java.text.NumberFormat, and java.text.SimpleDateFormat.

The bug associated with this change is 8169480.

Internationalization: Add references to Calendar constants to DateFormatSymbols

Unlike other methods in java.text.DateFormatSymbols, the month-related methods of did not contain references to java.util.Calendar month constants. The required references were added. This is the list of affected methods: java.text.DateFormatSymbols.getMonths, java.text.DateFormatSymbols.setMonths, java.text.DateFormatSymbols.getShortMonths, and java.text.DateFormatSymbols.setShortMonths.

The bug associated with this change is 8129555.

Internationalization: Update Currency

The following changes were made to java.util.Currency and associated support for currency.

Networking

Networking: Preserve operating system’s IP address order

A new token, ‘system’, was added to the set of possible values for the system property java.net.preferIPV6Addresses which may be used to re-order Internet Protocol (IP) addresses. The new value is specified to preserve the order returned by the operating system.

The bug associated with this change is 8016521.

Networking: Specify exceptional conditions for URL constructors

The specification of the four URL constructors was enhanced to describe restrictions on the port number and to document the long-standing behaviour to throw a java.net.MalformedURLException when the port number is invalid. These are the affected constructors: java.net.URL.URL(String,String,int,String), java.net.URL.URL(String,String,String), java.net.URL.URL(URL,String), and java.net.URL.URL(URL,String,URLStreamHandler).

The bug associated with this change is 4906983.

Networking: Allow multiple sockets to be bound to the same address & port

Support for a new socket option which allows a number of sockets to be bound to the same address and port was provided with the addition of the following APIs:

The enhancement associated with this change is 6432031.

Networking: Use ServiceLoader for URL/URLConnnection provider lookup

The specification in the java.net package and the java.net.URL.URL constructor describing the how protocol handler implementations are found was updated to use java.util.ServiceLoader instead of the old “java.protocol.handler.pkgs” system property. The mechanism locates implementations of a new service type, abstract class java.net.spi.URLStreamHandlerProvider, using the system class loader. A small specification clarification to java.net.URLStreamHandlerFactory.createURLStreamHandler was also required.

The location of implementations of java.net.ContentHandlerFactory was changed to use java.util.ServiceLoader as documented in java.net.URLConnection.getContent. If that fails, the original mechanism based on core reflection is used.

Compatibility Note: Any applications setting the java.protocol.handler.pkgs system property will silently fail to find their protocol handlers at runtime.

The enhancements associated with this change are 8064924 and 8064925.

Networking: Generify URL.getContent() & URLConnection.getContent()

The parameter type of methods java.net.URL.getContent and java.net.URLConnection.getContent was paramaterized with an unbounded wildcard (<?>).

The enhancement associated with this change is 8031326.

Networking: Add a general purpose socket option mechanism

Following the model in package java.nio.channels, package java.net socket options may now be set via two simple getOption() and getOption() methods. The set of supported options may be retrieved with the new supportedOptions() method. This is the list of new methods: java.net.Socket.setOption, java.net.Socket.getOption, java.net.Socket.supportedOptions, java.net.ServerSocket.setOption, java.net.ServerSocket.getOption, java.net.ServerSocket.supportedOptions, java.net.DatagramSocket.setOption, java.net.DatagramSocket.getOption, java.net.DatagramSocket.supportedOptions, and java.net.MulticastSocket.supportedOptions.

The enhancement associated with this change is 8036979.

Networking: Update URLClassLoader.definePackage() to expect packages to be defined per class loader

The specification of the protected java.net.URLClassLoader.definePackage method was updated to throw a java.lang.IllegalArgumentException if the package has already been defined by this class loader.

Networking: Add java.content.handler.pkgs property

The class specification of java.net.ContentHandler was enhanced with the definition of a new system property, “java.content.handler.pkgs” which may be used to define locations to search for content handlers. This replaces the implementation-specific property, “sun.net.www.content”. Adjustments to reference the new user-definable handlers and to elide references to the old system property were also required in java.net.URL.URL and java.net.URLConnection.getContent.

The enhancement associated with this change is 8039470.

Networking: Ignore userinfo in URLPermission

The class specification of java.net.URLPermission was modified to recognize the userinfo portion of a URL (e.g. “username@” in a URL) but otherwise ignore that information.

The bug associated with this change is 8029354.

Networking: Document support of jar: scheme URLs in URLClassLoader

The specifications for the java.net.URLClassLoader class and the java.net.URLClassLoader.URLClassLoader constructor were enhanced to declare the long-standing behaviour to accept jar: scheme URLs and to describe how they are interpreted.

The bug associated with this change is 8155770.

Networking: Specify behaviour for platforms lacking multicast support

The method specifications of java.net.MulticastSocket.joinGroup(InetAddress), java.net.MulticastSocket.joinGroup(SocketAddress,NetworkInterface), and java.nio.channels.MulticastChannel.join were updated to indicate that an java.io.IOException will be thrown if invoked on a platform that does not support multicasting.

The bug associated with this change is 8157166.

Networking: Enable per-protocol setting for URLConnection caching

New methods java.net.URLConnection.getDefaultUseCaches and java.net.URLConnection.setDefaultUseCaches were added to support setting and retrieving of per-protocol defaults. Adjustments to reference the new methods for overriding the default value were made to the specifications of the protected field java.net.URLConnection.useCaches, and the java.net.URLConnection.setUseCaches, java.net.URLConnection.getDefaultUseCaches, and java.net.URLConnection.setDefaultUseCaches methods.

The bug associated with this change is 8163449.

Networking: Require trailing ':' in header-names

The class specification of java.net.URLPermission and the method specification of java.net.URLPermission.getActions differed with respect to the presence of the trailing ':' for empty header-names. The method specification was modified to align with the class specification. The ':' may not be present.

The bug associated with this change is 8163482.

Networking: Support multi-release JAR files

The class specification of java.net.URLClassLoader was extended to include support of multi-release JAR files.

The enhancements associated with this change are 8166914 and 8172732.

Networking: Add Authenticator.getDefault()

The java.net.Authenticator.getDefault method was added to retrieve the default authenticator.

The enhancement associated with this change is 8169068.

Networking: Support per-connection authentication

Support to use HTTP to log to the same web server using different credentials was provided with two additions. A new static method, java.net.Authenticator.requestPasswordAuthentication, asks the given authenticator for a password. New method, java.net.HttpURLConnection.setAuthenticator, supplies an Authenticator for use in HTTP authentication.

The enhancement associated with this change is 8169495.

JAR & ZIP APIs

JAR & ZIP: Remove Packer/Unpacker property change listeners

The java.util.jar.Pack200.{Packer,Unpacker} addPropertyChangeListener() and removePropertyChangeListener() methods were deprecated in Java SE 8 because they had a chain of dependencies that ultimately required the very large java.desktop module. These methods were removed in this specification.

The enhancement associated with this change is 8029806.

JAR & ZIP: Support Multi-Release JAR Files

The JAR file format was extended to allow a single archive containing multiple, Java-release-specific versions of class files. Multiple changes were necessary:

Additional details may be found in JEP 238 Multi-Release JAR Files.

The enhancements associated with this change are 8132734, 8150680, 8165782, and 8166735.

JAR & ZIP: Support CRC32C

A new class java.util.zip.CRC32C, extending the java.util.zip.Checksum interface was added. Default implementations for new methods java.util.zip.Checksum.update(byte[]) and java.util.zip.Checksum.update(ByteBuffer) were added. Since the interface provides default implementations of these methods, the overrides in java.util.zip.CRC32 and java.util.zip.Adler32 were removed.

The enhancement associated with this change is 6321472.

JAR & ZIP: Define Attributes iteration order

The class specification of java.util.jar.Attributes was enhanced to guarantee that the iteration order is the order of insertion.

The bug associated with this change is 8062194.

JAR & ZIP: Add ZipEntry.{get,set}TimeLocal()

New methods java.util.zip.ZipEntry.setTimeLocal and java.util.zip.ZipEntry.getTimeLocal were added to avoid implicit timezone conversion between Java time (milliseconds since the beginning of the epoch) and local system time.

The enhancement associated with this change is 8075526.

RMI

RMI: Add support for serialization filters

Object serialization generally provides a mechanism to filter classes and objects during deserialization. For RMI, object serialization provides a mechanism for RMI-exported objects to validate the classes expected in invocation. Two changes were necessary:

Additional details may be found in JEP 290 Filter Incoming Serialization Data.

The enhancement associated with this change is 8165261.

RMI: Update ActivationInstantiator.newInstance() & UnicastRemoteObject to describe access requirements

The specifications of the java.rmi.activation.ActivationInstantiator.newInstance method and the java.rmi.server.UnicastRemoteObject class were updated to stipulate access requirements on packages used by java.rmi.

The enhancement associated with this change is 8044626.

RMI: Refine RemoteObjectInvocationHandler.invoke()

The specification of java.rmi.server.RemoteObjectInvocationHandler.invoke was enhanced to include finalize() in the set of methods which require alternate handling. Since the RemoteObjectInvocationHandler is intended for invoking remote methods and the finalize method is a protocol between the garbage collector and an object within a single, local virtual machine, the finalize() method will be ignored if the underlying method overrides it.

RMI: Remove references to HTTP proxy implementation

The entire RMI HTTP proxy mechanism was deprecated in Java SE 8. Reference to this mechanism was removed to the class specification of java.rmi.server.RMISocketFactory.

The enhancement associated with this change is 8066750.

CORBA

CORBA: Provide helper classes for IDL-generated exception classes

These four CORBA helper classes for IDL-generated exception classes were added: org.omg.CORBA.BoundsHelper, org.omg.CORBA.TypeCodePackage.BoundsHelper, org.omg.CORBA.TypeCodePackage.BadKindHelper, and org.omg.CORBA.ORBPackage.InvalidNameHelper. These exception classes extend the serializable java.lang.Exception; hence they require helper classes for marshalling.

The bug associated with this change is 7130985.

CORBA: Extend the search algorithm for ORB properties

The specification of the search order for locating org.omg.CORBA.ORB’s “orb.properties” file was amended to include ${java.home}/conf.

The enhancement associated with this change is 8049376.

CORBA: Remove references to JDK-specific system property

References to the JDK-specific system property, jdk.corba.allowInputStreamSubclass, in org.omg.CORBA_2_3.portable.InputStream and org.omg.CORBA_2_3.portable.OutputStream were moved to an @implNote.

The bug associated with this change is 8077395.

Security

Security: Support DRBG-based SecureRandom implementations

Three Deterministic Random Bit Generator (DRBG) mechanisms described in NIST 800-90Ar1 were implemented. The following changes were applied:

Additional details may be found in JEP 273 DRBG-Based SecureRandom Implementations.

The features associated with this change are 8051408 and 8156213.

Security: Create PKCS12 keystores by default

The default keystore type was changed from JKS, a custom, JDK-specific keystore type, to PKCS12 an extensible, standard, and widely-supported format for storing cryptographic keys. The following changes were applied:

Additional details may be found in JEP 229 Create PKCS12 Keystores by Default.

The enhancements associated with this change are 8044445 and 8130800.

Security: Define an API for Datagram Transport Layer Security (DTLS)

An API for Datagram Transport Layer Security (DTLS) version 1.0 as defined by RFC 4347 and and RFC 6347 was defined with the following changes in package javax.net.ssl:

Additional details may be found in JEP 219 Datagram Transport Layer Security (DTLS).

The enhancements associated with this change are 8043758 and 8130461.

Security: Specify thread safety of SecureRandom{Spi}?

The class specifications of java.security.SecureRandom and java.security.SecureRandomSpi were updated to provide additional details about thread safety, primarily through the use of an @implSpec notice which describes the new java.security.SecureRandom service provider attribute named “ThreadSafe”.

The bug associated with this change is 8169871.

Security: Specify exceptional condition for SecureRandom.getSeed()

The specification of method java.security.SecureRandom.getSeed was updated to throw a java.lang.IllegalArgumentException when the provided number of seed bytes to generate is negative.

The bug associated with this change is 8169312.

Security: Allow SecurityManager.checkPackage*() to consult an additional list

The method specifications of java.lang.SecurityManager.checkPackageAccess and java.lang.SecurityManager.checkPackageDefinition were modified to allow the list of restricted packages to be augmented. An @implNote was added to provide a definition of “non-exported packages” with respect to modules.

Compatibility Note: After this change, applications running with a SecurityManager may throw a java.lang.SecurityException. instead of an java.lang.IllegalArgumentException. if the application has not been granted an appropriate "accessClassInPackage.{package}" java.lang.RuntimePermission. Attempts to access a type in a non-exported package that does not contain any classes will throw a java.lang.ClassNotFoundException instead of a java.security.AccessControlException. The implementation of this change adds more than 150 internal JDK packages to the restricted list of packages.

The enhancement associated with this change is 8055206.

Security: Enhance SecurityManager.checkPackageAccess()

The specification of java.lang.SecurityManager.checkPackageAccess was enhanced to state that it may be invoked by the Java Virtual Machine and the loadClass method of class loaders.

The bug associated with this change is 8181295.

Security: Allow application-defined Permission target names

The class specifications of java.security.SecurityPermission, java.lang.RuntimePermission, and javax.security.auth.AuthPermission were altered to explicitly allow applications to define additional target names. An @implNote was added to recommend use of the reverse domain name notation to reduce name-space collisions.

The enhancement associated with this change is 8077055.

Security: Clarify that enabled protocols may never be used

The specifications of methods javax.net.ssl.SSLSocket.getEnabledProtocols, javax.net.ssl.SSLEngine.getEnabledProtocols, and javax.net.ssl.SSLServerSocket.getEnabledProtocols were updated to declare that even if a protocol is enabled, it may never be used under some circumstances.

Security: Support the TLS Application Layer Protocol Negotiation (ALPN) Extension

The javax.net.ssl package was enhanced to support the TLS Application Layer Protocol Negotiation (ALPN) Extension (RFC 7301). This allows TLS clients and servers to use multiple application-layer protocols over the same transport-layer port. The following methods were added to enable this feature: javax.net.ssl.SSLEngine.getApplicationProtocol, javax.net.ssl.SSLEngine.getHandshakeApplicationProtocol, javax.net.ssl.SSLSocket.getApplicationProtocol, javax.net.ssl.SSLSocket.getHandshakeApplicationProtocol, javax.net.ssl.SSLParameters.getApplicationProtocols, and javax.net.ssl.SSLParameters.setApplicationProtocols.

The following methods were added to defer the section of an application protocol until after the TLS cipher suite is known: javax.net.ssl.SSLEngine.setHandshakeApplicationProtocolSelector, javax.net.ssl.SSLEngine.getHandshakeApplicationProtocolSelector, javax.net.ssl.SSLSocket.setHandshakeApplicationProtocolSelector, and javax.net.ssl.SSLSocket.getHandshakeApplicationProtocolSelector.

Additional details may be found in JEP 244 TLS Application-Layer Protocol Negotiation Extension

The enhancements associated with this change are 8051498, 8171443, and 8170282.

Security: Support OCSP stapling for TLS

TLS Certificate Status Request extension (section 8 of RFC 6066) and Multiple Certificate Status Request Extension (RFC 6961) describe “OCSP Stapling” which delegates OCSP from TLS clients to the TLS server. This allows the TLS clients to reliably and efficiently meet X.509 certificate revocation requirements. The javax.net.ssl.ExtendedSSLSession.getStatusResponses method was added to provide support for this approach.

Additional details may be found in JEP 249 OCSP Stapling for TLS

The enhancement associated with this change is 8046321.

Security: Clarify return values of SSLSession.getPeerCertificate*()

The specification of methods javax.net.ssl.SSLSession.getPeerCertificates and javax.net.ssl.SSLSession.getPeerCertificateChain was amended to note that returned value should not be used for trust decisions because it may not be a valid certificate chain. Similar documentation was also added to the following dependent methods: javax.net.ssl.HandshakeCompletedEvent.getPeerCertificates, javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain and javax.net.ssl.HttpsURLConnection.getServerCertificates.

Security: Provide description of default implementation of KeyStoreSpi.engineLoad()

An @implSpec was added to help developers determine whether the default implementation of java.security.KeyStoreSpi.engineLoad must be overridden.

The bug associated with this change is 8130850.

Security: Expose session key & KRB_CRED

GSS-API is the official API for krb5; however, there are cases where required data is not available through it. Several changes were necessary to provide access to the data.

The enhancement associated with this change is 8043071.

Security: Describe behaviour of destroyed KerberosTicket

The specifications of many accessor methods in javax.security.auth.kerberos.KerberosTicket was enhanced to describe their behavior after the ticket has been destroyed. These accessor methods were updated to throw a java.lang.IllegalAccessException or to return null or false. This is the complete list of affected methods: javax.security.auth.kerberos.KerberosTicket.getClient, javax.security.auth.kerberos.KerberosTicket.getServer, javax.security.auth.kerberos.KerberosTicket.getSessionKey, javax.security.auth.kerberos.KerberosTicket.getSessionKeyType, javax.security.auth.kerberos.KerberosTicket.isForwardable, javax.security.auth.kerberos.KerberosTicket.isForwarded, javax.security.auth.kerberos.KerberosTicket.isProxiable, javax.security.auth.kerberos.KerberosTicket.isProxy, javax.security.auth.kerberos.KerberosTicket.isPostdated, javax.security.auth.kerberos.KerberosTicket.isInitial, javax.security.auth.kerberos.KerberosTicket.getFlags, javax.security.auth.kerberos.KerberosTicket.getAuthTime, javax.security.auth.kerberos.KerberosTicket.getStartTime, javax.security.auth.kerberos.KerberosTicket.getEndTime, javax.security.auth.kerberos.KerberosTicket.getRenewTill, javax.security.auth.kerberos.KerberosTicket.getClientAddresses, javax.security.auth.kerberos.KerberosTicket.getEncoded, javax.security.auth.kerberos.KerberosTicket.isCurrent, and javax.security.auth.kerberos.KerberosTicket.refresh.

The bug associated with this change is 8147772.

Security: Represent version number as a String instead of double

JEP 223 New Version-String Scheme defines the version number to be a non-empty sequence of elements separated by period characters (U+002E). A double can not represent the set of possible values. The Provider and AuthProvider classes were updated to deprecate APIs which expect the version of type double: java.security.Provider.Provider, java.security.Provider.getVersion, and java.security.AuthProvider.AuthProvider. The following replacement APIs were added java.security.Provider.Provider, java.security.Provider.getVersionStr, and java.security.AuthProvider.AuthProvider. Updates to the java.security.Provider class specification, the java.security.Provider.toString, and serialization of Provider were also made.

Deprecation Note: While there is currently no intention to remove these deprecated APIs in a future release; use of them is strongly discouraged. An intent to remove these APIs may declared in the future.

The enhancement associated with this change is 8130181.

Security: Generify javax.xml.crypto

The parameters and return types in javax.xml.crypto package and subpackages were paramaterized. This change was motivated by a desire to reduce build warnings. During generification, the javax.xml.crypto.NodeSetData interface was changed to implement java.lang.Iterable to support use in for-each loops.

The enhancement associated with this change is 8046949.

Security: Allow yes & no in krb5.conf

The specification of the krb5.conf configuration file format in package javax.security.auth.kerberos was enhanced to interpret values of “yes” and “no” as “true” and “false” respectively. These values are supported by other krb5 implementations.

The enhancement associated with this change is 8029995.

Security: Clarify behaviour of null location in CodeSource

The specification of the following constructors and methods in java.security.CodeSource was updated to describe expectations for null as either a location parameter or a location return value: java.security.CodeSource.CodeSource(URL,Certificate[]), java.security.CodeSource.CodeSource(URL,CodeSigner[]), java.security.CodeSource.getLocation, java.security.CodeSource.getCertificates, and java.security.CodeSource.getCodeSigners.

The bug associated with this change is 8129972.

Security: Use ServiceLoader for JCE provider lookup

The class specification of java.security.Provider was updated to describe how Service provider implementations are found using java.util.ServiceLoader and loaded by the application class loader. The runtime may only add providers that have been configured for installation. New methods, java.security.Provider.configure and java.security.Provider.isConfigured were added to apply the supplied configuration to this provider instance and check configuration status respectively. The specifications of java.security.AuthProvider.login, java.security.AuthProvider.logout, and java.security.AuthProvider.setCallbackHandler were updated to throw an java.lang.IllegalStateException if the provider requires configuration and Provider.configure(String) has not been invoked. Finally, the class specification of java.security.SecurityPermission was updated to include the missing authProvider.{provider name} target.

The enhancement associated with this change are 7191662 and 8130648.

Security: Describe how permissions may be implied

The javax.security.auth.kerberos.ServicePermission.implies and javax.security.auth.kerberos.DelegationPermission.implies methods were modified to describe how one permission implies another.

The enhancement associated with this change is 8129789.

Security: Add @implNote to describing how to find a preferred provider

All methods which are used to find a specific algorithm from a list of registered providers were enhanced with an @implNote. The note describes how the preferred provider is located. A total of 29 methods in the following packages were affected: java.security, javax.crypto, javax.net.ssl, javax.security.auth.login, javax.security.sasl, javax.xml.crypto.dsig, and javax.xml.crypto.dsig.keyinfo.

The enhancement associated with this change is 8133151.

Security: Remove ExemptionMechanism.finalize() override

The protected override method javax.crypto.ExemptionMechanism.finalize was removed since its presence hurts performance and it does not do anything beyond the default finalizer.

The enhancement associated with this change is 8159009.

Security: Replace references to RFC 3280 with RFC 5280

All references to RFC 3280 Internet X.509 Public Key Infrastructure Certificate were replaced with the updated RFC 5280 Internet X.509 Public Key Infrastructure Certificate. This affected java.security.Key, java.security.cert.CRLReason, java.security.cert.PKIXReason, java.security.cert.TrustAnchor, java.security.cert.X509CRL, java.security.cert.X509CRLSelector, java.security.cert.X509CertSelector, java.security.cert.X509Certificate, javax.security.auth.x500.X500Principal, and javax.security.auth.x500.

The bug associated with this change is 8037550.

Security: Specify behaviour for null algorithm name in getInstance() methods

There are 21 getInstance() methods scattered across the java.security, javax.crypto, and javax.security.* packages, typically in one of the following forms:

public static AlgorithmParameterGenerator
    getInstance(String algorithm);

public static AlgorithmParameterGenerator
    getInstance(String algorithm, String provider);

public static AlgorithmParameterGenerator
    getInstance(String algorithm, Provider provider);

The specification of these methods was was enhanced to describe the long-standing behaviour to throw a java.lang.NullPointerException when passed null as an algorithm name.

The bug associated with this change is 4985694.

Security: Specify behaviour of Subject for null parameters

The specification of constructors javax.security.auth.Subject.Subject() and javax.security.auth.Subject.Subject(boolean,Set,Set,Set) was enhanced to specify that the sets containing the principals, public credentials, and private credentials prohibit null elements and all attempts to query or add a null will throw a java.lang.NullPointerException.

The bug associated with this change is 8015081.

Security: Expand set of required security algorithms

The list of required security algorithms and their associated keysizes was updated. These requirements follow recommendations by standards bodies for cryptographic operations and security protocols. The new algorithm (keysizes in parenthesis) are defined in class specifications as follows:

The enhancements associated with this change are 8015388, 8172869, and 8180307.

Security: Specify algorithm names in KerberosKey

The specifications of class javax.security.auth.kerberos.KerberosKey, constructor javax.security.auth.kerberos.KerberosKey.KerberosKey, and method javax.security.auth.kerberos.KerberosKey.getAlgorithm were enhanced to use standard algorithm names as defined by the IANA Specification, Kerberos Encryption Type Numbers.

The enhancement associated with this change is 8035986.

Security: Deprecate superseded security APIs

All classes, interfaces, and exceptions in packages java.security.acl and javax.security.cert were deprecated since they have been superseded by java.security.Policy and java.security.cert respectively. This is the complete list of affected types; java.security.acl.Acl, java.security.acl.AclEntry, java.security.acl.Group, java.security.acl.Owner, java.security.acl.Permission, java.security.acl.AclNotFoundException, java.security.acl.LastOwnerException, java.security.acl.NotOwnerException, javax.security.cert.Certificate, javax.security.cert.CertificateEncodingException, javax.security.cert.CertificateException, javax.security.cert.CertificateExpiredException, javax.security.cert.CertificateNotYetValidException, javax.security.cert.CertificateParsingException, and javax.security.cert.X509Certificate.

Further, the methods javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain and javax.net.ssl.SSLSession.getPeerCertificateChain which consume those types were also deprecated.

Deprecation Note: While there is currently no intention to remove these APIs in a future release; their use is strongly discouraged. An intent to remove these APIs may declared in the future.

The enhancement associated with this change is 8073430.

Security: Remove references to the sun.security.acl package

The class specification of java.security.acl.Acl was modified to remove references to the sun.security.acl implementation package.

The bug associated with this change is 8072663.

Security: Add URICertStoreParameters

The new class, java.security.cert.URICertStoreParameters, was added to pass parameters to CertStore algorithms which use information contained in a URI to retrieve certificates and CRLs.

The bug associated with this change is 8038084.

Security: Enhance parameter checking during CertificateRevokedException construction

The specification of constructor java.security.cert.CertificateRevokedException.CertificateRevokedException was enhanced to throw a java.lang.ClassCastException if the provided Map contains entries which have incorrect keys ore values.

Security: Enhance parameter checking in Signature.{update,sign}()

The specification of methods java.security.Signature.update and java.security.Signature.sign was enhanced to throw a java.lang.IllegalAccessException if the provided integer parameters would cause access beyond the expected bounds of the provided array.

Security: Add algorithm parameter to EncodedKeySpec & subclasses

A protected constructor which includes the name of an algorithm was added to EncodedkeySpec and its subclasses as follows: java.security.spec.EncodedKeySpec.EncodedKeySpec, java.security.spec.PKCS8EncodedKeySpec.PKCS8EncodedKeySpec. and java.security.spec.X509EncodedKeySpec.X509EncodedKeySpec. This algorithm may be retrieved using the new java.security.spec.EncodedKeySpec.getAlgorithm method.

The enhancement associated with this change is 8047223.

Security: Enhance specification for DrbgParameters of strength < 1

The specifications of java.security.DrbgParameters.instantiation and java.security.DrbgParameters.nextBytes was modified to declare that a java.lang.IllegalArgumentException. is thrown if the provided strength is less than one.

The bug associated with this change is 8158534.

Security: Enhance Kerberos interactions when a SecurityManager is present

A few changes were made to how Kerberos requests are processed when a java.lang.SecurityManager is present. The following adjustments were required:

Security: Use ServiceLoader for LoginModule

The interface javax.security.auth.spi.LoginModule was revised to become the service-provider interface for authentication technology providers. Login modules are located via java.util.ServiceLoader. If that fails, the original mechanism based on core reflection is used. Regardless of how the module is located, the LoginModule must be implemented.

The enhancement associated with this change is 8047789.

Security: Update SubjectDomainCombiner.combine() to describe behavior for static ProtectionDomain

The specification of method javax.security.auth.SubjectDomainCombiner.combine was enhanced to restrict creation of new java.security.ProtectionDomain instances only if the provided ProtectionDomain is not static.

Compatibility Note: After this change, applications which incorrectly use static ProtectionDomain objects may begin throwing a java.security.AccessControlException. Dynamic ProtectionDomain objects should be used instead.

Security: Add ProtectionDomain.staticPermissionsOnly()

The method java.security.ProtectionDomain.staticPermissionsOnly was added to determine whether the ProtectionDomain is statically bound. References to the new method were added to java.security.ProtectionDomain.ProtectionDomain(CodeSource,PermissionCollection), java.security.ProtectionDomain.ProtectionDomain(CodeSource,PermissionCollection,ClassLoader,Principal[]), and java.security.ProtectionDomain.implies.

Security: Load Policy via the system class loader

The specifications of java.security.Policy was modified to indicate that the system class loader is used to locate the class instead of the extension class loader provided with the now deprecated Java Extension Mechanism.

The bug associated with this change is 8075706.

Security: Update MessageDigest.isEqual()

The specification of java.security.MessageDigest.isEqual was modified to remove the phrase “simple byte compare” and to add an @implNote providing details of the equality check.

The bug associated with this change is 8136459.

Reference negotiated properties in Sasl

The method specifications of javax.security.sasl.SaslClient.getNegotiatedProperty and javax.security.sasl.SaslServer.getNegotiatedProperty were enhanced to reference property names which are defined as constants in javax.security.sasl.Sasl.

The enhancement associated with this change is 8044085.

Scripting

Scripting: Use ServiceLoader for Engine discovery

The specifications for javax.script.ScriptEngineFactory and the javax.script describing the Engine discovery mechanism were updated to replace reference to META-INF/services configuration files with use of the service-provider loading facility defined by java.util.ServiceLoader.

The bug associated with this change is 8068398.

Scripting: Specify behaviour on null argument for ScriptEngineFactory.getProgram()

The specification of javax.script.ScriptEngineFactory.getProgram was updated to describe the long-standing behaviour to throw java.lang.NullPointerException when the arguments array or any of its elements is null.

The bug associated with this change is 8071588.

Scripting: Specify exceptional conditions for ScriptContext.setAttribute()

The specification of javax.script.ScriptContext.setAttribute was updated to describe the long-standing no-op behaviour if javax.script.ScriptContext.GLOBAL_SCOPE is used and there is no associated global bindings.

The bug associated with this change is 8071678.

JNDI

JNDI: Use ServiceLoader for provider lookup

The specification of javax.naming.spi.NamingManager.getInitialContext describing the how service provider implementations are found was updated to use java.util.ServiceLoader. If that fails, the original mechanism based on core reflection is used.

The enhancement associated with this change is 8044627.

JNDI: Deprecate applet support to initialize context

JNDI defined a convenience mechanism to use an applet to specify all necessary properties for an javax.naming.ldap.InitialLdapContext. This mechanism has been deprecated. The environment hashtable should be used instead. The following changes were made:

Deprecation Note: While there is currently no intention to remove this mechanism in a future release; use is strongly discouraged. An intent to remove this mechanism may declared in the future.

The bug associated with this change is 8051422.

JNDI: Remove protected CompoundName.impl

The field javax.naming.CompoundName.impl was incorrectly declared protected. This inaccessible implementation type was made private.

The bug associated with this change is 8167178.

JMX

JMX: Specify behaviour for unresolvable localhost

The specifications of the host parameter of javax.management.remote.JMXServiceURL.JMXServiceURL(String,String,int) and javax.management.remote.JMXServiceURL.JMXServiceURL(String,String,int,String) were enhanced to specify that if the local hostname cannot be resolved, then it will default to the IP address of an active network interface.

The bug associated with this change is 8031753.

JMX: Add RMIConnectorServer.CREDENTIAL_TYPES

A new field, javax.management.remote.rmi.RMIConnectorServer.CREDENTIAL_TYPES, was added to specify the name of an attribute whose value is an array of class names that are expected when deserializing the credential object.

JMX: Add ConstructorParamaters annotation

A new annotation, javax.management.ConstructorParameters, was added to eliminate dependence on the java.desktop module. Additional changes were made to the class specification of javax.management.MXBean to reference the new annotation.

The enhancement associated with this change is 7199353.

JMX: Add default methods to MBeanServer

Default methods javax.management.MBeanServer.deserialize(ObjectName,byte[]), javax.management.MBeanServer.deserialize(String,byte[]), and javax.management.MBeanServer.deserialize(String,ObjectName,byte[]) were added to replace deprecated interface methods of the same name.

The enhancements associated with this change are 8066635 and 8165579.


User Interface

Applets

Applets: Deprecate Applets

All APIs supporting applets including the entire java.applet package (java.applet.Applet, java.applet.AppletStub, java.applet.AudioClip, java.applet.AppletContext) and the javax.swing.JApplet class have been deprecated. Browser-vendors have already removed the required browser plug-in to run a Java applet or have announced a time-line for removal. Alternative technologies such as Java Web Start or installable applications are recommended.

Deprecation Note: While there is currently no intention to remove these APIs in a future release; their use is strongly discouraged. An intent to remove these APIs may declared in the future.

Additional details may be found in JEP 289 Deprecate the Applet API.

The enhancement associated with this change is 8149502.

Applets: Deprecate APIs which reference Applets

All APIs whose signatures refer to types defined in the java.applet package were deprecated. This is the complete list of affected APIs: interface java.beans.AppletInitializer, java.beans.Beans.instantiate, and method javax.swing.RepaintManager.addDirtyRegion.

Deprecation Note: While there is currently no intention to remove these methods in a future release; their use is strongly discouraged. An intent to remove these APIs may declared in the future.

The bug associated with this change is 8169900.

2D

2D: Support TIFF Image I/O

The standard set of Image I/O plugins was extended to support the TIFF format. The TIFF reader and writer APIs originally developed in the Java Advanced Imaging API Tools Project was refined and relocated to package javax.imageio.plugins.tiff. The XML metadata format name was similarly renamed.

Additional details may be found in JEP 262 TIFF Image I/O.

The enhancements associated with this change are 8065682, 8152561, 8153208, 8154058, 8156580, 8165981, 8168367, 8169725, and 8169728.

2D: Update TextLayout.equals() specification

The specification of java.awt.font.TextLayout.equals was modified to indicate that it obeys the general contract of java.lang.Object.equals, the long-standing behaviour. Explicit overrides of java.awt.font.TextLayout.equals and java.awt.font.TextLayout.hashCode were removed since they added no value.

The bug associated with this change is 4497648.

2D: Specify SecurityException thrown by PrinterJob.getUserName()

The specification for java.awt.print.PrinterJob.getUserName was modified to describe conditions for the long-standing behaviour to throw a java.lang.SecurityException.

The bug associated with this change is 6197099.

2D: Support font loading directly from a file or stream

TrueType font collections used to be rare or only available under limited circumstances thus, pre-existing APIs did not support them. The added methods java.awt.Font.createFonts(InputStream) and java.awt.Font.createFonts(File) both return a Font[] of at least one element. These methods support font sources which represent a TrueType/OpenType font collection.

The enhancement associated with this change is 8055463.

2D: Allow for platform limitations during font rendering

The specification for java.awt.Font was augmented to state that platforms limitations may prevent glyphs from being rendered with the requested properties.

The bug associated with this change is 8166034.

2D: Specify Windows.setIconImages() behaviour for multi-resolution images

The specification of java.awt.Window.setIconImages was enhanced to described how multi-resolution images are processed when an image is added to the icons list.

The bug associated with this change is 8149371.

2D: Add serialVersionUID field to serializable types in the javax.print.* packages

Some serializable types in packages javax.print and javax.print.attribute did not contain a serialVersionUID field. The requisite declaration with a value matching the historical default was added. This is the complete list of affected public classes: javax.print.DocFlavor, javax.print.PrintException, javax.print.attribute.AttributeSetUtilities, and javax.print.attribute.UnmodifiableSetException.

The bug associated with this change is 8034050.

2D: Generify javax.print.* packages

The return type of methods javax.print.AttributeException.getUnsupportedAttributes and javax.print.attribute.standard.DialogTypeSelection.getCategory were paramaterized. This change was motivated by a desire to reduce build warnings.

The bug associated with this change is 8042864.

2D: Add Font.textRequiresLayout()

A new method, java.awt.Font.textRequiresLayout, was added to indicate whether any part of the specified text is from a complex script which would require special processing to render correctly. This method is a replacement for the unsupported, internal sun.font.FontUtilities.isComplexCharCode() method.

The enhancement associated with this change is 8146324.

2D: Provide explicit specification for methods in AbstractMultiResolutionImage

The specification describing the long-standing behaviour of five methods in java.awt.image.AbstractMultiResolutionImage was provided. The new specification overrides the original specification inherited from java.awt.Image. This is the complete list of affected methods: java.awt.image.AbstractMultiResolutionImage.getWidth, java.awt.image.AbstractMultiResolutionImage.getHeight, java.awt.image.AbstractMultiResolutionImage.getSource, java.awt.image.AbstractMultiResolutionImage.getGraphics, and java.awt.image.AbstractMultiResolutionImage.getProperty.

The bug associated with this change is 8138771.

2D: Update value of OpenType.TAG_OPBD

The value of constant java.awt.font.OpenType.TAG_OPBD was incorrectly assigned to the same value as java.awt.font.OpenType.TAG_MORT. The correct value, 0x6F70626UL, is now used.

The bug associated with this change is 8077584.

2D: Provide multi-resolution image support on HiDPI displays

A set of images with different resolutions may be encapsulated into a single multi-resolution image for HiDPI displays. The new interface java.awt.image.MultiResolutionImage defines basic operations for a set of images at various resolutions. The classes java.awt.image.AbstractMultiResolutionImage and java.awt.image.BaseMultiResolutionImage enable rapid creation of a multi-resolution image given a series of images. New image resolution variant hints control which image should be selected for image drawing: java.awt.RenderingHints.KEY_RESOLUTION_VARIANT, java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_DEFAULT, java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_BASE, java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_SIZE_FIT, and java.awt.RenderingHints.VALUE_RESOLUTION_VARIANT_DPI_FIT. A naming conventions for the scaled images was defined in java.awt.SplashScreen.

The enhancements associated with this change are 8029339 and 8151787.

2D: Add ColorModel*.{equals,hashCode}()

java.awt.image.ColorModel and its subclasses either did not override equals() and/or hashCode() or provided incomplete specification. These deficiencies were remedied as follows:

The bug associated with this change is 7107905.

2D: Specify ImageIO behaviour for failure to create streams

The conditions under which a java.io.IOException may be thrown were extended to include failure to create the required javax.imageio.spi.ImageInputStreamSpi or javax.imageio.spi.ImageOutputStreamSpi. The following is the list of affected methods: javax.imageio.ImageIO.read(File), javax.imageio.ImageIO.read(InputStream), javax.imageio.ImageIO.read(URL), javax.imageio.ImageIO.write(RenderedImage,String,File), and javax.imageio.ImageIO.write(RenderedImage,String,OutputStream).

The bug associated with this change is 8044289.

2D: Restrict ServiceRegistry to ImageIO types

The javax.imageio.spi.ServiceRegistry class was introduced in JDK 1.4 to load Image I/O service providers. The specification of this class updated to restrict support to the five listed standard Image I/O service types declared in package javax.imageio.spi. One constructor, javax.imageio.spi.ServiceRegistry.ServiceRegistry, and two methods, javax.imageio.spi.ServiceRegistry.lookupProviders(java.lang.Class) and javax.imageio.spi.ServiceRegistry.lookupProviders(java.lang.Class,java.lang.ClassLoader), were updated to throw java.lang.IllegalArgumentException. if the service type is unsupported.

The bug associated with this change is 8068749.

2D: Update ImageReader.getRawImageType()

The specification of method javax.imageio.ImageReader.getRawImageType, was updated to describe the return value when a close match is not available.

The bug associated with this change is 8143562.

2D: Reduce conditions for IllegalArgumentExcepetion in ImageWriter.replacePixels()

A contradiction for behaviour given a null write parameter was resolved in javax.imageio.ImageWriter.replacePixels(Raster,ImageWriteParam) and javax.imageio.ImageWriter.replacePixels(RenderedImage,ImageWriteParam). After to this change, a null write parameter indicates that the default write parameter should be used. An java.lang.IllegalArgumentException will not be thrown. This choice reflects the long-standing behaviour.

The bug associated with this change is 8144744.

2D: Generify javax.imageio.spi

The return types of methods in javax.imageio.spi.ImageReaderSpi and javax.imageio.spi.ImageWriterSpi were paramaterized. This change was motivated by a desire to reduce build warnings.

The enhancement associated with this change is 8035487.

2D: Add serialVersionUID field to serializable types in the javax.imageio.* packages

Some serializable types in javax.imageio, javax.imageio.metadata, and javax.imageio.spi did not contain a serialVersionUID field. The requisite declaration with a value matching the historical default was added. This is the complete list of affected public classes: javax.imageio.IIOException, javax.imageio.metadata.IIOInvalidTreeException, and javax.imageio.metadata.IIOMetadataNode.

The bug associated with this change is 8033616.

2D: Enhance Accessibility API to use service provider mechanism

The specification of java.awt.Toolkit.getDefaultToolkit was modified to locate a service provider implementation via the “javax.accessibility.assistive_technologies” system property. Existing accessibility provider implementations which do not use the service provider mechanism will continue to be located and function as if the classes are on the classpath.

A new abstract class, javax.accessibility.AccessibilityProvider, was added to provide mappings from the platform-specific accessibility APIs to the java Accessibility API.

The enhancement associated with this change is 8055160.

AWT

AWT: Define APIs for platform-specific desktop features

Support for accessing platform-specific desktop features such as interacting with a task bar or dock, or listening for system or application events was added via the following changes:

Additional details may be found in JEP 272 Platform-Specific Desktop Features.

The enhancements associated with this change are 8143227, 8164536, 8166594, 8176428, and 8177919.

AWT: Remove AWT Peers

As described in the main specification documentation, all APIs whose signatures refer to types defined in the internal packages java.awt.peer and java.awt.dnd.peer are only accessible within the java.desktop module were removed.

The bug associated with this change is 8037739,

AWT: Remove reference to awt.toolkit system property

Since peers are not exported from the java.desktop module as a result of 8037739, it is no longer possible to create a custom java.awt.Toolkit. The system property “awt.toolkit” was the mechanism to set this customization; thus, it is no longer needed. Reference to this historical system property was removed from java.awt.Toolkit.getDefaultToolkit.

The bug associated with this change is 8130478.

AWT: Deprecate AWTKeyStroke.registerSubclass()

Analysis revealed that this method was added for historical reasons which are no longer valid as of Java 2 SE 5.0 (see 8133453). Since the method is not useful for applications, there is no recommended alternative. Invocation of this method has no effect.

Deprecation Note: While there is currently no intention to remove this method in a future release; use of it is strongly discouraged. An intent to remove this API may declared in the future.

The bug associated with this change is 8133453.

AWT: Deprecate JDK 1.0 era constants in java.awt.event

The java.awt.event.InputEvent contained constants following two different naming conventions: the JDK 1.0 naming convention and the extended naming convention introduced in JDK 1.4. Thus, for every value, there were two possible names. The old constants and related methods were deprecated. This is the complete list of affected APIs: java.awt.event.InputEvent.getModifiersExText, java.awt.event.InputEvent.getModifiers, java.awt.AWTEvent.AWTEvent, java.awt.Event, java.awt.event.InputEvent.ALT_GRAPH_MASK, java.awt.event.InputEvent.ALT_MASK, java.awt.event.InputEvent.BUTTON1_MASK, java.awt.event.InputEvent.BUTTON2_MASK, java.awt.event.InputEvent.BUTTON3_MASK, java.awt.event.InputEvent.CTRL_MASK, java.awt.event.InputEvent.META_MASK, and java.awt.event.InputEvent.SHIFT_MASK.

Deprecation Note: While there is currently no intention to remove these APIs in a future release; use of them is strongly discouraged. An intent to remove these APIs may declared in the future.

The bug associated with this change is 8143077.

AWT: Improve HeadlessException specification

The specification for class java.awt.HeadlessException, introduced in JDK 1.4 was minimal. Specification describing the long-standing behaviour was added to the class description and all methods.

The bug associated with this change is 8016313.

AWT: Resolve Toolkit.isDynamicLayoutActive() contradiction

The specification for java.awt.Toolkit.isDynamicLayoutActive was updated to describe the relationship between this method and java.awt.Toolkit.isDynamicLayoutSet.

The bug associated with this change is 8027324.

AWT: Generify ParameterBlock.getParamClasses

The return type of method java.awt.image.renderable.ParameterBlock.getParamClasses was paramaterized with an unbounded wildcard (<?>). This change was motivated by a desire to reduce build warnings.

The bug associated with this change is 8039109.

AWT: Add missing specification in java.awt package

A number of @param, @return, and @throws declarations were missing from many methods in the java.awt package. Specification describing the long-standing behaviour was added. In many cases, the new specification merely echos documentation available elsewhere in the method’s specification. Forty-one classes were affected.

The bug associated with this change is 8043967.

AWT: Add Component.setMixingCutoutShape()

The method java.awt.Component.setMixingCutoutShape was added to to set a ‘mixing-cutout’ shape for lightweight components only.

The bug associated with this change is 8173409.

AWT: Remove references to implementation-specific configuration files

The specification of method java.awt.Toolkit.getSystemClipboard was updated to remove reference to the implementation-specific configuration files “flavormap.properties” and “AWT.DnD.flavorMapFileURL”. All other references to these files were eliminated in Java SE 8 as part of JEP 162 Prepare for Modularization.

The enhancement associated with this change is 8047336.

AWT: Specify behaviour of null input for Canvas constructor

The constructor specification of java.awt.Canvas.Canvas was refined to describe long-standing behaviour on null. When invoked with null, the default java.awt.GraphicsConfiguration will be used to construct the new java.awt.Canvas.

The bug associated with this change is 4703110.

AWT: Specify when null will be returned by Component.create*Image()

The specifications for the return value of java.awt.Component.createImage, java.awt.Component.createVolatileImage(int,int), and java.awt.Component.createVolatileImage(int,int,ImageCapabilities) were updated to replace a weak statement describing when null may be returned. The new specification describes the long-standing behaviour to return null if component is not displayable or is headless.

The bug associated with this change is 6815345.

AWT: Extend FocusEvent to include a “cause”

The java.awt.event.FocusEvent class was enhanced to provide information describing which action caused the event. This information may give a client the ability to provide a more specific response to a focus event. Several changes were necessary:

The enhancements associated with this change are 8080395 and 8154434.

AWT: Clarify platform-dependence of tooltip in TrayIcon

The display of tooltips for tray icons may not be supported by all platforms. The specification for java.awt.TrayIcon.TrayIcon(Image,String), java.awt.TrayIcon.TrayIcon(Image,String,PopupMenu), and java.awt.TrayIcon.setToolTip was updated to reflect this long-standing platform-dependent behaviour.

The bug associated with this change is 8117886.

AWT: Declare platform-dependence of FileDialog title

The display of a user-specified title in a java.awt.FileDialog may not be supported by all platforms; hence the specification was relaxed to allow this behaviour. This is the complete list of affected constructors and methods: java.awt.FileDialog.FileDialog(Frame), java.awt.FileDialog.FileDialog(Frame,String), java.awt.FileDialog.FileDialog(Frame,String,int), java.awt.FileDialog.FileDialog(Dialog), java.awt.FileDialog.FileDialog(Dialog,String), and java.awt.FileDialog.setTitle.

AWT: Extend Component.FlipBufferStrategy to support applets

When applets requested a flip buffer strategy using the java.awt.Component.FlipBufferStrategy nested class, a java.lang.ClassCastException was thrown because applets were not supported. Changes to the specification for the class and constructor were required.

The bug associated with this change is 8130390.

AWT: Remove BorderLayout reference to historical release

The class specification of java.awt.BorderLayout referenced a historical release of the JDK with the assumption that it was the current release. Since the specification for a given release is expected to document the current release, a specific version number is unnecessary. The reference was removed.

The bug associated with this change is 8153184.

AWT: Define new line handling in TextField

The specifications of java.awt.TextField.TextField(String), java.awt.TextField.TextField(String,int), and java.awt.TextField.setText were updated to document the long-standing behaviour of replacing all EOL and LF characters with a space.

The bugs associated with this change are 8145284 and 8160056.

AWT: Describe conditions for null value of DataFlavor.imageFlavor()

Specification for constant field java.awt.datatransfer.DataFlavor.imageFlavor was added to describe when it may be null.

The bug associated with this change is 8177672.

AWT: Relocate references to implmenetation details in DataFlavor.getTextPlainUnicodeFlavor()

References to Sun implementation details in class java.awt.datatransfer.DataFlavor.getTextPlainUnicodeFlavor were updated and relocated to an @implNote.

The bug associated with this change is 8180889.

AWT: Add Robot.createMultiResolutionScreenCaputure()

A new method, java.awt.Robot.createMultiResolutionScreenCapture, was added to return a java.awt.image.MultiResolutionImage containing pixels read from the screen. These pixels include any scaling from user space to the screen space.

The bug associated with this change is 8162959.

AWT: Amend Robot constructor

The specification for constructor, java.awt.Robot.Robot, was modified to include java.awt.Robot.getPixelColor in the list of methods which are affected by this constructor.

The bug associated with this change is 8033128.

AWT: Add serialVersionUID field to serializable types in the java.awt.* packages

Some serializable types in java.awt.color, java.awt.geom, java.awt.image, and java.awt.print did not contain a serialVersionUID field. The requisite declaration with a value matching the historical default was added. This is the complete list of affected public classes: java.awt.color.CMMException, java.awt.color.ProfileDataException, java.awt.geom.IllegalPathStateException, java.awt.geom.NoninvertibleTransformException, java.awt.image.ImagingOpException, java.awt.image.RasterFormatException, java.awt.image.renderable.ParameterBlock, java.awt.print.PrinterAbortException, and java.awt.print.PrinterException.

The bug associated with this change is 8033526.

2D: Enhance the specification for ServiceUI.printDialog() parameters

The specifications of the x and y parameters of javax.print.ServiceUI.printDialog were enhanced to declare that the screen coordinates are relative to the origin of the provided java.awt.GraphicsConfiguration.

The bug associated with this change is 6212751.

Swing

Swing: Generify javax.swing.text package

Methods in package javax.swing.text were paramaterized. This change was motivated by a desire to reduce build warnings. This is the complete list of affected public methods: javax.swing.text.InternationalFormatter.setMinimum, javax.swing.text.InternationalFormatter.getMinimum, javax.swing.text.InternationalFormatter.setMaximum, and javax.swing.text.InternationalFormatter.getMaximum.

The bugs associated with this change are 8043549 and 8055059.

Swing: Generify javax.swing.* packages

Methods in package javax.swing were paramaterized. This change was motivated by a desire to reduce build warnings. This is the complete list of affected public methods: javax.swing.DefaultCellEditor.DefaultCellEditor, javax.swing.JTable.JTable, javax.swing.SpinnerDateModel.SpinnerDateModel, javax.swing.SpinnerDateModel.setStart, javax.swing.SpinnerDateModel.getStart, javax.swing.SpinnerDateModel.setEnd, javax.swing.SpinnerDateModel.getEnd, javax.swing.SpinnerNumberModel.SpinnerNumberModel, javax.swing.SpinnerNumberModel.setMinimum, javax.swing.SpinnerNumberModel.getMinimum, javax.swing.SpinnerNumberModel.setMaximum, javax.swing.SpinnerNumberModel.getMaximum, javax.swing.event.RowSorterEvent.RowSorterEvent(RowSorter), javax.swing.event.RowSorterEvent.RowSorterEvent(RowSorter,Type,int[]), javax.swing.event.RowSorterEvent.getSource, javax.swing.table.DefaultTableModel.DefaultTableModel(Vector,int), javax.swing.table.DefaultTableModel.DefaultTableModel(Vector,Vector), javax.swing.table.DefaultTableModel.getDataVector, javax.swing.table.DefaultTableModel.setDataVector, javax.swing.table.DefaultTableModel.addRow, javax.swing.table.DefaultTableModel.insertRow, javax.swing.table.DefaultTableModel.setColumnIdentifiers, javax.swing.table.DefaultTableModel.addColumn, javax.swing.tree.DefaultMutableTreeNode.children, javax.swing.tree.DefaultMutableTreeNode.preorderEnumeration, javax.swing.tree.DefaultMutableTreeNode.postorderEnumeration, javax.swing.tree.DefaultMutableTreeNode.breadthFirstEnumeration, javax.swing.tree.DefaultMutableTreeNode.depthFirstEnumeration, and javax.swing.tree.DefaultMutableTreeNode.pathFromAncestorEnumeration.

The bugs associated with this change are 8043550, 8054360, and 8055254.

Swing: Remove inaccessible Swing types

As described in the main specification documentation, all APIs containing signature references to the internal, inaccessible types were removed.

The bug associated with this change is 8167176.

Swing: Deprecate MetalFileChooserUI.SingleClickListener & MetalFileChooserUI.FileRenderer

Nested classes javax.swing.plaf.metal.MetalFileChooserUI.SingleClickListener and javax.swing.plaf.metal.MetalFileChooserUI.FileRenderer were deprecated. Prior to deprecation, the only specification provided was “Obsolete class, not used in this version.”

Deprecation Note: While there is currently no intention to remove these APIs in a future release; use of them is strongly discouraged. An intent to remove these APIs may declared in the future.

The bug associated with this change is 8048702.

Swing: Enhance FileSystemView

Custom implementations of javax.swing.JFileChooser are now supported with the addition of the following three methods which provide access to the file view hierarchy: javax.swing.filechooser.FileSystemView.getChooserComboBoxFiles, javax.swing.filechooser.FileSystemView.isLink, and javax.swing.filechooser.FileSystemView.getLinkLocation.

The enhancement associated with this change is 8081722.

Swing: Generify javax.swing.* packages

Methods in packages javax.swing.text, javax.swing.plaf, javax.swing.plaf.basic, javax.swing.plaf.metal, javax.swing.plaf.multi, javax.swing.plaf.nimbus, and javax.swing.plaf.synth were paramaterized. This change was motivated by a desire to reduce build warnings.

The bug associated with this change is 8043548.

Swing: Add JComponent.getUI()

Method javax.swing.JComponent.getUI was added to return the look and feel delegate that renders the component. The declaration includes the java.beans.Transient annotation indicating that this method may be ignored by all subclasses of java.beans.Encoder.

The enhancements associated with this change are 4339584 and 8131754.

Swing: Refine UIDefaults.addResourceBundle()

The specification of javax.swing.UIDefaults.addResourceBundle was enhanced to declare that the application class loader is used to search for resource bundles.

The bug associated with this change is 8149879.

Swing: Swap use of “vertical” & “horizontal” in JComponent.{get,set}Alignment*()

The specifications of methods javax.swing.JComponent.getAlignmentX, javax.swing.JComponent.getAlignmentY, javax.swing.JComponent.setAlignmentX, and javax.swing.JComponent.setAlignmentY incorrectly swapped use of the terms “vertical” and “horizontal”. Methods referring to alignment in the “X” direction were updated to use use “horizontal”. Similarly, methods for “Y” alignment now use “vertical”.

The bug associated with this change is 8068374.

Swing: Remove JFrame.EXIT_ON_CLOSE

The constant field javax.swing.JFrame.EXIT_ON_CLOSE was removed in favor of the identically named javax.swing.WindowConstants.EXIT_ON_CLOSE. In the specification of method javax.swing.JFrame.setDefaultCloseOperation, a reference to JFrame.EXIT_ON_CLOSE was replaced with WindowsConstants.EXIT_ON_CLOSE. JFrame continues to have an EXIT_ON_CLOSE member via inheritance from WindowsConstants.

The bug associated with this change is 8073420.

Swing: Add JTableHeader.getPreferredSize()

Override method javax.swing.table.JTableHeader.getPreferredSize was added to return the preferred size of the table header. This override of JComponent.getPreferredSize() compensates for cases when the user manually sets the preferred size.

The bug associated with this change is 4473075.

Swing: Revise TableColumn.addPropertyChangeListener()

The specification of javax.swing.table.TableColumn.addPropertyChangeListener was re-written to document existing behaviour and remove references to invalid APIs.

The bug associated with this change is 4849595.

Swing: Define behavior for null parameter in JInternalFrame.setLayer()

The specification of method javax.swing.JInternalFrame.setLayer was updated to match the long-standing behaviour to throw a java.lang.NullPointerException when the provider parameter is null.

The bug associated with this change is 6206439.

Swing: Correct typo in JTabbedPane.AccessibleJTabbedPane.getAccessibleName()

The specification for the return value of javax.swing.JTabbedPane.AccessibleJTabbedPane.getAccessibleName was updated from “nor null” to “or null”.

The bug associated with this change is 8181401.

Swing: Deprecate JComponent.AccessibleJComponent.AccessibleFocusHandler

The class javax.swing.JComponent.AccessibleJComponent.AccessibleFocusHandler was deprecated since it was no longer used.

Deprecation Note: While there is currently no intention to remove this class in a future release; use of it is strongly discouraged. An intent to remove this API may declared in the future.

The bug associated with this change is 8009883.

Swing: Support accessiblity of JList items

The signature of nested class javax.swing.JList.AccessibleJList.AccessibleJListChild was modified to implement javax.accessibility.AccessibleAction. As a result, three new methods were added to the class: javax.swing.JList.AccessibleJList.AccessibleJListChild.doAccessibleAction, javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleActionCount, and javax.swing.JList.AccessibleJList.AccessibleJListChild.getAccessibleActionDescription.

The enhancement associated with this change is 8161483.

Swing: Add JToggleButton.requestFocus*()

Override methods javax.swing.JToggleButton.requestFocus and javax.swing.JToggleButton.requestFocusInWindow were added to redirect focus to the correct button. This allows the tab key to move to the next component.

The bug associated with this change is 8074883.

Swing: Add property to allow menu to remain open on mouse click

Swing properties “CheckBoxMenuItem.doNotCloseOnMouseClick” and “RadioButtonMenuItem.doNotCloseOnMouseClick” were added to support multiple selections without the need to re-open the menu after every selection. These new properties were documented in javax.swing.JCheckBoxMenuItem and javax.swing.JRadioButtonMenuItem respectively.

The enhancements associated with this change is 8158566 and 8165234.

Swing: Support target-based validation in InputVerifier

Prior to this change, javax.swing.InputVerifier supported only source-based validation. Support for target-based validation was added via enhancement of the class specification, addition of javax.swing.InputVerifier.verifyTarget, overload of javax.swing.InputVerifier.shouldYieldFocus(JComponent), and deprecation of javax.swing.InputVerifier.shouldYieldFocus(JComponent,JComponent).

Deprecation Note: While there is currently no intention to remove this method n a future release; use of it is strongly discouraged. An intent to remove this API may declared in the future.

The enhancement associated with this change is 8154431.

Swing: Provide missing specification for methods in javax.swing.* packages

The specifications of 45 methods in javax.swing.border package and classes javax.swing.colorchooser.AbstractColorChooserPanel, javax.swing.filechooser.FileFilter, javax.swing.filechooser.FileSystemView, and javax.swing.filechooser.FileView were enhanced with the addition of @param and @return tags to describe the methods expected parameters and return value.

The bugs associated with this change are 8039966 and 8040893.

Swing: Add {JLayer,LayerUI}.imageUpdate()

New method javax.swing.JLayer.imageUpdate was added to the final JLayer class. It delegate to javax.swing.plaf.LayerUI.imageUpdate which may be used to control animated gif repainting.

Swing: Add ability to disable JColorChooser transparency controls

Support to enable and disable transparency controls was added with methods javax.swing.colorchooser.AbstractColorChooserPanel.setColorTransparencySelectionEnabled and javax.swing.colorchooser.AbstractColorChooserPanel.isColorTransparencySelectionEnabled which set and query the controls respectively, constant javax.swing.colorchooser.AbstractColorChooserPanel.TRANSPARENCY_ENABLED_PROPERTY which indicates that the color transparency may be selected, and method override javax.swing.JColorChooser.showDialog which shows the modal color-chooser dialog with color transparency selection optionally enabled.

The enhancement associated with this change is 8051548.

Swing: Redesign JLayer.{get,set}Border()

The javax.swing.JLayer.setBorder and javax.swing.JLayer.getBorder methods were redesigned to delegate to the JLayer’s view component. Prior to this change, they always threw java.lang.IllegalArgumentException.

Swing: Declare platform-dependence of JInternalFrame.setFrameIcon()

The display of a a user-specified icon in a title bar may not be supported by all platforms; hence the specification of javax.swing.JInternalFrame.setFrameIcon was relaxed to allow this behaviour.

The bug associated with this change is 8059297.

Swing: Remove unnecessary final modifier from SwingPropertyChangeSupport.isNotifyOnEDT()

The unnecessary final modifier was removed from method javax.swing.event.SwingPropertyChangeSupport.isNotifyOnEDT since the class itself is declared final.

The enhancements associated with this change are 6521783 and 8061319.

Swing: Add Action.accept()

The method javax.swing.Action.accept was added to the Action interface to determine whether the action should be performed with the specified sender object. The specification javax.swing.SwingUtilities.notifyAction was modified to remove one of the notification conditions.

The bug associated with this change is 8133039.

Swing: Allow escape key to cancel a ProgressMonitor operation

The specification of javax.swing.ProgressMonitor.isCanceled was modified to consider the operation canceled if the progress dialog is dismissed using the escape key.

The bug associated with this change is 8065861.

Swing: Add PopupFactory.getPopup()

A new protected method, javax.swing.PopupFactory.getPopup, was added to enable creation of a heavyweight popup.

The enhancement associated with this change is 8147521.

Swing: Add missing specification to javax.swing.text.html

The specification of over 200 methods and fields in javax.swing.text.html was either entirely missing or incomplete. Specification documenting the long-standing behaviour was added to the following classes: javax.swing.text.html.BlockView, javax.swing.text.html.CSS, javax.swing.text.html.FormSubmitEvent, javax.swing.text.html.HTML, javax.swing.text.html.HTMLDocument, javax.swing.text.html.HTMLEditorKit, javax.swing.text.html.HTMLWriter, javax.swing.text.html.ImageView, javax.swing.text.html.InlineView, javax.swing.text.html.MinimalHTMLWriter, javax.swing.text.html.Option, javax.swing.text.html.ParagraphView, and javax.swing.text.html.StyleSheet.

The bug associated with this change is 8046446.

Swing: Create platform Look and Feel without installation

Support to create a supported, built-in Java Look and Feel by name was added by method javax.swing.UIManager.createLookAndFeel.

The enhancement associated with this change is 8136366.

Swing: Add marker interface to identify properties which are not serialized

A marker interface, javax.swing.UIClientPropertyKey, was added to identify keys which should be removed from client properties prior to serialization or after the Look and Feel is changed.

The bug associated with this change is 8141544.

Swing: Support drawing & measuring text using the platform Look & Feel

Text drawing methods using the platform Look and Feel were provided. These methods were designed to support HiDPI, hence they use floating-point values. This is the complete list of new methods: javax.swing.plaf.TextUI.getToolTipText2D, javax.swing.plaf.TextUI.modelToView2D(JTextComponent,int,Position.Bias), javax.swing.plaf.TextUI.viewToModel2D(JTextComponent,Point2D,PositionBias[]), javax.swing.plaf.basic.BasicGraphicsUtils.drawString, javax.swing.plaf.basic.BasicGraphicsUtils.drawStringUnderlineCharAt, javax.swing.plaf.basic.BasicGraphicsUtils.getClippedString, javax.swing.plaf.basic.BasicGraphicsUtils.getStringWidth, javax.swing.text.PasswordView.drawEchoCharacter, javax.swing.text.PlainView.drawSelectedText, javax.swing.text.PlainView.drawUnselectedText, javax.swing.text.WrappedPlainView.drawLine, javax.swing.text.WrappedPlainView.drawUnselectedText, javax.swing.text.WrappedPlainView.drawSelectedText, javax.swing.text.Utilities.drawTabbedText, javax.swing.text.Utilities.getTabbedTextWidth, javax.swing.text.Utilities.getTabbedTextOffset, javax.swing.text.Utilities.getBreakLocation, javax.swing.text.Utilities.getPositionAbove, and javax.swing.text.Utilities.getPositionBelow.

Methods in the following packages which either accept or return int coordinates for text drawing were deprecated: javax.swing.plaf, javax.swing.plaf.basic, javax.swing.plaf.multi, and javax.swing.text.

Deprecation Note: While there is currently no intention to remove these API in a future release; use of them is strongly discouraged. An intent to remove these APIs may declared in the future.

The bugs associated with this change are 8132119 and 8156217.

Swing: Allow JSlider.setPaintTrack() to ignore the platform Look & Feel

The specification for javax.swing.JSlider.setPaintTrack was modified to acknowledge that it is dependent on the platform Look and Feel and it may be ignored.

The bug associated with this change is 8063066.

Swing: Support painting an icon with a SynthContext

Support to use an icon from a UI manager in a component or as the base for a new icon drawing was added with the following changes. The internal SynthIcon interface became the public interface javax.swing.plaf.synth.SynthIcon. Three new methods, javax.swing.plaf.synth.SynthGraphicsUtils.getIconWidth, javax.swing.plaf.synth.SynthGraphicsUtils.getIconHeight, and javax.swing.plaf.synth.SynthGraphicsUtils.paintIcon were added to SynthGraphicsUtils. Finally, the class specification of javax.swing.plaf.synth.SynthLookAndFeel, was enhanced to reference the new APIs.

The bug associated with this change is 8081411.

Swing: Add missing specification to javax.swing.plaf.basic

The specification of over 100 methods and fields in javax.swing.plaf.basic was either entirely missing or incomplete. Specification documenting the long-standing behaviour was added to the following classes: javax.swing.plaf.basic.BasicButtonUI, javax.swing.plaf.basic.BasicComboBoxUI, javax.swing.plaf.basic.BasicComboPopup, javax.swing.plaf.basic.BasicDesktopIconUI, javax.swing.plaf.basic.BasicLabelUI, javax.swing.plaf.basic.BasicScrollPaneUI, javax.swing.plaf.basic.BasicSplitPaneDivider, and javax.swing.plaf.basic.BasicTableUI.

The bug associated with this change is 8049704.

sound

Sound: Add serialVersionUID field to serializable types in the javax.imageio.* packages

Some serializable types in javax.sound.midi and javax.sound.sampled did not contain a serialVersionUID field. The requisite declaration with a value matching the historical default was added. This is the complete list of affected public classes: javax.sound.midi.InvalidMidiDataException, javax.sound.midi.MidiUnavailableException, javax.sound.sampled.AudioPermission, javax.sound.sampled.LineEvent, javax.sound.sampled.LineUnavailableException, and javax.sound.sampled.UnsupportedAudioFileException.

The bug associated with this change is 8034046.

Sound: Specify behavior on null argument for methods in package javax.sound.midi.*

The specification of methods in javax.sound.midi and javax.sound.midi.spi was updated to describe the long-standing behaviour to throw java.lang.NullPointerException when passed null. This is the complete list of affected methods: javax.sound.midi.MidiSystem.getMidiDevice, javax.sound.midi.MidiSystem.getSoundbank(InputStream), javax.sound.midi.MidiSystem.getSoundbank(URL), javax.sound.midi.MidiSystem.getSoundbank(File), javax.sound.midi.MidiSystem.getMidiFileFormat(InputStream), javax.sound.midi.MidiSystem.getMidiFileFormat(URL), javax.sound.midi.MidiSystem.getMidiFileFormat(File), javax.sound.midi.MidiSystem.getSequence(InputStream), javax.sound.midi.MidiSystem.getSequence(URL), javax.sound.midi.MidiSystem.getSequence(File), javax.sound.midi.MidiSystem.getMidiFileTypes, javax.sound.midi.MidiSystem.isFileTypeSupported, javax.sound.midi.MidiSystem.write(Sequence,int,File), javax.sound.midi.MidiSystem.write(Sequence,int,OutputStream), javax.sound.midi.spi.SoundbankReader.getSoundbank(InputStream), javax.sound.midi.spi.SoundbankReader.getSoundbank(File), javax.sound.midi.spi.SoundbankReader.getSoundbank(URL), javax.sound.midi.spi.MidiFileWriter.getMidiFileTypes, javax.sound.midi.spi.MidiFileWriter.isFileTypeSupported, javax.sound.midi.spi.MidiFileWriter.write(Sequence,int,OutputStream), javax.sound.midi.spi.MidiFileWriter.write(Sequence,int,File), javax.sound.midi.spi.MidiFileReader.getMidiFileFormat(InputStream), javax.sound.midi.spi.MidiFileReader.getMidiFileFormat(URL), javax.sound.midi.spi.MidiFileReader.getMidiFileFormat(File), javax.sound.midi.spi.MidiFileReader.getSequence(InputStream), javax.sound.midi.spi.MidiFileReader.getSequence(URL), javax.sound.midi.spi.MidiFileReader.getSequence(File), javax.sound.midi.spi.MidiDeviceProvider.isDeviceSupported, and javax.sound.midi.spi.MidiDeviceProvider.getDevice.

The bug associated with this change is 8143909.

Sound: Specify behaviour on null argument for methods in package javax.sound.sampled

The specification of methods in javax.sound.sampled and javax.sound.sampled.spi was updated to consistently throw java.lang.NullPointerException when passed null. The only exception to this is javax.sound.sampled.spi.MixerProvider.getMixer which returns the default mixer for a null parameter. This is the complete list of affected methods: javax.sound.sampled.AudioSystem.getTargetEncodings(AudioFormat), javax.sound.sampled.AudioSystem.getTargetEncodings(AudioFormat.Encoding), javax.sound.sampled.AudioSystem.isConversionSupported, javax.sound.sampled.AudioSystem.getAudioInputStream, javax.sound.sampled.AudioSystem.getTargetFormats, javax.sound.sampled.AudioSystem.isConversionSupported, javax.sound.sampled.AudioSystem.getAudioInputStream, javax.sound.sampled.AudioSystem.getAudioFileFormat(InputStream), javax.sound.sampled.AudioSystem.getAudioFileFormat(File), javax.sound.sampled.AudioSystem.getAudioInputStream(InputStream), javax.sound.sampled.AudioSystem.getAudioInputStream(URL), javax.sound.sampled.AudioSystem.getAudioInputStream(File), javax.sound.sampled.AudioSystem.isFileTypeSupported, javax.sound.sampled.AudioSystem.getAudioFileTypes, javax.sound.sampled.AudioSystem.isFileTypeSupported, javax.sound.sampled.AudioSystem.write(AudioInputStream,AudioFileFormatType,OutputStream), javax.sound.sampled.AudioSystem.write(AudioInputStream,AudioFileFormat.Type,File), javax.sound.sampled.spi.AudioFileReader.getAudioFileFormat(InputStream), javax.sound.sampled.spi.AudioFileReader.getAudioFileFormat(URL), javax.sound.sampled.spi.AudioFileReader.getAudioFileFormat(File), javax.sound.sampled.spi.AudioFileReader.getAudioInputStream(InputStream), javax.sound.sampled.spi.AudioFileReader.getAudioInputStream(URL), javax.sound.sampled.spi.AudioFileReader.getAudioInputStream(File), javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported, javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes, javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported, javax.sound.sampled.spi.AudioFileWriter.write(AudioInputStream,AudioFileFormat.Type,OutputStream), javax.sound.sampled.spi.AudioFileWriter.write(AudioInputStream,AudioFileFormat.Type,File), javax.sound.sampled.spi.FormatConversionProvider.isSourceEncodingSupported, javax.sound.sampled.spi.FormatConversionProvider.isTargetEncodingSupported, javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings, javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported, javax.sound.sampled.spi.FormatConversionProvider.getTargetFormats, javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported, javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(AudioFormat.Encoding,AudioInputStream), javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(AudioFormat,AudioInputStream), javax.sound.sampled.spi.MixerProvider.isMixerSupported, and javax.sound.sampled.spi.MixerProvider.getMixer.

The bug associated with this change is 8135100.

Sound: Enhance AudioInputStream.skip()

The specification for javax.sound.sampled.AudioInputStream.skip was enhanced to describe long-standing behaviour similar to javax.sound.sampled.AudioInputStream.read. The method skips an integral number of frames. If the passed parameter is not an integral number of frames, a maximum computed value will be skipped.

The bug associated with this change is 8132782.

Sound: Update getAudio{InputSream,FileFormat}()

The specifications for javax.sound.sampled.AudioSystem.getAudioFileFormat, javax.sound.sampled.AudioSystem.getAudioInputStream, javax.sound.sampled.spi.AudioFileReader.getAudioFileFormat, and javax.sound.sampled.spi.AudioFileReader.getAudioInputStream were updated to require a stream reset. Prior to this change, the reset was optional.

The bug associated with this change is 8133677.


XML Parsing

XML Parsing

XML Parsing: Support XML Catalog

A standard XML Catalog API that supports OASIS XML Catalogs standard, v1.1 was provided. The API defines catalog and catalog-resolver abstractions which may be used with the XML parsing processors that accept resolvers via the addition of the javax.xml.catalog package containing the following classes:

Integration with the XML parsing processors was provided with the addition of the new constant javax.xml.XMLConstants.USE_CATALOG.

Additional details may be found in JEP 268 XML Catalogs.

The enhancements associated with this change are 8081248, 8144966, 8163232, 8171243, and 8158084.

XML Parsing: Specify behaviour of XPath for null context

The class specification for javax.xml.xpath.XPath was aligned with the specification for javax.xml.xpath.XPath.evaluate which defines the long-standing behaviour for a null context.

The bug associated with this change is 6211561.

XML Parsing: Deprecate XMLReaderFactory

The class org.xml.sax.helpers.XMLReaderFactory including both of its static methods, org.xml.sax.helpers.XMLReaderFactory.createXMLReader() and org.xml.sax.helpers.XMLReaderFactory.createXMLReader(String), were deprecated in favor of javax.xml.parsers.SAXParserFactory which conforms to the specification of the service-provider loading facility defined by java.util.ServiceLoader. The deprecated class is legacy and has not been updated since 2004.

Deprecation Note: While there is currently no intention to remove this class in a future release; use of it is strongly discouraged. An intent to remove this API may declared in the future.

The bug associated with this change is 8152912.

XML Parsing: Update references to configuration files

All references to location of the “jaxp.properties” file which is used by factory methods to locate service provider implementations were changed from normative to non-normative. This is the complete list of affected classes: javax.xml.datatype.DatatypeFactory, javax.xml.parsers.DocumentBuilderFactory, javax.xml.parsers.SAXParserFactory, javax.xml.stream.XMLEventFactory, javax.xml.stream.XMLInputFactory, javax.xml.stream.XMLOutputFactory, javax.xml.transform.TransformerFactory, javax.xml.validation.SchemaFactory, and javax.xml.xpath.XPathFactory.

The enhancement associated with this change is 8049378.

XML Parsing: Add *Source.isEmpty()

A convenience method, isEmpty(), was added to every *Source class to determine whether all inputs are empty for the given Source object. This is the complete list of new methods: javax.xml.transform.Source.isEmpty, javax.xml.transform.dom.DOMSource.isEmpty, javax.xml.transform.sax.SAXSource.isEmpty, javax.xml.transform.stax.StAXSource.isEmpty, javax.xml.transform.stream.StreamSource.isEmpty, and org.xml.sax.InputSource.isEmpty.

The enhancement associated with this change is 8144967.

XML Parsing: Add *Factory.newDefault{Instance,Factory}()

New public static methods to create a new instance of the system-default implementation were added to all XML parsing factories. This is the complete list of new methods: javax.xml.datatype.DatatypeFactory.newDefaultInstance, javax.xml.parsers.DocumentBuilderFactory.newDefaultInstance, javax.xml.parsers.SAXParserFactory.newDefaultInstance, javax.xml.stream.XMLEventFactory.newDefaultFactory, javax.xml.stream.XMLInputFactory.newDefaultFactory, javax.xml.stream.XMLOutputFactory.newDefaultFactory, javax.xml.transform.TransformerFactory.newDefaultInstance, javax.xml.validation.SchemaFactory.newDefaultInstance, and javax.xml.xpath.XPathFactory.newDefaultInstance.

The enhancement associated with this change is 8169778.

XML Parsing: Support complete DOM API

Two packages from JSR 206: Java API for XML Processing (JAXP) were added, thus providing support for all DOM APIs. The org.w3c.dom.ranges package contains interfaces supporting dynamic document traversal and identification of a content’s range. The org.w3c.dom.traversal package contains interfaces supporting document node traversal.

The enhancement associated with this change is 8023276.

XML Parsing: Add ElementTraversal

The new interface, org.w3c.dom.ElementTraversal, defined by the W3C Element Traversal Specification was added It provides a set of read-only attributes which allow navigation between document elements.

The enhancement associated with this change is 8135283.

XML Parsing: Generify javax.xml* packages

Methods in packages javax.xml.stream, javax.xml.stream.events, and javax.xml.stream.util were paramaterized. This change was motivated by a desire to reduce build warnings.

The bug associated with this change is 8170556.

XML Parsing: Update the org.w3c.dom package specification

A updated description of the supported JAXP specification was provided, including references to DOM Level 3 in the org.w3c.dom package specification.

The bug associated with this change is 8037948.

XML Parsing: Support any data type

The javax.xml.xpath package was extended to support any data type in addition to previously defined explicit types. Several changes were necessary:

The bug associated with this change is 8054196.

XML Parsing: Add serialVersionUID field to javax.xml.tranform.Transformer*Exception

The serializable types javax.xml.transform.TransformerConfigurationException and javax.xml.transform.TransformerException did not contain a serialVersionUID field. The requisite declaration with a value matching the historical default was added.

XML Parsing: Specify exceptional conditions for XPath

The class specification of javax.xml.xpath.XPath was updated to describe the long-standing behaviour to throw a javax.xml.xpath.XPathExpressionException when the value is null and the operation has no dependency on the context.

The bug associated with this change is 6211561.

STaX

STaX: Update XML{Event,Stream}?Reader conditions for START_DOCUMENT return

The class specification for javax.xml.stream.XMLStreamReader was updated to return START_DOCUMENT whenever XML document processing begins without an XML declaration. Further adjustments were necessary for javax.xml.stream.XMLStreamReader.getEventType and javax.xml.stream.XMLStreamReader.hasName.

Missing @return statement were added to document existing behaviour for the following methods: javax.xml.stream.XMLStreamReader.getLocation, javax.xml.stream.XMLStreamReader.getTextLength, javax.xml.stream.XMLStreamReader.getTextStart, javax.xml.stream.XMLEventReader.nextEvent. javax.xml.stream.XMLEventReader.peek, javax.xml.stream.XMLEventReader.getElementText, and javax.xml.stream.XMLEventReader.nextTag.

The bug associated with this change is 8069098.

XML Parsing: Adjust @deprecated tags to use correct JDK version number

The version number for deprecations’ since values was updated from since="5" and since="7" to since="1.5" and since="1.7" respectively. This aligns with the JDK version number convention used for the @since javadoc tag as described by JEP 277 Enhanced Deprecation. This is the set of affected APIs: javax.xml.stream.XMLEventFactory.newInstance, javax.xml.stream.XMLInputFactory.newFactory, javax.xml.stream.XMLInputFactory.newInstance, javax.xml.stream.XMLOutputFactory.newInstance, org.xml.sax.AttributeList, org.xml.sax.DocumentHandler, org.xml.sax.Parser, and org.xml.sax.helpers.ParserFactory.

The bug associated with this change is 8176541.


Tool Interface

java.lang.instrument / JVM TI

java.lang.instrument: Specify class loader for agent JAR files

The java.lang.instrument package specification was amended to require that the system system class loader support a mechanism to add an agent JAR file to the system classpath. Also, if a custom class loader is used, then it must define java.lang.instrument.Instrumentation.appendToSystemClassLoaderSearch for the agent to be loaded at start-up.

The bug associated with this change is 8160950.

java.lang.management

java.lang.management: Add ThreadInfo.{isDaemon,getPriority}()

Methods java.lang.management.ThreadInfo.isDaemon and java.lang.management.ThreadInfo.getPriority were added to return information about a thread’s daemon state and priority respectively.

The enhancement associated with this change is 6588467.

java.lang.management: Update set of ownable synchronizers for LockInfo

The final sentence of the java.lang.management.LockInfo class specification was updated to state that java.util.concurrent.locks.ReentrantLock and then entire java.util.concurrent.locks.ReentrantReadWriteLock are examples of ownable synchronizers. Prior to this change, only the write lock of java.util.concurrent.locks.ReentrantReadWriteLock was listed.

The bug associated with this change is 8176204.

java.lang.management: Use UndeclaredThrowableException to wrap exceptions

The specification of method java.lang.management.ManagementFactory.newPlatformMXBeanProxy was updated to describe existing behaviour to wrap java.io.IOException and java.io.InvalidObjectException with java.lang.reflect.UndeclaredThrowableException.

The bug associated with this change is 6659240.