JSR 379: Java SE 9: Annex 1 (original) (raw)

JSR 379: Java SE 9: Annex 1

Public Review Specification

API Specification Change Summary

2017/3/6 22:41 -0800 [75327a751fcc]

Copyright © 2017 Oracle and/or its affiliates · All Rights Reserved

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
Applets Beans Collections Streams I/O & NIO java.lang Reflection java.lang.ref java.lang.invoke java.math java.time Concurrency java.util Logging Regular Expressions Internationalization Networking JAR & ZIP APIs RMI CORBA Security Scripting JNDI JMX
User Interface XML Tool Interface
2D AWT Swing Sound XML Parsing STaX java.lang.instrument / JVM TI

Core Libraries

Applets

Applets: Deprecate Applets

All APIs supporting applets including the entirejava.appletpackage (java.applet.Applet,java.applet.AppletStub,java.applet.AudioClip,java.applet.AppletContext) and thejavax.swing.JAppletclass 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 inJEP 289 Deprecate the Applet API.

The enhancement associated with this change is8149502.

Applets: Deprecate APIs which reference Applets

All APIs whose signatures refer to types defined in thejava.applet package weredeprecated. This is the complete list of affected APIs: interfacejava.beans.AppletInitializer,java.beans.Beans.instantiate, and methodjavax.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 is8169900.

Beans

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

The specification of the return value ofjava.beans.SimpleBeanInfo.loadImagewas updated to include the interpretation of a null return value.

Beans: Add annotations to generateBeanInfo classes at runtime

New annotationsjava.beans.JavaBean,java.beans.BeanProperty, andjavax.swing.SwingContainerwere added to allow runtime generation of java.beans.BeanInfoclasses. These new annotations may be used to replace the compile-time javadoc @beaninfo tags.

The enhancements associated with this change are4058433 and8132973.

Beans: Specify IllegalArgumentExceptionconditions 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. Ajava.lang.IllegalArgumentExceptionwill 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), andjava.beans.EventHandler.create(Class,Object,String,String,String).

Beans: Generify java.beans.beancontextpackage

Methods in package java.beans.beancontextwere 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, andjava.beans.beancontext.BeanContextSupport.iterator.

The bug associated with this change is8039096.

Collections

Collections: Add convenience factory methods for collections

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

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

The enhancements associated with this change are8048330, 8133977,8144952, and8159404.

Collections: Enhance List.spliteratorfor randomly accessible lists

The specification ofjava.util.List.spliteratorwas enhanced to describe how to account forjava.util.Listimplementingjava.util.RandomAccess.

The enhancement associated with this change is8158365.

Collections: Declare unspecified behaviour forIterator methods

The specifications ofjava.util.Iterator.remove,java.util.Iterator.forEachRemaining, andjava.lang.Iterable.forEachwere 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 is8168745.

Collections: Specify exceptional conditions forMap, HashMap, & Hashtable

The specification of thejava.util.Mapinterface was updated to declare that mapping functions should not modify the Map during computations. If any of the compute*() ormerge() methods of java.util.HashMapandjava.util.Hashtabledetect that mapping functions have modified the map, they will throw ajava.util.ConcurrentModificationExceptionjust 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, andjava.util.Hashtable.merge.

The bug associated with this change is8071667.

Collections: Repeat class-level warnings inVector and Hashtable methods

Alljava.util.Enumerations returned by java.util.Vectorandjava.util.Hashtablein 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, andjava.util.Hashtable.elements.

The enhancement associated with this change is8020860.

Collections: Remove incorrect restriction fromArrayList.removeRange()

Injava.util.ArrayList.removeRange, the list of conditions for throwing ajava.lang.IndexOutOfBoundsExceptionwas updated to eliminate “fromIndex <= size()”.

The bug associated with this change is8014066.

Collections: Add Enumeration.asIterator()

An adaptor methodjava.util.Enumeration.asIteratorwas added to returnjava.util.Iteratorwhich wraps the Enumeration instance and forwards method invocations.

The enhancement associated with this change is8072726.

Collections: Remove references to private fields inAbstractList.subList()

References to the names of private fields in the @implSpec ofjava.util.AbstractList.subListwere removed.

The enhancement associated with this change is8079136.

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

The specification of constant java.util.Spliterator.CONCURRENTwas 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 is8032513.

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, andjava.util.stream.DoubleStream.sum.

The bug associated with this change is8030942.

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 is8050819.

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, andjava.util.stream.DoubleStream.takeWhile.

The enhancement associated with this change is8071597.

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, andjava.util.stream.DoubleStream.iterate.

The enhancement associated with this change is8072727 and8164691.

Streams: Generify Stream.generate()

The parameter of methodjava.util.stream.Stream.generatewas paramaterized with a bounded wildcard type.

The bug associated with this change is8132097.

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. andjava.util.stream.DoubleStream.iterate.

The bug associated with this change is8164691.

Streams: Specify stream pipeline optimization

The class specifications of java.util.stream.Stream,java.util.stream.IntStream,java.util.stream.LongStream, andjava.util.stream.DoubleStreamwere 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 is8130023.

Streams: Update Collectors

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

Streams: Clarify BaseStream.spiterator()

The specification ofjava.util.stream.BaseStream.spliteratorwas 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 is8048689.

I/O & NIO

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

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

The bug associated with this change is8073692.

I/O & NIO: Remove FilePermissionpath name canonicalization

The path name canonicalization process injava.io.FilePermissionwas removed so that only the original path name argument is used in theimplies(), 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, andjava.io.FilePermission.equals.

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

The bugs associated with this change are8164705 and8168979.

I/O & NIO: Specify exceptional conditions forReader

The abstract methodjava.io.Reader.readdid not specify pre-conditions for the parameters. The long-standing behaviour to throw ajava.lang.IndexOutOfBoundsExceptionwhen 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, andjava.io.LineNumberReader.read.

The bug associated with this change is8029689.

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

An unexpectedjava.lang.NullPointerExceptionwas 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, andjava.io.StringReader.close.

The bug associated with this change is8143394.

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

Three kinds of problems were addressed by this change:

The bug associated with this change is8154183.

I/O & NIO: Specify exceptional conditions forWriter

The abstract methodsjava.io.Writer.writeandjava.io.Writer.writedid not specify pre-conditions for their parameters. The long-standing behaviour to throw ajava.lang.IndexOutOfBoundsExceptionwhen 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), andjava.io.StringWriter.write(String,int,int).

The bug associated with this change is8130679.

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 is8066867.

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

Convenience methodsjava.io.InputStream.readAllBytesandjava.io.InputStream.readNByteswere 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 is8080835.

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

Conditions for throwingjava.io.IOExceptionin the abstract methodjava.io.InputStream.skipwere unclear with regard to seeking. References to “seeking” were replaced withInputStream.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, andjava.io.PushbackInputStream.skip.

The bug associated with this change is8136738.

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

The java.io.FilterOutputStream.closemethod specified that it invokesjava.io.FilterOutputStream.flushbefore closing the underlying stream; however, it is ambiguous whetherflush() 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 is8054565.

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

Thejava.nio.filepackage description was enhanced to state that ajava.lang.NullPointerExceptionwill be thrown when a passed array contains a null element.

The enhancement associated with this change is8062632.

I/O & NIO: Use co-variance injava.nio.Buffer and all subclasses

Many methods injava.nio.Bufferare 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, andjava.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, andjava.nio.ShortBuffer.

The enhancement associated with this change is4774077.

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

Since every known subclass of java.nio.Bufferdefinedjava.nio.Buffer.duplicateandjava.nio.Buffer.slicemethods in exactly the same way, their specification was moved toBuffer.

The enhancement associated with this change is8150785.

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

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

The enhancement associated with this change is8149469.

I/O & NIO: Allow null parameter inAtomicMoveNotSupportedException

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 is8024086.

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

Eight methods in interfacejava.nio.file.Pathwere 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…), andjava.nio.file.Path.iterator.

The enhancement associated with this change is8030090.

I/O & NIO: Specify exceptional conditions forFile

The specification for all methods injava.nio.file.Filesthat allow file open options to be specified was modified to throw ajava.lang.IllegalArgumentExceptionwhen invalid options or combinations of options are specified. The specification describing conditions to throw ajava.lang.SecurityExceptionwas enhanced to indicate that it may be thrown when the file is open with theDELETE_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…), andjava.nio.file.Files.write(Path,Iterable,OpenOption…).

The bugs associated with this change are8062553 and8065109.

I/O & NIO: Clarify behaviour for zero attributes

The specification for java.nio.file.Files.readAttributeswas 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 is8064466.

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 inJEP 290 Filter Incoming Serialization Data.

The enhancements associated with this change are8155760,8169645,8170291, and8166739.

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

The specifications ofjava.io.ObjectInputStream.resolveClassandjava.io.ObjectInputStream.resolveProxyClasswere revised to filter the platform class loader and its ancestors rather than just the null class loader.

The bugs associated with this change are8155977 and8169653.

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 tojava.lang.Stringand 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.StackWalkerclass contains methods to open a sequential stream of java.lang.StackWalker.StackFrameobjects for the current thread and to examine the contents of the stack frames. java.lang.StackFramePermissioncontrols access to the stack frame information including the class loader name. These APIs replace functionality provided by the internal methodsun.reflect.Reflection.getCallerClass().

Additional details may be found inJEP 259 Stack-Walking API.

The enhancements associated with this change are8140450 and8153912.

java.lang: Add Runtime.Version

The static, nested, inner classjava.lang.Runtime.Versionwas 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 are8144062 and8161236.

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 inJEP 102 Process API Updates.

The enhancements associated with this change are8077350,8133216,8129344,8131763,8138566,8003488,8140213, and8140250.

java.lang: Update Process

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

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 throwjava.lang.NullPointerExceptionif 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.getResourceAsStreamandjava.net.URLClassLoader.getResourceAsStream.

The enhancement associated with this change is81702940.

java.lang: Add ClassLoader.resources()

java.lang.ClassLoader.resourceswas added to support return of ajava.util.stream.Streamwhose elements are the URLs of all the resources with a given name.

The enhancement associated with this change is8161230.

java.lang: Specify exceptional condition forget*Package()

The specifications of java.lang.ClassLoader.getPackage,java.lang.Package.getPackageand the new methodjava.lang.ClassLoader.getDefinedPackage, were updated to describe conditions for throwing ajava.lang.NullPointerException.

The bug associated with this change is8165346.

java.lang: AddClassLoader.isRegisteredAsParallelCapable()

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

The enhancements associated with this change are8165793 and8169435.

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

The specification of java.lang.ClassLoaderwas enhanced to explicitly state that java.lang.Class.forNamemust be used to create java.lang.Classobjects representing array classes.

The enhancement associated with this change is6516909.

java.lang: UpdateClassLoader.getSystemClassLoader()

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

The bug associated with this change is8165563.

java.lang: Update Math & StrictMath

The following changes were made tojava.lang.Math andjava.lang.StrictMath.

java.lang: Declare SecurityExceptionconsistently in class loader methods

The conditions under whichjava.lang.SecurityExceptionmay 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, andjava.lang.Thread.getContextClassLoader.

The bug associated with this change is7181225.

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

The specifications for deprecated methodsjava.lang.SecurityManager.checkTopLevelWindow,java.lang.SecurityManager.checkSystemClipboardAccess, andjava.lang.SecurityManager.checkAwtEventQueueAccesswere revised to check the target name “AllPermission” as described in the Java SE 8 Platform Specification. These methods are superseded by invocations ofjava.lang.SecurityManager.checkPermissionwith AWTPermission("showWindowWithoutWarningBanner"),AWTPermission("accessClipboard"), andAWTPermission("accessEventQueue") respectively.

The enhancement associated with this change is8029886.

java.lang: Add Thread.onSpinWait()

Some hardware platforms may benefit from a software hint indicating that a spin loop is in progress. Thejava.lang.Thread.onSpinWaitmethod 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 inJEP 285 Spin-Wait Hints.

The enhancement associated with this change is8147832.

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 ofjava.lang.InheritableThreadLocalwas augmented to note that initial values may not be set at object creation.

The enhancement associated with this change is8056152.

java.lang: Enhance Deprecated

The class specification of java.lang.Deprecatedcorresponding 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 inJEP 277 Enhanced Deprecation.

The enhancement associated with this change is8145461.

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

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

The bug associated with this change is6481080.

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 inJEP 277 Enhanced Deprecation.

The enhancement associated with this change is8145468.

java.lang: Enhance SafeVarargs

The specification ofjava.lang.SafeVarargswas enhanced to allow @SafeVarargs on private methods.

The enhancement associated with this change is7196160.

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

java.lang.Runtime.traceInstructionsandjava.lang.Runtime.traceMethodCallswere 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 withforRemoval=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 inJEP 277 Enhanced Deprecation.

The bug associated with this change is8153330.

java.lang: Deprecate Compiler

The classjava.lang.Compilerwas 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 byJEP 165 Compiler Control.

Deprecation Note: These methods have been annotated withforRemoval=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 is4285505.

java.lang: GenerifySecurityManager.getClassContext()

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

The bug associated with this change is8027063.

Reflection

Reflection: Update Class

Reflection: Tidy Constructor &Method classes

Three problems were addressed by this change:

The bug associated with this change is8169479.

Reflection: ClarifyExecutable.getAnnotatedReceiverType()

The specification ofjava.lang.reflect.Executable.getAnnotatedReceiverTypewas clarified to indicate that it will return null forConstructors of nested static classes, top-level classes, local classes, and anonymous classes.

The bug associated with this change is8044629.

Reflection: AddAnnotatedElement.getAnnotatedOwnerType()

The interface java.lang.reflect.AnnotatedElementdid not support access to the potentially annotated owner type which retained its annotations. The java.lang.reflect.AnnotatedType.getAnnotatedOwnerTypemethod 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, andjava.lang.reflect.AnnotatedWildcardType.getAnnotatedOwnerType.

The bug associated with this change is8057804.

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 is8054304.

Annotations: Adjust number of type contexts

The specification forjava.lang.annotation.ElementTypereferred 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 is8033812.

Annotations: Support serialization ofAnnotationTypeMismatchException

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

The bug associated with this change is6226715.

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 Cleanerhas been notified that the object has become phantom reachable, the cleaning actions are executed.

The enhancement associated with this change is8138696.

java.lang.ref: Automatically clearPhantomReference

The specification ofjava.lang.ref.PhantomReferencewas aligned with soft and weak references which are automatically cleared by the garbage collector as they are enqueued.

The enhancement associated with this change is8071507.

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.Referenceclass specification were required,

Additional details may be found inJEP 193 Variable Handles.

The enhancement associated with this change is8133348.

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 inJEP 193 Variable Handles.

The enhancements associated with this change are8149644,8151198,8151705,8154556,8154737,8154755,8157726,8158039,8161444,8162106,8162107, and8162108.

java.lang.invoke: Support enhanced method handles

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

Additional details may be found inJEP 194 Enhanced Method Handles.

The enhancements associated with this change are8130227,8150829,8151179,8158169,8153637,8150956,8158171, and8167974.

java.lang.invoke: Indify string concatenation

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

Additional details may be found inJEP 280 Indify String Concatenation

The enhancements associated with this change are8085796,

java.lang.invoke: Specify behaviour for static methods

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

java.lang.invoke: Refine MethodHandle &MethodHandles

Several changes were applied systematically to java.lang.invoke.MethodHandleandjava.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, andjava.lang.invoke.MethodHandles.permuteArguments.

The bugs associated with this change are8143410 and8150360.

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.inwere clarified to describe what constitutes a lookup context for aLookup instance.

The bug associated with this change is8150782.

java.lang.invoke: Specify exceptional conditions forMethodHandles.loop()

The specification of java.lang.invoke.MethodHandles.loopwas modified to reformulate the conditions leading tojava.lang.IllegalArgumentException.

The bug associated with this change is8150635.

java.lang.invoke: AddMethodHandles.arrayConstructor()

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

The bug associated with this change is8155106.

java.lang.invoke: AddMethodHandles.arrayLength()

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

The enhancement associated with this change is8156915.

java.lang.invoke: Propagate errors from invokedynamic

Thejava.lang.invokepackage specification was updated to reflect changes to the Java SE 9 Edition of the Java Virtual Machine Specification. Exceptions frominvokedynamic are propagated directly from the bootstrap method. Formerly, they were wrapped by ajava.lang.BootstrapMethodError.

The enhancement associated with this change is8166974.

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 is4851777.

java.math: Add BigInteger square root methods

Two methods returning the integer square root were added.java.math.BigInteger.sqrtreturns the largest integer which is less than or equal to the real square root.java.math.BigInteger.sqrtAndRemainderreturns 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 is8032027.

java.math: Add BigInteger.TWO

The constantjava.math.BigInteger.TWOequal to BigInetger.valueOf(2) was added.

The enhancement associated with this change is8152237.

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)andjava.math.BigInteger.BigInteger(int,byte[],int,int)

The enhancement associated with this change is4026465.

java.math: Update BigInteger Serialized Form documentation

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

The bug associated with this change is8035279.

java.math: Deprecate BigDecimal rounding mode integer constants

Eight legacy constants and their uses in three BigDecimalmethod signatures were deprecated in favor ofjava.math.RoundingModewhich was added by JSR 176: Java 2 SE 5.0 (Tiger) Release Contents via componentJSR-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, andjava.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 is4943627.

java.time

java.time: Correct boundaries specified byChronoField.EPOCH_DAY

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

The bug associated with this change is8160681.

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 CLDRsection 8 was provided. Changes to the class specification ofjava.time.format.DateTimeFormatterand new methodsjava.time.format.DateTimeFormatterBuilder.appendGenericZoneText(TextStyle)andjava.time.format.DateTimeFormatterBuilder.appendGenericZoneText(TextStyle,Set)were required.

The enhancement associated with this change is8155823.

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

The specification for the computation of the time-zone format was optimized injava.time.format.DateTimeFormatterBuilder.appendZoneText(TextStyle)andjava.time.format.DateTimeFormatterBuilder.appendZoneText(TextStyle,Set). If the input temporal is a java.time.chrono.ChronoLocalDateTimeand 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 is8154567.

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

The specifications of pattern letters `A`, 'n', and 'N' injava.time.format.DateTimeFormatterBuilder.appendPatternwas changed to match the specification inCLDRsection 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 is8148949.

java.time: Add pattern letter 'g'

Pattern letter `g` matching the field java.time.temporal.JulianFields.MODIFIED_JULIAN_DAYwas added to java.time.format.DateTimeFormatterBuilder.appendPattern. The new pattern letter matches the specification inCLDRsection 8.

The bug associated with this change is8148949.

java.time: Add pattern letter 'DD'

Pattern letter `DD` was added tojava.time.format.DateTimeFormatterBuilder.appendPattern. The new pattern letter matches theCLDRspecification.

The bug associated with this change is8079628.

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 is8030864.

java.time: Specify adjacent value parsing inDateTimeForamtterBuilder.appendFraction()

The specification ofjava.time.format.DateTimeFormatterBuilder.appendFractionwas 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 is8031085.

java.time: Specify lenient parsing for offset parsing

The specifications ofjava.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME,java.time.format.DateTimeFormatter.BASIC_ISO_DATE,java.time.format.DateTimeFormatterBuilder.appendOffset, and java.time.format.DateTimeFormatterBuilder.appendOffsetIdwere 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 is8032051.

java.time: Support parsing of a single digit hour

The specifications ofjava.time.format.DateTimeFormatterBuilder.appendOffsetwas 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 is8066806.

java.time: Add Duration.dividedBy()

The methodjava.time.Duration.dividedBywas added to return the number of whole times that a Durationoccurs within this Duration, e.g. how many four hour periods there are in twelve hours.

The enhancement associated with this change is8032510.

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 is8054214.

java.time: Modify the return value ofZoneRulesProvider.getAvailableZoneIds()

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

The bug associated with this change is8066291.

java.time: Clarify DateTimeFormatter resolution

The specification of java.time.format.DateTimeFormatterwas 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 is8066982.

java.time: Clarify behaviour ofChronology.isLeapYear() outside of Chronologyrange

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

The bug associated with this change is8067800.

java.time: Add Clock.tickMillis()

The method of java.time.Clock.tickMilliswas added to return a millisecond clock. This new method follows the existing pattern of the methods java.time.Clock.tickSecondsandjava.time.Clock.tickMinutes.

The enhancement associated with this change is8071919.

java.time: Change the return type ofLocalDate.getEra()

The return type of java.time.LocalDate.getErawas changed from java.time.chrono.Erato the more specific typejava.time.chrono.IsoErawhich is the correct era type for the calendar system. The method specification was also updated to remove reference to non-existentjava.time.chrono.IsoChronologyconstants.

The bug associated with this change is8072746.

java.time: Add conditions for throwingIllegalArgumentException toZoneOffseTransitionRule.of()

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

The bug associated with this change is8079063.

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

Two static methods,java.time.LocalDate.ofInstantandjava.time.LocalTime.ofInstantwere added to ease conversion fromjava.time.Instantto java.util.Dateandjava.time.Instanttojava.time.LocalDate.

The enhancement associated with this change is8133079.

java.time: Add methods to retrieve portions of aDuration

Convenience methodsjava.time.Duration.toDaysPart,java.time.Duration.toHoursPart,java.time.Duration.toMinutesPart,java.time.Duration.toSecondsPart,java.time.Duration.toMillisPart, andjava.time.Duration.toNanosPartwere 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 methodjava.time.Duration.toSecondswas added following the existing method naming convention in this class.

The enhancement associated with this change is8142936.

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 providetoEpochSeconds methods; however, they are missing in few notable, final classes. The necessary methods were added:java.time.LocalDate.toEpochSecond,java.time.LocalTime.toEpochSecond, andjava.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 is8143413.

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), andjava.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 is8146218.

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 is8148849.

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 inJEP 266 More Concurrency Updates

Concurrency: Specify exceptional conditions forThreadPoolExecutor.setCorePoolSize()

The specification ofjava.util.concurrent.ThreadPoolExecutor.setCorePoolSizewas updated to throw ajava.lang.IllegalArgumentExceptionif the provided core pool size is not between 0 and the maximum pool size.

The bug associated with this change is7153400.

Concurrency: ImproveCompletableFuture 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 ofjava.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), andjava.util.concurrent.CompletableFuture.whenCompleteAsync(BiConsumer,Executor).

The bugs associated with this change are8139927 and8143089.

Concurrency: ForkJoinPool updates

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

Concurrency: Describe implementation requirements for atomicity guarantee

The class specification ofjava.util.concurrent.ConcurrentMapwas enhanced to describe all required method overrides to maintain atomicity guarantees.

The bug associated with this change is8078645.

Concurrency: Revise java.util.concurrent.atomicto use VarHandles

The packagejava.util.concurrent.atomicwas comprehensively updated to leverage java.lang.invoke.VarHandlespecification and methods. Twelve classes were affected.

The enhancement associated with this change is8080603.

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

The class specifications of java.util.PriorityQueueandjava.util.concurrent.PriorityBlockingQueuewere 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 is8132964.

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

Methodsjava.util.concurrent.TimeUnit.toChronoUnitandjava.util.concurrent.TimeUnit.ofwere added to convert betweenjava.util.concurrent.TimeUnitandjava.time.temporal.ChronoUnit.

The enhancement associated with this change is8141452.

Concurrency: DeprecateAtomic*.weakCompareAndSet() and addAtomic*.weakCompareAndSetPlain()

The convention for methods injava.lang.invoke.VarHandleis 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() andAtomic*.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, andjava.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, andjava.util.concurrent.atomic.AtomicReferenceArray.weakCompareAndSetPlain.

The enhancement associated with this change is8164814.

Concurrency: ClarifySemaphore.drainPermits()

The specification ofjava.util.concurrent.Semaphore.drainPermitswas extended to describe the behaviour when the number of permits is negative.

The bug associated with this change is8169272.

Concurrency: Define access control context forThreadPoolExecutor.finalize()

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

Concurrency: Document null return value forForkJoinWorkerThread.newThread()

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

The enhancement associated with this change is8143086.

java.util

The following changes have been made in thejava.utilpackage, in addition to changes detailed elsewhere in this document.

java.util: Remove fail-fast guarantee fromProperties 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, andjava.util.Properties.values, are no longer fail-fast; hence, the unchecked exceptionjava.util.ConcurrentModificationExceptionwill 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 is8029891.

java.util: Update Formatter

The following changes were made tojava.util.Formatter.

java.util: Deprecate Observer &Observable

Thejava.util.Observerinterface andjava.util.Observableclass were deprecated. Their event model was limited and under specified. Neither has been maintained or enhanced in years. The packagejava.beansprovides a richer event model. Concurrent data structures injava.util.concurrentprovides 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 is8154801.

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), andjava.lang.StringIndexOutOfBoundsException.StringIndexOutOfBoundsException(int).

The enhancement associated with this change is8135248.

java.util: Specify exceptional conditions forProperties.load()

The specification of methodsjava.util.Properties.load(Reader)andjava.util.Properties.load(InputStream)was updated to describe the long-standing behaviour to throwjava.lang.NullPointerExceptionwhen the parameter is null.

The bug associated with this change is8073214.

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

The specification of methodjava.util.Properties.stringPropertyNameswas updated to declare the long-standing behaviour to return an unmodifiable set of keys.

The bug associated with this change is8059361.

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(), andArrays.mismatch() where parameters always include two arrays.

The enhancements associated with this change are8033148 and8141409.

java.util: Support streams in Scanner

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

The enhancement associated with this change is8072722.

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

Several classes which only returnjava.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, andjava.sql.DriverManager.drivers.

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

The enhancements associated with this change are8081678 and8164815.

java.util: Specify late-binding for streaming methods

The specifications of java.util.BitSet.stream,java.lang.CharSequence.chars, andjava.lang.CharSequence.codePointswere enhanced to declare that the sourcejava.util.Spliteratoris late-binding.

The bug associated with this change is8169808.

java.util: Specify argument checking in selectedScanner methods

Exceptional conditions resulting in ajava.lang.IllegalArgumentExceptionwhen 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 is8166261.

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 is8159855.

java.util: Document exceptional conditions inPreferences

The specifications for all put*(), get*(), andremove() methods injava.util.prefs.AbstractPreferencesandjava.util.prefs.Preferenceswere updated to prohibit the use of any key or value String containing codepoint U+000 (the null control character). If this character is detected, ajava.lang.IllegalArgumentExceptionis thrown. This affects 15 methods in each class.

The class specification ofjava.util.prefs.AbstractPreferenceswas updated to correct references to the return type offlush() and sync() methods. They return aboolean instead of the documented void.

The bugs associated with this change are8038373 and8075156.

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 inJEP 264 Platform Logging API & Service.

The enhancements associated with this change are8140364 and8148568.

Logging: Remove selectedPropertyChangeListeners

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 is8029805.

Logging: Add LogManager.*ConfigurationListener()

New methodsjava.util.logging.LogManager.addConfigurationListenerandjava.util.logging.LogManager.removeConfigurationListenerwere added to provide equivalent functionality as removed methodsLogManager.addPropetyChangeListener()andLogManager.removePropertyChangeListener(). These new methods are the alternative for applications which can not subclassLogManager.

The enhancement associated with this change is8043306.

Logging: AddLogManager.updateConfiguration() methods

Methodsjava.util.logging.LogManager.updateConfigurationandjava.util.logging.LogManager.updateConfigurationwere added to update the LogManager. Unlikejava.util.logging.LogManager.readConfigurationthese new methods do not invokejava.util.logging.LogManager.resetwhich always removes and closes handlers on all existing loggers. Adjustments were also made to the class specification, java.util.logging.LogManagerand methodsjava.util.logging.LogManager.readConfiguration(),java.util.logging.LogManager.readConfiguration(InputStream), andjava.util.logging.LogManager.reset.

The bug associated with this change is8033661 and8075810.

Logging: Add FileHandler constructor

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

The enhancement associated with this change is8059767.

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 ofjava.util.logging.LogManager.

The bug associated with this change is8060132.

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 ajava.util.logging.FileHandler. The default value is 100. Complete documentation may be found in the class specification of java.util.logging.FileHandlerand the new constructor,java.util.logging.FileHandler.FileHandler.

The enhancement associated with this change is8153955.

Logging: Upgrade to nanosecond event time resolution

The resolution of time stamps in java.util.logging.LogRecordwere upgraded from milliseconds to nanoseconds backed by java.time. This change was documented in thejava.util.logging.LogRecord.LogRecord. The event instant may be retrieved and set via new methodsjava.util.logging.LogRecord.getInstantandjava.util.logging.LogRecord.setInstant. The specification of existing methodsjava.util.logging.LogRecord.getMillisandjava.util.logging.LogRecord.setMilliswas 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 are8072645 and8144262.

Logging: Revise the Formatter.formatMessage()specification

The specification ofjava.util.logging.Formatter.formatMessagewas revised to use java.text.MessageFormatif the string contains digits.

The bug associated with this change is8153666.

Regular Expressions

Regular Expressions: Add two Perl regular expression constructs

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

The enhancement associated with this change is7071819.

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 methodjava.lang.Character.codePointOf.

The enhancement associated with this change is8147531.

Regular Expressions: AddMatcher.appendReplacement() and Matcher.appendTailfor StringBuilder

Overload methods java.util.regex.Matcher.appendReplacementandjava.util.regex.Matcher.appendTailwere added matching the identically named methods with aStringBuffer parameter.

The enhancement associated with this change is8039124.

Regular Expressions: Support functional programming

New functional methodsjava.util.regex.Matcher.replaceAllandjava.util.regex.Matcher.replaceFirstwere added matching the identically named methods.java.util.regex.Matcher.resultswas added to return a stream of java.util.regex.MatchResult.

The enhancement associated with this change is8071479.

Internationalization

These are the changes relating to internationalization support, primarily in thejava.utilandjava.textpackages and injava.lang.Character.

Internationalization: Support Unicode 8.0

The supported version of the Unicode standard for java.lang.Characterandjava.lang.Stringwas 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 tojava.lang.Character, 42 constants were added tojava.lang.Character.UnicodeBlock, 29 enums were added tojava.lang.Character.UnicodeScript, and two ranges were added tojava.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 inJEP 227 Unicode 7.0 andJEP 267 Unicode 8.0.

The enhancements associated with this change are8032446 and8072600.

Internationalization: Update Locale

The following changes were made tojava.util.Locale.

Internationalization: Use CLDR Locale data by default

The Unicode Consortium’sCommon 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 inJEP 252 Use CLDR Locale Data by Default.

.

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

The SPI implementations forjava.awt.im.spi,java.text.spi, andjava.util.spiwere 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 inJEP 226 UTF-8 Property Resource Bundles.

The enhancements associated with this change are8027607 and8152629.

Internationalization: Load ResourceBundleControlProvider implementations from the application’s classpath

java.util.spi.ResourceBundleControlProvideris 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 are8172365.

Internationalization: Clarify type of constant inResourceBundle.Control

A link under the word “unmodifiable” in the specification of constantsjava.util.ResourceBundle.Control.FORMAT_CLASS,java.util.ResourceBundle.Control.FORMAT_DEFAULT, andjava.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 is8134373.

Internationalization: Clarify context sensitivity of the month pattern

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

The bug associated with this change is8055900.

Internationalization: Specify exceptional condition for Format.parseObject()

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

The bugs associated with this change are8073211 and8150702.

Internationalization: Specify exceptional conditions in Format

The specification of many methods in abstract classjava.text.Formatand concrete subclasses was inconsistent in declaring java.lang.NullPointerExceptionandjava.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, andjava.text.SimpleDateFormat.

The bug associated with this change is8169480.

Internationalization: Add references toCalendar constants to DateFormatSymbols

Unlike other methods injava.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, andjava.text.DateFormatSymbols.setShortMonths.

The bug associated with this change is8129555.

Internationalization: Update Currency

The following changes were made tojava.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 propertyjava.net.preferIPV6Addresseswhich 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 is8016521.

Networking: Specify exceptional conditions forURL 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 ajava.net.MalformedURLExceptionwhen 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), andjava.net.URL.URL(URL,String,URLStreamHandler).

The bug associated with this change is4906983.

Networking: Allow multiple sockets to be bound to the same address and 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 is6432031.

Networking: Use ServiceLoader forURL/URLConnnection provider lookup

The specification in thejava.netpackage and thejava.net.URL.URLconstructor describing the how protocol handler implementations are found was updated to usejava.util.ServiceLoaderinstead of the old “java.protocol.handler.pkgs” system property. The mechanism locates implementations of a new service type, abstract classjava.net.spi.URLStreamHandlerProvider, using the system class loader. A small specification clarification to java.net.URLStreamHandlerFactory.createURLStreamHandlerwas also required.

The location of implementations of java.net.ContentHandlerFactorywas changed to use java.util.ServiceLoaderas documented injava.net.URLConnection.getContent. If that fails, the original mechanism based on core reflection is used.

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

The enhancements associated with this change are8064924 and8064925.

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

The parameter type of methodsjava.net.URL.getContentandjava.net.URLConnection.getContentwas paramaterized with an unbounded wildcard (<?>).

The enhancement associated with this change is8031326.

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 simplegetOption() and getOption() methods. The set of supported options may be retrieved with the newsupportedOptions() 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, andjava.net.MulticastSocket.supportedOptions.

The enhancement associated with this change is8036979.

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

The specification of the protectedjava.net.URLClassLoader.definePackagemethod was updated to throw ajava.lang.IllegalArgumentExceptionif the package has already been defined by this class loader.

Networking: Add java.content.handler.pkgsproperty

The class specification ofjava.net.ContentHandlerwas 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 injava.net.URL.URLandjava.net.URLConnection.getContent.

The enhancement associated with this change is8039470.

Networking: Ignore userinfo in URLPermission

The class specification of java.net.URLPermissionwas 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 is8029354.

Networking: Document support of jar: scheme URLs in URLClassLoader

The specifications for thejava.net.URLClassLoaderclass and thejava.net.URLClassLoader.URLClassLoaderconstructor were enhanced to declare the long-standing behaviour to acceptjar: scheme URLs and to describe how they are interpreted.

The bug associated with this change is8155770.

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.joinwere updated to indicate that anjava.io.IOExceptionwill be thrown if invoked on a platform that does not support multicasting.

The bug associated with this change is8157166.

Networking: Enable per-protocol setting forURLConnection caching

New methodsjava.net.URLConnection.getDefaultUseCachesandjava.net.URLConnection.setDefaultUseCacheswere 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 fieldjava.net.URLConnection.useCaches, and the java.net.URLConnection.setUseCaches,java.net.URLConnection.getDefaultUseCaches, andjava.net.URLConnection.setDefaultUseCachesmethods.

The bug associated with this change is8163449.

Networking: Require trailing ':' in header-names

The class specification ofjava.net.URLPermissionand the method specification ofjava.net.URLPermission.getActionsdiffered 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 is8163482.

Networking: Support multi-release JAR files

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

The enhancements associated with this change are8166914 and8172732.

Networking: Add Authenticator.getDefault()

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

The enhancement associated with this change is8169068.

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 is8169495.

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 is8029806.

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 inJEP 238 Multi-Release JAR Files.

The enhancements associated with this change are8132734,8150680,8165782, and8166735.

JAR & ZIP: Support CRC32C

A new classjava.util.zip.CRC32C, extending thejava.util.zip.Checksuminterface was added. Default implementations for new methods java.util.zip.Checksum.update(byte[])andjava.util.zip.Checksum.update(ByteBuffer)were added. Since the interface provides default implementations of these methods, the overrides injava.util.zip.CRC32andjava.util.zip.Adler32were removed.

The enhancement associated with this change is6321472.

JAR & ZIP: Define Attributes iteration order

The class specification ofjava.util.jar.Attributeswas enhanced to guarantee that the iteration order is the order of insertion.

The bug associated with this change is8062194.

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

New methods java.util.zip.ZipEntry.setTimeLocalandjava.util.zip.ZipEntry.getTimeLocalwere 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 is8075526.

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 inJEP 290 Filter Incoming Serialization Data.

The enhancement associated with this change is8165261.

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

The specifications of thejava.rmi.activation.ActivationInstantiator.newInstancemethod and the java.rmi.server.UnicastRemoteObjectclass were updated to stipulate access requirements on packages used byjava.rmi.

The enhancement associated with this change is8044626.

RMI: RefineRemoteObjectInvocationHandler.invoke()

The specification ofjava.rmi.server.RemoteObjectInvocationHandler.invokewas enhanced to include finalize() in the set of methods which require alternate handling. Since theRemoteObjectInvocationHandler 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, thefinalize() 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 ofjava.rmi.server.RMISocketFactory.

The enhancement associated with this change is8066750.

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, andorg.omg.CORBA.ORBPackage.InvalidNameHelper. These exception classes extend the serializablejava.lang.Exception; hence they require helper classes for marshalling.

The bug associated with this change is7130985.

CORBA: Extend the search algorithm for ORBproperties

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 is8049376.

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.InputStreamandorg.omg.CORBA_2_3.portable.OutputStreamwere moved to an @implNote.

The bug associated with this change is8077395.

Security

Security: Support DRBG-based SecureRandom implementations

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

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

The feature associated with this change is 8051408.

Security: Create PKCS12 keystores by default

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

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

The enhancements associated with this change are8044445 and8130800.

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 andRFC 6347 was defined with the following changes in packagejavax.net.ssl:

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

The enhancements associated with this change are8043758 and8130461.

Security: Clarify that enabled protocols may never be used

The specifications of methodsjavax.net.ssl.SSLSocket.getEnabledProtocols,javax.net.ssl.SSLEngine.getEnabledProtocols, andjavax.net.ssl.SSLServerSocket.getEnabledProtocolswere 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

Thejavax.net.sslpackage was enhanced to support the TLSApplication 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, andjavax.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, andjavax.net.ssl.SSLSocket.getHandshakeApplicationProtocolSelector.

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

The enhancements associated with this change are8051498,8171443, and8170282.

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. Thejavax.net.ssl.ExtendedSSLSession.getStatusResponsesmethod was added to provide support for this approach.

Additional details may be found inJEP 249 OCSP Stapling for TLS

The enhancement associated with this change is8046321.

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

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

The bug associated with this change is8130850.

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 is8043071.

Security: Generify javax.xml.crypto

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

The enhancement associated with this change is8046949.

Security: Allow yes & no inkerb5.conf

The specification of the krb5.conf configuration file format in packagejavax.security.auth.kerberoswas 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 is8029995.

Security: Clarify behaviour of null location in CodeSource

The specification of the following constructors and methods in java.security.CodeSourcewas 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, andjava.security.CodeSource.getCodeSigners.

The bug associated with this change is8129972.

Security: Use ServiceLoader for JCE provider lookup

The class specification ofjava.security.Providerwas updated to describe how Service provider implementations are found using java.util.ServiceLoaderand loaded by the application class loader. The runtime may only add providers that have been configured for installation. A new method,java.security.Provider.configure, was added to apply the supplied configuration to this provider instance.

The enhancement associated with this change is7191662.

Security: Describe how permissions may be implied

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

The enhancement associated with this change is8129789.

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, andjavax.xml.crypto.dsig.keyinfo.

The enhancement associated with this change is8133151.

Security: Remove ExemptionMechanism.finalize()override

The protected override methodjavax.crypto.ExemptionMechanism.finalizewas removed since its presence hurts performance and it does not do anything beyond the default finalizer.

The enhancement associated with this change is8159009.

Security: Replace references to RFC 3280 with RFC 5280

All references to RFC 3280Internet X.509 Public Key Infrastructure Certificate were replaced with the updated RFC 5280Internet X.509 Public Key Infrastructure Certificate. This affectedjava.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, andjavax.security.auth.x500.

The bug associated with this change is8037550.

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

There are 21 getInstance() methods scattered across thejava.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.NullPointerExceptionwhen passed null as an algorithm name.

The bug associated with this change is4985694.

Security: Specify behaviour of Subject fornull parameters

The specification of constructorsjavax.security.auth.Subject.Subject()andjavax.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 ajava.lang.NullPointerException.

The bug associated with this change is8015081.

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 are8015388 and8172869.

Security: Remove references to thesun.security.acl package

The class specification of java.security.acl.Aclwas modified to remove references to the sun.security.aclimplementation package.

The bug associated with this change is8072663.

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 is8038084.

Security: Enhance parameter checking duringCertificateRevokedException construction

The specification of constructorjava.security.cert.CertificateRevokedException.CertificateRevokedExceptionwas enhanced to throw ajava.lang.ClassCastExceptionif the provided Map contains entries which have incorrect keys ore values.

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

The specification of methodsjava.security.Signature.updateandjava.security.Signature.signwas enhanced to throw ajava.lang.IllegalAccessExceptionif the provided integer parameters would cause access beyond the expected bounds of the provided array.

Security: Add algorithm parameter toEncodedKeySpec and 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. andjava.security.spec.X509EncodedKeySpec.X509EncodedKeySpec. This algorithm may be retrieved using the new java.security.spec.EncodedKeySpec.getAlgorithmmethod.

The enhancement associated with this change is8047223.

Security: Enhance specification forDrbgParameters of strength < 1

The specifications of java.security.DrbgParameters.instantiationandjava.security.DrbgParameters.nextByteswas modified to declare that ajava.lang.IllegalArgumentException. is thrown if the provided strength is less than one.

The bug associated with this change is8158534.

Security: Enhance Kerberos interactions when aSecurityManager is present

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

Security: Load Policy via the sytem class loader

The specifications of java.security.Policywas 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 is8075706.

Security: Update MessageDigest.isEqual()

The specification of java.security.MessageDigest.isEqualwas 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 is8136459.

Scripting

Scripting: Use ServiceLoader for Engine discovery

The specifications for javax.script.ScriptEngineFactoryand thejavax.scriptdescribing the Engine discovery mechanism were updated to replace reference toMETA-INF/services configuration files with use of the service-provider loading facility defined byjava.util.ServiceLoader.

The bug associated with this change is8068398.

Scripting: Specify behaviour on nullargument for ScriptEngineFactory.getProgram()

The specification ofjavax.script.ScriptEngineFactory.getProgramwas updated to describe the long-standing behaviour to throwjava.lang.NullPointerExceptionwhen the arguments array or any of its elements isnull.

The bug associated with this change is8071588.

Scripting: Specify exceptional conditions forScriptContext.setAttribute()

The specification ofjavax.script.ScriptContext.setAttributewas updated to describe the long-standing no-op behaviour ifjavax.script.ScriptContext.GLOBAL_SCOPEis used and there is no associated global bindings.

The bug associated with this change is8071678.

JNDI

JNDI: Use ServiceLoader for provider lookup

The specification ofjavax.naming.spi.NamingManager.getInitialContextdescribing 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 is8044627.

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:

The bug associated with this change is8051422.

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 is8167178.

JMX

JMX: Specify behaviour for unresolvable localhost

The specifications of the host parameter of javax.management.remote.JMXServiceURL.JMXServiceURL(String,String,int)andjavax.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.


User Interface

2D

2D: Update TextLayout.equals() specification

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

The bug associated with this change is 4497648.

2D: Specify SecurityException thrown byPrinterJob.getUserName()

The specification forjava.awt.print.PrinterJob.getUserNamewas modified to describe conditions for the long-standing behaviour to throw ajava.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 methodsjava.awt.Font.createFonts(InputStream)andjava.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 is8055463.

2D: Allow for platform limitations during font rendering

The specification forjava.awt.Fontwas augmented to state that platforms limitations may prevent glyphs from being rendered with the requested properties.

The bug associated with this change is8166034.

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

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

The bug associated with this change is8149371.

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

Some serializable types in packagesjavax.print andjavax.print.attributedid 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, andjavax.print.attribute.UnmodifiableSetException.

The bug associated with this change is8034050.

2D: Generify javax.print.* packages

The return type of methodsjavax.print.AttributeException.getUnsupportedAttributesandjavax.print.attribute.standard.DialogTypeSelection.getCategorywere paramaterized. This change was motivated by a desire to reduce build warnings.

The bug associated with this change is8042864.

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, internalsun.font.FontUtilities.isComplexCharCode() method.

The enhancement associated with this change is8146324.

2D: Provide explicit specification for methods inAbstractMultiResolutionImage

The specification describing the long-standing behaviour of five methods injava.awt.image.AbstractMultiResolutionImagewas 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, andjava.awt.image.AbstractMultiResolutionImage.getProperty.

The bug associated with this change is8138771.

2D: Update value of OpenType.TAG_OPBD

The value of constantjava.awt.font.OpenType.TAG_OPBDwas incorrectly assigned to the same value asjava.awt.font.OpenType.TAG_MORT. The correct value, 0x6F70626UL, is now used.

The bug associated with this change is8077584.

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 interfacejava.awt.image.MultiResolutionImagedefines basic operations for a set of images at various resolutions. The classes java.awt.image.AbstractMultiResolutionImageandjava.awt.image.BaseMultiResolutionImageenable 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, andjava.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 are8029339 and8151787.

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

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

The bug associated with this change is7107905.

2D: Specify ImageIO behaviour for failure to create streams

The conditions under which ajava.io.IOExceptionmay be thrown were extended to include failure to create the required javax.imageio.spi.ImageInputStreamSpiorjavax.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 is8044289.

2D: Update ImageReader.getRawImageType()

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

The bug associated with this change is8143562.

2D: Generify javax.imageio.spi

The return types of methods in javax.imageio.spi.ImageReaderSpiandjavax.imageio.spi.ImageWriterSpiwere paramaterized. This change was motivated by a desire to reduce build warnings.

The enhancement associated with this change is8035487.

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

Some serializable types injavax.imageio,javax.imageio.metadata, andjavax.imageio.spidid 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, andjavax.imageio.metadata.IIOMetadataNode.

The bug associated with this change is8033616.

2D: Enhance Accessibility API to use service provider mechanism

The specification ofjava.awt.Toolkit.getDefaultToolkitwas 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 inJEP 272 Platform-Specific Desktop Features.

The enhancements associated with this change are8143227,8164536, and8166594.

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 customjava.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 is8130478.

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 (see8133453). 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 is8133453.

AWT: Deprecate JDK 1.0 era constants injava.awt.event

Thejava.awt.event.InputEventcontained 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, andjava.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 this API may declared in the future.

The bug associated with this change is8143077.

AWT: Improve HeadlessException specification

The specification forjava.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 is8016313.

AWT: Resolve Toolkit.isDynamicLayoutActive()contradiction

The specification forjava.awt.Toolkit.isDynamicLayoutActivewas updated to describe the relationship between this method andjava.awt.Toolkit.isDynamicLayoutSet.

The bug associated with this change is8027324.

AWT: Generify ParameterBlock.getParamClasses

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

The bug associated with this change is8039109.

AWT: Add missing specification in java.awtpackage

A number of @param, @return, and@throws declarations were missing from many methods in thejava.awtpackage. 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 is8043967.

AWT: Add Component.setMixingCutoutShape()

The methodjava.awt.Component.setMixingCutoutShapewas added to to set a ‘mixing-cutout’ shape for lightweight components only.

The bug associated with this change is8173409.

AWT: Remove references to implementation-specific configuration files

The specification of methodjava.awt.Toolkit.getSystemClipboardwas 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 ofJEP 162 Prepare for Modularization.

The enhancement associated with this change is8047336.

AWT: Specify behaviour of null input forCanvas constructor

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

The bug associated with this change is4703110.

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

The specifications for the return value ofjava.awt.Component.createImage,java.awt.Component.createVolatileImage(int,int), andjava.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 is6815345.

AWT: Extend FocusEvent to include a “cause”

Thejava.awt.event.FocusEventclass 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 are8080395 and8154434.

AWT: Clarify platform-dependence of tooltip inTrayIcon

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), andjava.awt.TrayIcon.setToolTipwas updated to reflect this long-standing platform-dependent behaviour.

The bug associated with this change is8117886.

AWT: Declare platform-dependence of FileDialog title

The display of a user-specified title in a java.awt.FileDialogmay 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), andjava.awt.FileDialog.setTitle.

AWT: Extend Component.FlipBufferStrategy to support applets

When applets requested a flip buffer strategy using thejava.awt.Component.FlipBufferStrategynested class, ajava.lang.ClassCastExceptionwas thrown because applets were not supported. Changes to the specification for the class and constructor were required.

The bug associated with this change is8130390.

AWT: Remove BorderLayout reference to historical release

The class specification of java.awt.BorderLayoutreferenced 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 is8153184.

AWT: Define new line handling inTextField

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

The bugs associated with this change are8145284 and8160056.

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

Some serializable types injava.awt.color,java.awt.geom,java.awt.image, andjava.awt.printdid 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, andjava.awt.print.PrinterException.

The bug associated with this change is8033526.

2D: Enhance the specification forServiceUI.printDialog() parameters

The specifications of the x and y parameters of javax.print.ServiceUI.printDialogwere enhanced to declare that the screen coordinates are relative to the origin of the providedjava.awt.GraphicsConfiguration.

The bug associated with this change is6212751.

Swing

Swing: Generify javax.swing.textpackage

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, andjavax.swing.text.InternationalFormatter.getMaximum.

The bugs associated with this change are8043549 and8055059.

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, andjavax.swing.tree.DefaultMutableTreeNode.pathFromAncestorEnumeration.

The bugs associated with this change are8043550,8054360, and8055254.

Swing: Generify javax.swing.* packages

Methods in packagesjavax.swing.text,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.nimbus, andjavax.swing.plaf.synthwere paramaterized. This change was motivated by a desire to reduce build warnings.

The bug associated with this change is8043548.

Swing: Add JComponent.getUI()

Methodjavax.swing.JComponent.getUIwas added to return the look and feel delegate that renders the component. The declaration includes thejava.beans.Transientannotation indicating that this method may be ignored by all subclasses ofjava.beans.Encoder.

The enhancements associated with this change are4339584 and8131754.

Swing: Add JTableHeader.getPreferredSize()

Override methodjavax.swing.table.JTableHeader.getPreferredSizewas added to return the preferred size of the table header. This override ofJComponent.getPreferredSize() compensates for cases when the user manually sets the preferred size.

The bug associated with this change is4473075.

Swing: ReviseTableColumn.addPropertyChangeListener()

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

The bug associated with this change is4849595.

Swing: Define behavior for null parameter inJInternalFrame.setLayer()

The specification of methodjavax.swing.JInternalFrame.setLayerwas updated to match the long-standing behaviour to throw ajava.lang.NullPointerExceptionwhen the provider parameter is null.

The bug associated with this change is6206439.

Swing: Provide missing specification for methods injavax.swing.* packages

The specifications of 45 methods injavax.swing.borderpackage and classesjavax.swing.colorchooser.AbstractColorChooserPanel,javax.swing.filechooser.FileFilter,javax.swing.filechooser.FileSystemView, andjavax.swing.filechooser.FileViewwere enhanced with the addition of @param and@return tags to describe the methods expected parameters and return value.

The bugs associated with this change are8039966 and8040893.

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

New methodjavax.swing.JLayer.imageUpdatewas added to the final JLayer class. It delegate to javax.swing.plaf.LayerUI.imageUpdatewhich may be used to control animated gif repainting.

Swing: Add ability to disable JColorChoosertransparency controls

Support to enable and disable transparency controls was added with methods javax.swing.colorchooser.AbstractColorChooserPanel.setColorTransparencySelectionEnabledandjavax.swing.colorchooser.AbstractColorChooserPanel.isColorTransparencySelectionEnabledwhich set and query the controls respectively, constantjavax.swing.colorchooser.AbstractColorChooserPanel.TRANSPARENCY_ENABLED_PROPERTYwhich indicates that the color transparency may be selected, and method overridejavax.swing.JColorChooser.showDialogwhich shows the modal color-chooser dialog with color transparency selection optionally enabled.

The enhancement associated with this change is8051548.

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

The javax.swing.JLayer.setBorderandjavax.swing.JLayer.getBordermethods were redesigned to delegate to the JLayer’s view component. Prior to this change, they always threwjava.lang.IllegalArgumentException.

Swing: Add missing specification tojavax.swing.text.html

The specification of over 200 methods and fields in javax.swing.text.htmlwas 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, andjavax.swing.text.html.StyleSheet.

The bug associated with this change is8046446.

Swing: Add missing specification tojavax.swing.plaf.basic

The specification of over 100 methods and fields in javax.swing.plaf.basicwas 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, andjavax.swing.plaf.basic.BasicTableUI.

The bug associated with this change is8049704.

sound

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

Some serializable types injavax.sound.midiandjavax.sound.sampleddid 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, andjavax.sound.sampled.UnsupportedAudioFileException.

The bug associated with this change is8034046.

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 throwjava.lang.NullPointerExceptionwhen 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, andjavax.sound.midi.spi.MidiDeviceProvider.getDevice.

The bug associated with this change is8143909.

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

The specification of methods in javax.sound.sampledandjavax.sound.sampled.spiwas updated to consistently throwjava.lang.NullPointerExceptionwhen passed null. The only exception to this isjavax.sound.sampled.spi.MixerProvider.getMixerwhich 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, andjavax.sound.sampled.spi.MixerProvider.getMixer.

The bug associated with this change is8135100.

Sound: Enhance AudioInputStream.skip()

The specification for javax.sound.sampled.AudioInputStream.skipwas 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 is8132782.


XML Parsing

XML Parsing

XML Parsing: Support XML Catalog

A standard XML Catalog API that supportsOASIS XML Catalogs standard, v1.1was 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.catalogpackage containing the following classes:

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

Additional details may be found inJEP 268 XML Catalogs.

The enhancements associated with this change are8081248, 8144966,8163232,8171243, and8158084.

XML Parsing: Specify behaviour of XPath for nullcontext

The class specification forjavax.xml.xpath.XPathwas aligned with the specification forjavax.xml.xpath.XPath.evaluatewhich defines the long-standing behaviour for a null context.

The bug associated with this change is6211561.

XML Parsing: Deprecate XMLReaderFactory

The classorg.xml.sax.helpers.XMLReaderFactoryincluding both of its static methods,org.xml.sax.helpers.XMLReaderFactory.createXMLReader()andorg.xml.sax.helpers.XMLReaderFactory.createXMLReader(String), were deprecated in favor of javax.xml.parsers.SAXParserFactorywhich 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 is8152912.

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, andjavax.xml.xpath.XPathFactory.

The enhancement associated with this change is8049378.

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, andorg.xml.sax.InputSource.isEmpty.

The enhancement associated with this change is8144967.

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 is8169778.

XML Parsing: Support complete DOM API

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

The enhancement associated with this change is8023276.

XML Parsing: Add ElementTraversal

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

The enhancement associated with this change is8135283.

XML Parsing: Generify javax.xml* packages

Methods in packagesjavax.xml.stream,javax.xml.stream.events, andjavax.xml.stream.utilwere paramaterized. This change was motivated by a desire to reduce build warnings.

The bug associated with this change is8170556.

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 theorg.w3c.dompackage specification.

The bug associated with this change is8037948.

XML Parsing: Support any data type

Thejavax.xml.xpathpackage was extended to support any data type in addition to previously defined explicit types. Several changes were necessary:

The bug associated with this change is8054196.

XML Parsing: Specify exceptional conditions forXPath

The class specification ofjavax.xml.xpath.XPathwas updated to describe the long-standing behaviour to throw ajavax.xml.xpath.XPathExpressionExceptionwhen the value is null and the operation has no dependency on the context.

The bug associated with this change is6211561.

STaX

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

The class specification for javax.xml.stream.XMLStreamReaderwas updated to return START_DOCUMENT whenever XML document processing begins without an XML declaration. Further adjustments were necessary for javax.xml.stream.XMLStreamReader.getEventTypeandjavax.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, andjavax.xml.stream.XMLEventReader.nextTag.

The bug associated with this change is8069098.


java.lang.instrument / JVM TI

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

The java.lang.instrumentpackage 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 definejava.lang.instrument.Instrumentation.appendToSystemClassLoaderSearchfor the agent to be loaded at start-up.

The bug associated with this change is8160950.