Java

Java Community ProcessSM Maintenance Review
for J2SETM 1.5.0 Beta 2

 

Introduction

This document provides descriptions of specification changes being made in version 1.5.0 Beta 2 ("Tiger") of the JavaTM 2 Platform, Standard Edition (J2SETM).

Version 1.5.0 includes a set of new Java Specification Reviews (JSRs) that introduce major new functionality. This Maintenance Review does not cover new APIs defined through those JSRs; it documents only smaller changes made under the JCP Maintenance Review process.

The descriptions in this document correspond to the platform changes made since J2SE 1.5.0 Beta 1. The specification change descriptions are provided for purposes of Java Community ProcessSM public maintenance review.

J2SE 1.5.0 is a feature release containing significant API changes. The J2SE 1.5.0 specification requires a new Java Compatibility Kit (JCK).

Feedback

Please use the following address to provide review feedback on the specification changes described here.

tiger-jsr-review@sun.com

Change Descriptions

All changes to the specification made between J2SE 1.5.0 Beta 1 and J2SE 1.5.0 Beta 2, including trivial changes such as corrections of typographical errors and misspellings, are indicated in the following document, where insertions are shown in bold and deletions are shown in strike-through:

Specification Difference Pages

Many of the changes in Beta 2 are trivial type changes due to generification— the propagation of generic types throughout the Java platform, especially in the collection classes. Generic types are covered under JSR 14, but changes in types required some signature changes throughout the J2SE APIs. All these changes are fully binary compatible. A summary of these signature changes is shown in the following document:

Generification Changes

Some of the more significant specification clarifications are described in the following sections of this document.

Core Libraries

User Interface


Core Libraries

Accessibility

Specification update for javax.accessibility.AccessibleContext

The ACCESSIBLE_COMPONENT_BOUNDS_CHANGED field, introduced in 1.5, was incorrectly specified and has been fixed.

The bug report associated with this change is 5004808.

Improving accessibility constant names and strings

A number of constant strings for functionality added to the Accessibility package in 1.5.0 Beta 1 were incorrect, inconsistent with existing formatting, or missing. These problems have been fixed, and constants for PropertyChangeEvents have been added as necessary.

The values of the following constants have changed to be consistent with existing string formatting:

The following AccessibleRelation constants have been added to enable PropertyChangeEvents:

The bug report associated with this change is 4981070.

New constant for package javax.accessibility

A new constant has been added to AccessibleRole to describe the progress monitor role:

The bug report associated with this change is 4986504.

Beans

Specification update for PropertyChangeSupport

Several methods in java.beans.PropertyChangeSupport did not clearly specify what happened when the PropertyChangeListener argument was null, attempted to add a listener that had already been added, or attempted to remove a listener that had not been added. In every case but one, this is a change only to the specification and reflects both what was originally intended and implemented. The exception is the case of adding a null property change listener. This used to cause a NullPointerException eventually, but now has no effect.

The following PropertyChangeSupport methods are affected:

The bug report associated with this change is 4937059.

Specification update for BeanContextChildSupport and VetoableChangeSupport

This update is similar to the previous item's update for PropertyChangeSupport (4937059). Similarly, the only change to the existing behavior is in the case of adding a null listener, which used to cause an eventual NullPointerException but now has no effect.

The following BeanContextChildSupport methods are affected:

The following VetoableChangeSupport methods are affected:

The bug report associated with this change is 4937062.

I/O

'^' flag removed from java.util.Formatter

In the formatter API introduced in 1.5, format strings are intended to be recognizable to C programmers but not necessarily completely compatible with those in C. One area where they were not compatible in Beta 1 was in the request for uppercase output (as in C's "%X"). To get equivalent output in the java.util.Formatter implementation, the format specifier "%^x" was needed.

User feedback has indicated a significant preference towards the C-style mechanism, so we have removed support for the '^' flag and support uppercase versions of the conversions that support the '^' flag.

The java.util.Formatter specification has changed in the following ways:

The result is the same as the corresponding lowercase conversion characters, except that it is converted to uppercase according to the rules of the prevailing Locale.

The bug report associated with this change is 4962433.

'p' and 'P' switched in java.util.Formatter

The formatter API introduced in 1.5.0 Beta 1 used the GNU date and POSIX strftime conventions of 'P' for "am/pm" and 'p' for "AM/PM". This is counterintuitive to users unfamiliar with those specifications, so they have been switched in Beta 2 to 'p' for "am/pm" and 'P' for "AM/PM". The java.util.Formatter specification has been updated accordingly.

The bug report associated with this change is 4989961.

'E' changed to 'Q' in java.util.Formatter

The formatter API introduced in 1.5.0 Beta 1 used 'E' to indicate milliseconds since the beginning of the epoch. However, 'E' should not be used for date/time suffixes; an alternate letter should be used that doesn't conflict with existing definitions in POSIX strftime or GNU date.

To fix this problem, milliseconds since the beginning of the epoch is now indicated by 'Q', and the java.util.Formatter specification has been updated accordingly.

The bug report associated with this change is 5031150.

Minor changes to Formattable interface

A number of minor changes have been made to the Formattable interface, in response to feedback received during its initial release (1.5.0 Beta 1):

The bug associated with this change is 5030716.

Additional convenience constructors

In response to feedback received during the formatting API's initial release (1.5.0 Beta 1), several convenience constructors have been added:

The bug report associated with this change is 4984465.

IllegalFormatException constructor removed

External users should not instantiate IllegalFormatException. If a formatting error occurs, the explicit subtype which describes the error should be used. To encourage this, it should be more difficult to create the exception.

The public IllegalFormatException constructor has been changed to package-private, and the IllegalFormatException specification has been updated to clearly document that subtypes should be used to represent explicit errors.

The bug report associated with this change is 5033028.

Illegal format exception parameter type changed

Bug 4992540 changed the precision and width parameter types of Formattable.formatTo from Integer to int. The exceptions thrown when precision or width are invalid should use int for the constructor and accessor methods for consistency. The following methods and constructors have had changes to return or parameter types:

The bug report associated with this change is 5039962.

New Flushable interface implemented by Formatter

In response to feedback from the initial (1.5.0 Beta 1) release of the formatter API, a flush method has been added to the Formatter class to force the data to be written to the underlying stream.

The following interface has been added to identify classes that implement the flush method.

The following classes have been changed to declare that they implement the Flushable interface:

The bug report associated with this change is 5030063.

Formatter implements Closeable

The Formatter class has been changed to declare that it supports the Closeable interface. It already implemented the method required by Closeable.

The bug report associated with this change is 5030064.

Scanner factories changed to constructors

It is rather jarring that Formatter uses constructors but Scanner uses factory methods to make new instances. Although factory methods definitely have their advantages, the Scanner should use constructors like the Formatter for ease of use. The eight Scanner factory methods have been changed into the following eight constructors:

The bug report associated with this change is 5032610.

java.lang

java.lang.Class specification clarified

The specification didn't correctly document the conditions under which a security check is performed. The following methods have been updated to reflect what has been the intended and implemented behavior since 1.2:

"enableContextClassLoaderOverride" RuntimePermission added

The RuntimePermission("enableContextClassLoaderOverride") object was added to RuntimePermission's targets in 1.5 Beta 2. The context class loader is used by system code and extensions when they need to look up resources that might not exist in the system class loader. The RuntimePermission class specification has been updated, and the specification for the primary Thread constructor has been updated to document its use of "enableContextClassLoaderOverride".

Java now requires fdlibm 5.3

The StrictMath class uses fdlibm algorithms to implement various methods (sin, cos, exp, and so on). Previously, version 5.2 of fdlibm was used, but this has small correctness bugs in the pow and tan algorithms. These bugs have been addressed in the 5.3 release of fdlibm, which is now required.

The bug report associated with this change is 5033578.

New contains and replace methods use CharSequence interface

Two methods introduced in 1.5 have been changed from using the String class to the CharSequence interface:

The bug report associated with this change is 5019917.

String.contentEquals(CharSequence) method added

The contentEquals(CharSequence) method has been added to the java.lang.String class.

The bug report associated with this change is 4982981.

String subsequence parameter names standardized

Typically, methods that accept sub-sequences of Strings and CharSequences use the parameter convention of int start, int end. However, several methods have been created that don't follow this convention; for example, append(CharSequence s, int srcOffset, int len). Fixing this problem affects the following methods:

The bug report associated with this change is 5019111.

"preferences" permission added to RuntimePermission

In release 1.4, the RuntimePermission("preferences") object was added to RuntimePermission's targets. This permission allows access to the user or system root of the Java Preferences tree and wasn't previously documented. The RuntimePermission class specification has been updated.

The bug report associated with this change is 4963812.

java.util

New methods for Matcher region modes

Regions in the Matcher class have four possible interpretations, all of which can be useful in certain circumstances. In 1.5.0 Beta 1 the specification and behavior weren't consistent about which of these interpretations was being used. Since the regions API is new in 1.5.0, now is the time to correct this.

The default behavior is to allow anchors ^ and $ to match at the beginning and end of the region, respectively. This is used to restrict the input of the matcher, making the region boundaries opaque to look-ahead and look-behind constructs. In other words, the default is for the only input to be what is in the region. You can query and change the default behavior with the following new Matcher methods:

The bug report associated with this change is 5003322.

Matcher asResult method changed to toMatchResult

By convention, methods named asXyz provide a different view on the same data so that changes to either are visible in the other. Matcher.asResult doesn't follow that convention; later changes to the Matcher do not affect the returned MatchResult because it contains copied data. To avoid confusion, the asResult method has been renamed:

The bug report associated with this change is 4988891.

Changes to the regular expression specification

With two changes — codepoint support and improved unicode word boundary support — the Pattern class has come into compliance with Level 1 of Unicode Technical Report #18: Unicode Regular Expression Guidelines, plus RL2.1 Canonical Equivalents. The Pattern class description has been updated to mention this compliance and point to the standard's new location.

The reset methods of the java.util.regex.Matcher class now clearly state that resetting does not affect the anchoring and tranparency of the matcher's region boundaries.

The bug report associated with this change is 4979006.

Incompatible Matcher.find(int) behavior reverted

A change released in 1.5.0 Beta 1 caused the java.util.regex.Matcher find(int x) method to change the position of the region to start at index x. This change was unnecessary and incompatible, and the specification and behavior have been reverted to the original:

The bug report associated with this change is 4997476.

UUID specification clarified

Several changes have been made to the UUID class specification, which was introduced in 1.5.0 Beta 1:

The bug report associated with this change is 4977727.

Scanner now has a hasNextLine method

All the nextXyz methods have an accompanying hasNextXyz method except for nextLine, which needs such a method so you can write a program to go through all the lines of a source without having to catch a NoSuchElementException. The following method was added:

The bug report associated with this change is 5032622.

Jar/Zip

Clarified signature verification behavior of JarInputStream

The specification now is better at describing the signature verification behavior of the JarInputStream class. Signature failures are noticed as individual JAR entries are actually read. The signature failure can either be as a result of a modification of the individual JAR entry itself or as a result of a modification of the signature metadata for multiple entries in the JAR. This is a change only to the specification and reflects both what was originally intended and implemented. The following method descriptions have been affected:

The bug report associated with this change is 4193255.

Networking

ServerSocket specification clarified

According to the specification the following code fragment should never have worked for
non-blocking server-socket channels:

ServerSocketChannel ssc = ...;
Socket s = ssc.socket().accept();

In fact, this code has worked since 1.4.0 so long as the socket is bound and there is a connection ready to be accepted. The specification for the ServerSocket.accept method has been updated to allow this behavior, and so has the implementation, which temporarily broke the preceding code.

The bug report associated with this change is 5046333.

New methods for setting Socket performance preferences

Applications need a way to provide some information about their performance requirements to the networking code, in order that certain beneficial tradeoffs can be made. For example, with some networking technologies like Infiniband, an application may be able to bypass the TCP/IP stack and use an alternate protocol like SDP (Sockets Direct Protocol), which offers higher bandwidth and lower latency, but at a cost of higher connection setup time.

The following new methods provide a mechanism for applications to express such preferences:

The bug report associated with this change is 5002180.

Additions to the Authenticator class

A number of requests have been made for additional information to be provided by the java.net.Authenticator class. In particular, users have requested access to:

The request URL/URI
This is needed so that the user can (on some servers) determine which username and password to use. Normally, the realm field is used for this purpose, but some servers allow the same realm to be used in multiple protection spaces, and the user needs to know the URL in order to figure out which username/password to provide.

Whether the remote entity is a proxy or a server
Again this information may be implicit from existing information such as the hostname or realm, but it is more helpful to implementors of Authentication dialogs to know for sure if the requesting entity is (for certain) a proxy or a server. The dialogs can be customized in a more friendly way with this information.
This information is being provided through the following new methods:

The class description has also been updated, and an enum type (Authenticator.RequestorType) added.

The bug report associated with this change is 4962064.

Support for flushing the output stream when writing to an HttpURLConnection

Previously, when posting data with HTTP, the OutputStream was buffered internally before writing any of it to the socket. Many customers have complained about this behavior, pointing out that chunked encoding was designed in HTTP 1.1 to specifically address this issue, and so it should be possible to stream the data directly to the socket without intermediate buffering.

To solve this problem, two new APIs have been added, enabling two streaming output modes. The first one works using chunked encoding. The second works by allowing the application to specify the content length in advance; the normal HTTP content encoding can then be used. (The second mode is necessary because not all servers support chunked encoding for HTTP requests.)

Two methods have been added to java.net.HttpURLConnection:

A new IOException class has been added to indicate when an HTTP request needs to be retried but cannot be retried automatically, due to streaming mode being enabled:

The bug report associated with this change is 5026745.

Specification added for java.net.Proxy.Type

Documentation comments were missing from the java.net.Proxy.Type enum and have been added. This is a change only to the specification and reflects both what was originally intended and implemented.

The bug report associated with this change is 4985490.

Clarified SocketImpl.bind() documentation

The documentation for SocketImpl.bind() was misleading: it did not clearly indicate that the bind is with respect to a local InetAddress. In addtion, the address parameter stated that it is a remote address (probably a copy/paste bug from the connect method). These problems have been fixed. This is a change only to the specification and reflects both what was originally intended and implemented.

The bug report associated with this change is 4997489.

Removed new ServerSocket(Proxy) constructor

A new ServerSocket constructor that took a Proxy argument seemed likely to create more confusion than it was worth. For that reason, it has been removed. There were two problems with it:

The bug report associated with this change is 5019393.

Reflection

Class.isSynthetic method added

The Class class didn't have a method to determine if the specified class is synthetic. The isSynthetic method has been added.

The bug report associated with this change is 5012133.

Clarify values returned from Class.getMethods

As of release 1.1, Class.getMethods has returned the members inherited from the Object class. However, this behavior was not documented. This information is now documented.

The bug report associated with this change is 4508592.

Reflective set-field operations allowed on final fields if setAccessible(true)

JSR-133 requires that all fields of classes that are specified to be immutable must be declared as "final". However, this causes a problem in code that does manual deserialization: It is impossible to reflectively assign a value to a final field. The solution implemented in 1.5.0 Beta 2 is to allow reflective set-field operations on a final field only if setAccessible(true) succeeds on the field. The following method documentation has been updated accordingly:

The bug report associated with this change is 5044412.

New toGenericString methods

Core reflection has been augmented with methods that provide the "generic" version of a member's type information; for example, getGenericExceptionTypes and getGenericParameterTypes. Since the toString method for Method, Constructor and Field didn't represent the new generic type information, several toGenericString methods have been added:

The bug report associated with this change is 5033583.

Specification Correction for getEnclosingConstructor

The Class.getEnclosingConstructor method, introduced in this release, incorrectly documented its return value as a Method object. The documentation has been changed to state that this method returns a Constructor object.

The bug report associated with this change is 4986032.

Security

New class javax.net.ssl.X509ExtendedKeyManager

In 1.5.0 Beta 1, two methods called chooseEngineClientAlias and chooseEngineServerAlias were added to the javax.net.ssl.X509KeyManager interface to support the new class javax.net.ssl.SSLEngine. Due to beta feedback, the X509KeyManager interface has been reverted and the methods have been placed in a new abstract class called X509ExtendedKeyManager, which implements X509KeyManager.

New wrap/unwrap methods in SSLEngine

Members of the SSLEngine working group have requested that a scatter/gather API be made available in JSSE's javax.net.ssl.SSLEngine, similar in function to the java.nio.channels.ScatteringByteChannel/GatheringByteChannels. This is a very reasonable and useful refinement of the new SSLEngine API, allowing such things as XML and HTTP messages to use static buffers. This prevents users from having to write scatter/gather code (which also involves an extra copy).

The new methods:

The specifications of the following methods have been changed to refer to the new methods:

SSLEngine specification clarified

Delegated tasks run in the context of the AccessControlContext (ACC) in place during object creation. We now describe that so people won't wonder why they are getting errors when running tasks in contexts other than the one that created it. This has been clarified in the following places:

New SSLEngine getHandshakeStatus method; isHandshaking removed

SSLEngine provides data privacy and integrity protection by negotiating cryptographic parameters during a SSL/TLS handshake. During this handshaking, calls to wrap/unwrap generate SSLEngineResults, which consist of an overall command status, plus the status of any handshake currently in progress.

In 1.5.0 Beta 1, the only way to get the HandshakeStatus was to call wrap or unwrap. Another method called isHandshaking returned true if a handshake was in progress.

In 1.5.0 Beta 2, the isHandshaking method has been removed from SSLEngine, and the following method has replaced it:

To see if a handshake is in progress, you can use this code:

if (ssle.getHandshakeStatus() != NOT_HANDSHAKING)

SSLEngine hostname specification clarified

To use Kerberos Cipher Suites in TLS, a TLS client needs to obtain a service ticket for the TLS server for Kerberos authentication. The service ticket follows the Kerberos naming convention — for example, host/<hostname>@realm. The hostname passed to the JSSE API is used to obtain the appropriate service ticket.

With the addition of SSLEngine for non-blocking I/O, an SSLEngine can be initialized with or without hostname, since the hints (hostname/port) were being used only for caching. At the time when SSLEngine API was integrated, the support for Kerberos was still in progress.

With the addition of Kerberos Cipher Suites to TLS, hostname is required to obtain the service ticket for Kerberos authentication in TLS. Hence if hostname is not specified, the implementation will throw an exception.

The specification for SSLEngine used to say that hostname/port are only used as hints
for session reuse strategy. It has been updated to specify the hostname usage. The documentation for the following methods and constructors has been affected:

Enabling the use of SSL/TLS connections with RMI

Two new classes enable the use of SSL/TLS connections with RMI. They allow the user to specify (customize) the SSL/TLS connection parameters such as enabled cipher suites, enabled protocols, and the need of client authentication. The new classes are:

Two new system properties, documented in SslRMIClientSocketFactory, support the configuration of the aforementioned SSL/TLS parameters:

KeyStore.Builder now an abstract class

The KeyStore.Builder class has been redefined as an abstract class for easy extensibility. Static factory methods are defined that cover the common-use cases and a new class, CallbackHandlerProtection, is defined to give KeyStore implementations full control over how callbacks are invoked.

Documentation clarification for Subject constructor

Previously, the documentation for the Subject constructors was confusing regarding how the Set objects were passed in and handled. The documentation has been clarified.

VM/Classloader

ClassLoader.getResources() no longer final

The behavior of java.lang.ClassLoader was not fully customizable. Many of the ClassLoader methods were correctly permitted to be overriden in order to implement secure, networked, etc. class loaders. However the method ClassLoader.getResources was final. This restriction prevented ClassLoader subclasses from overriding the order that ClassLoader used to return all the resources of a class loader for a given name.

Custom class loading schemes ought to be able to customize the getResources behavior. Additionally, it was inconsistent that getResource could be overridden but getResources could not. Thus, the getResources method has been changed to not be final:

The bug report associated with this change is 4432218.


User Interface

2D

Font decoding clarified

The Font decode method now clearly specifies what characters are permitted in font names, and when a font might not be properly recognized. The getFont methods that take String arguments have been updated to refer to the decode method's detailed description. This is a change only to the specification and reflects both what was originally intended and implemented. The following Font methods were affected:

The bug report associated with this change is 4971470.

Documentation correction for java.awt.Font.decode return value

Previously, the documentation for java.awt.Font.decode stated that if a font family name can't be identified in the string to be decoded, that a font with the family name "dialog" was returned. In fact, the string "Dialog" is returned. The documentation has been corrected.

The bug report associated with this change is 4971469.

AWT

Return GridBagLayout behavior to pre-1.5 releases

Bug 4617682 was fixed in the Beta 1 release of 1.5.0 and has now been backed out. Previously, java.awt.GridBagLayout used a single ipadx (or ipady) but the documentation stated that (ipadx * 2) was used. In 1.5.0 Beta 1 the behavior of GridBagLayout was modified to match the documented behavior. This broke applications which relied on existing behavior. Therefore, the bugfix for 4617682 has been backed out and the documentation has been corrected.

The bug report associated with this change is 5004032.

Clarification of Window.setFocusableWindowState documentation

Setting a window's focusableWindowState property to be focusable doesn't work immediately on some platforms. On Solaris, for example, the window must be hidden and made visible for this to take effect. This has been true since the focus system was rearchitected in 1.4, but wasn't documented. The java.awt.Window.setFocusableWindowState documentation has been updated to include this information.

The bug report associated with this change is 5001987.

Clarification of the asynchronous nature of the AWT Toolkit

It has not always been clear to developers that many GUI operations are performed asynchronously. The java.awt.Toolkit class specification has been clarified to state that if you set the state of a component and then immediately query the state, the returned value may not yet reflect the requested change. This includes scrolling, moving the focus, making a top-level container visible, and setting the size or location of a top-level container.

The bug report associated with this change is 5028762.

Swing

Swing BeanInfo optional package

This is not a Beta 2 change, but an expected RC change.

The java.beans.BeanInfo interface is the standard way to provide information about a Bean. In particular, vendors of GUI-building tools have found it useful to supply BeanInfos for Components in the javax.swing package. It has been common practice for these BeanInfo classes to also be in the javax.swing package.

However, due to an oversight, there has been no formal API definition for these classes, even though they are in the javax namespace, which is normally managed through the JCP.

To remedy this oversight, we are now proposing the following optional package definition for the javax.swing BeanInfo classes. (This optional package is not a required component of the JRE.)

The optional package consists of a common base class, SwingBeanInfoBase, and a set of BeanInfos for the Swing components:

/**
* Common base class for the Swing BeanInfo optional package.
*/
public class javax.swing.SwingBeanInfoBase extends java.beans.SimpleBeanInfo {
/**
* This method allows a BeanInfo object to return an arbitrary collection
* of other BeanInfo objects that provide additional information on the
* current bean.
* <P>
* If there are conflicts or overlaps between the information provided
* by different BeanInfo objects, then the current BeanInfo takes precedence
* over the getAdditionalBeanInfo objects, and later elements in the array
* take precedence over earlier ones.
*
* @return an array of BeanInfo objects. May return null.
*/
public BeanInfo[] getAdditionalBeanInfo();
/**
* Gets the beans <code>BeanDescriptor</code>.
*
* @return A BeanDescriptor providing overall information about
* the bean, such as its displayName, its customizer, etc. May
* return null if the information should be obtained by automatic
* analysis.
*/
public BeanDescriptor getBeanDescriptor();

/**
* A bean may have a "default" event that is the event that will
* mostly commonly be used by humans when using the bean.
* @return Index of default event in the EventSetDescriptor array
* returned by getEventSetDescriptors.
* <P> Returns -1 if there is no default event.
*/
public int getDefaultEventIndex();

/**
* A bean may have a "default" property that is the property that will
* mostly commonly be initially chosen for update by human's who are
* customizing the bean.
* @return Index of default property in the PropertyDescriptor array
* returned by getPropertyDescriptors.
* <P> Returns -1 if there is no default property.
*/
public int getDefaultPropertyIndex();

/**
* Gets the beans <code>EventSetDescriptor</code>s.
*
* @return An array of EventSetDescriptors describing the kinds of
* events fired by this bean. May return null if the information
* should be obtained by automatic analysis.
*/
public EventSetDescriptor[] getEventSetDescriptors();

/**
* This method returns an image object that can be used to
* represent the bean in toolboxes, toolbars, etc. Icon images
* will typically be GIFs, but may in future include other formats.
* <p>
* Beans aren't required to provide icons and may return null from
* this method.
* <p>
* There are four possible flavors of icons (16x16 color,
* 32x32 color, 16x16 mono, 32x32 mono). If a bean choses to only
* support a single icon we recommend supporting 16x16 color.
* <p>
* We recommend that icons have a "transparent" background
* so they can be rendered onto an existing background.
*
* @param iconKind The kind of icon requested. This should be
* one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32,
* ICON_MONO_16x16, or ICON_MONO_32x32.
* @return An image object representing the requested icon. May
* return null if no suitable icon is available.
*/
public java.awt.Image getIcon(int iconKind);

/**
* Gets the beans <code>MethodDescriptor</code>s.
*
* @return An array of MethodDescriptors describing the externally
* visible methods supported by this bean. May return null if
* the information should be obtained by automatic analysis.
*/
public MethodDescriptor[] getMethodDescriptors();

/**
* Gets the beans <code>PropertyDescriptor</code>s.
*
* @return An array of PropertyDescriptors describing the editable
* properties supported by this bean. May return null if the
* information should be obtained by automatic analysis.
* <p>
* If a property is indexed, then its entry in the result array will
* belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
* A client of getPropertyDescriptors can use "instanceof" to check
* if a given PropertyDescriptor is an IndexedPropertyDescriptor.
*/
public PropertyDescriptor[] getPropertyDescriptors();

/**
* This is a utility method to help in loading icon images.
* It takes the name of a resource file associated with the
* current object's class file and loads an image object
* from that file. Typically images will be GIFs.
* <p>
* @param resourceName A pathname relative to the directory
* holding the class file of the current class. For example,
* "wombat.gif".
* @return an image object. May be null if the load failed.
*/
public java.awt.Image loadImage(final String resourceName);
}

/**
* Individual BeanInfos which must extend SwingBeanInfoBase
*/

public class javax.swing.AbstractButtonBeanInfo extends SwingBeanInfoBase
public class javax.swing.BoxBeanInfo extends SwingBeanInfoBase
public class javax.swing.JComponentBeanInfo extends SwingBeanInfoBase
public class javax.swing.JAppletBeanInfo extends SwingBeanInfoBase
public class javax.swing.JButtonBeanInfo extends SwingBeanInfoBase
public class javax.swing.JCheckBoxBeanInfo extends SwingBeanInfoBase
public class javax.swing.JCheckBoxMenuItemBeanInfo extends SwingBeanInfoBase
public class javax.swing.JComboBoxBeanInfo extends SwingBeanInfoBase
public class javax.swing.JColorChooserBeanInfo extends SwingBeanInfoBase
public class javax.swing.JDesktopPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JDialogBeanInfo extends SwingBeanInfoBase
public class javax.swing.JEditorPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JFileChooserBeanInfo extends SwingBeanInfoBase
public class javax.swing.JFrameBeanInfo extends SwingBeanInfoBase
public class javax.swing.JFormattedTextFieldBeanInfo extends SwingBeanInfoBase
public class javax.swing.JInternalFrameBeanInfo extends SwingBeanInfoBase
public class javax.swing.JLabelBeanInfo extends SwingBeanInfoBase
public class javax.swing.JLayeredPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JListBeanInfo extends SwingBeanInfoBase
public class javax.swing.JMenuBeanInfo extends SwingBeanInfoBase
public class javax.swing.JMenuBarBeanInfo extends SwingBeanInfoBase
public class javax.swing.JMenuItemBeanInfo extends SwingBeanInfoBase
public class javax.swing.JOptionPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JPanelBeanInfo extends SwingBeanInfoBase
public class javax.swing.JPasswordFieldBeanInfo extends SwingBeanInfoBase
public class javax.swing.JPopupMenuBeanInfo extends SwingBeanInfoBase
public class javax.swing.JProgressBarBeanInfo extends SwingBeanInfoBase
public class javax.swing.JRadioButtonBeanInfo extends SwingBeanInfoBase
public class javax.swing.JRadioButtonMenuItemBeanInfo extends SwingBeanInfoBase
public class javax.swing.text.JTextComponentBeanInfo extends SwingBeanInfoBase
public class javax.swing.JScrollBarBeanInfo extends SwingBeanInfoBase
public class javax.swing.JScrollPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JSeparatorBeanInfo extends SwingBeanInfoBase
public class javax.swing.JSliderBeanInfo extends SwingBeanInfoBase
public class javax.swing.JSplitPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JSpinnerBeanInfo extends SwingBeanInfoBase
public class javax.swing.JTabbedPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JTableBeanInfo extends SwingBeanInfoBase
public class javax.swing.JTextAreaBeanInfo extends SwingBeanInfoBase
public class javax.swing.JTextFieldBeanInfo extends SwingBeanInfoBase
public class javax.swing.JTextPaneBeanInfo extends SwingBeanInfoBase
public class javax.swing.JToggleButtonBeanInfo extends SwingBeanInfoBase
public class javax.swing.JToolBarBeanInfo extends SwingBeanInfoBase
public class javax.swing.JTreeBeanInfo extends SwingBeanInfoBase
public class javax.swing.JWindowBeanInfo extends SwingBeanInfoBase


No supersetting or other modifications of the public and protected API of the Swing BeanInfo classes are allowed.

In the interest of easing adoption of J2SE 1.5, and to allow time for vendors to make any necessary adjustments to meet this specification, there will be a grace period around compatibility requirements: TCK compliance for the javax.swing BeanInfo classes will be optional for products based on 1.5.X and earlier. However, products that ship BeanInfos in the javax.swing namespace and that are based on or targeted for J2SE 1.6 will be required to conform to the Swing BeanInfo optional package specification.

The bug report associated with this change is 4972589.

Changes to methods that generate disabled icons

The task of generating disabled icons is now performed by the LookAndFeel, rather than the UI classes. This reduces the number of implementations of similar code, improving consistency.

The following methods, all introduced in 1.5, have been removed:

The following methods have been added to LookAndFeel and overridden by MetalLookAndFeel:

The bug report associated with this change is 4969419.

OceanTheme class is now public

1.5.0 introduced an "Ocean" theme, which is the new default theme for the Java look and feel. The OceanTheme class was kept private, unlike other XyzTheme classes, which caused two problems:

These problems have been resolved by making the following API public:

In addition, the already public MetalLookAndFeel method setCurrentTheme() has been specified.

The bug report associated with this change is 4973946.

New Java look and feel property specifies nonbold fonts

The Java look and feel, also known as Metal, uses bold fonts by default. This is problematic in some locales where software loops must be used to produce a bold font, resulting in text that's hard to read. Also, bold fonts can be visually jarring.

To allow easy setting of nonbold fonts, a new property called swing.boldMetal has been created. It is documented in the MetalLookAndFeel class description.

The bug report associated with this change is 4991622.

SynthLookAndFeel not serializable

The javax.swing.plaf.synth.SynthLookAndFeel class is Serializable by inheritance, but it is not intended to be serialized. Consequently, SynthLookAndFeel has been changed so that an attempt to serialize it results in a NotSerializableException.

The bug report associated with this change is 4981263.

JScrollPane.AccessibleJScrollPane now implements PropertyChangeListener

The fix for a regression in JScrollPane requires JScrollPane.AccessibleJScrollPane to implement the PropertyChangeListener interface. This results in the following method being added to JScrollPane.AccessibleJScrollPane:

The bug report associated with this change is 4908276.

New constructor for JPopupMenu.AccessibleJPopupMenu

To fix a serialization problem, a protected constructor has been added:

The bug report associated with this change is 5009739.

New constructor for JTable.AccessibleJTable

To enable customers who develop custom Swing components derived from JTable to reuse JTable's accessibility implementation, a protected constructor has been added:

The bug report associated with this change is 4483577.

JSpinner now supports accessibility

The JSpinner class now implements the Accessible interface. The following method has been added to JSpinner, as required by the Accessible interface:

The AccessibleContext is implemented by a new class:

The bug report associated with this change is 4864610.

ProgressMonitor now supports accessibility

The ProgressMonitor class now implements the Accessible interface. The following method has been added to ProgressMonitor, as required by the Accessible interface:

The AccessibleContext is implemented by a new class:

The bug report associated with this change is 4986504.

Sound

Change to "bitrate" and "quality" property ranges

In the properties feature added to javax.sound.sampled.AudioFormat in 1.5, the "bitrate" property was originally specified in kilobits per second. That's not good enough for custom bit rates, so the spec has been changed to be in bits per second.

The same applies to the "quality" property: an integer in the range 1..10 is not fine-grained enough to accomodate encoders' capabilities. Therefore, the quality range has been changed to 1..100.

The javax.sound.sampled.AudioFormat property documentation has changed accordingly:

The bug report associated with this change is 5001940.

Last update: Thu, 24-Jun-2004 7:56


Copyright © 2004 Sun Microsystems, Inc. All Rights Reserved.

Sun