From 10d82f29a4d08acfa68e8988c07369f53a67e32f Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Thu, 19 Jun 2014 15:35:23 -0700 Subject: [PATCH 001/111] 8047724: @since tag cleanup in jaxws Reviewed-by: alanb, mkos --- .../javax/activation/CommandMap.java | 10 ++--- .../javax/activation/MailcapCommandMap.java | 4 +- .../internal/bind/DatatypeConverterImpl.java | 2 +- .../sun/xml/internal/bind/api/Messages.java | 2 +- .../internal/bind/marshaller/Messages.java | 2 +- .../internal/bind/marshaller/XMLWriter.java | 2 +- .../bind/unmarshaller/DOMScanner.java | 2 +- .../internal/bind/unmarshaller/Messages.java | 2 +- .../internal/bind/util/AttributesImpl.java | 2 +- .../xml/internal/txw2/output/XMLWriter.java | 2 +- .../javax/annotation/Generated.java | 2 +- .../javax/annotation/PostConstruct.java | 3 +- .../javax/annotation/PreDestroy.java | 2 +- .../javax/annotation/Resource.java | 4 +- .../javax/annotation/Resources.java | 2 +- .../jaxws_classes/javax/jws/HandlerChain.java | 3 ++ .../share/jaxws_classes/javax/jws/Oneway.java | 3 ++ .../jaxws_classes/javax/jws/WebMethod.java | 3 ++ .../jaxws_classes/javax/jws/WebParam.java | 3 ++ .../jaxws_classes/javax/jws/WebResult.java | 3 ++ .../jaxws_classes/javax/jws/WebService.java | 3 ++ .../javax/jws/soap/InitParam.java | 3 +- .../javax/jws/soap/SOAPBinding.java | 3 ++ .../javax/jws/soap/SOAPMessageHandler.java | 3 +- .../javax/jws/soap/SOAPMessageHandlers.java | 3 +- .../jaxws_classes/javax/xml/bind/Binder.java | 4 +- .../javax/xml/bind/DataBindingException.java | 2 +- .../javax/xml/bind/DatatypeConverter.java | 2 +- .../javax/xml/bind/DatatypeConverterImpl.java | 2 +- .../xml/bind/DatatypeConverterInterface.java | 2 +- .../jaxws_classes/javax/xml/bind/Element.java | 2 +- .../jaxws_classes/javax/xml/bind/JAXB.java | 2 +- .../javax/xml/bind/JAXBContext.java | 18 ++++----- .../javax/xml/bind/JAXBElement.java | 2 +- .../javax/xml/bind/JAXBException.java | 2 +- .../javax/xml/bind/JAXBIntrospector.java | 2 +- .../javax/xml/bind/JAXBPermission.java | 2 +- .../javax/xml/bind/MarshalException.java | 2 +- .../javax/xml/bind/Marshaller.java | 24 ++++++------ .../javax/xml/bind/NotIdentifiableEvent.java | 2 +- .../javax/xml/bind/ParseConversionEvent.java | 2 +- .../javax/xml/bind/PrintConversionEvent.java | 2 +- .../javax/xml/bind/PropertyException.java | 2 +- .../javax/xml/bind/SchemaOutputResolver.java | 1 + .../xml/bind/TypeConstraintException.java | 2 +- .../javax/xml/bind/UnmarshalException.java | 2 +- .../javax/xml/bind/Unmarshaller.java | 32 ++++++++-------- .../javax/xml/bind/UnmarshallerHandler.java | 2 +- .../javax/xml/bind/ValidationEvent.java | 2 +- .../xml/bind/ValidationEventHandler.java | 2 +- .../xml/bind/ValidationEventLocator.java | 2 +- .../javax/xml/bind/ValidationException.java | 2 +- .../javax/xml/bind/Validator.java | 2 +- .../javax/xml/bind/annotation/DomHandler.java | 2 +- .../xml/bind/annotation/W3CDomHandler.java | 2 +- .../xml/bind/annotation/XmlAccessOrder.java | 2 +- .../xml/bind/annotation/XmlAccessType.java | 2 +- .../xml/bind/annotation/XmlAccessorOrder.java | 2 +- .../xml/bind/annotation/XmlAccessorType.java | 2 +- .../xml/bind/annotation/XmlAnyAttribute.java | 2 +- .../xml/bind/annotation/XmlAnyElement.java | 2 +- .../xml/bind/annotation/XmlAttachmentRef.java | 2 +- .../xml/bind/annotation/XmlAttribute.java | 2 +- .../javax/xml/bind/annotation/XmlElement.java | 2 +- .../xml/bind/annotation/XmlElementDecl.java | 2 +- .../xml/bind/annotation/XmlElementRef.java | 4 +- .../xml/bind/annotation/XmlElementRefs.java | 2 +- .../bind/annotation/XmlElementWrapper.java | 4 +- .../xml/bind/annotation/XmlElements.java | 2 +- .../javax/xml/bind/annotation/XmlEnum.java | 2 +- .../xml/bind/annotation/XmlEnumValue.java | 2 +- .../javax/xml/bind/annotation/XmlID.java | 2 +- .../javax/xml/bind/annotation/XmlIDREF.java | 2 +- .../bind/annotation/XmlInlineBinaryData.java | 2 +- .../javax/xml/bind/annotation/XmlList.java | 2 +- .../xml/bind/annotation/XmlMimeType.java | 2 +- .../javax/xml/bind/annotation/XmlMixed.java | 2 +- .../javax/xml/bind/annotation/XmlNs.java | 2 +- .../javax/xml/bind/annotation/XmlNsForm.java | 2 +- .../xml/bind/annotation/XmlRegistry.java | 2 +- .../xml/bind/annotation/XmlRootElement.java | 2 +- .../javax/xml/bind/annotation/XmlSchema.java | 4 +- .../xml/bind/annotation/XmlSchemaType.java | 2 +- .../xml/bind/annotation/XmlSchemaTypes.java | 2 +- .../javax/xml/bind/annotation/XmlSeeAlso.java | 2 +- .../xml/bind/annotation/XmlTransient.java | 2 +- .../javax/xml/bind/annotation/XmlType.java | 2 +- .../javax/xml/bind/annotation/XmlValue.java | 2 +- .../adapters/CollapsedStringAdapter.java | 2 +- .../annotation/adapters/HexBinaryAdapter.java | 2 +- .../adapters/NormalizedStringAdapter.java | 2 +- .../bind/annotation/adapters/XmlAdapter.java | 2 +- .../adapters/XmlJavaTypeAdapter.java | 2 +- .../adapters/XmlJavaTypeAdapters.java | 2 +- .../javax/xml/bind/annotation/package.html | 2 +- .../bind/attachment/AttachmentMarshaller.java | 2 +- .../attachment/AttachmentUnmarshaller.java | 2 +- .../javax/xml/bind/attachment/package.html | 2 +- .../bind/helpers/AbstractMarshallerImpl.java | 2 +- .../helpers/AbstractUnmarshallerImpl.java | 2 +- .../DefaultValidationEventHandler.java | 2 +- .../helpers/NotIdentifiableEventImpl.java | 2 +- .../helpers/ParseConversionEventImpl.java | 2 +- .../helpers/PrintConversionEventImpl.java | 2 +- .../xml/bind/helpers/ValidationEventImpl.java | 2 +- .../helpers/ValidationEventLocatorImpl.java | 2 +- .../javax/xml/bind/util/JAXBResult.java | 1 + .../javax/xml/bind/util/JAXBSource.java | 1 + .../bind/util/ValidationEventCollector.java | 2 +- .../javax/xml/soap/AttachmentPart.java | 14 ++++--- .../jaxws_classes/javax/xml/soap/Detail.java | 4 +- .../javax/xml/soap/DetailEntry.java | 2 + .../javax/xml/soap/MessageFactory.java | 4 +- .../javax/xml/soap/MimeHeader.java | 1 + .../javax/xml/soap/MimeHeaders.java | 1 + .../jaxws_classes/javax/xml/soap/Name.java | 1 + .../jaxws_classes/javax/xml/soap/Node.java | 4 +- .../javax/xml/soap/SAAJMetaFactory.java | 2 +- .../javax/xml/soap/SAAJResult.java | 12 +++--- .../javax/xml/soap/SOAPBody.java | 15 ++++---- .../javax/xml/soap/SOAPBodyElement.java | 2 + .../javax/xml/soap/SOAPConnection.java | 4 +- .../javax/xml/soap/SOAPConnectionFactory.java | 2 + .../javax/xml/soap/SOAPConstants.java | 38 ++++++++++--------- .../javax/xml/soap/SOAPElement.java | 24 ++++++------ .../javax/xml/soap/SOAPElementFactory.java | 1 + .../javax/xml/soap/SOAPEnvelope.java | 2 + .../javax/xml/soap/SOAPException.java | 2 + .../javax/xml/soap/SOAPFactory.java | 11 +++--- .../javax/xml/soap/SOAPFault.java | 38 ++++++++++--------- .../javax/xml/soap/SOAPFaultElement.java | 2 + .../javax/xml/soap/SOAPHeader.java | 17 +++++---- .../javax/xml/soap/SOAPHeaderElement.java | 10 +++-- .../javax/xml/soap/SOAPMessage.java | 17 +++++---- .../javax/xml/soap/SOAPPart.java | 2 + .../jaxws_classes/javax/xml/soap/Text.java | 1 + .../jaxws_classes/javax/xml/ws/Action.java | 2 +- .../javax/xml/ws/AsyncHandler.java | 2 +- .../jaxws_classes/javax/xml/ws/Binding.java | 4 +- .../javax/xml/ws/BindingProvider.java | 6 +-- .../javax/xml/ws/BindingType.java | 2 +- .../jaxws_classes/javax/xml/ws/Dispatch.java | 2 +- .../jaxws_classes/javax/xml/ws/Endpoint.java | 16 ++++---- .../javax/xml/ws/EndpointContext.java | 2 +- .../javax/xml/ws/EndpointReference.java | 2 +- .../javax/xml/ws/FaultAction.java | 2 +- .../jaxws_classes/javax/xml/ws/Holder.java | 2 +- .../javax/xml/ws/LogicalMessage.java | 2 +- .../javax/xml/ws/ProtocolException.java | 2 +- .../jaxws_classes/javax/xml/ws/Provider.java | 2 +- .../javax/xml/ws/RequestWrapper.java | 4 +- .../javax/xml/ws/RespectBinding.java | 2 +- .../javax/xml/ws/RespectBindingFeature.java | 2 +- .../jaxws_classes/javax/xml/ws/Response.java | 2 +- .../javax/xml/ws/ResponseWrapper.java | 4 +- .../jaxws_classes/javax/xml/ws/Service.java | 20 +++++----- .../javax/xml/ws/ServiceMode.java | 2 +- .../javax/xml/ws/WebEndpoint.java | 2 +- .../jaxws_classes/javax/xml/ws/WebFault.java | 4 +- .../javax/xml/ws/WebServiceClient.java | 2 +- .../javax/xml/ws/WebServiceContext.java | 6 +-- .../javax/xml/ws/WebServiceException.java | 2 +- .../javax/xml/ws/WebServiceFeature.java | 2 +- .../javax/xml/ws/WebServicePermission.java | 1 + .../javax/xml/ws/WebServiceProvider.java | 2 +- .../javax/xml/ws/WebServiceRef.java | 4 +- .../javax/xml/ws/WebServiceRefs.java | 2 +- .../javax/xml/ws/handler/Handler.java | 2 +- .../javax/xml/ws/handler/HandlerResolver.java | 2 +- .../javax/xml/ws/handler/LogicalHandler.java | 2 +- .../xml/ws/handler/LogicalMessageContext.java | 2 +- .../javax/xml/ws/handler/MessageContext.java | 4 +- .../javax/xml/ws/handler/PortInfo.java | 2 +- .../xml/ws/handler/soap/SOAPHandler.java | 2 +- .../ws/handler/soap/SOAPMessageContext.java | 2 +- .../javax/xml/ws/http/HTTPBinding.java | 2 +- .../javax/xml/ws/http/HTTPException.java | 2 +- .../javax/xml/ws/soap/Addressing.java | 4 +- .../javax/xml/ws/soap/AddressingFeature.java | 8 ++-- .../jaxws_classes/javax/xml/ws/soap/MTOM.java | 2 +- .../javax/xml/ws/soap/MTOMFeature.java | 2 +- .../javax/xml/ws/soap/SOAPBinding.java | 2 +- .../javax/xml/ws/soap/SOAPFaultException.java | 2 +- .../javax/xml/ws/spi/Invoker.java | 2 +- .../javax/xml/ws/spi/Provider.java | 18 ++++----- .../javax/xml/ws/spi/ServiceDelegate.java | 16 ++++---- .../ws/spi/WebServiceFeatureAnnotation.java | 2 +- .../javax/xml/ws/spi/http/HttpContext.java | 2 +- .../javax/xml/ws/spi/http/HttpExchange.java | 2 +- .../javax/xml/ws/spi/http/HttpHandler.java | 2 +- .../javax/xml/ws/spi/http/package-info.java | 2 +- .../ws/wsaddressing/W3CEndpointReference.java | 2 +- .../W3CEndpointReferenceBuilder.java | 7 ++-- 193 files changed, 413 insertions(+), 342 deletions(-) diff --git a/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java b/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java index d07ae3ec38b..acc194b5248 100644 --- a/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java +++ b/jaxws/src/share/jaf_classes/javax/activation/CommandMap.java @@ -127,7 +127,7 @@ public abstract class CommandMap { * @param mimeType the MIME type * @param ds a DataSource for the data * @return the CommandInfo classes that represent the command Beans. - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public CommandInfo[] getPreferredCommands(String mimeType, DataSource ds) { return getPreferredCommands(mimeType); @@ -155,7 +155,7 @@ public abstract class CommandMap { * @param mimeType the MIME type * @param ds a DataSource for the data * @return the CommandInfo objects representing all the commands. - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public CommandInfo[] getAllCommands(String mimeType, DataSource ds) { return getAllCommands(mimeType); @@ -183,7 +183,7 @@ public abstract class CommandMap { * @param cmdName the command name * @param ds a DataSource for the data * @return the CommandInfo corresponding to the command. - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public CommandInfo getCommand(String mimeType, String cmdName, DataSource ds) { @@ -215,7 +215,7 @@ public abstract class CommandMap { * @param mimeType the MIME type * @param ds a DataSource for the data * @return the DataContentHandler for the MIME type - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public DataContentHandler createDataContentHandler(String mimeType, DataSource ds) { @@ -228,7 +228,7 @@ public abstract class CommandMap { * null is returned. * * @return array of MIME types as strings, or null if not supported - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public String[] getMimeTypes() { return null; diff --git a/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java b/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java index 91df5fe9afb..7d13a9b506f 100644 --- a/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java +++ b/jaxws/src/share/jaf_classes/javax/activation/MailcapCommandMap.java @@ -603,7 +603,7 @@ public class MailcapCommandMap extends CommandMap { * Get all the MIME types known to this command map. * * @return array of MIME types as strings - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public synchronized String[] getMimeTypes() { List mtList = new ArrayList(); @@ -639,7 +639,7 @@ public class MailcapCommandMap extends CommandMap { * MIME type are returned. * * @return array of native command entries - * @since JAF 1.1 + * @since 1.6, JAF 1.1 */ public synchronized String[] getNativeCommands(String mimeType) { List cmdList = new ArrayList(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java index 7f58b05f24f..8f5c7e66585 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java @@ -58,7 +58,7 @@ import javax.xml.stream.XMLStreamWriter; * This class is responsible for whitespace normalization. * * @author - * @since JAXB1.0 + * @since JAXB 1.0 * @deprecated in JAXB 2.2.4 - use javax.xml.bind.DatatypeConverterImpl instead * or let us know why you can't */ diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Messages.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Messages.java index 13e42bb6328..50554b51c15 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Messages.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/api/Messages.java @@ -31,7 +31,7 @@ import java.util.ResourceBundle; /** * Formats error messages. * - * @since JAXB2.1.10 + * @since JAXB 2.1.10 */ enum Messages { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/Messages.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/Messages.java index 97c98af4835..b736fd9cb45 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/Messages.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/Messages.java @@ -31,7 +31,7 @@ import java.util.ResourceBundle; /** * Formats error messages. * - * @since JAXB1.0 + * @since JAXB 1.0 */ public class Messages { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java index 6e1dd7b2359..3fbd954efa6 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java @@ -249,7 +249,7 @@ import org.xml.sax.helpers.XMLFilterImpl; * * @author David Megginson, david@megginson.com * @version 0.2 - * @since JAXB1.0 + * @since JAXB 1.0 * @see org.xml.sax.XMLFilter * @see org.xml.sax.ContentHandler */ diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java index c43a3d9a402..8be5e51a980 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java @@ -55,7 +55,7 @@ import org.xml.sax.helpers.NamespaceSupport; * classes like this. * * @author - * @since JAXB1.0 + * @since JAXB 1.0 */ public class DOMScanner implements LocatorEx,InfosetScanner/* --- but can't do this to protect 1.0 clients, or can I? */ { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/Messages.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/Messages.java index 730fb17ddaa..b199f76a844 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/Messages.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/unmarshaller/Messages.java @@ -31,7 +31,7 @@ import java.util.ResourceBundle; /** * Formats error messages. * - * @since JAXB1.0 + * @since JAXB 1.0 */ public class Messages { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/util/AttributesImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/util/AttributesImpl.java index c0f345aaf2d..26a328556dc 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/util/AttributesImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/util/AttributesImpl.java @@ -62,7 +62,7 @@ import org.xml.sax.Attributes; * AttributeList} interface, it also includes a much more efficient * implementation using a single array rather than a set of Vectors.

* - * @since JAXB1.0 + * @since JAXB 1.0 * @since SAX 2.0 * @author David Megginson * @version 2.0.1 (sax2r2) diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java index 5ea7a6842f9..fe1d274df36 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java @@ -262,7 +262,7 @@ import java.util.Map; * * @author David Megginson, david@megginson.com * @version 0.2 - * @since JAXB1.0 + * @since JAXB 1.0 * @see org.xml.sax.XMLFilter * @see org.xml.sax.ContentHandler */ diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/Generated.java b/jaxws/src/share/jaxws_classes/javax/annotation/Generated.java index f9d34e4a398..b59595f98f8 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/Generated.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/Generated.java @@ -43,7 +43,7 @@ import static java.lang.annotation.RetentionPolicy.*; *

The comment element is a place holder for any comments that the code * generator may want to include in the generated code.

* - * @since Common Annotations 1.0 + * @since 1.6, Common Annotations 1.0 */ @Documented diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java b/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java index 4f2976ca617..fbe226ca42e 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java @@ -70,9 +70,10 @@ import static java.lang.annotation.RetentionPolicy.*; *
  • If the method throws an unchecked exception the class MUST NOT be put into * service except in the case of EJBs where the EJB can handle exceptions and * even recover from them.
  • - * @since Common Annotations 1.0 + * * @see javax.annotation.PreDestroy * @see javax.annotation.Resource + * @since 1.6, Common Annotations 1.0 */ @Documented @Retention (RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java b/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java index d24cd3f70ad..eff974a5e4a 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java @@ -72,7 +72,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * @see javax.annotation.PostConstruct * @see javax.annotation.Resource - * @since Common Annotations 1.0 + * @since 1.6, Common Annotations 1.0 */ @Documented diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/Resource.java b/jaxws/src/share/jaxws_classes/javax/annotation/Resource.java index 7c6541139fa..0f29fa5e6b8 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/Resource.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/Resource.java @@ -48,7 +48,7 @@ import static java.lang.annotation.RetentionPolicy.*; * appear on private fields and methods of superclasses; the container * is required to perform injection in these cases as well. * - * @since Common Annotations 1.0 + * @since 1.6, Common Annotations 1.0 */ @Target({TYPE, FIELD, METHOD}) @Retention(RUNTIME) @@ -66,7 +66,7 @@ public @interface Resource { * The name of the resource that the reference points to. It can * link to any compatible resource using the global JNDI names. * - * @since Common Annotations 1.1 + * @since 1.7, Common Annotations 1.1 */ String lookup() default ""; diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/Resources.java b/jaxws/src/share/jaxws_classes/javax/annotation/Resources.java index 6bbe04e01c7..7b6e1dec589 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/Resources.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/Resources.java @@ -32,7 +32,7 @@ import static java.lang.annotation.RetentionPolicy.*; * This class is used to allow multiple resources declarations. * * @see javax.annotation.Resource - * @since Common Annotations 1.0 + * @since 1.6, Common Annotations 1.0 */ @Documented diff --git a/jaxws/src/share/jaxws_classes/javax/jws/HandlerChain.java b/jaxws/src/share/jaxws_classes/javax/jws/HandlerChain.java index 497f8b5aa69..cb52ff235d3 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/HandlerChain.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/HandlerChain.java @@ -28,6 +28,9 @@ package javax.jws; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({TYPE, METHOD, FIELD}) public @interface HandlerChain { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/Oneway.java b/jaxws/src/share/jaxws_classes/javax/jws/Oneway.java index f5a4823211d..613e0940c8b 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/Oneway.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/Oneway.java @@ -27,6 +27,9 @@ package javax.jws; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({METHOD}) public @interface Oneway { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/WebMethod.java b/jaxws/src/share/jaxws_classes/javax/jws/WebMethod.java index ae3f3156140..f2eeaf08b03 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/WebMethod.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/WebMethod.java @@ -27,6 +27,9 @@ package javax.jws; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({METHOD}) public @interface WebMethod { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/WebParam.java b/jaxws/src/share/jaxws_classes/javax/jws/WebParam.java index ac7752fdbf0..df9f3d9bd58 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/WebParam.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/WebParam.java @@ -27,6 +27,9 @@ package javax.jws; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({PARAMETER}) public @interface WebParam { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/WebResult.java b/jaxws/src/share/jaxws_classes/javax/jws/WebResult.java index 800fa659029..c878433a077 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/WebResult.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/WebResult.java @@ -27,6 +27,9 @@ package javax.jws; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({METHOD}) public @interface WebResult { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/WebService.java b/jaxws/src/share/jaxws_classes/javax/jws/WebService.java index 8d29d21c947..c133f583547 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/WebService.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/WebService.java @@ -27,6 +27,9 @@ package javax.jws; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({TYPE}) public @interface WebService { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/soap/InitParam.java b/jaxws/src/share/jaxws_classes/javax/jws/soap/InitParam.java index 83acb8b4254..43088e25e20 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/soap/InitParam.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/InitParam.java @@ -25,7 +25,8 @@ package javax.jws.soap; -/* +/** + * @since 1.6 * @Deprecated */ @Deprecated public @interface InitParam { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPBinding.java b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPBinding.java index 5966f11032a..5fb23ba09bb 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPBinding.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPBinding.java @@ -27,6 +27,9 @@ package javax.jws.soap; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; +/** + * @since 1.6 + */ @Retention(value=RetentionPolicy.RUNTIME) @Target({TYPE,METHOD}) public @interface SOAPBinding { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandler.java b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandler.java index b586c875e89..fe974e3e090 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandler.java @@ -25,7 +25,8 @@ package javax.jws.soap; -/* +/** + * @since 1.6 * @Deprecated */ @Deprecated public @interface SOAPMessageHandler { diff --git a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandlers.java b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandlers.java index 068df03cce3..c255f756c1a 100644 --- a/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandlers.java +++ b/jaxws/src/share/jaxws_classes/javax/jws/soap/SOAPMessageHandlers.java @@ -27,7 +27,8 @@ package javax.jws.soap; import java.lang.annotation.*; import static java.lang.annotation.ElementType.*; -/* +/** + * @since 1.6 * @Deprecated */ @Retention(value=RetentionPolicy.RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/Binder.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/Binder.java index a243aaaa1a9..70ec8ea8af0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Binder.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Binder.java @@ -76,7 +76,7 @@ import javax.xml.validation.Schema; * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) * Joseph Fialli * - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public abstract class Binder { /** @@ -153,7 +153,7 @@ public abstract class Binder { * binding. * @throws IllegalArgumentException * If any of the input parameters are null - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public abstract JAXBElement unmarshal( XmlNode xmlNode, Class declaredType ) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/DataBindingException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/DataBindingException.java index 2d0461ef16c..26c0e4e28ce 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DataBindingException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DataBindingException.java @@ -34,7 +34,7 @@ package javax.xml.bind; * is a checked exception. * * @see JAXB - * @since JAXB2.1 + * @since 1.6, JAXB 2.1 */ public class DataBindingException extends RuntimeException { public DataBindingException(String message, Throwable cause) { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverter.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverter.java index c7cc50943b0..a5c8e13dbc0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverter.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverter.java @@ -88,7 +88,7 @@ import javax.xml.namespace.NamespaceContext; * @see DatatypeConverterInterface * @see ParseConversionEvent * @see PrintConversionEvent - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ final public class DatatypeConverter { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterImpl.java index a2358500ae8..093c2899200 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterImpl.java @@ -49,7 +49,7 @@ import javax.xml.datatype.DatatypeConfigurationException; * This class is responsible for whitespace normalization. * * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    - * @since JAXB2.1 + * @since JAXB 2.1 */ final class DatatypeConverterImpl implements DatatypeConverterInterface { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterInterface.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterInterface.java index 228673bc764..0f4796e0db5 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterInterface.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/DatatypeConverterInterface.java @@ -78,7 +78,7 @@ package javax.xml.bind; * @see DatatypeConverter * @see ParseConversionEvent * @see PrintConversionEvent - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface DatatypeConverterInterface { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/Element.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/Element.java index 6e576d05548..9e2c7b99eeb 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Element.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Element.java @@ -35,7 +35,7 @@ package javax.xml.bind; * and 5.7.1 "Bind to Java Element Interface" of the specification. * * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    • Joe Fialli, Sun Microsystems, Inc.
    - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface Element { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXB.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXB.java index 3c16454697b..b6a16de0d18 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXB.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXB.java @@ -92,7 +92,7 @@ import java.net.URLConnection; * a non-null value. * * @author Kohsuke Kawaguchi - * @since 2.1 + * @since 1.6, JAXB 2.1 */ public final class JAXB { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBContext.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBContext.java index 2d3c1255cba..77d84390c93 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBContext.java @@ -257,7 +257,7 @@ import java.io.InputStream; * @see Marshaller * @see Unmarshaller * @see S 7.4.1 "Named Packages" in Java Language Specification - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public abstract class JAXBContext { @@ -423,7 +423,7 @@ public abstract class JAXBContext { *
  • failure to locate a value for the context factory provider property
  • *
  • mixing schema derived packages from different providers on the same contextPath
  • * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public static JAXBContext newInstance( String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException { @@ -497,7 +497,7 @@ public abstract class JAXBContext { // * @throws IllegalArgumentException // * if the parameter contains {@code null} (i.e., {@code newInstance(null);}) // * -// * @since JAXB2.0 +// * @since JAXB 2.0 // */ // public static JAXBContext newInstance( Source[] externalBindings, Class... classesToBeBound ) // throws JAXBException { @@ -576,7 +576,7 @@ public abstract class JAXBContext { * @throws IllegalArgumentException * if the parameter contains {@code null} (i.e., {@code newInstance(null);}) * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public static JAXBContext newInstance( Class... classesToBeBound ) throws JAXBException { @@ -622,7 +622,7 @@ public abstract class JAXBContext { * @throws IllegalArgumentException * if the parameter contains {@code null} (i.e., {@code newInstance(null,someMap);}) * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public static JAXBContext newInstance( Class[] classesToBeBound, Map properties ) throws JAXBException { @@ -692,7 +692,7 @@ public abstract class JAXBContext { * if DOM API corresponding to domType is not supported by * the implementation. * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public Binder createBinder(Class domType) { // to make JAXB 1.0 implementations work, this method must not be @@ -705,7 +705,7 @@ public abstract class JAXBContext { * * @return always a new valid Binder object. * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public Binder createBinder() { return createBinder(Node.class); @@ -722,7 +722,7 @@ public abstract class JAXBContext { * Calling this method on JAXB 1.0 implementations will throw * an UnsupportedOperationException. * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public JAXBIntrospector createJAXBIntrospector() { // to make JAXB 1.0 implementations work, this method must not be @@ -744,7 +744,7 @@ public abstract class JAXBContext { * Calling this method on JAXB 1.0 implementations will throw * an UnsupportedOperationException. * - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public void generateSchema(SchemaOutputResolver outputResolver) throws IOException { // to make JAXB 1.0 implementations work, this method must not be diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBElement.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBElement.java index fa240af7b0d..bc0b5281d5a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBElement.java @@ -58,7 +58,7 @@ import java.io.Serializable; *

    * * @author Kohsuke Kawaguchi, Joe Fialli - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public class JAXBElement implements Serializable { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java index 218dceb7ae3..432f0531d39 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java @@ -34,7 +34,7 @@ import java.io.PrintWriter; * @see JAXBContext * @see Marshaller * @see Unmarshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class JAXBException extends Exception { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBIntrospector.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBIntrospector.java index 18a70ff6a3f..ed75427b442 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBIntrospector.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBIntrospector.java @@ -41,7 +41,7 @@ import javax.xml.namespace.QName; * {@link JAXBContext#createJAXBIntrospector()}. * * @see JAXBContext#createJAXBIntrospector() - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public abstract class JAXBIntrospector { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java index 05b83450798..42dedafaaa6 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java @@ -73,7 +73,7 @@ import java.security.BasicPermission; * @see java.lang.SecurityManager * * @author Joe Fialli - * @since JAXB 2.2 + * @since 1.7, JAXB 2.2 */ /* code was borrowed originally from java.lang.RuntimePermission. */ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/MarshalException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/MarshalException.java index f944d1d05af..e1f2cad20b8 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/MarshalException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/MarshalException.java @@ -38,7 +38,7 @@ package javax.xml.bind; * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    * @see JAXBException * @see Marshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class MarshalException extends JAXBException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java index 6a469039a06..abb41042479 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java @@ -311,7 +311,7 @@ import java.io.File; * @see JAXBContext * @see Validator * @see Unmarshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface Marshaller { @@ -421,7 +421,7 @@ public interface Marshaller { * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null - * @since JAXB2.1 + * @since 1.6, JAXB 2.1 */ public void marshal( Object jaxbElement, File output ) throws JAXBException; @@ -515,7 +515,7 @@ public interface Marshaller { * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public void marshal( Object jaxbElement, javax.xml.stream.XMLStreamWriter writer ) throws JAXBException; @@ -539,7 +539,7 @@ public interface Marshaller { * Marshalling a JAXB element. * @throws IllegalArgumentException * If any of the method parameters are null - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public void marshal( Object jaxbElement, javax.xml.stream.XMLEventWriter writer ) throws JAXBException; @@ -655,7 +655,7 @@ public interface Marshaller { * if the adapter parameter is null. * @throws UnsupportedOperationException * if invoked agains a JAXB 1.0 implementation. - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public void setAdapter( XmlAdapter adapter ); @@ -684,7 +684,7 @@ public interface Marshaller { * if the type parameter is null. * @throws UnsupportedOperationException * if invoked agains a JAXB 1.0 implementation. - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public void setAdapter( Class type, A adapter ); @@ -697,7 +697,7 @@ public interface Marshaller { * if the type parameter is null. * @throws UnsupportedOperationException * if invoked agains a JAXB 1.0 implementation. - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public A getAdapter( Class type ); @@ -730,7 +730,7 @@ public interface Marshaller { * @throws UnsupportedOperationException could be thrown if this method is * invoked on an Marshaller created from a JAXBContext referencing * JAXB 1.0 mapped classes - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public void setSchema( Schema schema ); @@ -745,7 +745,7 @@ public interface Marshaller { * @throws UnsupportedOperationException could be thrown if this method is * invoked on an Marshaller created from a JAXBContext referencing * JAXB 1.0 mapped classes - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public Schema getSchema(); @@ -766,7 +766,7 @@ public interface Marshaller { * * @see Marshaller#setListener(Listener) * @see Marshaller#getListener() - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public static abstract class Listener { /** @@ -807,7 +807,7 @@ public interface Marshaller { * One can unregister current Listener by setting listener to null. * * @param listener an instance of a class that implements {@link Listener} - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public void setListener(Listener listener); @@ -815,7 +815,7 @@ public interface Marshaller { *

    Return {@link Listener} registered with this {@link Marshaller}. * * @return registered {@link Listener} or null if no Listener is registered with this Marshaller. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public Listener getListener(); } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/NotIdentifiableEvent.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/NotIdentifiableEvent.java index f4820c96da1..e2f547ed9c7 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/NotIdentifiableEvent.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/NotIdentifiableEvent.java @@ -32,7 +32,7 @@ package javax.xml.bind; * @author

    • Ryan Shoemaker, Sun Microsystems, Inc.
    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    • Joe Fialli, Sun Microsystems, Inc.
    * @see Validator * @see ValidationEventHandler - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface NotIdentifiableEvent extends ValidationEvent { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/ParseConversionEvent.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/ParseConversionEvent.java index b6ee5e69399..4c900b49184 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ParseConversionEvent.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ParseConversionEvent.java @@ -33,7 +33,7 @@ package javax.xml.bind; * @see ValidationEvent * @see ValidationEventHandler * @see Unmarshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface ParseConversionEvent extends ValidationEvent { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/PrintConversionEvent.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/PrintConversionEvent.java index c630cf62b08..b9146f4e310 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/PrintConversionEvent.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/PrintConversionEvent.java @@ -33,7 +33,7 @@ package javax.xml.bind; * @see ValidationEvent * @see ValidationEventHandler * @see Marshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface PrintConversionEvent extends ValidationEvent { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/PropertyException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/PropertyException.java index 65613b84bd1..60860e9bac7 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/PropertyException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/PropertyException.java @@ -35,7 +35,7 @@ package javax.xml.bind; * @see JAXBContext * @see Validator * @see Unmarshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class PropertyException extends JAXBException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java index f911107ba99..c39b78c870d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java @@ -42,6 +42,7 @@ import java.io.IOException; * * @author * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) + * @since 1.6 */ public abstract class SchemaOutputResolver { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java index 24a295b8d02..fa9ae393635 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java @@ -42,7 +42,7 @@ package javax.xml.bind; * * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    • Joe Fialli, Sun Microsystems, Inc.
    * @see ValidationEvent - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class TypeConstraintException extends java.lang.RuntimeException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshalException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshalException.java index 88746597953..239675fce2b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshalException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshalException.java @@ -40,7 +40,7 @@ package javax.xml.bind; * @see JAXBException * @see Unmarshaller * @see ValidationEventHandler - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class UnmarshalException extends JAXBException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/Unmarshaller.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/Unmarshaller.java index eb3090ab57b..19dfb6e6f4b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Unmarshaller.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Unmarshaller.java @@ -404,7 +404,7 @@ import java.io.Reader; * @see JAXBContext * @see Marshaller * @see Validator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface Unmarshaller { @@ -474,7 +474,7 @@ public interface Unmarshaller { * binding. See
    Unmarshalling XML Data * @throws IllegalArgumentException * If the InputStream parameter is null - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public Object unmarshal( Reader reader ) throws JAXBException; @@ -571,7 +571,7 @@ public interface Unmarshaller { * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public JAXBElement unmarshal( org.w3c.dom.Node node, Class declaredType ) throws JAXBException; @@ -660,7 +660,7 @@ public interface Unmarshaller { * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public JAXBElement unmarshal( javax.xml.transform.Source source, Class declaredType ) throws JAXBException; @@ -696,7 +696,7 @@ public interface Unmarshaller { * @throws IllegalStateException * If reader is not pointing to a START_DOCUMENT or * START_ELEMENT event. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see #unmarshal(javax.xml.stream.XMLStreamReader, Class) */ public Object unmarshal( javax.xml.stream.XMLStreamReader reader ) @@ -731,7 +731,7 @@ public interface Unmarshaller { * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public JAXBElement unmarshal( javax.xml.stream.XMLStreamReader reader, Class declaredType ) throws JAXBException; @@ -766,7 +766,7 @@ public interface Unmarshaller { * @throws IllegalStateException * If reader is not pointing to a START_DOCUMENT or * START_ELEMENT event. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see #unmarshal(javax.xml.stream.XMLEventReader, Class) */ public Object unmarshal( javax.xml.stream.XMLEventReader reader ) @@ -802,7 +802,7 @@ public interface Unmarshaller { * binding. See Unmarshalling XML Data * @throws IllegalArgumentException * If any parameter is null - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public JAXBElement unmarshal( javax.xml.stream.XMLEventReader reader, Class declaredType ) throws JAXBException; @@ -962,7 +962,7 @@ public interface Unmarshaller { * @throws UnsupportedOperationException could be thrown if this method is * invoked on an Unmarshaller created from a JAXBContext referencing * JAXB 1.0 mapped classes - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public void setSchema( javax.xml.validation.Schema schema ); @@ -986,7 +986,7 @@ public interface Unmarshaller { * @throws UnsupportedOperationException could be thrown if this method is * invoked on an Unmarshaller created from a JAXBContext referencing * JAXB 1.0 mapped classes - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public javax.xml.validation.Schema getSchema(); @@ -1001,7 +1001,7 @@ public interface Unmarshaller { * if the adapter parameter is null. * @throws UnsupportedOperationException * if invoked agains a JAXB 1.0 implementation. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public void setAdapter( XmlAdapter adapter ); @@ -1030,7 +1030,7 @@ public interface Unmarshaller { * if the type parameter is null. * @throws UnsupportedOperationException * if invoked agains a JAXB 1.0 implementation. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public void setAdapter( Class type, A adapter ); @@ -1043,7 +1043,7 @@ public interface Unmarshaller { * if the type parameter is null. * @throws UnsupportedOperationException * if invoked agains a JAXB 1.0 implementation. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public A getAdapter( Class type ); @@ -1081,7 +1081,7 @@ public interface Unmarshaller { * (@link #setListener(Listener)} * (@link #getListener()} * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public static abstract class Listener { /** @@ -1128,7 +1128,7 @@ public interface Unmarshaller { * One can unregister current Listener by setting listener to null. * * @param listener provides unmarshal event callbacks for this {@link Unmarshaller} - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public void setListener(Listener listener); @@ -1136,7 +1136,7 @@ public interface Unmarshaller { *

    Return {@link Listener} registered with this {@link Unmarshaller}. * * @return registered {@link Listener} or null if no Listener is registered with this Unmarshaller. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public Listener getListener(); } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshallerHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshallerHandler.java index 0f2c7954ad0..cf7f7452996 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshallerHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/UnmarshallerHandler.java @@ -57,7 +57,7 @@ import org.xml.sax.ContentHandler; * * @author

    • Kohsuke KAWAGUCHI, Sun Microsystems, Inc.
    * @see Unmarshaller#getUnmarshallerHandler() - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface UnmarshallerHandler extends ContentHandler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEvent.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEvent.java index 5395904c234..9f21bf6c5e6 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEvent.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEvent.java @@ -34,7 +34,7 @@ package javax.xml.bind; * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    • Joe Fialli, Sun Microsystems, Inc.
    * @see Validator * @see ValidationEventHandler - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface ValidationEvent { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventHandler.java index 76ed5842416..1161fe89ba9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventHandler.java @@ -65,7 +65,7 @@ package javax.xml.bind; * @see Marshaller * @see ValidationEvent * @see javax.xml.bind.util.ValidationEventCollector - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface ValidationEventHandler { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventLocator.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventLocator.java index c45327eae7e..e9b325d0f63 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventLocator.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationEventLocator.java @@ -40,7 +40,7 @@ package javax.xml.bind; * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    • Joe Fialli, Sun Microsystems, Inc.
    * @see Validator * @see ValidationEvent - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public interface ValidationEventLocator { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationException.java index 32f2223ba2b..b06feb7777e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/ValidationException.java @@ -38,7 +38,7 @@ package javax.xml.bind; * @author
    • Ryan Shoemaker, Sun Microsystems, Inc.
    * @see JAXBException * @see Validator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class ValidationException extends JAXBException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/Validator.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/Validator.java index 830c30aecbd..18f7d6166c9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Validator.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Validator.java @@ -154,7 +154,7 @@ package javax.xml.bind; * @see ValidationEventHandler * @see ValidationEvent * @see javax.xml.bind.util.ValidationEventCollector - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 * @deprecated since JAXB 2.0 */ public interface Validator { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/DomHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/DomHandler.java index e9ab331101c..97d7ccbe909 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/DomHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/DomHandler.java @@ -49,7 +49,7 @@ import javax.xml.transform.Source; * be called from applications. * * @author Kohsuke Kawaguchi - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public interface DomHandler { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/W3CDomHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/W3CDomHandler.java index 113780e27f7..b5d973860f6 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/W3CDomHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/W3CDomHandler.java @@ -40,7 +40,7 @@ import javax.xml.transform.dom.DOMSource; * {@link DomHandler} implementation for W3C DOM (org.w3c.dom package.) * * @author Kohsuke Kawaguchi - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public class W3CDomHandler implements DomHandler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessOrder.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessOrder.java index 2235678ae0d..ec38d4e29c0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessOrder.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessOrder.java @@ -30,7 +30,7 @@ package javax.xml.bind.annotation; * fields in a JAXB bound class. * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see XmlAccessorOrder */ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessType.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessType.java index c53213a49cd..821c2244610 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessType.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessType.java @@ -32,7 +32,7 @@ package javax.xml.bind.annotation; * properties. * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see XmlAccessorType */ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorOrder.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorOrder.java index a72a9d2a7d2..483849c16e3 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorOrder.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorOrder.java @@ -70,7 +70,7 @@ import static java.lang.annotation.RetentionPolicy.*; * following annotations at the package level: {@link XmlJavaTypeAdapter}. * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see XmlAccessOrder */ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorType.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorType.java index e8f044f97c4..a4e5525c151 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorType.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAccessorType.java @@ -84,7 +84,7 @@ import static java.lang.annotation.RetentionPolicy.*; * following annotations at the package level: {@link XmlJavaTypeAdapter}. * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see XmlAccessType */ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyAttribute.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyAttribute.java index bf1a6ad2075..ff9c13778de 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyAttribute.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyAttribute.java @@ -66,7 +66,7 @@ import static java.lang.annotation.ElementType.METHOD; * map's key. The key's value is the String value of the attribute. * * @author Kohsuke Kawaguchi, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyElement.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyElement.java index 9613547c1dc..3ca62ccd61b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAnyElement.java @@ -243,7 +243,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * * * @author Kohsuke Kawaguchi - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttachmentRef.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttachmentRef.java index d15dc3691ef..e6cd4fcee93 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttachmentRef.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttachmentRef.java @@ -66,7 +66,7 @@ import java.lang.annotation.Target; * The above binding supports WS-I AP 1.0
    WS-I Attachments Profile Version 1.0. * * @author Kohsuke Kawaguchi - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttribute.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttribute.java index 13f52547e3c..b37ca5d2898 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttribute.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlAttribute.java @@ -122,7 +122,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlType - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD, METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElement.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElement.java index 6f2c7e5afb9..5254769d26f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElement.java @@ -134,7 +134,7 @@ import static java.lang.annotation.RetentionPolicy.*; * *

    * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD, METHOD, PARAMETER}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementDecl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementDecl.java index d5c558de122..00b6782d8e8 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementDecl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementDecl.java @@ -130,7 +130,7 @@ import static java.lang.annotation.ElementType.METHOD; * name "foo". * * @see XmlRegistry - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRef.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRef.java index 0f5c7219d4e..00be7a5cc15 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRef.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRef.java @@ -216,7 +216,7 @@ import static java.lang.annotation.ElementType.METHOD; * * @author

    • Kohsuke Kawaguchi, Sun Microsystems,Inc.
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    * @see XmlElementRefs - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD}) @@ -284,7 +284,7 @@ public @interface XmlElementRef { * For compatibility with JAXB 2.1, this property defaults to true, * despite the fact that {@link XmlElement#required()} defaults to false. * - * @since 2.2 + * @since 1.7, JAXB 2.2 */ boolean required() default true; } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRefs.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRefs.java index bb3633ed876..5f9b66c361b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRefs.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementRefs.java @@ -50,7 +50,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * * @see XmlElementWrapper * @see XmlElementRef - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementWrapper.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementWrapper.java index c6bebb2775f..71aeec1141a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementWrapper.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElementWrapper.java @@ -87,7 +87,7 @@ import java.lang.annotation.Target; * @see XmlElements * @see XmlElementRef * @see XmlElementRefs - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * */ @@ -139,7 +139,7 @@ public @interface XmlElementWrapper { * simply a mechanism to let users express their application constraints * better. * - * @since JAXB 2.1 + * @since 1.6, JAXB 2.1 */ boolean required() default false; } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElements.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElements.java index 2e5384600cc..4d52a73c037 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElements.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlElements.java @@ -166,7 +166,7 @@ import java.lang.annotation.Target; * @see XmlElementRef * @see XmlElementRefs * @see XmlJavaTypeAdapter - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface XmlElements { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnum.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnum.java index 544a21e12bb..f6059ffed9c 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnum.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnum.java @@ -62,7 +62,7 @@ import java.lang.annotation.Target; * *

    Examples: See examples in {@link XmlEnumValue} * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({TYPE}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnumValue.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnumValue.java index ea656abd7bb..1948f3670a2 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnumValue.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlEnumValue.java @@ -114,7 +114,7 @@ import static java.lang.annotation.ElementType.FIELD; * </xs:simpleType> * * - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlID.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlID.java index 13ce41d5ed1..8fc3542a5f8 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlID.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlID.java @@ -87,7 +87,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlIDREF - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD, METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlIDREF.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlIDREF.java index ef9e2c6bb9d..5789dcc3d33 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlIDREF.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlIDREF.java @@ -243,7 +243,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlID - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD, METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlInlineBinaryData.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlInlineBinaryData.java index 9390b0e3de6..d6beedba4a2 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlInlineBinaryData.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlInlineBinaryData.java @@ -51,7 +51,7 @@ import javax.activation.DataHandler; * ever called for the property. The binary data will always be inlined. * * @author Joseph Fialli - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD,TYPE}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlList.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlList.java index ef11b5b15f3..0576e7f61da 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlList.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlList.java @@ -104,7 +104,7 @@ import static java.lang.annotation.ElementType.PARAMETER; * * * @author

    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER}) public @interface XmlList { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMimeType.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMimeType.java index 09506aae260..c7fabf524c4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMimeType.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMimeType.java @@ -47,7 +47,7 @@ import javax.xml.transform.Source; * the value of the attribute takes precedence and that will control the marshalling. * * @author Kohsuke Kawaguchi - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMixed.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMixed.java index 7b0462e61c0..8259b59540f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMixed.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlMixed.java @@ -124,7 +124,7 @@ import javax.xml.bind.JAXBElement; *

    See "Package Specification" in javax.xml.bind.package javadoc for * additional common information.

    * @author Kohsuke Kawaguchi - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNs.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNs.java index dc92cc55a66..7625b5175cc 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNs.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNs.java @@ -42,7 +42,7 @@ import java.lang.annotation.Target; * *

    Example:See XmlSchema annotation type for an example. * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNsForm.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNsForm.java index 68670a9c1b3..769df76146a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNsForm.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlNsForm.java @@ -61,6 +61,6 @@ package javax.xml.bind.annotation; * * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET} diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRegistry.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRegistry.java index 1218061c051..61f5b520fb4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRegistry.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRegistry.java @@ -34,7 +34,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * Marks a class that has {@link XmlElementDecl}s. * * @author

    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 * @see XmlElementDecl */ @Retention(RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRootElement.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRootElement.java index 4216d4a8c9f..80506a4d05a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRootElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlRootElement.java @@ -155,7 +155,7 @@ import static java.lang.annotation.ElementType.TYPE; * * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({TYPE}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchema.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchema.java index 80756f387ee..756c5f298e1 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchema.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchema.java @@ -114,7 +114,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target(PACKAGE) @@ -191,7 +191,7 @@ public @interface XmlSchema { * such attribute), for example so that the user can specify a local * copy of the resource through the command line interface. * - * @since JAXB2.1 + * @since 1.6, JAXB 2.1 */ String location() default NO_LOCATION; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaType.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaType.java index 7484cc1cbc8..eac31a6533f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaType.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaType.java @@ -83,7 +83,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * } * * - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaTypes.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaTypes.java index d32a6218ed0..deee2d408d6 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaTypes.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSchemaTypes.java @@ -50,7 +50,7 @@ import java.lang.annotation.Target; * * @author
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    * @see XmlSchemaType - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({PACKAGE}) public @interface XmlSchemaTypes { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSeeAlso.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSeeAlso.java index 41bf41e3b26..02053ff2502 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSeeAlso.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlSeeAlso.java @@ -70,7 +70,7 @@ import java.lang.annotation.Target; * correctly bind Dog and Cat. * * @author Kohsuke Kawaguchi - * @since JAXB2.1 + * @since 1.6, JAXB 2.1 */ @Target({ElementType.TYPE}) @Retention(RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlTransient.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlTransient.java index 730dea19228..fbd4d6eaa3c 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlTransient.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlTransient.java @@ -88,7 +88,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * * @author Sekhar Vajjhala, Sun Microsystems, Inc. - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD, METHOD, TYPE}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlType.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlType.java index 3802f978c3a..0f4b2506927 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlType.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlType.java @@ -379,7 +379,7 @@ import java.lang.annotation.Target; * @see XmlAttribute * @see XmlValue * @see XmlSchema - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({TYPE}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlValue.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlValue.java index dc18c2fcfe4..ecf23aceb49 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlValue.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/XmlValue.java @@ -124,7 +124,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlType - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({FIELD, METHOD}) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java index b9c1b7d314b..9a589653c12 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java @@ -35,7 +35,7 @@ package javax.xml.bind.annotation.adapters; * sequnce of tab, CR, LF, and SP by a single whitespace character ' '. * * @author Kohsuke Kawaguchi - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public class CollapsedStringAdapter extends XmlAdapter { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java index 84704a68831..153378a788d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java @@ -34,7 +34,7 @@ import javax.xml.bind.DatatypeConverter; * This {@link XmlAdapter} binds byte[] to the hexBinary representation in XML. * * @author Kohsuke Kawaguchi - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public final class HexBinaryAdapter extends XmlAdapter { public byte[] unmarshal(String s) { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java index 1ec0b11ca0f..3c64dd48bb2 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java @@ -35,7 +35,7 @@ package javax.xml.bind.annotation.adapters; * as specified in the whitespace facet 'replace' * * @author Kohsuke Kawaguchi, Martin Grebac - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public final class NormalizedStringAdapter extends XmlAdapter { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlAdapter.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlAdapter.java index 8a047de8847..4ca79b0358d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlAdapter.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlAdapter.java @@ -160,7 +160,7 @@ package javax.xml.bind.annotation.adapters; * * @author
    • Sekhar Vajjhala, Sun Microsystems Inc.
    • Kohsuke Kawaguchi, Sun Microsystems Inc.
    * @see XmlJavaTypeAdapter - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 */ public abstract class XmlAdapter { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java index ab0cf949323..a296ae8e50e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java @@ -86,7 +86,7 @@ import static java.lang.annotation.ElementType.PACKAGE; *

    Example: See example in {@link XmlAdapter} * * @author

    • Sekhar Vajjhala, Sun Microsystems Inc.
    • Kohsuke Kawaguchi, Sun Microsystems Inc.
    - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 * @see XmlAdapter */ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java index c29493b42c8..6cebcf89dc9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java @@ -51,7 +51,7 @@ import java.lang.annotation.Target; * * @author
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    * @see XmlJavaTypeAdapter - * @since JAXB2.0 + * @since 1.6, JAXB 2.0 */ @Retention(RUNTIME) @Target({PACKAGE}) public @interface XmlJavaTypeAdapters { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/package.html b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/package.html index 5e6a2a3d650..57f80e44acd 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/package.html +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/package.html @@ -279,7 +279,7 @@ - @since JAXB 2.0 + @since 1.6, JAXB 2.0 diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentMarshaller.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentMarshaller.java index 8d4892b61a5..dd291917a70 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentMarshaller.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentMarshaller.java @@ -50,7 +50,7 @@ import javax.xml.bind.Marshaller; * @author Marc Hadley * @author Kohsuke Kawaguchi * @author Joseph Fialli - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 * * @see Marshaller#setAttachmentMarshaller(AttachmentMarshaller) * diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java index 23d87215889..548f3c9bafe 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java @@ -56,7 +56,7 @@ import javax.activation.DataHandler; * @author Kohsuke Kawaguchi * @author Joseph Fialli * - * @since JAXB 2.0 + * @since 1.6, JAXB 2.0 * * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller) * diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/package.html b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/package.html index 5dca81dbd1a..c452cb9ad7f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/package.html +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/attachment/package.html @@ -61,7 +61,7 @@ - @since JAXB 2.0 + @since 1.6, JAXB 2.0 diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java index c2506d23a31..35d47b6c1c3 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java @@ -62,7 +62,7 @@ import java.io.IOException; * * @author
    • Kohsuke Kawaguchi, Sun Microsystems, Inc.
    * @see javax.xml.bind.Marshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public abstract class AbstractMarshallerImpl implements Marshaller { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java index 37e040881c0..e51d6338a8e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java @@ -68,7 +68,7 @@ import java.net.URL; *
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
  • * * @see javax.xml.bind.Unmarshaller - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public abstract class AbstractUnmarshallerImpl implements Unmarshaller { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java index 7fe68ef8c4c..b188eeaf1f3 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java @@ -52,7 +52,7 @@ import java.net.URL; * @see javax.xml.bind.Unmarshaller * @see javax.xml.bind.Validator * @see javax.xml.bind.ValidationEventHandler - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class DefaultValidationEventHandler implements ValidationEventHandler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java index e34c7889cac..c6e5311761d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java @@ -41,7 +41,7 @@ import javax.xml.bind.ValidationEventLocator; * @see javax.xml.bind.ValidationEventHandler * @see javax.xml.bind.ValidationEvent * @see javax.xml.bind.ValidationEventLocator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class NotIdentifiableEventImpl extends ValidationEventImpl diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ParseConversionEventImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ParseConversionEventImpl.java index 92b504848b2..4cfa28e0309 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ParseConversionEventImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ParseConversionEventImpl.java @@ -42,7 +42,7 @@ import javax.xml.bind.ValidationEventLocator; * @see javax.xml.bind.ValidationEventHandler * @see javax.xml.bind.ValidationEvent * @see javax.xml.bind.ValidationEventLocator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class ParseConversionEventImpl extends ValidationEventImpl diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/PrintConversionEventImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/PrintConversionEventImpl.java index 00de3b15a53..37d63a02e8d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/PrintConversionEventImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/PrintConversionEventImpl.java @@ -42,7 +42,7 @@ import javax.xml.bind.ValidationEventLocator; * @see javax.xml.bind.ValidationEventHandler * @see javax.xml.bind.ValidationEvent * @see javax.xml.bind.ValidationEventLocator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class PrintConversionEventImpl extends ValidationEventImpl diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventImpl.java index c357000617d..3b58bc5c9f0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventImpl.java @@ -43,7 +43,7 @@ import javax.xml.bind.ValidationEventLocator; * @see javax.xml.bind.ValidationEventHandler * @see javax.xml.bind.ValidationEvent * @see javax.xml.bind.ValidationEventLocator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class ValidationEventImpl implements ValidationEvent { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java index 36da72658ee..306b9777358 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java @@ -47,7 +47,7 @@ import org.xml.sax.SAXParseException; * @see javax.xml.bind.ValidationEventHandler * @see javax.xml.bind.ValidationEvent * @see javax.xml.bind.ValidationEventLocator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class ValidationEventLocatorImpl implements ValidationEventLocator { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBResult.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBResult.java index fbf7caac727..7dabf4fab56 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBResult.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBResult.java @@ -71,6 +71,7 @@ import javax.xml.transform.sax.SAXResult; * * @author * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) + * @since 1.6 */ public class JAXBResult extends SAXResult { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBSource.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBSource.java index 515894615fd..11b6c495c82 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBSource.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/JAXBSource.java @@ -87,6 +87,7 @@ import org.xml.sax.XMLFilter; * * @author * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) + * @since 1.6 */ public class JAXBSource extends SAXSource { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/ValidationEventCollector.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/ValidationEventCollector.java index 9cfd2abba16..48dfeea2f5c 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/util/ValidationEventCollector.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/util/ValidationEventCollector.java @@ -45,7 +45,7 @@ import java.util.List; * @see javax.xml.bind.ValidationEventHandler * @see javax.xml.bind.ValidationEvent * @see javax.xml.bind.ValidationEventLocator - * @since JAXB1.0 + * @since 1.6, JAXB 1.0 */ public class ValidationEventCollector implements ValidationEventHandler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/AttachmentPart.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/AttachmentPart.java index aa0f8565b4f..ae3390c82c1 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/AttachmentPart.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/AttachmentPart.java @@ -114,6 +114,8 @@ import javax.activation.DataHandler; *
      *     ap1.clearContent();
      * 
    + * + * @since 1.6 */ public abstract class AttachmentPart { @@ -190,7 +192,7 @@ public abstract class AttachmentPart { * AttachmentPart object or if there was a data * transformation error. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 * @see #getRawContentBytes */ public abstract InputStream getRawContent() throws SOAPException; @@ -208,7 +210,7 @@ public abstract class AttachmentPart { * AttachmentPart object or if there was a data * transformation error. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract byte[] getRawContentBytes() throws SOAPException; @@ -225,7 +227,7 @@ public abstract class AttachmentPart { * AttachmentPart object or if there was a data * transformation error. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract InputStream getBase64Content() throws SOAPException; @@ -267,7 +269,7 @@ public abstract class AttachmentPart { * * @exception SOAPException if an there is an error in setting the content * @exception NullPointerException if content is null - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract void setRawContent(InputStream content, String contentType) throws SOAPException; @@ -285,7 +287,7 @@ public abstract class AttachmentPart { * * @exception SOAPException if an there is an error in setting the content * or content is null - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract void setRawContentBytes( byte[] content, int offset, int len, String contentType) @@ -309,7 +311,7 @@ public abstract class AttachmentPart { * @exception SOAPException if an there is an error in setting the content * @exception NullPointerException if content is null * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract void setBase64Content( InputStream content, String contentType) throws SOAPException; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/Detail.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/Detail.java index 62f9973702b..d7d09bc34dc 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Detail.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Detail.java @@ -56,6 +56,8 @@ import javax.xml.namespace.QName; * d.addDetailEntry(name); * Iterator it = d.getDetailEntries(); * + * + * @since 1.6 */ public interface Detail extends SOAPFaultElement { @@ -85,7 +87,7 @@ public interface Detail extends SOAPFaultElement { * DetailEntry object to this Detail object. * * @see Detail#addDetailEntry(Name name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public DetailEntry addDetailEntry(QName qname) throws SOAPException; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/DetailEntry.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/DetailEntry.java index 6523ff660f3..6643dcbf7a2 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/DetailEntry.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/DetailEntry.java @@ -30,6 +30,8 @@ package javax.xml.soap; * a SOAPFault object. A DetailEntry object, * which carries information about errors related to the SOAPBody * object that contains it, is application-specific. + * + * @since 1.6 */ public interface DetailEntry extends SOAPElement { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java index 8501297f3dc..f2094daaa1b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java @@ -63,6 +63,8 @@ import java.io.InputStream; * This method can be used internally by a service implementation to * create a message that is a response to a request. * + * + * @since 1.6 */ public abstract class MessageFactory { @@ -140,7 +142,7 @@ public abstract class MessageFactory { * @exception SOAPException if there was an error in creating the * specified implementation of MessageFactory. * @see SAAJMetaFactory - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static MessageFactory newInstance(String protocol) throws SOAPException { return SAAJMetaFactory.getInstance().newMessageFactory(protocol); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeader.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeader.java index fa792036e37..b1416e7f813 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeader.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeader.java @@ -32,6 +32,7 @@ package javax.xml.soap; * object. * * @see MimeHeaders + * @since 1.6 */ public class MimeHeader { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeaders.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeaders.java index 282d5b30e18..b3ffa768137 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeaders.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MimeHeaders.java @@ -39,6 +39,7 @@ import java.util.Vector; * API. * @see SOAPMessage#getAttachments * @see AttachmentPart + * @since 1.6 */ public class MimeHeaders { private Vector headers; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java index 6ef60c2f6ec..7c227f19eb3 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Name.java @@ -73,6 +73,7 @@ package javax.xml.soap; * in favor of javax.xml.namespace.QName * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName + * @since 1.6 */ public interface Name { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java index 4488d92f3f2..1db693187cd 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Node.java @@ -30,6 +30,8 @@ package javax.xml.soap; * This interface extnends the standard DOM Node interface with methods for * getting and setting the value of a node, for * getting and setting the parent of a node, and for removing a node. + * + * @since 1.6 */ public interface Node extends org.w3c.dom.Node { /** @@ -61,7 +63,7 @@ public interface Node extends org.w3c.dom.Node { * node and either has more than one child node or has a child * node that is not a Text node. * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public void setValue(String value); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java index e7fcf813aeb..d6516fd33de 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java @@ -38,7 +38,7 @@ package javax.xml.soap; * class. * * @author SAAJ RI Development Team -* @since SAAJ 1.3 +* @since 1.6, SAAJ 1.3 */ public abstract class SAAJMetaFactory { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJResult.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJResult.java index 9899c81dd4a..f540940c102 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJResult.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJResult.java @@ -35,7 +35,7 @@ import javax.xml.transform.dom.DOMResult; * * @author XWS-Security Development Team * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public class SAAJResult extends DOMResult { @@ -53,7 +53,7 @@ public class SAAJResult extends DOMResult { * * @throws SOAPException if there is a problem creating a SOAPMessage * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SAAJResult() throws SOAPException { this(MessageFactory.newInstance().createMessage()); @@ -79,7 +79,7 @@ public class SAAJResult extends DOMResult { * @throws SOAPException if a SOAPMessage supporting the * specified protocol cannot be created * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SAAJResult(String protocol) throws SOAPException { this(MessageFactory.newInstance(protocol).createMessage()); @@ -99,7 +99,7 @@ public class SAAJResult extends DOMResult { * populated as a result of some transformation or * marshalling operation * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SAAJResult(SOAPMessage message) { super(message.getSOAPPart()); @@ -116,7 +116,7 @@ public class SAAJResult extends DOMResult { * * @param rootNode - the root to which the results will be appended * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SAAJResult(SOAPElement rootNode) { super(rootNode); @@ -125,7 +125,7 @@ public class SAAJResult extends DOMResult { /** * @return the resulting Tree that was created under the specified root Node. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public javax.xml.soap.Node getResult() { return (javax.xml.soap.Node)super.getNode().getFirstChild(); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBody.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBody.java index 7ef27aed41c..ca4a9210f30 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBody.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBody.java @@ -42,6 +42,7 @@ import javax.xml.namespace.QName; * error information, is an example of a SOAPBodyElement object. * * @see SOAPFault + * @since 1.6 */ public interface SOAPBody extends SOAPElement { @@ -90,7 +91,7 @@ public interface SOAPBody extends SOAPElement { * @exception SOAPException if there is a SOAP error * @see SOAPFault#setFaultCode * @see SOAPFault#setFaultString - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException; @@ -127,7 +128,7 @@ public interface SOAPBody extends SOAPElement { * @see SOAPFault#setFaultString * @see SOAPBody#addFault(Name faultCode, String faultString, Locale locale) * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException; @@ -164,7 +165,7 @@ public interface SOAPBody extends SOAPElement { * if there is a SOAP error * @see SOAPFault#setFaultCode * @see SOAPFault#setFaultString - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException; @@ -202,7 +203,7 @@ public interface SOAPBody extends SOAPElement { * @see SOAPFault#setFaultCode * @see SOAPFault#setFaultString * @see SOAPBody#addFault(Name faultCode, String faultString) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPFault addFault(QName faultCode, String faultString) throws SOAPException; @@ -252,7 +253,7 @@ public interface SOAPBody extends SOAPElement { * @exception SOAPException * if a SOAP error occurs * @see SOAPBody#addBodyElement(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPBodyElement addBodyElement(QName qname) throws SOAPException; @@ -272,7 +273,7 @@ public interface SOAPBody extends SOAPElement { * that was added. * @exception SOAPException * if the Document cannot be added - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public SOAPBodyElement addDocument(org.w3c.dom.Document document) throws SOAPException; @@ -290,7 +291,7 @@ public interface SOAPBody extends SOAPElement { * if there is not exactly one child SOAPElement of the * SOAPBody. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public org.w3c.dom.Document extractContentAsDocument() throws SOAPException; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBodyElement.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBodyElement.java index 7f0eb8db86a..2fcec639180 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBodyElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPBodyElement.java @@ -38,6 +38,8 @@ package javax.xml.soap; *
      *    SOAPBodyElement sbe = sb.addBodyElement(myName);
      * 
    + * + * @since 1.6 */ public interface SOAPBodyElement extends SOAPElement { } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java index ca06b1e7951..0151359b2af 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnection.java @@ -45,6 +45,8 @@ package javax.xml.soap; * directly to a URL following the request/response paradigm. That is, * messages are sent using the method call, which sends the * message and then waits until it gets a reply. + * + * @since 1.6 */ public abstract class SOAPConnection { @@ -78,7 +80,7 @@ public abstract class SOAPConnection { * @return the SOAPMessage object that is the response to the * get message request * @throws SOAPException if there is a SOAP error - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPMessage get(Object to) throws SOAPException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java index c1e51f098c1..849b5dc8be3 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java @@ -32,6 +32,8 @@ package javax.xml.soap; * SAAJ communication infrastructure. Otherwise {@link SOAPConnection} objects * can be created by calling createConnection() on the newly * created SOAPConnectionFactory object. + * + * @since 1.6 */ public abstract class SOAPConnectionFactory { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConstants.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConstants.java index 8f5ae0b2dec..fe84fcfa2e6 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConstants.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConstants.java @@ -29,6 +29,8 @@ import javax.xml.namespace.QName; /** * The definition of constants pertaining to the SOAP protocol. + * + * @since 1.6 */ public interface SOAPConstants { /** @@ -41,7 +43,7 @@ public interface SOAPConstants { * argument version of createMessage, an * UnsupportedOperationException. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String DYNAMIC_SOAP_PROTOCOL = "Dynamic Protocol"; @@ -49,7 +51,7 @@ public interface SOAPConstants { * Used to create MessageFactory instances that create * SOAPMessages whose behavior supports the SOAP 1.1 specification. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String SOAP_1_1_PROTOCOL = "SOAP 1.1 Protocol"; @@ -58,26 +60,26 @@ public interface SOAPConstants { * SOAPMessages whose behavior supports the SOAP 1.2 * specification * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String SOAP_1_2_PROTOCOL = "SOAP 1.2 Protocol"; /** * The default protocol: SOAP 1.1 for backwards compatibility. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String DEFAULT_SOAP_PROTOCOL = SOAP_1_1_PROTOCOL; /** * The namespace identifier for the SOAP 1.1 envelope. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String URI_NS_SOAP_1_1_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/"; /** * The namespace identifier for the SOAP 1.2 envelope. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String URI_NS_SOAP_1_2_ENVELOPE = "http://www.w3.org/2003/05/soap-envelope"; @@ -102,21 +104,21 @@ public interface SOAPConstants { /** * The namespace identifier for the SOAP 1.2 encoding. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String URI_NS_SOAP_1_2_ENCODING = "http://www.w3.org/2003/05/soap-encoding"; /** * The media type of the Content-Type MIME header in SOAP 1.1. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String SOAP_1_1_CONTENT_TYPE = "text/xml"; /** * The media type of the Content-Type MIME header in SOAP 1.2. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String SOAP_1_2_CONTENT_TYPE = "application/soap+xml"; @@ -137,21 +139,21 @@ public interface SOAPConstants { * The URI identifying the next application processing a SOAP request as the intended * role for a SOAP 1.2 header entry (see section 2.2 of part 1 of the SOAP 1.2 * specification). - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String URI_SOAP_1_2_ROLE_NEXT = URI_NS_SOAP_1_2_ENVELOPE + "/role/next"; /** * The URI specifying the role None in SOAP 1.2. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String URI_SOAP_1_2_ROLE_NONE = URI_NS_SOAP_1_2_ENVELOPE + "/role/none"; /** * The URI identifying the ultimate receiver of the SOAP 1.2 message. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER = @@ -159,41 +161,41 @@ public interface SOAPConstants { /** * The default namespace prefix for http://www.w3.org/2003/05/soap-envelope - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final String SOAP_ENV_PREFIX = "env"; /** * SOAP 1.2 VersionMismatch Fault - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final QName SOAP_VERSIONMISMATCH_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "VersionMismatch", SOAP_ENV_PREFIX); /** * SOAP 1.2 MustUnderstand Fault - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final QName SOAP_MUSTUNDERSTAND_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "MustUnderstand", SOAP_ENV_PREFIX); /** * SOAP 1.2 DataEncodingUnknown Fault - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final QName SOAP_DATAENCODINGUNKNOWN_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "DataEncodingUnknown", SOAP_ENV_PREFIX); /** * SOAP 1.2 Sender Fault - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final QName SOAP_SENDER_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "Sender", SOAP_ENV_PREFIX); /** * SOAP 1.2 Receiver Fault - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static final QName SOAP_RECEIVER_FAULT = new QName(URI_NS_SOAP_1_2_ENVELOPE, "Receiver", SOAP_ENV_PREFIX); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElement.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElement.java index 4a55a60b22c..b4d8bca6006 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElement.java @@ -40,6 +40,8 @@ import javax.xml.namespace.QName; * objects of the correct type. See {@link #getChildElements()} and * {@link javax.xml.soap} * for details. + * + * @since 1.6 */ public interface SOAPElement extends Node, org.w3c.dom.Element { @@ -74,7 +76,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * @exception SOAPException if there is an error in creating the * SOAPElement object * @see SOAPElement#addChildElement(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPElement addChildElement(QName qname) throws SOAPException; @@ -173,7 +175,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * is also useful for recycling portions of a document within a SOAP * message. * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public abstract void removeContents(); @@ -224,7 +226,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { an attribute with QName qname on this SOAPElement. * @see SOAPElement#addAttribute(Name, String) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPElement addAttribute(QName qname, String value) throws SOAPException; @@ -261,7 +263,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * @return a String giving the value of the specified * attribute, Null if there is no such attribute * @see SOAPElement#getAttributeValue(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public String getAttributeValue(QName qname); @@ -287,7 +289,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * * @return an iterator over the QNames of the attributes * @see SOAPElement#getAllAttributes() - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public Iterator getAllAttributesAsQNames(); @@ -322,7 +324,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * @return an iterator over the namespace prefixes are within scope of this * SOAPElement object * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Iterator getVisibleNamespacePrefixes(); @@ -348,7 +350,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * * @exception SOAPException if the QName cannot be created. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public QName createQName(String localName, String prefix) throws SOAPException; @@ -366,7 +368,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * @return a QName object with the qname of this * SOAPElement object * @see SOAPElement#getElementName() - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public QName getElementQName(); @@ -386,7 +388,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * is not allowed. * @return The renamed Node * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPElement setElementQName(QName newName) throws SOAPException; @@ -409,7 +411,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * @return true if the attribute was * removed successfully; false if it was not * @see SOAPElement#removeAttribute(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public boolean removeAttribute(QName qname); @@ -496,7 +498,7 @@ public interface SOAPElement extends Node, org.w3c.dom.Element { * in this SOAPElement object with the * specified qname * @see SOAPElement#getChildElements(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public Iterator getChildElements(QName qname); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElementFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElementFactory.java index ff6a8ddf314..a45a3db59e8 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElementFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPElementFactory.java @@ -37,6 +37,7 @@ package javax.xml.soap; * inserted. * @deprecated - Use javax.xml.soap.SOAPFactory for creating SOAPElements. * @see javax.xml.soap.SOAPFactory + * @since 1.6 */ public class SOAPElementFactory { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPEnvelope.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPEnvelope.java index 0839e7fbe23..a32d535f3ec 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPEnvelope.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPEnvelope.java @@ -93,6 +93,8 @@ package javax.xml.soap; * Name name = se.createName("GetLastTradePrice", "WOMBAT", * "http://www.wombat.org/trader"); * + * + * @since 1.6 */ public interface SOAPEnvelope extends SOAPElement { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPException.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPException.java index 333c772e9e0..669130204e9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPException.java @@ -39,6 +39,8 @@ package javax.xml.soap; * the provider. Reasons for embedding a Throwable * object include problems such as input/output errors or a parsing * problem, such as an error in parsing a header. + * + * @since 1.6 */ public class SOAPException extends Exception { private Throwable cause; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java index 5f8778e7e5b..c32f6926519 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java @@ -43,6 +43,7 @@ import org.w3c.dom.Element; * javax.xml.soap.Detail objects as well as * java.xml.soap.Name objects. * + * @since 1.6 */ public abstract class SOAPFactory { @@ -77,7 +78,7 @@ public abstract class SOAPFactory { * @exception SOAPException if there is an error in creating the * SOAPElement object * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPElement createElement(Element domElement) throws SOAPException { throw new UnsupportedOperationException("createElement(org.w3c.dom.Element) must be overridden by all subclasses of SOAPFactory."); @@ -120,7 +121,7 @@ public abstract class SOAPFactory { * @exception SOAPException if there is an error in creating the * SOAPElement object * @see SOAPFactory#createElement(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPElement createElement(QName qname) throws SOAPException { throw new UnsupportedOperationException("createElement(QName) must be overridden by all subclasses of SOAPFactory."); @@ -188,7 +189,7 @@ public abstract class SOAPFactory { *@param faultCode the FaultCode for the fault *@return a SOAPFault object *@throws SOAPException if there is a SOAP error - *@since SAAJ 1.3 + *@since 1.6, SAAJ 1.3 */ public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException; @@ -196,7 +197,7 @@ public abstract class SOAPFactory { *Creates a new default SOAPFault object *@return a SOAPFault object *@throws SOAPException if there is a SOAP error - *@since SAAJ 1.3 + *@since 1.6, SAAJ 1.3 */ public abstract SOAPFault createFault() throws SOAPException; @@ -290,7 +291,7 @@ public abstract class SOAPFactory { * @exception SOAPException if there was an error creating the * specified SOAPFactory * @see SAAJMetaFactory - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public static SOAPFactory newInstance(String protocol) throws SOAPException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFault.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFault.java index ee05dfc2d6d..67d3c6004d3 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFault.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFault.java @@ -42,6 +42,8 @@ import javax.xml.namespace.QName; * Depending on the protocol specified while creating the * MessageFactory instance, a SOAPFault has * sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification. + * + * @since 1.6 */ public interface SOAPFault extends SOAPBodyElement { @@ -72,7 +74,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception SOAPException if there was an error in adding the * faultcode element to the underlying XML tree. * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public void setFaultCode(Name faultCodeQName) throws SOAPException; @@ -91,7 +93,7 @@ public interface SOAPFault extends SOAPBodyElement { * @see #setFaultCode(Name) * @see #getFaultCodeAsQName() * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void setFaultCode(QName faultCodeQName) throws SOAPException; @@ -128,7 +130,7 @@ public interface SOAPFault extends SOAPBodyElement { * @return a Name representing the faultcode * @see #setFaultCode(Name) * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Name getFaultCodeAsName(); @@ -141,7 +143,7 @@ public interface SOAPFault extends SOAPBodyElement { * * @see #setFaultCode(QName) * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public QName getFaultCodeAsQName(); @@ -158,7 +160,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Subcode. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public Iterator getFaultSubcodes(); @@ -171,7 +173,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Subcode. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void removeAllFaultSubcodes(); @@ -187,7 +189,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Subcode. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void appendFaultSubcode(QName subcode) throws SOAPException; @@ -270,7 +272,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception SOAPException if there was an error in adding the * faultString to the underlying XML tree. * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public void setFaultString(String faultString, Locale locale) throws SOAPException; @@ -315,7 +317,7 @@ public interface SOAPFault extends SOAPBodyElement { * the fault string or null if no locale was specified * @see #setFaultString(String, Locale) * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Locale getFaultStringLocale(); @@ -327,7 +329,7 @@ public interface SOAPFault extends SOAPBodyElement { * @return true if this SOAPFault has a Detail * subelement and false otherwise. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public boolean hasDetail(); @@ -377,7 +379,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Reason. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public Iterator getFaultReasonLocales() throws SOAPException; @@ -393,7 +395,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Reason. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public Iterator getFaultReasonTexts() throws SOAPException; @@ -414,7 +416,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Reason. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public String getFaultReasonText(Locale locale) throws SOAPException; @@ -441,7 +443,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Reason. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void addFaultReasonText(String text, java.util.Locale locale) throws SOAPException; @@ -457,7 +459,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Node. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public String getFaultNode(); @@ -472,7 +474,7 @@ public interface SOAPFault extends SOAPBodyElement { * support the SOAP 1.2 concept of Fault Node. * * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void setFaultNode(String uri) throws SOAPException; @@ -487,7 +489,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Role. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public String getFaultRole(); @@ -504,7 +506,7 @@ public interface SOAPFault extends SOAPBodyElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Role. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void setFaultRole(String uri) throws SOAPException; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFaultElement.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFaultElement.java index f89b4c04393..fcf3a02f80d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFaultElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFaultElement.java @@ -32,6 +32,8 @@ package javax.xml.soap; *

    * Content is added to a SOAPFaultElement using the * SOAPElement method addTextNode. + * + * @since 1.6 */ public interface SOAPFaultElement extends SOAPElement { } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java index dd10957f0ed..870b423c70b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java @@ -66,6 +66,7 @@ import javax.xml.namespace.QName; * * * @see SOAPHeaderElement + * @since 1.6 */ public interface SOAPHeader extends SOAPElement { /** @@ -92,7 +93,7 @@ public interface SOAPHeader extends SOAPElement { * inserted into this SOAPHeader object * @exception SOAPException if a SOAP error occurs * @see SOAPHeader#addHeaderElement(Name) - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPHeaderElement addHeaderElement(QName qname) throws SOAPException; @@ -115,7 +116,7 @@ public interface SOAPHeader extends SOAPElement { * @see #extractHeaderElements * @see SOAPConstants#URI_SOAP_ACTOR_NEXT * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Iterator examineMustUnderstandHeaderElements(String actor); @@ -180,7 +181,7 @@ public interface SOAPHeader extends SOAPElement { * inserted into this SOAPHeader object * @exception SOAPException if a SOAP error occurs. * @exception UnsupportedOperationException if this is a SOAP 1.1 Header. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPHeaderElement addNotUnderstoodHeaderElement(QName name) throws SOAPException; @@ -196,7 +197,7 @@ public interface SOAPHeader extends SOAPElement { * @return the new SOAPHeaderElement object that was * inserted into this SOAPHeader object * @exception SOAPException if a SOAP error occurs. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPHeaderElement addUpgradeHeaderElement(Iterator supportedSOAPURIs) throws SOAPException; @@ -211,7 +212,7 @@ public interface SOAPHeader extends SOAPElement { * @return the new SOAPHeaderElement object that was * inserted into this SOAPHeader object * @exception SOAPException if a SOAP error occurs. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) throws SOAPException; @@ -226,7 +227,7 @@ public interface SOAPHeader extends SOAPElement { * @return the new SOAPHeaderElement object that was * inserted into this SOAPHeader object * @exception SOAPException if a SOAP error occurs. - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri) throws SOAPException; @@ -240,7 +241,7 @@ public interface SOAPHeader extends SOAPElement { * SOAPHeader * @see #extractAllHeaderElements * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Iterator examineAllHeaderElements(); @@ -255,7 +256,7 @@ public interface SOAPHeader extends SOAPElement { * * @see #examineAllHeaderElements * - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Iterator extractAllHeaderElements(); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java index 29f331964fc..f6755f1c372 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java @@ -33,6 +33,8 @@ package javax.xml.soap; *

    * A SOAPHeaderElement object can have other * SOAPElement objects as its children. + * + * @since 1.6 */ public interface SOAPHeaderElement extends SOAPElement { @@ -65,7 +67,7 @@ public interface SOAPHeaderElement extends SOAPElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Role. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void setRole(String uri) throws SOAPException; @@ -89,7 +91,7 @@ public interface SOAPHeaderElement extends SOAPElement { * @exception UnsupportedOperationException if this message does not * support the SOAP 1.2 concept of Fault Role. * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public String getRole(); @@ -143,7 +145,7 @@ public interface SOAPHeaderElement extends SOAPElement { * @see #setMustUnderstand * @see #getRelay * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public void setRelay(boolean relay) throws SOAPException; @@ -160,7 +162,7 @@ public interface SOAPHeaderElement extends SOAPElement { * @see #getMustUnderstand * @see #setRelay * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public boolean getRelay(); } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPMessage.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPMessage.java index a86f73865b1..821c64817e9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPMessage.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPMessage.java @@ -100,6 +100,7 @@ import javax.activation.DataHandler; * * @see MessageFactory * @see AttachmentPart + * @since 1.6 */ public abstract class SOAPMessage { /** @@ -108,7 +109,7 @@ public abstract class SOAPMessage { * supported values. The default is "utf-8". * * @see SOAPMessage#setProperty(String, Object) SOAPMessage.setProperty - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public static final String CHARACTER_SET_ENCODING = "javax.xml.soap.character-set-encoding"; @@ -119,7 +120,7 @@ public abstract class SOAPMessage { * "false". * * @see SOAPMessage#setProperty(String, Object) SOAPMessage.setProperty - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public static final String WRITE_XML_DECLARATION = "javax.xml.soap.write-xml-declaration"; @@ -163,7 +164,7 @@ public abstract class SOAPMessage { * object * @exception SOAPException * if the SOAP Body does not exist or cannot be retrieved - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public SOAPBody getSOAPBody() throws SOAPException { throw new UnsupportedOperationException("getSOAPBody must be overridden by all subclasses of SOAPMessage"); @@ -178,7 +179,7 @@ public abstract class SOAPMessage { * object * @exception SOAPException * if the SOAP Header does not exist or cannot be retrieved - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public SOAPHeader getSOAPHeader() throws SOAPException { throw new UnsupportedOperationException("getSOAPHeader must be overridden by all subclasses of SOAPMessage"); @@ -230,7 +231,7 @@ public abstract class SOAPMessage { * @param headers * a MimeHeaders object containing the MIME * headers for which to search - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract void removeAttachments(MimeHeaders headers); @@ -258,7 +259,7 @@ public abstract class SOAPMessage { * @throws SOAPException if there is an error in the attempt to access the * attachment * - * @since SAAJ 1.3 + * @since 1.6, SAAJ 1.3 */ public abstract AttachmentPart getAttachment(SOAPElement element) throws SOAPException; @@ -432,7 +433,7 @@ public abstract class SOAPMessage { * the value to be associated with the specified property * @exception SOAPException * if the property name is not recognized. - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public void setProperty(String property, Object value) throws SOAPException { @@ -448,7 +449,7 @@ public abstract class SOAPMessage { * if no such property exists. * @exception SOAPException * if the property name is not recognized. - * @since SAAJ 1.2 + * @since 1.6, SAAJ 1.2 */ public Object getProperty(String property) throws SOAPException { throw new UnsupportedOperationException("getProperty must be overridden by all subclasses of SOAPMessage"); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPPart.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPPart.java index ab605b6f757..dc280fab60e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPPart.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPPart.java @@ -64,6 +64,8 @@ import javax.xml.transform.Source; * The SOAPPart method getEnvelope can be used * to retrieve the SOAPEnvelope object. *

    + * + * @since 1.6 */ public abstract class SOAPPart implements org.w3c.dom.Document, Node { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/Text.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/Text.java index c385e1646d5..49f0e2cb19f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/Text.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/Text.java @@ -29,6 +29,7 @@ package javax.xml.soap; * A representation of a node whose value is text. A Text object * may represent text that is content or text that is a comment. * + * @since 1.6 */ public interface Text extends Node, org.w3c.dom.Text { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Action.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Action.java index daadc48d1f6..f42190b295e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Action.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Action.java @@ -118,7 +118,7 @@ import java.lang.annotation.Target; * * @see FaultAction * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @Documented diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/AsyncHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/AsyncHandler.java index 6f553b0a5c6..66acc97af26 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/AsyncHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/AsyncHandler.java @@ -29,7 +29,7 @@ package javax.xml.ws; * clients that wish to receive callback notification of the completion of * service endpoint operations invoked asynchronously. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface AsyncHandler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Binding.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Binding.java index 9c92f1eed96..24be0222c67 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Binding.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Binding.java @@ -29,7 +29,7 @@ package javax.xml.ws; /** The Binding interface is the base interface * for JAX-WS protocol bindings. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface Binding { @@ -61,7 +61,7 @@ public interface Binding { * @return String The binding identifier for the port. * Never returns null * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ String getBindingID(); } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingProvider.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingProvider.java index bac4d26ccd9..11194fd5078 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingProvider.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingProvider.java @@ -33,7 +33,7 @@ import javax.xml.ws.wsaddressing.W3CEndpointReference; * protocol binding and associated context objects for request and * response message processing. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * * @see javax.xml.ws.Binding **/ @@ -154,7 +154,7 @@ public interface BindingProvider { * * @see W3CEndpointReference * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public EndpointReference getEndpointReference(); @@ -176,7 +176,7 @@ public interface BindingProvider { * @throws java.lang.UnsupportedOperationException If this * BindingProvider uses the XML/HTTP binding. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public T getEndpointReference(Class clazz); } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingType.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingType.java index 29ce8757287..0976add7606 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingType.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/BindingType.java @@ -39,7 +39,7 @@ import java.lang.annotation.RetentionPolicy; * This annotation may be overriden programmatically or via * deployment descriptors, depending on the platform in use. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * **/ @Target(ElementType.TYPE) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Dispatch.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Dispatch.java index f1f38a35883..7c96bab57d8 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Dispatch.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Dispatch.java @@ -33,7 +33,7 @@ import java.util.concurrent.Future; * class acts as a factory for the creation of Dispatch * instances. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface Dispatch extends BindingProvider { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Endpoint.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Endpoint.java index 484c6510e43..1cb19ea1590 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Endpoint.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Endpoint.java @@ -61,7 +61,7 @@ import org.w3c.dom.Element; * as possible instead of generating new ones based on the annotations * present on the implementor. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * * @see javax.xml.ws.Binding * @see javax.xml.ws.BindingType @@ -119,7 +119,7 @@ public abstract class Endpoint { * * * @return The newly created endpoint. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 * */ public static Endpoint create(Object implementor, WebServiceFeature ... features) { @@ -166,7 +166,7 @@ public abstract class Endpoint { * parameter will have their default values. * * @return The newly created endpoint. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public static Endpoint create(String bindingId, Object implementor, WebServiceFeature ... features) { return Provider.provider().createEndpoint(bindingId, implementor, features); @@ -266,7 +266,7 @@ public abstract class Endpoint { * If a java.lang.SecurityManger * is being used and the application doesn't have the * WebServicePermission("publishEndpoint") permission. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public static Endpoint publish(String address, Object implementor, WebServiceFeature ... features) { return Provider.provider().createAndPublishEndpoint(address, implementor, features); @@ -330,7 +330,7 @@ public abstract class Endpoint { * If a java.lang.SecurityManger * is being used and the application doesn't have the * WebServicePermission("publishEndpoint") permission. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public void publish(HttpContext serverContext) { throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour."); @@ -446,7 +446,7 @@ public abstract class Endpoint { * * @see W3CEndpointReference * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract EndpointReference getEndpointReference(Element... referenceParameters); @@ -472,7 +472,7 @@ public abstract class Endpoint { * uses the XML/HTTP binding. * * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract T getEndpointReference(Class clazz, Element... referenceParameters); @@ -490,7 +490,7 @@ public abstract class Endpoint { * @throws java.lang.IllegalStateException * If the endpoint has been published already or it has been stopped. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public void setEndpointContext(EndpointContext ctxt) { throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour."); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointContext.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointContext.java index 13bc527fc21..b1a4b49db59 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointContext.java @@ -42,7 +42,7 @@ import java.util.Set; * before {@link Endpoint#publish} methods. * * @author Jitendra Kotamraju - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public abstract class EndpointContext { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointReference.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointReference.java index 6ef626b4d17..3ed68c0511f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointReference.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/EndpointReference.java @@ -81,7 +81,7 @@ import java.io.StringWriter; * * @see W3CEndpointReference * @see Service - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature) public abstract class EndpointReference { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/FaultAction.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/FaultAction.java index 0e29a0aa858..43e37f608ea 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/FaultAction.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/FaultAction.java @@ -145,7 +145,7 @@ import java.lang.annotation.Target; * </definitions> * * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @Documented diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Holder.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Holder.java index 8eddf0575f9..8f58f34eda1 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Holder.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Holder.java @@ -30,7 +30,7 @@ import java.io.Serializable; /** * Holds a value of type T. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 */ public final class Holder implements Serializable { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java index 19b5be1dfd0..4f50c1604b5 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/LogicalMessage.java @@ -32,7 +32,7 @@ import javax.xml.bind.JAXBContext; * protocol agnostic XML message and contains methods that * provide access to the payload of the message. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface LogicalMessage { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/ProtocolException.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/ProtocolException.java index 16ba0dae50d..5ea3926db9f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/ProtocolException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/ProtocolException.java @@ -30,7 +30,7 @@ package javax.xml.ws; * are used to communicate protocol level fault information to clients and may * be used on the server to control the protocol specific fault representation. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public class ProtocolException extends WebServiceException { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Provider.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Provider.java index 79d26450baa..78c7b717948 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Provider.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Provider.java @@ -38,7 +38,7 @@ package javax.xml.ws; * the Provider instance will receive entire protocol messages * or just message payloads. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * * @see javax.xml.transform.Source * @see javax.xml.soap.SOAPMessage diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/RequestWrapper.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/RequestWrapper.java index a33af7c3d33..34b6b6a33d4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/RequestWrapper.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/RequestWrapper.java @@ -40,7 +40,7 @@ import java.lang.annotation.RetentionPolicy; * overloading conflicts in document literal mode. Only the className * is required in this case. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ @Target(ElementType.METHOD) @@ -65,7 +65,7 @@ public @interface RequestWrapper { /** * wsdl:part name for the wrapper part * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public String partName() default ""; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBinding.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBinding.java index c71a3215e9a..e5357873ec1 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBinding.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBinding.java @@ -54,7 +54,7 @@ import javax.xml.ws.spi.WebServiceFeatureAnnotation; * * @see RespectBindingFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java index 51320734bc4..5bf7bdd7ec0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java @@ -80,7 +80,7 @@ import javax.xml.ws.soap.AddressingFeature; * * @see AddressingFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public final class RespectBindingFeature extends WebServiceFeature { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Response.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Response.java index 8d5451f3be2..e98ae8b20a0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Response.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Response.java @@ -39,7 +39,7 @@ import java.util.concurrent.Future; * {@link WebServiceException} that represents the error that occured during the * asynchronous method invocation.

    * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface Response extends Future { /** Gets the contained response context. diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/ResponseWrapper.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/ResponseWrapper.java index 3d7bb75051b..0bb891a9c66 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/ResponseWrapper.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/ResponseWrapper.java @@ -39,7 +39,7 @@ import java.lang.annotation.RetentionPolicy; * overloading conflicts in document literal mode. Only the className * is required in this case. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ @Target(ElementType.METHOD) @@ -65,7 +65,7 @@ public @interface ResponseWrapper { /** * wsdl:part name for the wrapper part * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public String partName() default ""; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java index 77b77e23c63..a31df76c9df 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java @@ -57,7 +57,7 @@ import javax.xml.ws.spi.Provider; * can be enabled by creating a ThreadPoolExecutor and * registering it with the service. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * * @see javax.xml.ws.spi.Provider * @see javax.xml.ws.handler.HandlerResolver @@ -153,7 +153,7 @@ public class Service { * @see java.lang.reflect.InvocationHandler * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public T getPort(QName portName, Class serviceEndpointInterface, WebServiceFeature... features) { @@ -219,7 +219,7 @@ public class Service { * * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public T getPort(Class serviceEndpointInterface, WebServiceFeature... features) { @@ -297,7 +297,7 @@ public class Service { * with this port or is unsupported. * * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public T getPort(EndpointReference endpointReference, Class serviceEndpointInterface, WebServiceFeature... features) { @@ -381,7 +381,7 @@ public class Service { * @see javax.xml.soap.SOAPMessage * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public Dispatch createDispatch(QName portName, Class type, Service.Mode mode, WebServiceFeature... features) { @@ -456,7 +456,7 @@ public class Service { * @see javax.xml.soap.SOAPMessage * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public Dispatch createDispatch(EndpointReference endpointReference, Class type, Service.Mode mode, @@ -514,7 +514,7 @@ public class Service { * @see javax.xml.bind.JAXBContext * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public Dispatch createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features) { @@ -587,7 +587,7 @@ public class Service { * @see javax.xml.bind.JAXBContext * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public Dispatch createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, @@ -722,7 +722,7 @@ public class Service { * it must throw a WebServiceException. * @throws WebServiceException If any error in creation of the * specified service. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 **/ public static Service create( java.net.URL wsdlDocumentLocation, @@ -752,7 +752,7 @@ public class Service { * @throws WebServiceException If any error in creation of the * specified service * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public static Service create(QName serviceName, WebServiceFeature ... features) { return new Service(null, serviceName, features); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/ServiceMode.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/ServiceMode.java index a451cd5fbae..84624794734 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/ServiceMode.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/ServiceMode.java @@ -36,7 +36,7 @@ import java.lang.annotation.Inherited; * Used to indicate whether a {@link Provider} implementation wishes to work * with entire protocol messages or just with protocol message payloads. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebEndpoint.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebEndpoint.java index ebff61a1abc..3654ef202d0 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebEndpoint.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebEndpoint.java @@ -41,7 +41,7 @@ import java.lang.annotation.RetentionPolicy; * determined based on the value of the WebServiceClient * annotation on the generated service interface itself. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * * @see javax.xml.ws.WebServiceClient **/ diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebFault.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebFault.java index 7135c26f96b..f3abbee0358 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebFault.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebFault.java @@ -36,7 +36,7 @@ import java.lang.annotation.RetentionPolicy; * to the local and namespace name of the fault element and the name * of the fault bean. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @@ -60,7 +60,7 @@ public @interface WebFault { /** * wsdl:Message's name. Default name is the exception's class name. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public String messageName() default ""; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceClient.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceClient.java index d1e84128915..0d40a1fb47d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceClient.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceClient.java @@ -40,7 +40,7 @@ import java.lang.annotation.RetentionPolicy; * element represents the Web service for which the generated * service interface provides a client view. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceContext.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceContext.java index 618592ddbef..8ba63ab75a4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceContext.java @@ -41,7 +41,7 @@ import org.w3c.dom.Element; * into an endpoint implementation class using the * Resource annotation. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * * @see javax.annotation.Resource **/ @@ -120,7 +120,7 @@ public interface WebServiceContext { * * @see W3CEndpointReference * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public EndpointReference getEndpointReference(Element... referenceParameters); @@ -144,7 +144,7 @@ public interface WebServiceContext { * @throws WebServiceException If the clazz type of * EndpointReference is not supported. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public T getEndpointReference(Class clazz, Element... referenceParameters); diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceException.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceException.java index aaf116bf143..acd122b3a91 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceException.java @@ -28,7 +28,7 @@ package javax.xml.ws; /** The WebServiceException class is the base * exception class for all JAX-WS API runtime exceptions. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public class WebServiceException extends java.lang.RuntimeException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceFeature.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceFeature.java index a08f95dbbff..ea60d367ff5 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceFeature.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceFeature.java @@ -44,7 +44,7 @@ package javax.xml.ws; * @see javax.xml.ws.soap.AddressingFeature * @see javax.xml.ws.soap.MTOMFeature * - * @since 2.1 + * @since 1.6, JAX-WS 2.1 */ public abstract class WebServiceFeature { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServicePermission.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServicePermission.java index d0ecad9aa21..743243f22f6 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServicePermission.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServicePermission.java @@ -55,6 +55,7 @@ import java.security.BasicPermission; * @see java.security.Permissions * @see java.lang.SecurityManager * @see java.net.SocketPermission + * @since 1.6 */ public final class WebServicePermission extends BasicPermission { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceProvider.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceProvider.java index 4dfcaad9590..c2d48d2f5b9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceProvider.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceProvider.java @@ -33,7 +33,7 @@ import java.lang.annotation.RetentionPolicy; /** * Used to annotate a Provider implementation class. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * @see javax.xml.ws.Provider */ @Target(ElementType.TYPE) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRef.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRef.java index fe01112906c..4d5c70e0a64 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRef.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRef.java @@ -75,7 +75,7 @@ import java.lang.annotation.RetentionPolicy; * @see javax.annotation.Resource * @see WebServiceFeatureAnnotation * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 * **/ @@ -143,7 +143,7 @@ public @interface WebServiceRef { * A portable JNDI lookup name that resolves to the target * web service reference. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ String lookup() default ""; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRefs.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRefs.java index c77749bb510..10104f35d3e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRefs.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/WebServiceRefs.java @@ -69,7 +69,7 @@ import static java.lang.annotation.RetentionPolicy.*; * * * @see WebServiceRef - * @since 2.0 + * @since 1.6, JAX-WS 2.0 */ @Documented diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/Handler.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/Handler.java index ec278114012..dfd972b705c 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/Handler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/Handler.java @@ -31,7 +31,7 @@ import javax.xml.ws.handler.MessageContext; /** The Handler interface * is the base interface for JAX-WS handlers. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface Handler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/HandlerResolver.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/HandlerResolver.java index 3c3e04f8ce6..c0f2f97361b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/HandlerResolver.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/HandlerResolver.java @@ -39,7 +39,7 @@ package javax.xml.ws.handler; * * @see javax.xml.ws.Service#setHandlerResolver * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface HandlerResolver { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalHandler.java index cc95233c938..c5e9589d24b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalHandler.java @@ -28,7 +28,7 @@ package javax.xml.ws.handler; /** The LogicalHandler extends * Handler to provide typesafety for the message context parameter. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface LogicalHandler extends Handler { } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalMessageContext.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalMessageContext.java index 24c09dae3a5..0ae213ba063 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalMessageContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/LogicalMessageContext.java @@ -32,7 +32,7 @@ import javax.xml.ws.LogicalMessage; * provide access to a the contained message as a protocol neutral * LogicalMessage * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface LogicalMessageContext extends MessageContext { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/MessageContext.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/MessageContext.java index a893c749651..35525fc0440 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/MessageContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/MessageContext.java @@ -36,7 +36,7 @@ import java.util.Map; * enable handlers in a handler chain to share processing related * state. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 */ public interface MessageContext extends Map { @@ -168,7 +168,7 @@ public interface MessageContext extends Map { * wsa:IsReferenceParameter="true" attribute. *

    Type: List<Element> * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public static final String REFERENCE_PARAMETERS = "javax.xml.ws.reference.parameters"; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/PortInfo.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/PortInfo.java index ee91456abdf..5f1b2c2dad9 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/PortInfo.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/PortInfo.java @@ -35,7 +35,7 @@ import javax.xml.namespace.QName; * This interface is never implemented by an application, * only by a JAX-WS implementation. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface PortInfo { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPHandler.java index ba9232726c2..98a43cd181a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPHandler.java @@ -33,7 +33,7 @@ import java.util.Set; * to provide typesafety for the message context parameter and add a method * to obtain access to the headers that may be processed by the handler. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface SOAPHandler extends Handler { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPMessageContext.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPMessageContext.java index 2df709f7721..cf75e7d13fa 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPMessageContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/handler/soap/SOAPMessageContext.java @@ -38,7 +38,7 @@ import java.util.Set; * * @see javax.xml.soap.SOAPMessage * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface SOAPMessageContext extends javax.xml.ws.handler.MessageContext { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPBinding.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPBinding.java index 8d4e0d0de33..233a0a702f4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPBinding.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPBinding.java @@ -31,7 +31,7 @@ import javax.xml.ws.Binding; /** The HTTPBinding interface is an * abstraction for the XML/HTTP binding. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface HTTPBinding extends Binding { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPException.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPException.java index 4796394eb39..592e302f054 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/http/HTTPException.java @@ -32,7 +32,7 @@ package javax.xml.ws.http; *

    Since there is no standard format for faults or exceptions * in XML/HTTP messaging, only the HTTP status code is captured. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public class HTTPException extends javax.xml.ws.ProtocolException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/Addressing.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/Addressing.java index 163d0f538b1..5dbb42d26da 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/Addressing.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/Addressing.java @@ -57,7 +57,7 @@ import javax.xml.ws.spi.WebServiceFeatureAnnotation; * This annotation's behaviour is defined by the corresponding feature * {@link AddressingFeature}. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @@ -106,7 +106,7 @@ public @interface Addressing { * * 3.1.3 NonAnonymousResponses Assertion in the generated WSDL. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ Responses responses() default Responses.ALL; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/AddressingFeature.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/AddressingFeature.java index dfd95c739f0..8f9d730d797 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/AddressingFeature.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/AddressingFeature.java @@ -112,7 +112,7 @@ import javax.xml.ws.Service; * for more information on WS-Addressing. * * @see Addressing - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public final class AddressingFeature extends WebServiceFeature { @@ -151,7 +151,7 @@ public final class AddressingFeature extends WebServiceFeature { * * 3.1.3 NonAnonymousResponses Assertion in the generated WSDL. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public enum Responses { /** @@ -229,7 +229,7 @@ public final class AddressingFeature extends WebServiceFeature { * @param required true means requires the use of ws-addressing . * @param responses specifies what type of responses are required * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public AddressingFeature(boolean enabled, boolean required, Responses responses) { this.enabled = enabled; @@ -268,7 +268,7 @@ public final class AddressingFeature extends WebServiceFeature { * {@link Responses#NON_ANONYMOUS} when endpoint requires the use * of only non-anonymous responses * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public Responses getResponses() { return responses; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOM.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOM.java index 995727497dd..da6714e9a7e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOM.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOM.java @@ -54,7 +54,7 @@ import javax.xml.ws.WebServiceProvider; * This annotation's behaviour is defined by the corresponding feature * {@link MTOMFeature}. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOMFeature.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOMFeature.java index a9581070088..232f98f91c2 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOMFeature.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/MTOMFeature.java @@ -54,7 +54,7 @@ import javax.xml.ws.Service; * The {@link #threshold} property can be used to set the threshold * value used to determine when binary data should be XOP encoded. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public final class MTOMFeature extends WebServiceFeature { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPBinding.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPBinding.java index 104de2c1e35..4b9d88887f4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPBinding.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPBinding.java @@ -34,7 +34,7 @@ import javax.xml.soap.MessageFactory; /** The SOAPBinding interface is an abstraction for * the SOAP binding. * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public interface SOAPBinding extends Binding { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPFaultException.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPFaultException.java index 0ac01421bc6..575f840801c 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPFaultException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/soap/SOAPFaultException.java @@ -48,7 +48,7 @@ import javax.xml.soap.SOAPFault; * @see javax.xml.ws.soap.SOAPBinding#getSOAPFactory * @see javax.xml.ws.ProtocolException * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 **/ public class SOAPFaultException extends javax.xml.ws.ProtocolException { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Invoker.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Invoker.java index b581fba1919..de719cabf53 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Invoker.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Invoker.java @@ -43,7 +43,7 @@ import java.lang.reflect.InvocationTargetException; * * @see Provider#createEndpoint(String, Class, Invoker, WebServiceFeature...) * @author Jitendra Kotamraju - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public abstract class Invoker { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Provider.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Provider.java index f881048ed20..8c8b802130f 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Provider.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/Provider.java @@ -41,7 +41,7 @@ import org.w3c.dom.Element; * Endpoint objects. *

    * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 */ public abstract class Provider { @@ -161,7 +161,7 @@ public abstract class Provider { * it must throw a WebServiceException. * @return The newly created service delegate. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public ServiceDelegate createServiceDelegate( java.net.URL wsdlDocumentLocation, @@ -218,7 +218,7 @@ public abstract class Provider { * @throws NullPointerException If the null * eprInfoset value is given. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset); @@ -271,7 +271,7 @@ public abstract class Provider { * * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract T getPort(EndpointReference endpointReference, Class serviceEndpointInterface, @@ -333,7 +333,7 @@ public abstract class Provider { * @throws WebServiceException If an error occurs while creating the * W3CEndpointReference. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List metadata, String wsdlDocumentLocation, List referenceParameters); @@ -407,7 +407,7 @@ public abstract class Provider { * * @throws WebServiceException If an error occurs while creating the * W3CEndpointReference. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public W3CEndpointReference createW3CEndpointReference(String address, QName interfaceName, QName serviceName, QName portName, @@ -434,7 +434,7 @@ public abstract class Provider { * endpoint. Supported features not in the features * parameter will have their default values. * @return The newly created endpoint. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature ... features) { @@ -455,7 +455,7 @@ public abstract class Provider { * endpoint. Supported features not in the features * parameter will have their default values. * @return The newly created endpoint. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public Endpoint createEndpoint(String bindingId, Object implementor, WebServiceFeature ... features) { @@ -478,7 +478,7 @@ public abstract class Provider { * endpoint. Supported features not in the features * parameter will have their default values. * @return The newly created endpoint. - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public Endpoint createEndpoint(String bindingId, Class implementorClass, Invoker invoker, WebServiceFeature ... features) { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/ServiceDelegate.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/ServiceDelegate.java index dd181754e36..1c47536cf3a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/ServiceDelegate.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/ServiceDelegate.java @@ -47,7 +47,7 @@ import javax.xml.ws.WebServiceException; * @see javax.xml.ws.Service * @see javax.xml.ws.spi.Provider * - * @since JAX-WS 2.0 + * @since 1.6, JAX-WS 2.0 */ public abstract class ServiceDelegate { @@ -119,7 +119,7 @@ public abstract class ServiceDelegate { * @see java.lang.reflect.InvocationHandler * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract T getPort(QName portName, Class serviceEndpointInterface, WebServiceFeature... features); @@ -194,7 +194,7 @@ public abstract class ServiceDelegate { * with this port or is unsupported. * * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract T getPort(EndpointReference endpointReference, Class serviceEndpointInterface, WebServiceFeature... features); @@ -256,7 +256,7 @@ public abstract class ServiceDelegate { * * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract T getPort(Class serviceEndpointInterface, WebServiceFeature... features); @@ -334,7 +334,7 @@ public abstract class ServiceDelegate { * @see javax.xml.soap.SOAPMessage * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract Dispatch createDispatch(QName portName, Class type, Service.Mode mode, WebServiceFeature... features); @@ -406,7 +406,7 @@ public abstract class ServiceDelegate { * @see javax.xml.soap.SOAPMessage * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract Dispatch createDispatch(EndpointReference endpointReference, Class type, Service.Mode mode, @@ -462,7 +462,7 @@ public abstract class ServiceDelegate { * @see javax.xml.bind.JAXBContext * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract Dispatch createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features); @@ -532,7 +532,7 @@ public abstract class ServiceDelegate { * @see javax.xml.bind.JAXBContext * @see WebServiceFeature * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 **/ public abstract Dispatch createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java index c99a4e88260..39c0f25e3c4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java @@ -65,7 +65,7 @@ import javax.xml.ws.soap.MTOM; * @see MTOM * @see RespectBinding * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ @Target(ElementType.ANNOTATION_TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpContext.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpContext.java index aca0e3fb487..f62458455ac 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpContext.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpContext.java @@ -37,7 +37,7 @@ import java.util.Set; * web service requests to corresponding HttpContext objects. * * @author Jitendra Kotamraju - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public abstract class HttpContext { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpExchange.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpExchange.java index 233a48d084d..7b275ffb176 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpExchange.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpExchange.java @@ -46,7 +46,7 @@ import java.security.Principal; * is undefined. * * @author Jitendra Kotamraju - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public abstract class HttpExchange { diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpHandler.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpHandler.java index 8d11ea35c83..cafc48ee47e 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpHandler.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/HttpHandler.java @@ -36,7 +36,7 @@ import java.io.IOException; * {@link Endpoint#publish(HttpContext) } * * @author Jitendra Kotamraju - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public abstract class HttpHandler { /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/package-info.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/package-info.java index 87f37c76bb9..d105948e7f4 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/package-info.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/spi/http/package-info.java @@ -90,6 +90,6 @@ @author Jitendra Kotamraju - @since JAX-WS 2.2 + @since 1.7, JAX-WS 2.2 */ package javax.xml.ws.spi.http; diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java index a1bc3e2b9c2..3d58a30159d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java @@ -61,7 +61,7 @@ import java.util.Map; * WS-Addressing * for more information on WS-Addressing EndpointReferences. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ // XmlRootElement allows this class to be marshalled on its own diff --git a/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java b/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java index 5538a1e0261..fb33746531a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java @@ -62,7 +62,7 @@ import javax.xml.ws.spi.Provider; * endpointName (if specified) MUST match a service and port * in the WSDL document. * - * @since JAX-WS 2.1 + * @since 1.6, JAX-WS 2.1 */ public final class W3CEndpointReferenceBuilder { /** @@ -110,6 +110,7 @@ public final class W3CEndpointReferenceBuilder { * @return A W3CEndpointReferenceBuilder instance with * the interfaceName as wsam:InterfaceName * element added to the wsa:Metadata element + * @since 1.7 */ public W3CEndpointReferenceBuilder interfaceName(QName interfaceName) { this.interfaceName = interfaceName; @@ -253,7 +254,7 @@ public final class W3CEndpointReferenceBuilder { * @throws java.lang.IllegalArgumentException if element * is null. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public W3CEndpointReferenceBuilder element(Element element) { if (element == null) { @@ -277,7 +278,7 @@ public final class W3CEndpointReferenceBuilder { * @throws java.lang.IllegalArgumentException if name * or value is null. * - * @since JAX-WS 2.2 + * @since 1.7, JAX-WS 2.2 */ public W3CEndpointReferenceBuilder attribute(QName name, String value) { if (name == null || value == null) { From 89e241569b393b35b6d993097e3076dcd9c08ce9 Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Tue, 8 Jul 2014 16:01:18 +0400 Subject: [PATCH 002/111] 8043126: move awt automated functional tests from AWT_Events/Lw and AWT_Events/AWT to OpenJDK repository Reviewed-by: pchelko --- .../ExtendedModifiersTest.java | 271 +++++++ .../KeyEvent/KeyMaskTest/KeyMaskTest.java | 219 ++++++ .../MouseButtonsAndKeyMasksTest.java | 302 ++++++++ .../MouseButtonsTest/MouseButtonsTest.java | 254 ++++++ .../MultipleMouseButtonsTest.java | 237 ++++++ .../event/helpers/lwcomponents/LWButton.java | 418 ++++++++++ .../helpers/lwcomponents/LWComponent.java | 464 +++++++++++ .../event/helpers/lwcomponents/LWList.java | 726 ++++++++++++++++++ 8 files changed, 2891 insertions(+) create mode 100644 jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java create mode 100644 jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java create mode 100644 jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java create mode 100644 jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java create mode 100644 jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java create mode 100644 jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java create mode 100644 jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java create mode 100644 jdk/test/java/awt/event/helpers/lwcomponents/LWList.java diff --git a/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java b/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java new file mode 100644 index 00000000000..f6b00c4c1cf --- /dev/null +++ b/jdk/test/java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @bug 8043126 + * @summary Check whether + * 1. correct extended modifiers are returned + * by KeyEvent.getModifiersEx() + * 2. InputEvent.getModifiersExText() returns + * correct extended modifier keys description + * + * @library ../../../../../lib/testlibrary/ ../../helpers/lwcomponents/ + * @build LWComponent + * @build LWButton + * @build LWList + * @build ExtendedRobot + * @run main/timeout=600 ExtendedModifiersTest + */ + + +import java.awt.*; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.util.ArrayList; + +import static jdk.testlibrary.Asserts.*; +import test.java.awt.event.helpers.lwcomponents.LWButton; +import test.java.awt.event.helpers.lwcomponents.LWList; + + +public class ExtendedModifiersTest implements KeyListener { + + Frame frame; + + Button button; + LWButton buttonLW; + TextField textField; + TextArea textArea; + List list; + LWList listLW; + + private final ExtendedRobot robot; + private final static int robotDelay = 1000; + private final static int waitDelay = 5000; + private final static int keyDelay = 500; + + private final Object lock; + + private boolean keyPressedFlag = false; + + private int modifiersEx = 0; + private String exText = ""; + + + @Override + public void keyTyped(KeyEvent e) {} + + @Override + public void keyPressed(KeyEvent e) { + + if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { + return; + } + + modifiersEx = e.getModifiersEx(); + exText = InputEvent.getModifiersExText(modifiersEx); + keyPressedFlag = true; + + synchronized (lock) { lock.notifyAll(); } + } + + @Override + public void keyReleased(KeyEvent e) {} + + + public void createGUI() { + + frame = new Frame(); + frame.setTitle("ExtendedModifiersTest"); + frame.setLayout(new GridLayout(1, 6)); + + button = new Button(); + button.addKeyListener(this); + frame.add(button); + + buttonLW = new LWButton(); + buttonLW.addKeyListener(this); + frame.add(buttonLW); + + textField = new TextField(5); + textField.addKeyListener(this); + frame.add(textField); + + textArea = new TextArea(5, 5); + textArea.addKeyListener(this); + frame.add(textArea); + + list = new List(); + for (int i = 1; i <= 5; ++i) { list.add("item " + i); } + list.addKeyListener(this); + frame.add(list); + + listLW = new LWList(); + for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); } + listLW.addKeyListener(this); + frame.add(listLW); + + frame.setBackground(Color.gray); + frame.setSize(500, 100); + frame.setVisible(true); + frame.toFront(); + } + + public ExtendedModifiersTest() throws Exception { + lock = new Object(); + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( this::createGUI ); + } + + + private void runScenario(int keys[], int refMask) { + + if (keys.length < 1) { return; } + + for (int k = 0; k < keys.length; ++k) { + + keyPressedFlag = false; + robot.keyPress(keys[k]); + robot.delay(keyDelay); + + if (!keyPressedFlag) { + synchronized (lock) { + try { + lock.wait(waitDelay); + } catch (InterruptedException ex) {} + } + } + + if (!keyPressedFlag) { + robot.keyRelease(keys[k]); + robot.delay(keyDelay); + assertTrue(false, "key press event was not received"); + } + } + + int modEx = modifiersEx & refMask; + + for (int k = keys.length - 1; k >=0; --k) { + robot.keyRelease(keys[k]); + robot.delay(keyDelay); + } + + + assertEQ(modifiersEx, modEx, "invalid extended modifiers"); + + for (int k = 0; k < keys.length; ++k) { + String keyText = KeyEvent.getKeyText(keys[k]).toLowerCase(); + assertTrue(exText.toLowerCase().contains(keyText), "invalid extended modifier keys description"); + } + + System.out.println(exText + " : passed"); + + robot.type(KeyEvent.VK_ESCAPE); + + robot.delay(robotDelay); + } + + private void doTest() throws Exception { + + ArrayList components = new ArrayList(); + components.add(button); + components.add(buttonLW); + components.add(textField); + components.add(textArea); + components.add(list); + components.add(listLW); + + String OS = System.getProperty("os.name").toLowerCase(); + System.out.println(OS); + + for (Component c: components) { + + String className = c.getClass().getName(); + System.out.println("component class : " + className); + + Point origin = c.getLocationOnScreen(); + int xc = origin.x + c.getWidth() / 2; + int yc = origin.y + c.getHeight() / 2; + Point center = new Point(xc, yc); + + robot.delay(robotDelay); + robot.glide(origin, center); + robot.click(); + robot.delay(robotDelay); + + // 1. shift + control + runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, + InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + + // 2. alt + shift + control + runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, + InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + + // 3. shift + runScenario(new int[]{KeyEvent.VK_SHIFT}, + InputEvent.SHIFT_DOWN_MASK); + + // 4. alt + control + runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_CONTROL}, + InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + + // 5. shift + alt + runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_ALT}, + InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + + + if (OS.contains("os x") || OS.contains("sunos")) { + // 6. meta + runScenario(new int[]{KeyEvent.VK_META}, InputEvent.META_DOWN_MASK); + + // 7. shift + ctrl + alt + meta + runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META}, + InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK); + + // 8. meta + shift + ctrl + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, + InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + + // 9. meta + shift + alt + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT}, + InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + + // 10. meta + ctrl + alt + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT}, + InputEvent.META_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + } + } + + robot.waitForIdle(); + frame.dispose(); + } + + public static void main(String[] args) throws Exception { + ExtendedModifiersTest test = new ExtendedModifiersTest(); + test.doTest(); + } +} + diff --git a/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java b/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java new file mode 100644 index 00000000000..3400444ebbd --- /dev/null +++ b/jdk/test/java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test + * @bug 8043126 + * @summary Check whether KeyEvent.getModifiers() returns correct modifiers + * when Ctrl, Alt or Shift keys are pressed. + * + * @library ../../../../../lib/testlibrary/ ../../helpers/lwcomponents/ + * @build LWComponent + * @build LWButton + * @build LWList + * @build ExtendedRobot + * @run main/timeout=600 KeyMaskTest + */ + + +import java.awt.*; +import java.awt.event.InputEvent; + +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +import java.util.ArrayList; + +import static jdk.testlibrary.Asserts.*; + +import test.java.awt.event.helpers.lwcomponents.LWButton; +import test.java.awt.event.helpers.lwcomponents.LWList; + + + +public class KeyMaskTest extends KeyAdapter { + + Frame frame; + + Button button; + LWButton buttonLW; + TextField textField; + TextArea textArea; + List list; + LWList listLW; + + int buttonPressedNumber; + int buttonReleasedNumber; + + ExtendedRobot robot; + + private final static int robotDelay = 1500; + private final static int waitDelay = 3500; + + final Object lock; + + private boolean keyPressReceived = false; + private int keyCode = -1; + + KeyMaskTest() throws Exception { + lock = new Object(); + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( this::createGUI ); + } + + public void createGUI() { + + frame = new Frame(); + frame.setTitle("KeyMaskTest"); + frame.setLayout(new GridLayout(1, 6)); + + button = new Button(); + button.addKeyListener(this); + frame.add(button); + + buttonLW = new LWButton(); + buttonLW.addKeyListener(this); + frame.add(buttonLW); + + textField = new TextField(5); + textField.addKeyListener(this); + frame.add(textField); + + textArea = new TextArea(5, 5); + textArea.addKeyListener(this); + frame.add(textArea); + + list = new List(); + for (int i = 1; i <= 5; ++i) { list.add("item " + i); } + list.addKeyListener(this); + frame.add(list); + + listLW = new LWList(); + for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); } + listLW.addKeyListener(this); + frame.add(listLW); + + + frame.setBackground(Color.gray); + frame.setSize(500, 100); + frame.setVisible(true); + frame.toFront(); + } + + @Override + public void keyPressed(KeyEvent e) { + + keyPressReceived = true; + + int code = e.getKeyCode(); + + assertEQ(code, keyCode, "wrong key code"); + + int mask = 0; + + if (code == KeyEvent.VK_SHIFT) { + mask = InputEvent.SHIFT_MASK; + } else if (code == KeyEvent.VK_CONTROL) { + mask = InputEvent.CTRL_MASK; + } else if (code == KeyEvent.VK_ALT) { + mask = InputEvent.ALT_MASK; + } else if (code == KeyEvent.VK_META) { + mask = InputEvent.META_MASK; + } + + int mod = e.getModifiers() & mask; + assertEQ(mod, mask, "invalid key mask"); + + synchronized (lock) { lock.notifyAll(); } + } + + + void doTest() throws Exception { + + ArrayList components = new ArrayList(); + components.add(button); + components.add(buttonLW); + components.add(textField); + components.add(textArea); + components.add(list); + components.add(listLW); + + int keys[]; + String OS = System.getProperty("os.name").toLowerCase(); + System.out.println(OS); + if (OS.contains("os x") || OS.contains("sunos")) { + keys = new int[] {KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META}; + } else { + keys = new int[] {KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT}; + } + + for (Component c: components) { + + System.out.print(c.getClass().getName() + ": "); + + Point origin = c.getLocationOnScreen(); + int xc = origin.x + c.getWidth() / 2; + int yc = origin.y + c.getHeight() / 2; + Point center = new Point(xc, yc); + + robot.delay(robotDelay); + robot.glide(origin, center); + robot.click(); + robot.delay(robotDelay); + + for (int k = 0; k < keys.length; ++k) { + + keyPressReceived = false; + + keyCode = keys[k]; + + robot.type(keyCode); + + robot.delay(robotDelay); + + if (!keyPressReceived) { + synchronized (lock) { + try { + lock.wait(waitDelay); + } catch (InterruptedException e) {} + } + } + + assertTrue(keyPressReceived, "key press event was not received"); + } + + System.out.println("passed"); + } + + robot.waitForIdle(); + frame.dispose(); + } + + + public static void main(String[] args) throws Exception { + + KeyMaskTest test = new KeyMaskTest(); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java b/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java new file mode 100644 index 00000000000..850679c6d44 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; + +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; + +import static jdk.testlibrary.Asserts.*; + + +import test.java.awt.event.helpers.lwcomponents.LWButton; +import test.java.awt.event.helpers.lwcomponents.LWList; + + +/* + * @test + * @bug 8043126 + * @summary Check whether MouseEvent.getModifiers(), MouseEvent.getModifiersEx() + * and KeyEvent.getModifiers() return correct modifiers when pressing + * keys Ctrl, Alt, Shift, Meta and mouse buttons sequentially + * + * @library ../../../../../lib/testlibrary/ ../../helpers/lwcomponents/ + * @build LWComponent + * @build LWButton + * @build LWList + * @build ExtendedRobot + * @run main/timeout=600 MouseButtonsAndKeyMasksTest + */ + +public class MouseButtonsAndKeyMasksTest implements MouseListener, KeyListener { + + Frame frame; + + Button button; + LWButton buttonLW; + TextField textField; + TextArea textArea; + List list; + LWList listLW; + + ExtendedRobot robot; + + private final static int robotDelay = 1500; + private final static int keyDelay = 500; + private final static int waitDelay = 5000; + + int modMouse = 0, modMouseEx = 0, modKey = 0, modAction = 0; + + boolean mousePressFired = false; + boolean keyPressFired = false; + + final Object lock; + + MouseButtonsAndKeyMasksTest() throws Exception { + lock = new Object(); + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( this::createGUI ); + } + + public void createGUI() { + + frame = new Frame(); + frame.setTitle("MouseButtonsAndKeysTest"); + frame.setLayout(new GridLayout(1, 6)); + + button = new Button(); + button.addKeyListener(this); + button.addMouseListener(this); + frame.add(button); + + buttonLW = new LWButton(); + buttonLW.addKeyListener(this); + buttonLW.addMouseListener(this); + frame.add(buttonLW); + + textField = new TextField(5); + textField.addKeyListener(this); + textField.addMouseListener(this); + frame.add(textField); + + textArea = new TextArea(5, 5); + textArea.addKeyListener(this); + textArea.addMouseListener(this); + frame.add(textArea); + + list = new List(); + for (int i = 1; i <= 5; ++i) { list.add("item " + i); } + list.addKeyListener(this); + list.addMouseListener(this); + frame.add(list); + + listLW = new LWList(); + for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); } + listLW.addKeyListener(this); + listLW.addMouseListener(this); + frame.add(listLW); + + + frame.setBackground(Color.gray); + frame.setSize(500, 80); + frame.setVisible(true); + frame.toFront(); + } + + + @Override + public void mouseClicked(MouseEvent e) {} + + @Override + public void mousePressed(MouseEvent e) { + + modMouse = e.getModifiers(); + modMouseEx = e.getModifiersEx(); + mousePressFired = true; + synchronized (lock) { lock.notifyAll(); } + } + + @Override + public void mouseReleased(MouseEvent e) {} + @Override + public void mouseEntered(MouseEvent e) {} + @Override + public void mouseExited(MouseEvent e) {} + + + @Override + public void keyTyped(KeyEvent e) {} + + @Override + public void keyPressed(KeyEvent e) { + + if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { return; } + + keyPressFired = true; + modKey = e.getModifiers(); + + synchronized (lock) { lock.notifyAll(); } + } + + @Override + public void keyReleased(KeyEvent e) {} + + void doTest() throws Exception { + + int buttons[] = new int[]{ + InputEvent.BUTTON1_MASK, InputEvent.BUTTON2_MASK, InputEvent.BUTTON3_MASK}; + + int buttonsEx[] = new int[]{ + InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, InputEvent.BUTTON3_DOWN_MASK}; + + String OS = System.getProperty("os.name").toLowerCase(); + System.out.println(OS); + + int keyMods[], keyModsEx[], keys[]; + + + if (OS.contains("linux")) { + keyMods = new int[]{InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK}; + keyModsEx = new int[]{InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK}; + keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}; + } else if (OS.contains("os x")) { + keyMods = new int[]{ + InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK, InputEvent.ALT_MASK, InputEvent.META_MASK}; + keyModsEx = new int[]{ + InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.ALT_DOWN_MASK, InputEvent.META_DOWN_MASK}; + keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META}; + } else if (OS.contains("sunos")) { + keyMods = new int[]{InputEvent.SHIFT_MASK, InputEvent.META_MASK}; + keyModsEx = new int[]{InputEvent.SHIFT_DOWN_MASK, InputEvent.META_DOWN_MASK}; + keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_META}; + } else { + keyMods = new int[]{ + InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK, InputEvent.ALT_MASK}; + keyModsEx = new int[]{ + InputEvent.SHIFT_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.ALT_DOWN_MASK}; + keys = new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT}; + } + + + ArrayList components = new ArrayList(); + components.add(button); + components.add(buttonLW); + components.add(textField); + components.add(textArea); + components.add(list); + components.add(listLW); + + for (Component c: components) { + + System.out.println(c.getClass().getName() + ":"); + + Point origin = c.getLocationOnScreen(); + int xc = origin.x + c.getWidth() / 2; + int yc = origin.y + c.getHeight() / 2; + Point center = new Point(xc, yc); + + robot.delay(robotDelay); + robot.glide(origin, center); + robot.click(); + robot.delay(robotDelay); + + for (int b = 0; b < buttons.length; ++b) { + + int btn = buttons[b]; + + for (int k = 0; k < keys.length; ++k) { + + int key = keys[k]; + + System.out.print(KeyEvent.getKeyText(key) + " + button " + (b + 1)); + + robot.delay(robotDelay); + + robot.keyPress(key); + robot.delay(keyDelay); + + if (!keyPressFired) { + synchronized (lock) { + try { + lock.wait(waitDelay); + } catch (InterruptedException ex) {} + } + } + + if (!keyPressFired) { + robot.keyRelease(key); + assertTrue(false, "key press event was not received"); + } + + robot.mousePress(btn); + robot.delay(robotDelay); + + if (!mousePressFired) { + synchronized (lock) { + try { + lock.wait(waitDelay); + } catch (InterruptedException ex) {} + } + } + + assertTrue(mousePressFired, "mouse press event was not received"); + + robot.mouseRelease(btn); + robot.delay(robotDelay); + + // do checks + assertEQ(modMouse & btn, btn, "invalid mouse button mask"); + assertEQ(modKey & keyMods[k], keyMods[k], "invalid key mask"); + assertEQ(buttonsEx[b] | keyModsEx[k], modMouseEx, "invalid extended modifiers"); + + mousePressFired = false; + keyPressFired = false; + + robot.keyRelease(key); + robot.delay(keyDelay); + + robot.type(KeyEvent.VK_ESCAPE); + + robot.delay(robotDelay); + + System.out.println(" - passed"); + } + } + } + + robot.waitForIdle(); + frame.dispose(); + } + + + public static void main(String[] args) throws Exception { + + MouseButtonsAndKeyMasksTest test = new MouseButtonsAndKeyMasksTest(); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java b/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java new file mode 100644 index 00000000000..cc36b0c35b8 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; + +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import test.java.awt.event.helpers.lwcomponents.LWButton; +import test.java.awt.event.helpers.lwcomponents.LWList; + +import java.util.ArrayList; + +import static jdk.testlibrary.Asserts.*; + +/* + * @test + * @bug 8043126 + * @summary Check whether getButton() returns correct mouse button + * number when the mouse buttons are pressed and getModifiers() + * returns correct modifiers + * + * @library ../../../../../lib/testlibrary/ ../../helpers/lwcomponents/ + * @build LWComponent + * @build LWButton + * @build LWList + * @build ExtendedRobot + * @run main/timeout=600 MouseButtonsTest + */ + +public class MouseButtonsTest implements MouseListener { + + private Frame frame; + + private Button button; + private LWButton buttonLW; + private TextField textField; + private TextArea textArea; + private List list; + private LWList listLW; + + private int buttonPressedNumber = 0; + private int buttonReleasedNumber = 0; + private int modifiers = 0; + + + private final ExtendedRobot robot; + + private final static int robotDelay = 1000; + private final static int waitDelay = 3500; + + private boolean released = false; + private boolean pressed = false; + private final Object lock; + + + MouseButtonsTest() throws Exception { + lock = new Object(); + robot = new ExtendedRobot(); + EventQueue.invokeAndWait( this::createGUI ); + } + + public void createGUI() { + + frame = new Frame(); + frame.setTitle("MouseButtonsTest"); + frame.setLayout(new GridLayout(1, 6)); + + button = new Button(); + button.addMouseListener(this); + frame.add(button); + + buttonLW = new LWButton(); + buttonLW.addMouseListener(this); + frame.add(buttonLW); + + textField = new TextField(5); + textField.addMouseListener(this); + frame.add(textField); + + textArea = new TextArea(5, 5); + textArea.addMouseListener(this); + frame.add(textArea); + + list = new List(); + for (int i = 1; i <= 5; ++i) { list.add("item " + i); } + list.addMouseListener(this); + frame.add(list); + + listLW = new LWList(); + for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); } + listLW.addMouseListener(this); + frame.add(listLW); + + + frame.setBackground(Color.gray); + frame.setSize(500, 100); + frame.setVisible(true); + frame.toFront(); + } + + + @Override + public void mouseClicked(MouseEvent e) {} + + @Override + public void mousePressed(MouseEvent e) { + + assertFalse(e.getButton() == MouseEvent.NOBUTTON, "invalid button"); + + buttonPressedNumber = e.getButton(); + modifiers = e.getModifiers(); + + pressed = true; + + synchronized (lock) { + try { + lock.notifyAll(); + } catch (Exception ex) {} + } + } + + @Override + public void mouseReleased(MouseEvent e) { + + assertFalse(e.getButton() == MouseEvent.NOBUTTON, "invalid button"); + + buttonReleasedNumber = e.getButton(); + modifiers = e.getModifiers(); + + released = true; + + synchronized (lock) { + try { + lock.notifyAll(); + } catch (Exception ex) {} + } + } + + @Override + public void mouseEntered(MouseEvent e) {} + + @Override + public void mouseExited(MouseEvent e) {} + + + void doTest() throws Exception { + + int masks[] = new int[]{ + InputEvent.BUTTON1_MASK, InputEvent.BUTTON2_MASK, InputEvent.BUTTON3_MASK}; + + int buttons[] = new int[]{ + MouseEvent.BUTTON1, MouseEvent.BUTTON2, MouseEvent.BUTTON3}; + + ArrayList components = new ArrayList(); + components.add(button); + components.add(buttonLW); + components.add(textField); + components.add(textArea); + components.add(list); + components.add(listLW); + + for (Component c: components) { + + System.out.println(c.getClass().getName() + ":"); + + Point origin = c.getLocationOnScreen(); + int xc = origin.x + c.getWidth() / 2; + int yc = origin.y + c.getHeight() / 2; + Point center = new Point(xc, yc); + + robot.delay(robotDelay); + robot.glide(origin, center); + robot.click(); + robot.delay(robotDelay); + + for (int i = 0; i < masks.length; ++i) { + + pressed = false; + released = false; + + int mask = masks[i]; + robot.mousePress(mask); + robot.delay(robotDelay); + + if (!pressed) { + synchronized (lock) { + try { + lock.wait(waitDelay); + } catch (InterruptedException ex) {} + } + } + + assertTrue(pressed, "mouse press event was not received"); + assertEQ((modifiers & mask), mask, "invalid mask modifiers"); + + robot.mouseRelease(mask); + robot.delay(robotDelay); + + if (!released) { + synchronized (lock) { + try { + lock.wait(waitDelay); + } catch (InterruptedException ex) {} + } + } + + assertTrue(released, "mouse release event was not received"); + assertEQ((modifiers & mask), mask, "invalid mask modifiers"); + + assertEquals(buttonPressedNumber, buttons[i]); + assertEquals(buttonReleasedNumber, buttons[i]); + + robot.type(KeyEvent.VK_ESCAPE); + robot.delay(robotDelay); + + System.out.println("button " + buttons[i] + " - passed"); + } + } + + robot.waitForIdle(); + frame.dispose(); + } + + + public static void main(String[] args) throws Exception { + + MouseButtonsTest test = new MouseButtonsTest(); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java b/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java new file mode 100644 index 00000000000..df143b78c05 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.*; +import java.util.ArrayList; + +import test.java.awt.event.helpers.lwcomponents.LWButton; +import test.java.awt.event.helpers.lwcomponents.LWList; + +import static jdk.testlibrary.Asserts.*; + +/* + * @test + * @bug 8043126 + * @summary Check whether correct modifiers set when multiple mouse buttons were pressed; + * check number of received events. + * + * @library ../../../../../lib/testlibrary/ ../../helpers/lwcomponents/ + * @build LWComponent + * @build LWButton + * @build LWList + * @build ExtendedRobot + * @run main/timeout=600 MultipleMouseButtonsTest + */ + + +public class MultipleMouseButtonsTest implements MouseListener { + + private final static int robotDelay = 1000; + + private final ExtendedRobot robot; + private final Object lock = new Object(); + + private Frame frame; + + private Button button; + private LWButton buttonLW; + private TextField textField; + private TextArea textArea; + private List list; + private LWList listLW; + + private int eventCount; + private int testCount; + private boolean pressed = false; + private int modifiers = 0; + private int modifiersEx = 0; + + private boolean countEvents = false; + + + public void createGUI() { + + frame = new Frame("MultipleMouseButtonTest"); + frame.setLayout(new GridLayout(1, 6)); + + button = new Button(); + button.addMouseListener(this); + frame.add(button); + + buttonLW = new LWButton(); + buttonLW.addMouseListener(this); + frame.add(buttonLW); + + textField = new TextField(5); + textField.addMouseListener(this); + frame.add(textField); + + textArea = new TextArea(5, 5); + textArea.addMouseListener(this); + frame.add(textArea); + + list = new List(); + for (int i = 1; i <= 5; ++i) { list.add("item " + i); } + list.addMouseListener(this); + frame.add(list); + + listLW = new LWList(); + for (int i = 1; i <= 5; ++i) { listLW.add("item " + i); } + listLW.addMouseListener(this); + frame.add(listLW); + + frame.setBackground(Color.gray); + frame.setSize(500, 100); + frame.setVisible(true); + frame.toFront(); + } + + @Override + public void mouseClicked(MouseEvent e) {} + @Override + public void mouseEntered(MouseEvent e) {} + @Override + public void mouseExited (MouseEvent e) {} + + @Override + public void mousePressed(MouseEvent e) { + + if (!countEvents) { return; } + + ++eventCount; + + pressed = true; + modifiers = e.getModifiers(); + modifiersEx = e.getModifiersEx(); + + synchronized (lock) { lock.notifyAll(); } + } + + @Override + public void mouseReleased(MouseEvent e) { + + if (countEvents) { + ++eventCount; + } + } + + MultipleMouseButtonsTest() throws Exception { + this.robot = new ExtendedRobot(); + EventQueue.invokeAndWait( this::createGUI ); + } + + void doTest() throws Exception { + + int masks[] = new int[]{InputEvent.BUTTON1_MASK, InputEvent.BUTTON2_MASK, InputEvent.BUTTON3_MASK}; + int masksEx[] = new int[]{InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, InputEvent.BUTTON3_DOWN_MASK}; + + robot.waitForIdle(); + + ArrayList components = new ArrayList(); + components.add(button); + components.add(buttonLW); + components.add(textField); + components.add(textArea); + components.add(list); + components.add(listLW); + + for (Component c: components) { + + System.out.println(c.getClass().getName() + ": "); + + Point origin = c.getLocationOnScreen(); + + int xc = origin.x + c.getWidth() / 2; + int yc = origin.y + c.getHeight() / 2; + Point center = new Point(xc, yc); + + robot.delay(robotDelay); + robot.mouseMove(origin); + robot.delay(robotDelay); + robot.glide(origin, center); + robot.delay(robotDelay); + robot.click(); + robot.delay(robotDelay); + + testCount = 0; + eventCount = 0; + + for (int i = 0; i < masks.length; ++i) { + + for (int k = 0; k < masks.length; ++k) { + if (k == i) { continue; } + + countEvents = false; + robot.mousePress(masks[i]); + robot.delay(robotDelay); + + countEvents = true; + + pressed = false; + + robot.mousePress(masks[k]); + robot.delay(robotDelay); + ++testCount; + + if (!pressed) { + synchronized (lock) { + try { + lock.wait(3 * robotDelay); + } catch (InterruptedException ex) {} + } + } + + assertTrue(pressed, "mouse press event was not received"); + + assertEQ(modifiers & masks[k], masks[k], "invalid modifiers"); + assertEQ(modifiersEx & masksEx[i], masksEx[i], "invalid extended modifiers"); + + robot.mouseRelease(masks[k]); + robot.delay(robotDelay); + ++testCount; + + countEvents = false; + + robot.mouseRelease(masks[i]); + robot.delay(robotDelay); + + robot.type(KeyEvent.VK_ESCAPE); + robot.delay(robotDelay); + } //k + } //i + + assertEquals(testCount, eventCount, "different amount of sent and received events"); + System.out.println("passed"); + } //component + + robot.waitForIdle(); + frame.dispose(); + } + + public static void main(String[] args) throws Exception { + + MultipleMouseButtonsTest test = new MultipleMouseButtonsTest(); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java b/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java new file mode 100644 index 00000000000..866844e1ce7 --- /dev/null +++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWButton.java @@ -0,0 +1,418 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package test.java.awt.event.helpers.lwcomponents; + +import java.awt.*; +import java.awt.event.*; + +/** + * Lightweight Button component with some nice features. This + * component provides the capabilities of Buttons, namely that you it + * displays a label string and, when clicked, causes the + * ActionListener method to be called.

    + * + * The look of the button is a little unusual. There are three + * rectangles drawn at the border that indicate various states + * of the button. These are (listed from outside in)

    + *

      + *
    1. Focus: Indicates that the LWButton has the focus. + *
    2. Mouse Over: Indicates that the mouse is over the component. + *
    3. Mouse Pressed: Indicates that the mouse has been pressed. + *
    + * + * In addition, when the button has been activated (mouse clicked or + * via keyboard activation) the button flashes briefly. + */ + +public class LWButton extends LWComponent { + + /* + * The button's Label. + * If Label is not specified it will default to "". + * @serial + * @see getLabel() + * @see setLabel() + */ + private String label; + private boolean isInClick = false; + + private static final String base = "LWButton"; + private static int nameCounter = 0; + + private transient ActionListener actionListener; + + /* + * The action to be performaed once a button has been + * pressed. + * actionCommand can be null. + * @serial + * @see getActionCommand() + * @see setActionCommand() + */ + String actionCommand; + + Color colMousePressed; + + public LWButton() { this(""); } + + public LWButton(String label) { + this(label, Color.red, Color.green, Color.white); + } + + /** + * Initialize the LWButton, fully specifying all parameters. + * @param label The string to display. + * @param fgnd The color to draw the label in. + * @param bkgnd The color of the button itself. + * @param mousePressed The Color of the MousePressed rectangle. + */ + public LWButton(String label, Color fgnd, Color bkgnd, Color mousePressed) { + super(); + this.label = label; + setBackground(fgnd); + setForeground(bkgnd); + colMousePressed = mousePressed; + setName(makeComponentName()); + + enableEvents( AWTEvent.MOUSE_EVENT_MASK + | AWTEvent.KEY_EVENT_MASK + | AWTEvent.ACTION_EVENT_MASK); + setEnabled(true); + } + + /** + * Make the component flash briefly. + */ + public void flash() { + isInClick = true; + repaint(); + + class unClicker implements Runnable { + @Override + public void run() { + try { Thread.sleep(100); } catch (InterruptedException ee) {} + isInClick = false; + repaint(); + } + } + try { + unClicker uc = new unClicker(); + new Thread(uc).start(); + } catch (Exception e) { + // In case we're in an applet and the security has not been + // turned off (in which case we can't start a new thread) + // we can catch that and set the flag back to how it should be. + isInClick = false; + repaint(); + } + } + + /** + * Set the MousePressed color (the color shown in the MousePressed rectangle + * when the mouse is over the component). + * @param c The color of the MousePressed rectangle. + */ + public void setMousePressedColor(Color c) { colMousePressed = c; } + + /** + * Get the MousePressed color. + * @return The color of the MousePressed rectangle. + */ + public Color getMousePressedColor() { return colMousePressed; } + + /** + * Used to dispatch out the ActionEvent for a corresponding InputEvent. + * @param e The InputEvent that is causing the ActionEvent dispatch. + */ + private void sendActionEvent(InputEvent e) { + + int modifiers = e.getModifiers(); + int aModifiers = 0; + + if ((modifiers & MouseEvent.SHIFT_MASK) != 0) { + aModifiers |= ActionEvent.SHIFT_MASK; + } + if ((modifiers & MouseEvent.CTRL_MASK) != 0) { + aModifiers |= ActionEvent.CTRL_MASK; + } + if ((modifiers & MouseEvent.META_MASK) != 0) { + aModifiers |= ActionEvent.META_MASK; + } + if ((modifiers & MouseEvent.ALT_MASK) != 0) { + aModifiers |= ActionEvent.ALT_MASK; + } + + ActionEvent ae = new ActionEvent(this, + ActionEvent.ACTION_PERFORMED, + actionCommand, + aModifiers); + // XXX: What's the right way to send out the ActionEvent? + // My assumption was to put it into the system event queue + // and the it will be dispatched back into processEvent + // for us. However this doesn't happen...? + if (actionListener != null) { + actionListener.actionPerformed(ae); + } + //Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(ae); + } + + /** + * Set whether the component is enabled ({@code true}) or not. + * @param enabled If {@code true}, the component is to be enabled. + */ + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + + if (enabled) { + enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK); + } else { + disableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK); + } + repaint(1); + } + + /** + * Indicates that LWButton component can receive focus. + * @return {@code true} if the LWButton component can receive focus + */ + @Override + public boolean isFocusTraversable() { return true; } + + /** + * Construct a name for this component. Called by getName() when the + * name is null. + */ + String makeComponentName() { + synchronized (getClass()) { + return base + nameCounter++; + } + } + + /** + * Handle painting the enabled version of the component. + * + * ASSUMES: g.color may be changed + */ + @Override + public void paint(Graphics g) { + + super.paint(g); + restrictGraphicsToClientArea(g); + + Dimension dim = getClientSize(); + + int s = Math.min(dim.width - 1, dim.height - 1); + + if (isInClick) { + g.setColor(Color.white); + } else { + g.setColor(getBackground()); + } + + // In jdk 1.2 (pre-release) there was a bug using clearRect + // to paint the background of a lightweight. + //g.clearRect(loc.x, loc.y, dim.width, dim.height); + g.fillRect(0, 0, dim.width, dim.height); + + if (mouseB1Pressed) { + g.setColor(colMousePressed); + //LWComponent.traceMsg("paint mousePressed " + this.toString()); + g.drawRect(1, 1, dim.width - 3, dim.height - 3); + } + + Font f = getFont(); + if (f != null) { + FontMetrics fm = getFontMetrics(f); + g.setColor(getForeground()); + g.drawString(label, + s/2 - fm.stringWidth(label)/2, + s/2 + fm.getMaxDescent()); + } + + unrestrictGraphicsFromClientArea(g); + } + + @Override + public Dimension getPreferredSize() { + Font f = getFont(); + if (f != null) { + FontMetrics fm = getFontMetrics(f); + int max = Math.max(fm.stringWidth(label) + 40, fm.getHeight() + 40); + return new Dimension(max, max); + } else { + return new Dimension(100, 100); + } + } + + @Override + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + /** + * Get the text displayed in the LWButton. + * @return the text displayed in the LWButton + */ + public String getText() { return label; } + + /** + * Set the text displayed in the LWButton. + * @param s The text to be displayed. + */ + public void setText(String s) { + Font f = getFont(); + int oWidth = 0; + int oHeight = 0; + int nWidth = 0; + int nHeight = 0; + int invalidated = 0; + FontMetrics fm = null; + + if (f != null) { + fm = getFontMetrics(f); + oWidth = fm.stringWidth(label); + oHeight = fm.getHeight(); + } + + this.label = s; + + if (f != null) { + nWidth = fm.stringWidth(label); + nHeight = fm.getHeight(); + + if ((nWidth > oWidth) || (nHeight > oHeight)) { + invalidate(); + invalidated = 1; + } + } + + if (invalidated == 0) { + repaint(); + } + } + + /** + * Set the command name for the action event fired + * by this button. By default this action command is + * set to match the label of the button. + * @param command A string used to set the button's + * action command. + * If the string is null then the action command + * is set to match the label of the button. + * @see java.awt.event.ActionEvent + * @since JDK1.1 + */ + public void setActionCommand(String command) { + actionCommand = command; + } + + /** + * Returns the command name of the action event fired by this button. + * If the command name is {@code null} (default) then this method + * returns the label of the button. + * + * @return the command name of the action event fired by this button + * or the label of the button (in case of {@code null}) + */ + public String getActionCommand() { + return (actionCommand == null? label : actionCommand); + } + + /** + * Add the specified action listener to receive action events from + * this button. Action events occur when a user presses or releases + * the mouse over this button. + * @param l the action listener. + * @see java.awt.event.ActionListener + * @see #removeActionListener + * @since JDK1.1 + */ + public synchronized void addActionListener(ActionListener l) { + actionListener = AWTEventMulticaster.add(actionListener, l); + enableEvents(AWTEvent.MOUSE_EVENT_MASK); + } + + /** + * Remove the specified action listener so that it no longer + * receives action events from this button. Action events occur + * when a user presses or releases the mouse over this button. + * @param l the action listener. + * @see java.awt.event.ActionListener + * @see #addActionListener + * @since JDK1.1 + */ + public synchronized void removeActionListener(ActionListener l) { + actionListener = AWTEventMulticaster.remove(actionListener, l); + } + + @Override + protected void processKeyEvent(KeyEvent e) { + super.processKeyEvent(e); + if (!isEnabled()) { return; } + switch(e.getID()) { + case KeyEvent.KEY_TYPED: + switch (e.getKeyCode()) { + case KeyEvent.VK_ENTER: + case KeyEvent.VK_SPACE: + flash(); + sendActionEvent(e); + break; + } + break; + } + } + + @Override + protected void processMouseEvent(MouseEvent e) { + super.processMouseEvent(e); + if (!isEnabled()) { return; } + switch(e.getID()) { + case MouseEvent.MOUSE_PRESSED: + requestFocus(); + repaint(); + break; + case MouseEvent.MOUSE_RELEASED: + repaint(); + break; + case MouseEvent.MOUSE_CLICKED: + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) { + flash(); + sendActionEvent(e); + } + break; + } + } + + /** + * Returns the parameter string representing the state of this + * button. This string is useful for debugging. + * @return the parameter string of this button. + */ + @Override + protected String paramString() { + return super.paramString() + ", label = " + label; + } + +} diff --git a/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java b/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java new file mode 100644 index 00000000000..2209d0c107a --- /dev/null +++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWComponent.java @@ -0,0 +1,464 @@ +/* + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package test.java.awt.event.helpers.lwcomponents; + +import java.io.*; +import java.awt.*; +import java.awt.event.*; + +/** + * This is experimental - The idea is to subclass all the LW components + * from LWComponent to provide for some common capabilities. The main + * capability to be provided is the status rectangles as done for LWButton. + * In particular the Focus and MouseOver rectangles are generically + * useful, while other rectangles might be useful to other components.

    + * + * To implement that, here is the idea ... borrowed from Win32 ... Each + * of the LW components has both a client and non-client region. We + * call paintNC to paint the non-client region (Focus and MouseOver + * rectangles), and the subclass might be permitted to implement paintNC + * but for now they aren't.

    + * + * Then the paint{Enabled,Disabled} methods are called as appropriate. + * Note that paintDisabled is implemented in LWComponent to call paintEnabled + * then stipple over the top of it.

    + * + * So it is paintEnabled that the component should implement. This method + * needs to know the dimensions of the client area (getClientRegion?) and + * the Graphics needs to have it's clip region set appropriately.

    + * + * KVETCHING: Kvetch is a Yiddish word which means, basically, + * to complain very precisely. The LWComponent family tracks various pieces + * of information over time that are used to check closely for correct behavior + * in some circumstances. The method kvetch is where this code lives + * and is intended to check a broad range of conditions.

    + * + * To turn off specific kvetch's, one simply specifies a System property + * as in this table:

    + * + * + * + * + * + * + * + * + *
    Property nameValueDiscussion
    javasoft.awtsqe.lw.IGNORE_FOCUS_KVETCHtrue or falseSpecify whether the hasFocus kvetch is checked.

    + * + * XXX To implement - specifying colors. NCBackground, + * FocusRectColor, MouseOverColor are the threee colors. paintNC + * fills the NC region with NCBackground, and then pains the two + * colors as appropriate. There needs to be methods to get/specify + * these colors.

    + * + * XXX To implement - Specifying the component name and toString(). + * The subclass should only give the base class name, and a method + * in LWComponent should construct a name from that. For toString() + * there needs to be a small amount of infrastructure built.

    + */ + +public abstract class LWComponent extends Component { + + protected static Color ncBackgroundColor; + protected static Color focusColor; + protected static Color focusWrongColor; + protected static Color mouseOverColor; + + static { + ncBackgroundColor = Color.white; + focusColor = Color.black; + focusWrongColor = Color.magenta; + mouseOverColor = Color.blue; + } + + /** + * Flag indicating whether our records indicate that the component + * should have focus. + */ + protected boolean _shouldHaveFocus = false; + protected boolean _shouldBeShowing = false; + + protected boolean mouseB1Pressed = false; + protected boolean mouseB2Pressed = false; + protected boolean mouseB3Pressed = false; + protected boolean mouseInside = false; + + protected static boolean tracingOn = false; + protected static PrintStream traceOutput = null; + + // Uncommenting these lines turns on tracing for the package. + // static { + // tracingOn = true; + // traceOutput = System.err; + // } + + public LWComponent() { + enableEvents(AWTEvent.MOUSE_EVENT_MASK + /*| AWTEvent.MOUSE_MOTION_EVENT_MASK*/ + | AWTEvent.FOCUS_EVENT_MASK + | AWTEvent.COMPONENT_EVENT_MASK); + } + + /** + * Print out an error message. + * @param msg the message + */ + public static void errorMsg(String msg) { + System.err.println("ERROR: " + msg); + } + + /** + * Print out a tracing message + * @param msg the message + */ + public static void traceMsg(String msg) { + if (LWComponent.tracingOn) { + LWComponent.traceOutput.println(msg); + } + } + + ///////////////////////////////////////////// + /////// FLAGS FOR IGNORING KVETCH's ///////// + ///////////////////////////////////////////// + + static boolean bIgnFocus = false; + + static { + // Initialize the kvetch ignoring flags here. + String ignFocus = System.getProperty("javasoft.awtsqe.lw.IGNORE_FOCUS_KVETCH", + "false"); + bIgnFocus = ignFocus.trim().toLowerCase().equals("true"); + } + + /** + * Check the shoulds and return a string indicating which + * do not match the components actual state. + * + * @return the string indicating which do not match the components actual state + */ + public String kvetch() { + String ret = this.toString(); + boolean errors = false; + + if (!bIgnFocus) { + if (hasFocus()) { + if (!shouldHaveFocus()) { + ret += "\nERROR: hasFocus indicates we have Focus, when we shouldn't."; + errors = true; + } + } else { + if (shouldHaveFocus()) { + ret += "\nERROR: (see bug#4233658) hasFocus does not indicate we have Focus, when we should."; + errors = true; + } + } + } + + if (errors) { + return ret; + } else { + return null; + } + } + + /** + * Check the shoulds and return a string indicating which + * do not match the components actual state. Prints the output + * to the given PrintStream. + * @param out The PrintStream to print to. + */ + public void kvetch(PrintStream out) { + if (out != null) { + String s = kvetch(); + if (s != null) { + LWComponent.errorMsg(s); + } + } + } + + /** + * Turn on tracing for the LWComponent family. + * @param out the output stream + */ + public static void startTracing(PrintStream out) { + tracingOn = true; + traceOutput = out; + } + + /** + * Turn off tracing for the LWComponent family. + */ + public static void stopTracing() { tracingOn = false; traceOutput = null; } + + /** + * Indicate whether it is believed the component should have focus. + * @return {@code true} if the component should have focus + */ + public boolean shouldHaveFocus() { return _shouldHaveFocus; } + + /** + * Indicate whether it is believed the component should be showing. + * @return {@code true} if the component should be showing + */ + public boolean shouldBeShowing() { return _shouldBeShowing; } + + @Override + protected void processFocusEvent(FocusEvent e) { + super.processFocusEvent(e); + LWComponent.traceMsg("processFocusEvent " + e.toString()); + switch (e.getID()) { + case FocusEvent.FOCUS_GAINED: + _shouldHaveFocus = true; + repaint(); + break; + case FocusEvent.FOCUS_LOST: + _shouldHaveFocus = false; + repaint(); + break; + } + } + + @Override + protected void processComponentEvent(ComponentEvent e) { + super.processComponentEvent(e); + LWComponent.traceMsg("processComponentEvent " + e.toString()); + switch (e.getID()) { + case ComponentEvent.COMPONENT_MOVED: break; + case ComponentEvent.COMPONENT_RESIZED: break; + case ComponentEvent.COMPONENT_SHOWN: _shouldBeShowing = true; break; + case ComponentEvent.COMPONENT_HIDDEN: _shouldBeShowing = false; break; + } + } + + @Override + protected void processMouseEvent(MouseEvent e) { + int mod = e.getModifiers(); + super.processMouseEvent(e); + LWComponent.traceMsg("processMouseEvent " + e.toString()); + switch (e.getID()) { + case MouseEvent.MOUSE_PRESSED: + if ((mod & MouseEvent.BUTTON1_MASK) != 0) { + if (mouseB1Pressed) { + errorMsg("ERROR: MOUSE_PRESSED for B1 when already pressed, on " + + this.toString()); + } + mouseB1Pressed = true; + break; + } + if ((mod & MouseEvent.BUTTON2_MASK) != 0) { + if (mouseB2Pressed) { + errorMsg("ERROR: MOUSE_PRESSED for B2 when already pressed, on " + + this.toString()); + } + mouseB2Pressed = true; + break; + } + if ((mod & MouseEvent.BUTTON3_MASK) != 0) { + if (mouseB3Pressed) { + errorMsg("ERROR: MOUSE_PRESSED for B3 when already pressed, on " + + this.toString()); + } + mouseB3Pressed = true; + break; + } + repaint(); + break; + case MouseEvent.MOUSE_RELEASED: + if ((mod & MouseEvent.BUTTON1_MASK) != 0) { + if (!mouseB1Pressed) { + errorMsg("ERROR: MOUSE_RELEASED for B1 when not pressed, on " + + this.toString()); + } + mouseB1Pressed = false; + break; + } + if ((mod & MouseEvent.BUTTON2_MASK) != 0) { + if (!mouseB2Pressed) { + errorMsg("ERROR: MOUSE_RELEASED for B2 when not pressed, on " + + this.toString()); + } + mouseB2Pressed = false; + break; + } + if ((mod & MouseEvent.BUTTON3_MASK) != 0) { + if (!mouseB3Pressed) { + errorMsg("ERROR: MOUSE_RELEASED for B3 when not pressed, on " + + this.toString()); + } + mouseB3Pressed = false; + break; + } + repaint(); + break; + case MouseEvent.MOUSE_CLICKED: + break; + case MouseEvent.MOUSE_ENTERED: + if (mouseInside) { + errorMsg("ERROR: MOUSE_ENTERED when mouse already inside component, on " + + this.toString()); + } + mouseInside = true; + repaint(); + break; + case MouseEvent.MOUSE_EXITED: + if (!mouseInside) { + errorMsg("ERROR: MOUSE_EXITED when mouse not inside component, on " + + this.toString()); + } + mouseInside = false; + repaint(); + break; + case MouseEvent.MOUSE_MOVED: + break; + case MouseEvent.MOUSE_DRAGGED: + break; + } + } + + public Point getClientLocation() { + return new Point(5, 5); + } + + public Dimension getClientSize() { + Dimension dim = getSize(); + dim.width -= 10; + dim.height -= 10; + return dim; + } + + public Rectangle getClientBounds() { + Dimension dim = getClientSize(); + return new Rectangle(5, 5, dim.width, dim.height); + } + + public int getClientX() { return 5; } + public int getClientY() { return 5; } + + /** + * Set the color used for painting the non-client area of the component. + * The default for this is Color.white. + * + * @param c The new color to use. + */ + public void setNonClientColor(Color c) { + LWComponent.ncBackgroundColor = c; + } + + /** + * Handle painting for the component. + */ + @Override + public void paint(Graphics g) { + Dimension dim = getSize(); + + kvetch(System.err); + + Color saveColor = g.getColor(); + super.paint(g); + + // ------------------- Paint the background ----------------- + + // In jdk 1.2 (pre-release) there was a bug using clearRect + // to paint the background of a lightweight. + //g.clearRect(0, 0, dim.width, dim.height); + g.setColor(getBackground()); + g.fillRect(0, 0, dim.width, dim.height); + + // ------------------- Paint the non-client area ------------ + + g.setColor(ncBackgroundColor); + // x y width height + g.fillRect(0, 0, dim.width, 5); + g.fillRect(0, 5, 5, dim.height - 10); + g.fillRect(dim.width - 5, 5, 5, dim.height - 10); + g.fillRect(0, dim.height - 5, dim.width, 5); + + if (shouldHaveFocus() || hasFocus()) { + g.setColor(shouldHaveFocus() && hasFocus() + ? focusColor + : focusWrongColor); + g.drawRect(1, 1, dim.width - 3, dim.height - 3); + } + + if (mouseInside) { + g.setColor(mouseOverColor); + g.drawRect(3, 3, dim.width - 7, dim.height - 7); + } + + // ------------------- Paint disabledness, if true ----------- + + if (!isEnabled()) { + g.setColor(getBackground()); + Dimension size = getSize(); + int borderThickness = 0; + int startX = borderThickness; + int startY = borderThickness; + int endX = startX + size.width - 2 * borderThickness - 2; + int endY = startY + size.height - 2 * borderThickness - 2; + int x, y; + for (y = startY; y <= endY; y += 1) { + for (x = startX + (y % 2); x <= endX; x += 2) { + g.fillRect(x, y, 1, 1); + } // x + } // y + } + + g.setColor(saveColor); + } + + /** + * Restricts the Graphics to be within the "client area" of the + * component. Recall that the LWComponent series of components has + * a "non-client area" of 5 pixels wide in which it draws two + * status rectangles showing mouse-over and has-focus status.

    + * + * Child classes of LWComponent are to call {@code restrictGraphicsToClientArea} + * at the beginning of their {@code paint} method, and then call + * {@code unrestrictGraphicsFromClientArea} afterwards.

    + * + * In order to make those paint methods as convenient as possible, these + * two methods make it appear as if the Graphics available to the + * component is slightly smaller than it really is, by the amount + * used in the non-client area (5 pixel wide border).

    + * + * @param g The Graphics to restrict. + */ + public void restrictGraphicsToClientArea(Graphics g) { + Dimension dim = getSize(); + g.translate(5, 5); + g.setClip(0, 0, dim.width - 10, dim.height - 10); + } + + /** + * Undo the restriction done in restrictGraphicsToClientArea. + * + * @param g The Graphics to unrestrict. + */ + public void unrestrictGraphicsFromClientArea(Graphics g) { + g.translate(-5, -5); + Dimension dim = getSize(); + g.setClip(0, 0, dim.width, dim.height); + } + +} diff --git a/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java b/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java new file mode 100644 index 00000000000..d08a3141340 --- /dev/null +++ b/jdk/test/java/awt/event/helpers/lwcomponents/LWList.java @@ -0,0 +1,726 @@ +/* + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package test.java.awt.event.helpers.lwcomponents; + +import java.awt.*; +import java.awt.event.*; +import java.util.Vector; +import java.util.Enumeration; + +/** + * Remarks : Source for LightWeight component - List. + * + * Scroll bar support is not available for this component, so if the + * items exceeds visibility those items will be truncated. Also, here + * double buffering is not used so there will be little bit flickering + * while it repaints. Item listener support is not enabled in this + * component. Listeners handled were Mouse, Key and Focus. + * + * @author R.Govindarajan (govind@siptech.co.in), G.N.V.Sekhar (sekharv@siptech.co.in) + */ + +public class LWList extends LWComponent implements ItemSelectable { + + // Constants used for component size + private final int MIN_WIDTH = 100; + private final int MIN_HEIGHT = 100; + private final int PREF_WIDTH = 100; + private final int PREF_HEIGHT = 100; + + // Constants used for setting color for component + private final Color BACK_COLOR = Color.white; + private final Color FRONT_COLOR = Color.black; + private final Color BORDER_COLOR = Color.darkGray; + private final Color FOCUS_COLOR = Color.blue; + private final Color FOCUS_FORECOLOR = Color.white; + private final Color FOCUS_ENABLED_COLOR = Color.red; + private final int BORDER_WIDTH = 2; + + private Vector stringList; // List of items + private Vector selList; // List of selected items + private int rows; // Visible rows + private int focusIndex, prevfocusIndex; + private Dimension minSize; + private Dimension prefSize; + private boolean pressed, eventOccurred, focusEnabled; + private boolean multipleMode; + + // Listeners handled for this component + private ActionListener actionListener; + private KeyListener keyListener; + private FocusListener focusListener; + private ItemListener itemListener; + + private static int nameCounter = 0; + + /** + * Creates a new list. + */ + public LWList() { + this(0); + } + + /** + * Creates a new list with the specified number of rows; + * multiple selection mode is disabled. + * + * @param i the number of rows + */ + public LWList(int i) { + this(i, false); + } + + /** + * Creates a new list with the specified number of rows and multiple selection mode. + * + * @param rows the number of rows + * @param flag determines whether the list allows multiple selections + */ + public LWList(int rows, boolean flag) { + multipleMode = flag; + this.rows = rows; + minSize = new Dimension(MIN_WIDTH, MIN_HEIGHT); + prefSize = new Dimension(PREF_WIDTH, PREF_HEIGHT); + stringList = new Vector(); + selList = new Vector(); + selList.addElement(0); + focusIndex = -1; + prevfocusIndex = focusIndex; + enableEvents(AWTEvent.MOUSE_EVENT_MASK); + enableEvents(AWTEvent.KEY_EVENT_MASK); + enableEvents(AWTEvent.FOCUS_EVENT_MASK); + enableEvents(AWTEvent.ITEM_EVENT_MASK); + setName(makeComponentName()); // set the name to the component + } + + String makeComponentName() { + String s = "LWList" + nameCounter++; + return s; + } + + /** + * Set whether the component is enabled or not. + * @param enabled if {@code true}, the component is to be enabled + */ + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + + if (enabled) { + enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK); + } else { + disableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK); + } + repaint(1); + } + + /** + * Set the selection mode. + * + * @param flag determines whether the list allows multiple selections + */ + public void setSelectionMode(boolean flag) { + multipleMode = flag; + } + + /** + * Check if the list allows multiple selections. + * + * @return {@code true} if the list allows multiple selections + */ + public boolean isMultipleMode() { + return multipleMode; + } + + /** + * Add the specified item. + * + * @param listItem the item + */ + public void add(String listItem) { + stringList.addElement(listItem); + invalidate(); + repaint(); + } + + /** + * Get minimum dimension for the list. + * + * @return the minimum dimensions for displaying + */ + @Override + public Dimension getMinimumSize() { + return minSize; + } + + /** + * Get the preferred size of the list. + * + * @return the preferred dimensions for displaying + */ + @Override + public Dimension getPreferredSize() { + return prefSize; + } + + /** + * Get the background color for the component. + * + * @return the background color for the component + */ + @Override + public Color getBackground() { + return BACK_COLOR; + } + + /** + * Get the foreground color for the component. + * + * @return the foreground color for the component + */ + @Override + public Color getForeground() { + return FRONT_COLOR; + } + + /** + * Get the border color for the component. + * + * @return the border color for the component + */ + public Color getBorder() { + return BORDER_COLOR; + } + + /** + * Get background color for the selected item. + * + * @return the color for the selected item + */ + public Color getFocusColor() { + return FOCUS_COLOR; + } + + /** + * Get foreground color for the selected item. + * + * @return the foreground color for the selected item + */ + public Color getFocusForeColor() { + return FOCUS_FORECOLOR; + } + + /** + * Get a "focus enabled" color - a small rectangle around the item + * should be drawn when the component got the focus. + * + * @return the "focus enabled" color + */ + public Color getFocusEnabledColor() { + return FOCUS_ENABLED_COLOR; + } + + /** + * Get border width. + * + * @return the border width + */ + public int getBorderWidth() { + return BORDER_WIDTH; + } + + /** + * Get the list item count. + * + * @return the count of items + */ + public int getItemCount() { + return stringList.size(); + } + + /** + * Get the specified item from the list. + * + * @param index the index + * @return the item string + */ + public String getItem(int index) { + return (String)stringList.elementAt(index); + } + + /** + * Get array of items from the list. + * + * @return the array of item strings + */ + public String[] getItems() { + String str[] = new String[getItemCount()]; + int count = 0; + for (Enumeration e = stringList.elements(); e.hasMoreElements(); ) { + str[count++] = (String)e.nextElement(); + } + return str; + } + + /** + * Check whether the component can be a focus owner (explicitly enabled here). + * + * @return {@code true} if the component is focusable + */ + @Override + public boolean isFocusTraversable() { + return true; + } + + /** + * Check whether mouse click point lies within the list of items. + * + * @param pt the click point + * @return {@code true} if the click point lies within the list of items + */ + @Override + public boolean contains(Point pt) { + Rectangle rect = new Rectangle(); + Dimension d = getSize(); + rect.x = getBorderWidth(); + rect.y = getBorderWidth(); + rect.width = d.width - (getBorderWidth() * 2); + rect.height = d.height - (getBorderWidth() * 2); + return rect.contains(pt); + } + + /** + * Given a click point the item that has to be selected is found from the list + * and focusIndex variable is set accordingly. + * + * @param pt the click point + */ + private void findSelectedIndex(Point pt) { + Font f = getFont(); + FontMetrics fm = getFontMetrics(f); + focusIndex = pt.y / fm.getHeight() - 1; + if (multipleMode) { + Integer fi = focusIndex; + if (selList.contains(fi)) { + int i = selList.indexOf(fi); + selList.removeElementAt(i); + } else { + selList.addElement(fi); + } + } + } + + /** + * Set index of the selected item. + * + * @param index the index + */ + public void setSelectedIndex(int index) { + prevfocusIndex = focusIndex; + focusIndex = index; + } + + /** + * Get the selected item index. + * + * @return the selected item index. + */ + public int getSelectedIndex() { + return focusIndex; + } + + /** + * Get an array of the selected Objects. + * + * @return array of the Objects + */ + @Override + public Object[] getSelectedObjects() { + int ai[] = getSelectedIndexes(); + Object aobj[] = new Object[selList.size()]; + for (int i = 0; i < selList.size(); i++) { + aobj[i] = stringList.elementAt(ai[i]); + } + return aobj; + } + + /** + * Get an array of the selected item indices. + * + * @return the array of the indices + */ + public int[] getSelectedIndexes() { + int ai[] = new int[selList.size()]; + for (int i = 0; i < selList.size(); i++) { + ai[i] = ((Integer)selList.elementAt(i)); + } + return ai; + } + + /** + * Add the specified item listener to receive item events from the list. + * + * @param itemlistener the item listener + */ + @Override + public synchronized void addItemListener(ItemListener itemlistener) { + itemListener = AWTEventMulticaster.add(itemListener, itemlistener); + enableEvents(AWTEvent.ITEM_EVENT_MASK); + } + + /** + * Remove the specified item listener so + * that it no longer receives item events from this list. + * + * @param itemlistener the item listener + */ + @Override + public synchronized void removeItemListener(ItemListener itemlistener) { + itemListener = AWTEventMulticaster.remove(itemListener, itemlistener); + } + + /** + * Add the specified action listener to receive action events from this list. + * + * @param listener the action listener + */ + public synchronized void addActionListener(ActionListener listener) { + actionListener = AWTEventMulticaster.add(actionListener, listener); + enableEvents(AWTEvent.MOUSE_EVENT_MASK); + } + + /** + * Remove the specified action listener so + * that it no longer receives action events from this list. + * + * @param listener the action listener + */ + public synchronized void removeActionListener(ActionListener listener) { + actionListener = AWTEventMulticaster.remove(actionListener, listener); + } + + /** + * Add the specified key listener to receive key events from this component. + * + * @param listener the key listener + */ + @Override + public synchronized void addKeyListener(KeyListener listener) { + keyListener = AWTEventMulticaster.add(keyListener, listener); + enableEvents(AWTEvent.KEY_EVENT_MASK); + } + + /** + * Remove the specified key listener so + * that it no longer receives key events from this component. + * + * @param listener the key listener + */ + @Override + public synchronized void removeKeyListener(KeyListener listener) { + keyListener = AWTEventMulticaster.remove(keyListener, listener); + } + + /** + * Add the specified focus listener to receive focus events + * from this component when it gains input focus. + * + * @param listener the focus listener + */ + @Override + public synchronized void addFocusListener(FocusListener listener) { + focusListener = AWTEventMulticaster.add(focusListener, listener); + enableEvents(AWTEvent.FOCUS_EVENT_MASK); + } + + /** + * Remove the specified focus listener so + * that it no longer receives focus events from this component. + * + * @param listener the focus listener + */ + @Override + public synchronized void removeFocusListener(FocusListener listener) { + focusListener = AWTEventMulticaster.remove(focusListener, listener); + } + + @Override + protected void processEvent(AWTEvent awtevent) { + + if (awtevent instanceof FocusEvent) { + processFocusEvent((FocusEvent)awtevent); + } else if (awtevent instanceof ItemEvent) { + processItemEvent((ItemEvent)awtevent); + } else if (awtevent instanceof KeyEvent) { + processKeyEvent((KeyEvent)awtevent); + } else if (awtevent instanceof MouseEvent) { + switch (awtevent.getID()) { + case MouseEvent.MOUSE_CLICKED: + case MouseEvent.MOUSE_PRESSED: + case MouseEvent.MOUSE_RELEASED: + case MouseEvent.MOUSE_ENTERED: + case MouseEvent.MOUSE_EXITED: + processMouseEvent((MouseEvent)awtevent); + break; + + case MouseEvent.MOUSE_MOVED: + case MouseEvent.MOUSE_DRAGGED: + super.processEvent((MouseEvent)awtevent); + break; + } + } else { + if (awtevent instanceof ComponentEvent) + super.processComponentEvent((ComponentEvent)awtevent); + else + super.processEvent(awtevent); + } + } + + protected void processItemEvent(ItemEvent itemevent) { + if (itemListener != null) { + itemListener.itemStateChanged(itemevent); + } + } + + @Override + protected void processFocusEvent(FocusEvent e) { + switch (e.getID()) { + case FocusEvent.FOCUS_GAINED: + if (focusListener != null) { focusListener.focusGained(e); } + if (getSelectedIndex() == -1) { setSelectedIndex(0); } + focusEnabled = true; + repaint(); + break; + case FocusEvent.FOCUS_LOST: + if (focusListener != null) { + focusListener.focusLost(e); + } + focusEnabled = false; + repaint(); + break; + } + super.processFocusEvent(e); + } + + @Override + protected void processKeyEvent(KeyEvent e) { + rows = getItemCount(); + + switch (e.getID()) { + + case KeyEvent.KEY_TYPED: + if (keyListener != null) { + keyListener.keyTyped(e); + } + break; + + case KeyEvent.KEY_PRESSED: + if (keyListener != null) { + keyListener.keyPressed(e); + } + if (e.getKeyCode() == KeyEvent.VK_DOWN) { + prevfocusIndex = focusIndex; + int index = getSelectedIndex() + 1; + if (index > rows) { break; } + setSelectedIndex(index); + processItemEvent(new ItemEvent(this, 0, index, 0)); + eventOccurred = true; + repaint(); + } else if (e.getKeyCode() == KeyEvent.VK_UP) { + int index = getSelectedIndex()-1; + if (index >= 0) { + setSelectedIndex(index); + if (e.getID() != 400) { + processItemEvent(new ItemEvent(this, 0, index, 0)); + } + eventOccurred = true; + repaint(); + } + } + break; + + case KeyEvent.KEY_RELEASED: + if (keyListener != null) { + keyListener.keyReleased(e); + } + if (e.getKeyCode() == KeyEvent.VK_ENTER) { + eventOccurred = true; + + // ActionEvent is fired here + if (actionListener != null) { + actionListener.actionPerformed( new ActionEvent( + this, ActionEvent.ACTION_PERFORMED, null)); + } + repaint(); + } + break; + } // switch + super.processKeyEvent(e); + } + + @Override + protected void processMouseEvent(MouseEvent e) { + switch (e.getID()) { + case MouseEvent.MOUSE_PRESSED: + pressed = true; + if (contains(e.getPoint())) { + findSelectedIndex(e.getPoint()); + processItemEvent(new ItemEvent(this, 0, focusIndex, 0)); + eventOccurred = true; + } + repaint(); + break; + + case MouseEvent.MOUSE_RELEASED: + if (pressed) { requestFocus(); } + + if (contains(e.getPoint())) { + findSelectedIndex(e.getPoint()); + eventOccurred = true; + } + // ActionEvent is fired here + if (actionListener != null) { + actionListener.actionPerformed(new ActionEvent( + this, ActionEvent.ACTION_PERFORMED, null)); + } + + if (pressed) { + pressed = false; + repaint(); + } + break; + } + super.processMouseEvent(e); + } + + @Override + /** + * Paint the list. + * + * @param g the graphics context to be used for testing + */ + public void paint(Graphics g) { + super.paint(g); + restrictGraphicsToClientArea(g); + + Point loc = getClientLocation(); + Dimension dim = getClientSize(); + Color prevColor = g.getColor(); + + // List border is drawn here + g.setColor(getBackground()); + g.fillRect(0, 0, dim.width - 2, dim.height - 2); + g.setColor(getBorder()); + g.drawRect(0, 0, dim.width - 2, dim.height - 2); + + if (getItemCount() > 0) { + Font f = getFont(); + if (f != null) { + String str[] = getItems(); + FontMetrics fm = getFontMetrics(f); + int drawRow = loc.x + getBorderWidth() + fm.getAscent(); + int drawCol = loc.y + getBorderWidth(); + int rectRow = loc.y + getBorderWidth(); + int i = 0; + + // Draw items (if the items exceeds visibility those items will be truncated + // as scrollbar support is not enabled + + for (; + i < str.length && drawRow < (dim.height - getBorderWidth()); + i++) { + if (fm.stringWidth(str[i]) < (dim.width - (getBorderWidth() * 2))) { + drawItem(g, i, drawCol, drawRow, rectRow, fm); + drawRow += fm.getHeight(); + rectRow += fm.getHeight(); + } else { + LWComponent.errorMsg("string width exceeds list width"); + LWComponent.errorMsg("Horizontal scrollbar support is not available"); + } + } // for + + if ( (drawRow > (dim.height - getBorderWidth())) && (str.length > i) ) { + //LWComponent.errorMsg("no of strings exceeds list height"); + //LWComponent.errorMsg("Vertical scrollbar support is not available"); + } + } else { LWComponent.errorMsg("Font not available.."); } + } + + eventOccurred = false; + g.setColor(prevColor); + unrestrictGraphicsFromClientArea(g); + } + + // Draw String items + private void drawItem(Graphics g, int listIndex, int drawCol, + int drawRow, int rectRow, FontMetrics fm) { + Point loc = getClientLocation(); + Dimension dim = getClientSize(); + String str = getItem(listIndex); + if (multipleMode) { + for (int i1 = 0; i1 < selList.size(); i1++) { + if (listIndex == ((Integer)selList.elementAt(i1))) { + g.setColor(getFocusColor()); + g.fillRect(loc.x + getBorderWidth(), + rectRow, + dim.width - getBorderWidth() * 2, + fm.getHeight()); + g.setColor(getFocusEnabledColor()); + g.drawRect(loc.x + getBorderWidth(), + rectRow, + dim.width - getBorderWidth() * 2, + fm.getHeight()); + } + } // for + } else { + if (listIndex == getSelectedIndex() && !multipleMode) { + g.setColor(getFocusColor()); + g.fillRect(loc.x + getBorderWidth(), + rectRow, + dim.width - getBorderWidth() * 2, + fm.getHeight()); + g.setColor(getFocusForeColor()); + } + if ((listIndex == prevfocusIndex) && (prevfocusIndex != getSelectedIndex()) && !multipleMode) { + g.setColor(getBackground()); + g.fillRect(loc.x + getBorderWidth(), + rectRow, + dim.width - getBorderWidth() * 2, + fm.getHeight()); + prevfocusIndex = getSelectedIndex(); + } + if (focusEnabled && listIndex == getSelectedIndex() && !multipleMode) { + g.setColor(getFocusEnabledColor()); + g.drawRect(loc.x + getBorderWidth(), + rectRow, + dim.width - getBorderWidth() * 2, + fm.getHeight()); + } + } + g.setColor(getForeground()); + g.drawString(str,drawCol,drawRow); + } + +} + From 021ffcfbdf66a374cf51c27d690ee50e46ed768e Mon Sep 17 00:00:00 2001 From: Anton Nashatyrev Date: Tue, 8 Jul 2014 16:42:23 +0400 Subject: [PATCH 003/111] 8047066: Test test/sun/awt/image/bug8038000.java fails with ClassCastException Reviewed-by: bae, prr --- .../share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java | 3 ++- jdk/test/sun/awt/image/bug8038000.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java index 1bcb05ccbb7..06f4ea6d99b 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java +++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java @@ -384,7 +384,8 @@ class LCMSImageLayout { } public static LCMSImageLayout createImageLayout(Raster r) { LCMSImageLayout l = new LCMSImageLayout(); - if (r instanceof ByteComponentRaster) { + if (r instanceof ByteComponentRaster && + r.getSampleModel() instanceof ComponentSampleModel) { ByteComponentRaster br = (ByteComponentRaster)r; ComponentSampleModel csm = (ComponentSampleModel)r.getSampleModel(); diff --git a/jdk/test/sun/awt/image/bug8038000.java b/jdk/test/sun/awt/image/bug8038000.java index 2bfdc27d2b7..20affe806c2 100644 --- a/jdk/test/sun/awt/image/bug8038000.java +++ b/jdk/test/sun/awt/image/bug8038000.java @@ -23,11 +23,13 @@ /** * @test - * @bug 8038000 + * @bug 8038000 8047066 * * @summary Verifies that we could create different type of Rasters with height 1 * and strideline which exceeds raster width. * Also checks that a set of RasterOp work correctly with such kind of Rasters. + * For 8047066 verifies that ColorConvertOp could process + * Raster (ByteBuffer + SinglePixelPackedSampleModel) * * @run main bug8038000 */ From b8db13175e4a9fcf183b450a9f22b9f3a344339a Mon Sep 17 00:00:00 2001 From: Stuart Marks Date: Tue, 8 Jul 2014 09:19:29 -0700 Subject: [PATCH 004/111] 8047025: Fix raw and unchecked lint warnings in generated nimbus files Reviewed-by: henryjen, prr --- .../javax/swing/plaf/nimbus/Defaults.template | 14 ++++++++------ .../javax/swing/plaf/nimbus/StateImpl.template | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template index ee10c49bc47..8a27e35b208 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template @@ -398,7 +398,7 @@ ${UI_DEFAULT_INIT} @Override public Object createValue(UIDefaults table) { try { - Class c; + Class c; Object cl; // See if we should use a separate ClassLoader if (table == null || !((cl = table.get("ClassLoader")) @@ -412,7 +412,7 @@ ${UI_DEFAULT_INIT} } c = Class.forName(className, true, (ClassLoader)cl); - Constructor constructor = c.getConstructor( + Constructor constructor = c.getConstructor( AbstractRegionPainter.PaintContext.class, int.class); if (constructor == null) { throw new NullPointerException( @@ -564,7 +564,7 @@ ${UI_DEFAULT_INIT} //if c is not named, and parts[partIndex] has an expected class //type registered, then check to make sure c is of the //right type; - Class clazz = parts[partIndex].c; + Class clazz = parts[partIndex].c; if (clazz != null && clazz.isAssignableFrom(c.getClass())) { //so far so good, recurse return matches(c.getParent(), partIndex - 1); @@ -636,7 +636,7 @@ ${UI_DEFAULT_INIT} private String s; //true if this part represents a component name private boolean named; - private Class c; + private Class c; Part(String s) { named = s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"'; @@ -816,7 +816,7 @@ ${UI_DEFAULT_INIT} private static final class PainterBorder implements Border, UIResource { private Insets insets; - private Painter painter; + private Painter painter; private String painterKey; PainterBorder(String painterKey, Insets insets) { @@ -827,7 +827,9 @@ ${UI_DEFAULT_INIT} @Override public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (painter == null) { - painter = (Painter)UIManager.get(painterKey); + @SuppressWarnings("unchecked") + Painter temp = (Painter)UIManager.get(painterKey); + painter = temp; if (painter == null) return; } diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template index 3323ab15581..dfff2ea59f5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template @@ -28,7 +28,7 @@ import java.awt.*; import javax.swing.*; -class ${STATE_NAME} extends State { +class ${STATE_NAME} extends State { ${STATE_NAME}() { super("${STATE_KEY}"); } From 2a84acf3dd07edc3fcb3de12a4072f958926a0ca Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Wed, 9 Jul 2014 12:56:03 +0400 Subject: [PATCH 005/111] 8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2 Reviewed-by: pchelko --- .../FocusTransferDWFAppModalTest.java | 49 ++++ .../FocusTransferDWFDocModalTest.java | 49 ++++ .../FocusTransferDWFModelessTest.java | 49 ++++ .../FocusTransferDWFNonModalTest.java | 48 ++++ .../FocusTransferDWFTest.java | 186 ++++++++++++ .../FocusTransferDialogsAppModalTest.java | 50 ++++ .../FocusTransferDialogsDocModalTest.java | 50 ++++ .../FocusTransferDialogsModelessTest.java | 50 ++++ .../FocusTransferDialogsNonModalTest.java | 49 ++++ .../FocusTransferDialogsTest.java | 193 +++++++++++++ .../FocusTransferFDWAppModalTest.java | 49 ++++ .../FocusTransferFDWDocModalTest.java | 49 ++++ .../FocusTransferFDWModelessTest.java | 49 ++++ .../FocusTransferFDWNonModalTest.java | 48 ++++ .../FocusTransferFDWTest.java | 152 ++++++++++ .../FocusTransferFWDAppModal1Test.java | 50 ++++ .../FocusTransferFWDAppModal2Test.java | 50 ++++ .../FocusTransferFWDAppModal3Test.java | 50 ++++ .../FocusTransferFWDAppModal4Test.java | 50 ++++ .../FocusTransferFWDDocModal1Test.java | 50 ++++ .../FocusTransferFWDDocModal2Test.java | 50 ++++ .../FocusTransferFWDDocModal3Test.java | 50 ++++ .../FocusTransferFWDDocModal4Test.java | 50 ++++ .../FocusTransferFWDModeless1Test.java | 50 ++++ .../FocusTransferFWDModeless2Test.java | 50 ++++ .../FocusTransferFWDModeless3Test.java | 50 ++++ .../FocusTransferFWDModeless4Test.java | 50 ++++ .../FocusTransferFWDNonModal1Test.java | 49 ++++ .../FocusTransferFWDNonModal2Test.java | 49 ++++ .../FocusTransferFWDNonModal3Test.java | 49 ++++ .../FocusTransferFWDNonModal4Test.java | 49 ++++ .../FocusTransferFWDTest.java | 201 +++++++++++++ .../FocusTransferWDFAppModal1Test.java | 51 ++++ .../FocusTransferWDFAppModal2Test.java | 52 ++++ .../FocusTransferWDFAppModal3Test.java | 52 ++++ .../FocusTransferWDFDocModal1Test.java | 51 ++++ .../FocusTransferWDFDocModal2Test.java | 52 ++++ .../FocusTransferWDFDocModal3Test.java | 51 ++++ .../FocusTransferWDFModeless1Test.java | 51 ++++ .../FocusTransferWDFModeless2Test.java | 52 ++++ .../FocusTransferWDFModeless3Test.java | 51 ++++ .../FocusTransferWDFNonModal1Test.java | 51 ++++ .../FocusTransferWDFNonModal2Test.java | 52 ++++ .../FocusTransferWDFNonModal3Test.java | 51 ++++ .../FocusTransferWDFTest.java | 272 ++++++++++++++++++ .../ModalitySettingsTest.java | 139 +++++++++ .../NullModalityDialogTest.java | 161 +++++++++++ .../java/awt/Modal/helpers/TestDialog.java | 38 ++- .../java/awt/Modal/helpers/TestFrame.java | 60 ++-- .../java/awt/Modal/helpers/TestWindow.java | 42 ++- 50 files changed, 3390 insertions(+), 56 deletions(-) create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java create mode 100644 jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java create mode 100644 jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java create mode 100644 jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java new file mode 100644 index 00000000000..20f15fbe4de --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when the following + * happens: an application modal dialog (D) having null frame owner is shown; + * a window having D as owner is shown; a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDWFAppModalTest + */ + +public class FocusTransferDWFAppModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferDWFTest test = new FocusTransferDWFTest( + Dialog.ModalityType.APPLICATION_MODAL); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java new file mode 100644 index 00000000000..bb70a4fc090 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the + * following happens: a document modal dialog (D) having null frame owner is shown; + * a window having D as owner is shown; a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDWFDocModalTest + */ + +public class FocusTransferDWFDocModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferDWFTest test = new FocusTransferDWFTest( + Dialog.ModalityType.DOCUMENT_MODAL); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java new file mode 100644 index 00000000000..eb2ca1ecd08 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the + * following happens: a modeless dialog (D) having null frame owner is shown; + * a window having D as owner is shown; a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDWFModelessTest + */ + +public class FocusTransferDWFModelessTest { + + public static void main(String[] args) throws Exception { + FocusTransferDWFTest test = new FocusTransferDWFTest( + Dialog.ModalityType.MODELESS); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java new file mode 100644 index 00000000000..697c5c3d409 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following + * happens: a non-modal dialog (D) having null frame owner is shown; a window having D + * as owner is shown; a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDWFNonModalTest + */ + +public class FocusTransferDWFNonModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferDWFTest test = new FocusTransferDWFTest(null); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java new file mode 100644 index 00000000000..c6097b74b92 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFTest.java @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; + +import static jdk.testlibrary.Asserts.*; + +// DWF: Dialog -> Window -> Frame +public class FocusTransferDWFTest { + + class CustomDialog extends TestDialog { + + public CustomDialog(Frame f) { + super(f); + } + + @Override + public void doOpenAction() { + if (window != null) { + window.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomFrame extends TestFrame { + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomWindow extends TestWindow { + + public CustomWindow(Dialog d) { + super(d); + } + + @Override + public void doOpenAction() { + if (frame != null) { + frame.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + private TestDialog dialog; + private TestFrame frame; + private TestWindow window; + + private static final int delay = 1000; + + private final ExtendedRobot robot; + + private Dialog.ModalityType modalityType; + + FocusTransferDWFTest(Dialog.ModalityType modType) throws Exception { + + modalityType = modType; + + robot = new ExtendedRobot(); + EventQueue.invokeLater(this::createGUI); + } + + private void createGUI() { + + frame = new CustomFrame(); + frame.setLocation(50, 50); + + dialog = new CustomDialog((Frame) null); + if (modalityType == null) { + modalityType = Dialog.ModalityType.MODELESS; + } else { + dialog.setModalityType(modalityType); + } + dialog.setLocation(250, 50); + + window = new CustomWindow(dialog); + window.setLocation(450, 50); + dialog.setVisible(true); + } + + private void closeAll() { + if (dialog != null) { dialog.dispose(); } + if ( frame != null) { frame.dispose(); } + if (window != null) { window.dispose(); } + } + + public void doTest() throws Exception { + + robot.waitForIdle(delay); + + try { + + dialog.checkCloseButtonFocusGained(true); + + dialog.clickOpenButton(robot); + robot.waitForIdle(delay); + + window.checkCloseButtonFocusGained(true); + dialog.checkOpenButtonFocusLost(true); + + window.clickOpenButton(robot); + robot.waitForIdle(delay); + + switch (modalityType) { + case APPLICATION_MODAL: + frame.checkCloseButtonFocusGained(false, 10); + window.checkOpenButtonFocusLost(false, 10); + + frame.closeGained.reset(); + + dialog.clickCloseButton(robot); + robot.waitForIdle(delay); + + frame.checkCloseButtonFocusGained(true); + assertFalse(window.isVisible(), "window shouldn't be visible"); + + break; + + case DOCUMENT_MODAL: + case MODELESS: + frame.checkCloseButtonFocusGained(true); + window.checkOpenButtonFocusLost(true); + + window.openGained.reset(); + + frame.clickCloseButton(robot); + robot.waitForIdle(delay); + + window.checkOpenButtonFocusGained(true); + + dialog.openGained.reset(); + window.clickCloseButton(robot); + robot.waitForIdle(delay); + + dialog.checkOpenButtonFocusGained(true); + + break; + } + + } catch (Exception e) { + + // make screenshot before exit + Rectangle rect = new Rectangle(0, 0, 650, 250); + java.awt.image.BufferedImage img = robot.createScreenCapture(rect); + javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg")); + + throw e; + } + + robot.waitForIdle(delay); + + EventQueue.invokeAndWait(this::closeAll); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java new file mode 100644 index 00000000000..900c3889786 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsAppModalTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: an application modal dialog (D1) having a null + * frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog + * with a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDialogsAppModalTest + */ + +public class FocusTransferDialogsAppModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferDialogsTest test = new FocusTransferDialogsTest( + Dialog.ModalityType.APPLICATION_MODAL); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java new file mode 100644 index 00000000000..62e04584dc6 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a document modal dialog (D1) having a null + * frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog + * with a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDialogsDocModalTest + */ + +public class FocusTransferDialogsDocModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferDialogsTest test = new FocusTransferDialogsTest( + Dialog.ModalityType.DOCUMENT_MODAL); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java new file mode 100644 index 00000000000..2215b5a9b36 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a modeless dialog (D1) having a null + * frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog + * with a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDialogsModelessTest + */ + +public class FocusTransferDialogsModelessTest { + + public static void main(String[] args) throws Exception { + FocusTransferDialogsTest test = new FocusTransferDialogsTest( + Dialog.ModalityType.MODELESS); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java new file mode 100644 index 00000000000..dc87c0f4268 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a non-modal dialog (D1) having a null + * frame owner is shown; a dialog (D2) having D1 owner is shown; a dialog + * with a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferDialogsNonModalTest + */ + +public class FocusTransferDialogsNonModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferDialogsTest test = new FocusTransferDialogsTest(null); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java new file mode 100644 index 00000000000..322dd6b94d4 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsTest.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; + + +public class FocusTransferDialogsTest { + + class CustomDialog1 extends TestDialog { + + public CustomDialog1(Frame f) { + super(f); + } + + @Override + public void doOpenAction() { + if (dialog2 != null) { + dialog2.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomDialog2 extends TestDialog { + + public CustomDialog2(Dialog d) { + super(d); + } + + @Override + public void doOpenAction() { + if (dialog3 != null) { + dialog3.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomDialog3 extends TestDialog { + + public CustomDialog3(Frame f) { + super(f); + } + + public CustomDialog3(Dialog d) { + super(d); + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + + private TestDialog dialog1, dialog2, dialog3; + private Frame parentFrame; + + private static final int delay = 1000; + private final ExtendedRobot robot; + private Dialog.ModalityType modalityType; + + FocusTransferDialogsTest(Dialog.ModalityType modType) throws Exception { + + modalityType = modType; + robot = new ExtendedRobot(); + EventQueue.invokeLater(this::createGUI); + } + + private void createGUI() { + + dialog1 = new CustomDialog1((Frame) null); + dialog1.setTitle("Dialog1"); + dialog1.setLocation(50, 50); + + if (modalityType != null) { + dialog1.setModalityType(modalityType); + } else { + modalityType = Dialog.ModalityType.MODELESS; + } + + dialog2 = new CustomDialog2(dialog1); + dialog2.setTitle("Dialog2"); + dialog2.setLocation(250, 50); + + parentFrame = new Frame(); + dialog3 = new CustomDialog3(parentFrame); + dialog3.setTitle("Dialog3"); + dialog3.setLocation(450, 50); + + dialog1.setVisible(true); + } + + private void closeAll() { + if (dialog1 != null) { dialog1.dispose(); } + if (dialog2 != null) { dialog2.dispose(); } + if (dialog3 != null) { dialog3.dispose(); } + if (parentFrame != null) { parentFrame.dispose(); } + } + + public void doTest() throws Exception { + + robot.waitForIdle(delay); + + try { + + dialog1.checkCloseButtonFocusGained(true); + + dialog1.clickOpenButton(robot); + robot.waitForIdle(delay); + + dialog2.checkCloseButtonFocusGained(true); + dialog1.checkOpenButtonFocusLost(true); + + dialog1.openGained.reset(); + dialog2.clickOpenButton(robot); + robot.waitForIdle(delay); + + switch (modalityType) { + case APPLICATION_MODAL: + + dialog3.checkCloseButtonFocusGained(false, 10); + dialog2.checkOpenButtonFocusLost(true); + + dialog1.checkCloseButtonFocusGained(true); + dialog3.closeGained.reset(); + + dialog1.clickCloseButton(robot); + robot.waitForIdle(delay); + + dialog3.checkCloseButtonFocusGained(true); + + break; + + case DOCUMENT_MODAL: + case MODELESS: + + dialog3.checkCloseButtonFocusGained(true); + dialog2.checkOpenButtonFocusLost(true); + + dialog1.openGained.reset(); + + dialog2.clickCloseButton(robot); + robot.waitForIdle(delay); + + dialog1.checkOpenButtonFocusGained(true); + + break; + } + + } catch (Exception e) { + + // make screenshot before exit + Rectangle rect = new Rectangle(0, 0, 650, 250); + java.awt.image.BufferedImage img = robot.createScreenCapture(rect); + javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg")); + + throw e; + } + + robot.waitForIdle(delay); + EventQueue.invokeAndWait(this::closeAll); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java new file mode 100644 index 00000000000..f3fc961d460 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWAppModalTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a frame is shown; an application modal dialog (D) + * having a null frame owner is shown; a window having D as owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFDWAppModalTest + */ + +public class FocusTransferFDWAppModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferFDWTest test = new FocusTransferFDWTest( + Dialog.ModalityType.APPLICATION_MODAL); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java new file mode 100644 index 00000000000..9a163e47bbc --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a frame is shown; a document modal dialog (D) + * having a null frame owner is shown; a window having D as owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFDWDocModalTest + */ + +public class FocusTransferFDWDocModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferFDWTest test = new FocusTransferFDWTest( + Dialog.ModalityType.DOCUMENT_MODAL); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java new file mode 100644 index 00000000000..41dce55fea8 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWModelessTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a frame is shown; a modeless dialog (D) + * having a null frame owner is shown; a window having D as owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFDWModelessTest + */ + +public class FocusTransferFDWModelessTest { + + public static void main(String[] args) throws Exception { + FocusTransferFDWTest test = new FocusTransferFDWTest( + Dialog.ModalityType.MODELESS); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java new file mode 100644 index 00000000000..32117624ecb --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWNonModalTest.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a frame is shown; a non-modal dialog (D) + * having a null frame owner is shown; a window having D as owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFDWNonModalTest + */ + +public class FocusTransferFDWNonModalTest { + + public static void main(String[] args) throws Exception { + FocusTransferFDWTest test = new FocusTransferFDWTest(null); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java new file mode 100644 index 00000000000..41e2fb086f2 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWTest.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; + +// FDW: Frame -> Dialog -> Window +public class FocusTransferFDWTest { + + class CustomFrame extends TestFrame { + + @Override + public void doOpenAction() { + if (dialog != null) { + dialog.setVisible(true); + } + } + } + + class CustomWindow extends TestWindow { + + public CustomWindow(Dialog d) { + super(d); + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomDialog extends TestDialog { + + public CustomDialog(Frame f) { + super(f); + } + + @Override + public void doOpenAction() { + if (window != null) { + window.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + private TestDialog dialog; + private TestFrame frame; + private TestWindow window; + + private static final int delay = 1000; + + private final ExtendedRobot robot; + + private final Dialog.ModalityType modalityType; + + FocusTransferFDWTest(Dialog.ModalityType modType) throws Exception { + + modalityType = modType; + + robot = new ExtendedRobot(); + EventQueue.invokeLater(this::createGUI); + } + + private void createGUI() { + + frame = new CustomFrame(); + frame.setLocation(50, 50); + dialog = new CustomDialog((Frame) null); + if (modalityType != null) { + dialog.setModalityType(modalityType); + } + dialog.setLocation(250, 50); + window = new CustomWindow(dialog); + window.setLocation(450, 50); + frame.setVisible(true); + } + + private void closeAll() { + if (dialog != null) { dialog.dispose(); } + if ( frame != null) { frame.dispose(); } + if (window != null) { window.dispose(); } + } + + public void doTest() throws Exception { + + robot.waitForIdle(delay); + + try { + + frame.checkCloseButtonFocusGained(true); + + frame.clickOpenButton(robot); + robot.waitForIdle(delay); + + dialog.checkCloseButtonFocusGained(true); + + frame.checkOpenButtonFocusLost(true); + + dialog.clickOpenButton(robot); + robot.waitForIdle(delay); + + window.checkCloseButtonFocusGained(true); + dialog.checkOpenButtonFocusLost(true); + + dialog.openGained.reset(); + window.clickCloseButton(robot); + + dialog.checkOpenButtonFocusGained(true); + + frame.openGained.reset(); + dialog.clickCloseButton(robot); + + frame.checkOpenButtonFocusGained(true); + + } catch (Exception e) { + + // make screenshot before exit + Rectangle rect = new Rectangle(0, 0, 650, 250); + java.awt.image.BufferedImage img = robot.createScreenCapture(rect); + javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg")); + + throw e; + } + + robot.waitForIdle(delay); + EventQueue.invokeAndWait(this::closeAll); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java new file mode 100644 index 00000000000..121aeb5494f --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal1Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; an application modal dialog having + * a hidden dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDAppModal1Test + */ + +public class FocusTransferFWDAppModal1Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java new file mode 100644 index 00000000000..ba1ff589406 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal2Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; an application modal dialog having + * a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDAppModal2Test + */ + +public class FocusTransferFWDAppModal2Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferFWDTest.DialogParent.HIDDEN_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java new file mode 100644 index 00000000000..5098658d7e9 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal3Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; an application modal dialog having + * a null dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDAppModal3Test + */ + +public class FocusTransferFWDAppModal3Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferFWDTest.DialogParent.NULL_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java new file mode 100644 index 00000000000..f4ae06489aa --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDAppModal4Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; an application modal dialog having + * a null frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDAppModal4Test + */ + +public class FocusTransferFWDAppModal4Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferFWDTest.DialogParent.NULL_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java new file mode 100644 index 00000000000..4f3958f98d4 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal1Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a document modal dialog having + * a hidden dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDDocModal1Test + */ + +public class FocusTransferFWDDocModal1Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java new file mode 100644 index 00000000000..f68eb0e3a63 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal2Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a document modal dialog having + * a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDDocModal2Test + */ + +public class FocusTransferFWDDocModal2Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferFWDTest.DialogParent.HIDDEN_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java new file mode 100644 index 00000000000..7ad9e8e3d4a --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal3Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a document modal dialog having + * a null dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDDocModal3Test + */ + +public class FocusTransferFWDDocModal3Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferFWDTest.DialogParent.NULL_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java new file mode 100644 index 00000000000..d689b61be83 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDDocModal4Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a document modal dialog having + * a null frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDDocModal4Test + */ + +public class FocusTransferFWDDocModal4Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferFWDTest.DialogParent.NULL_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java new file mode 100644 index 00000000000..bdf00c0ca24 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless1Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a modeless dialog having + * a hidden dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDModeless1Test + */ + +public class FocusTransferFWDModeless1Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.MODELESS, + FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java new file mode 100644 index 00000000000..a1d31e4328a --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless2Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a modeless dialog having + * a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDModeless2Test + */ + +public class FocusTransferFWDModeless2Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.MODELESS, + FocusTransferFWDTest.DialogParent.HIDDEN_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java new file mode 100644 index 00000000000..6ed6f9eab21 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless3Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a modeless dialog having + * a null dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDModeless3Test + */ + +public class FocusTransferFWDModeless3Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.MODELESS, + FocusTransferFWDTest.DialogParent.NULL_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java new file mode 100644 index 00000000000..956b69127bb --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDModeless4Test.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a modeless dialog having + * a null frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDModeless4Test + */ + +public class FocusTransferFWDModeless4Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + Dialog.ModalityType.MODELESS, + FocusTransferFWDTest.DialogParent.NULL_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java new file mode 100644 index 00000000000..fd06036bce7 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having + * a hidden dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDNonModal1Test + */ + +public class FocusTransferFWDNonModal1Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + null, FocusTransferFWDTest.DialogParent.HIDDEN_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java new file mode 100644 index 00000000000..82283113c8c --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having + * a hidden frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDNonModal2Test + */ + +public class FocusTransferFWDNonModal2Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + null, FocusTransferFWDTest.DialogParent.HIDDEN_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java new file mode 100644 index 00000000000..4475351ba43 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having + * a null dialog owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDNonModal3Test + */ + +public class FocusTransferFWDNonModal3Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + null, FocusTransferFWDTest.DialogParent.NULL_DIALOG); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java new file mode 100644 index 00000000000..6ceed537376 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8049339 + * @summary Check whether the focus transfer between windows occurs correctly when the following happens: + * a frame (F) is shown; a window having F as owner is shown; a non-modal dialog having + * a null frame owner is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferFWDNonModal4Test + */ + +public class FocusTransferFWDNonModal4Test { + + public static void main(String[] args) throws Exception { + FocusTransferFWDTest test = new FocusTransferFWDTest( + null, FocusTransferFWDTest.DialogParent.NULL_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java new file mode 100644 index 00000000000..2d7a37419d1 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDTest.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; +import static jdk.testlibrary.Asserts.*; + + +// FWD: Frame -> Window -> Dialog +public class FocusTransferFWDTest { + + class CustomFrame extends TestFrame { + + @Override + public void doOpenAction() { + if (window != null) { + window.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomWindow extends TestWindow { + + public CustomWindow(Frame f) { + super(f); + } + + @Override + public void doOpenAction() { + if (dialog != null) { + dialog.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomDialog extends TestDialog { + + public CustomDialog(Frame f) { + super(f); + } + + public CustomDialog(Dialog d) { + super(d); + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + private TestDialog dialog; + private TestFrame frame; + private TestWindow window; + + private Frame parentFrame; + private Dialog parentDialog; + + private static final int delay = 1000; + + private final ExtendedRobot robot; + + private final Dialog.ModalityType modalityType; + + public enum DialogParent {NULL_DIALOG, NULL_FRAME, HIDDEN_DIALOG, HIDDEN_FRAME}; + private DialogParent dialogParent; + + FocusTransferFWDTest(Dialog.ModalityType modType, + DialogParent dlgParent) throws Exception { + + modalityType = modType; + dialogParent = dlgParent; + + robot = new ExtendedRobot(); + EventQueue.invokeLater(this::createGUI); + } + + private void createGUI() { + + frame = new CustomFrame(); + frame.setLocation(50, 50); + + switch (dialogParent) { + case NULL_DIALOG: + dialog = new CustomDialog((Dialog) null); + break; + case NULL_FRAME: + dialog = new CustomDialog((Frame) null); + break; + case HIDDEN_DIALOG: + parentDialog = new Dialog((Frame) null); + dialog = new CustomDialog(parentDialog); + break; + case HIDDEN_FRAME: + parentFrame = new Frame(); + dialog = new CustomDialog(parentFrame); + break; + } + + assertTrue(dialog != null, "error: null dialog"); + + if (modalityType != null) { + dialog.setModalityType(modalityType); + } + + dialog.setLocation(250, 50); + window = new CustomWindow(frame); + window.setLocation(450, 50); + frame.setVisible(true); + } + + private void closeAll() { + if (dialog != null) { dialog.dispose(); } + if ( frame != null) { frame.dispose(); } + if (window != null) { window.dispose(); } + + if (parentDialog != null) { parentDialog.dispose(); } + if (parentFrame != null) { parentFrame.dispose(); } + } + + public void doTest() throws Exception { + + robot.waitForIdle(delay); + + try { + + frame.checkCloseButtonFocusGained(true); + + frame.clickOpenButton(robot); + robot.waitForIdle(delay); + + window.checkCloseButtonFocusGained(true); + frame.checkOpenButtonFocusLost(true); + + window.clickOpenButton(robot); + robot.waitForIdle(delay); + + dialog.checkCloseButtonFocusGained(true); + window.checkOpenButtonFocusLost(true); + + window.openGained.reset(); + + dialog.clickCloseButton(robot); + robot.waitForIdle(delay); + + window.checkOpenButtonFocusGained(true); + + frame.openGained.reset(); + + window.clickCloseButton(robot); + robot.waitForIdle(delay); + + frame.checkOpenButtonFocusGained(true); + + frame.clickCloseButton(robot); + robot.waitForIdle(delay); + + } catch (Exception e) { + + // make screenshot before exit + Rectangle rect = new Rectangle(0, 0, 650, 250); + java.awt.image.BufferedImage img = robot.createScreenCapture(rect); + javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg")); + + throw e; + } + + robot.waitForIdle(delay); + EventQueue.invokeAndWait(this::closeAll); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java new file mode 100644 index 00000000000..d23593634c1 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * an application modal dialog having a frame (F) owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFAppModal1Test + */ + +public class FocusTransferWDFAppModal1Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java new file mode 100644 index 00000000000..e37420f3cdb --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 8048263 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * an application modal dialog having a null dialog owner is shown; + * a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFAppModal2Test + */ + +public class FocusTransferWDFAppModal2Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferWDFTest.DialogParent.NULL_DIALOG, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java new file mode 100644 index 00000000000..f75c869272a --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a frame (F) owner is shown; + * an application modal dialog having F owner is shown; F is shown. + * + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFAppModal3Test + */ + +public class FocusTransferWDFAppModal3Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.APPLICATION_MODAL, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java new file mode 100644 index 00000000000..cd1e9e8f9d9 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * a document modal dialog with a frame (F) owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFDocModal1Test + */ + +public class FocusTransferWDFDocModal1Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java new file mode 100644 index 00000000000..9f3a1f88cc8 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * a document modal dialog having a null dialog owner is shown; + * a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFDocModal2Test + */ + +public class FocusTransferWDFDocModal2Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferWDFTest.DialogParent.NULL_DIALOG, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java new file mode 100644 index 00000000000..2c116b09677 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a frame (F) owner is shown; + * a document modal dialog having F owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFDocModal3Test + */ + +public class FocusTransferWDFDocModal3Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.DOCUMENT_MODAL, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java new file mode 100644 index 00000000000..73d36b65bf0 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * a modeless dialog having a frame (F) owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFModeless1Test + */ + +public class FocusTransferWDFModeless1Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.MODELESS, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java new file mode 100644 index 00000000000..e496e253f58 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * a modeless dialog having a null dialog owner is shown; + * a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFModeless2Test + */ + +public class FocusTransferWDFModeless2Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.MODELESS, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java new file mode 100644 index 00000000000..df3ff81dc3d --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a frame (F) owner is shown; + * a modeless dialog having F owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFModeless3Test + */ + +public class FocusTransferWDFModeless3Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + Dialog.ModalityType.MODELESS, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java new file mode 100644 index 00000000000..c700a054136 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * a non-modal dialog having a frame (F) owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFNonModal1Test + */ + +public class FocusTransferWDFNonModal1Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + null, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java new file mode 100644 index 00000000000..5e36b8d50a7 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a hidden frame owner is shown; + * a non-modal dialog having a null dialog owner is shown; + * a frame is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFNonModal2Test + */ + +public class FocusTransferWDFNonModal2Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + null, + FocusTransferWDFTest.DialogParent.NULL_DIALOG, + FocusTransferWDFTest.WindowParent.NEW_FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java new file mode 100644 index 00000000000..e0d3ebbb1f2 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dialog; + +/* + * @test + * @bug 8047367 + * @summary Check whether the focus transfer between windows occurs correctly when + * the following happens: a window having a frame (F) owner is shown; + * a non-modal dialog having F owner is shown; F is shown. + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main FocusTransferWDFNonModal3Test + */ + +public class FocusTransferWDFNonModal3Test { + + public static void main(String[] args) throws Exception { + FocusTransferWDFTest test = new FocusTransferWDFTest( + null, + FocusTransferWDFTest.DialogParent.FRAME, + FocusTransferWDFTest.WindowParent.FRAME); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java new file mode 100644 index 00000000000..d79e715bfe9 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFTest.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.awt.*; +import static jdk.testlibrary.Asserts.*; + +// WDF: Window -> Dialog -> Frame +public class FocusTransferWDFTest { + + class CustomDialog extends TestDialog { + + public CustomDialog(Frame f) { + super(f); + } + + public CustomDialog(Dialog d) { + super(d); + } + + @Override + public void doOpenAction() { + if (frame != null) { + frame.setVisible(true); + } + } + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomFrame extends TestFrame { + + @Override + public void doCloseAction() { + this.dispose(); + } + } + + class CustomWindow extends TestWindow { + + public CustomWindow(Frame f) { + super(f); + } + + @Override + public void doOpenAction() { + if (dialog != null) { + dialog.setVisible(true); + } + } + } + + + private TestDialog dialog; + private TestFrame frame; + private TestWindow window; + + private Frame parentFrame; + + private static final int delay = 1000; + + private final ExtendedRobot robot; + + private Dialog.ModalityType modalityType; + + public enum DialogParent {FRAME, NULL_DIALOG}; + private DialogParent dialogParent; + + public enum WindowParent {FRAME, NEW_FRAME}; + private WindowParent windowParent; + + + FocusTransferWDFTest(Dialog.ModalityType modType, + DialogParent dlgParent, + WindowParent winParent) throws Exception { + + modalityType = modType; + dialogParent = dlgParent; + windowParent = winParent; + + robot = new ExtendedRobot(); + EventQueue.invokeLater( this::createGUI ); + } + + private void createGUI() { + + frame = new CustomFrame(); + frame.setLocation(50, 50); + + switch (dialogParent) { + case FRAME: + dialog = new CustomDialog(frame); + break; + case NULL_DIALOG: + dialog = new CustomDialog((Dialog) null); + break; + } + assertTrue(dialog != null, "error: null dialog"); + + if (modalityType == null) { + modalityType = Dialog.ModalityType.MODELESS; + } else { + dialog.setModalityType(modalityType); + } + + dialog.setLocation(250, 50); + + switch (windowParent) { + case FRAME: + window = new CustomWindow(frame); + break; + case NEW_FRAME: + parentFrame = new Frame(); + window = new CustomWindow(parentFrame); + break; + } + assertTrue(window != null, "error: null window"); + + window.setLocation(450, 50); + window.setVisible(true); + } + + private void closeAll() { + if (dialog != null) { dialog.dispose(); } + if ( frame != null) { frame.dispose(); } + if (window != null) { window.dispose(); } + + if (parentFrame != null) { parentFrame.dispose(); } + } + + private void ModalTest() throws Exception { + frame.checkCloseButtonFocusGained(false, 10); + dialog.checkOpenButtonFocusLost(false, 10); + + dialog.clickCloseButton(robot); + robot.waitForIdle(delay); + + frame.checkCloseButtonFocusGained(true); + + window.openGained.reset(); + + frame.clickCloseButton(robot); + robot.waitForIdle(delay); + } + + public void doTest() throws Exception { + + try { + + robot.waitForIdle(delay); + + window.checkCloseButtonFocusGained(false, 10); + + window.clickOpenButton(robot); + robot.waitForIdle(delay); + + dialog.checkCloseButtonFocusGained(true); + window.checkOpenButtonFocusLost(false, 10); + + dialog.clickOpenButton(robot); + robot.waitForIdle(delay); + + switch (modalityType) { + case APPLICATION_MODAL: + ModalTest(); + if (windowParent == WindowParent.FRAME) { + assertFalse(window.isVisible(), + "window shouldn't be visible"); + } else { // WindowParent.NEW_FRAME + window.checkOpenButtonFocusGained(false, 10); + } + + break; + + case DOCUMENT_MODAL: + if (dialogParent == DialogParent.FRAME) { + ModalTest(); + if (windowParent == WindowParent.FRAME) { // 10 + assertFalse(window.isVisible(), + "window shouldn't be visible"); + } else { // WindowParent.NEW_FRAME + window.checkOpenButtonFocusGained(false, 10); + } + } else { // DialogParent.NULL_DIALOG + frame.checkCloseButtonFocusGained(true); + dialog.checkOpenButtonFocusLost(true); + + dialog.openGained.reset(); + + frame.clickCloseButton(robot); + robot.waitForIdle(delay); + + dialog.checkOpenButtonFocusGained(true); + + window.openGained.reset(); + + dialog.clickCloseButton(robot); + robot.waitForIdle(delay); + + window.checkOpenButtonFocusGained(false, 10); + } + break; + + case MODELESS: + + frame.checkCloseButtonFocusGained(true); + dialog.checkOpenButtonFocusLost(true); + + dialog.openGained.reset(); + + frame.clickCloseButton(robot); + robot.waitForIdle(delay); + + if (dialogParent == DialogParent.NULL_DIALOG) { + dialog.checkOpenButtonFocusGained(true); + + window.openGained.reset(); + + dialog.clickCloseButton(robot); + robot.waitForIdle(delay); + + window.checkOpenButtonFocusGained(false, 10); + } else { + assertFalse(dialog.isVisible(), + "dialog shouldn't be visible"); + + if (windowParent == WindowParent.FRAME) { + assertFalse(window.isVisible(), + "window shouldn't be visible"); + } + } + + break; + } + + } catch (Exception e) { + + // make screenshot before exit + Rectangle rect = new Rectangle(0, 0, 650, 250); + java.awt.image.BufferedImage img = robot.createScreenCapture(rect); + javax.imageio.ImageIO.write(img, "jpg", new java.io.File("NOK.jpg")); + + throw e; + } + + robot.waitForIdle(delay); + EventQueue.invokeAndWait(this::closeAll); + } +} diff --git a/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java b/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java new file mode 100644 index 00000000000..614b32cd090 --- /dev/null +++ b/jdk/test/java/awt/Modal/ModalitySettingsTest/ModalitySettingsTest.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import static jdk.testlibrary.Asserts.*; + +/* + * @test + * @bug 8047367 + * @summary Check modality settings for Window and Dialog. + * + * @library ../../../../lib/testlibrary/ + * @run main ModalitySettingsTest + */ + + + +public class ModalitySettingsTest { + + private void doTest() throws Exception { + + Window w = new Window(new Frame()); + + boolean unexpectedExc = false; + + try { + Dialog d = new Dialog(w); + } catch (IllegalArgumentException iae) { + } catch (Exception e) { + unexpectedExc = true; + } + + assertFalse(unexpectedExc, "unexpected exception occured when a " + + "Window instance was passed to Dialog constructor"); + + Dialog d = new Dialog((Frame) null); + assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS, + "the default modality type returned by Dialog " + + "differs from Dialog.ModalityType.MODELESS"); + + Frame f = new Frame(); + assertTrue(f.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE, + "the default modality exclusion type returned by Frame" + + "differs from Dialog.ModalExclusionType.NO_EXCLUDE"); + + w = new Window((Frame) null); + assertTrue(w.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE, + "the default modality exclusion type returned by Window " + + "differs from Dialog.ModalExclusionType.NO_EXCLUDE"); + + d = new Dialog((Frame) null); + assertTrue(d.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE, + "the default modality exclusion type returned by Dialog " + + "differs from Dialog.ModalExclusionType.NO_EXCLUDE"); + + d.setModalityType(Dialog.ModalityType.TOOLKIT_MODAL); + assertTrue(d.getModalityType() == Dialog.ModalityType.TOOLKIT_MODAL, + "the modality type returned by Dialog " + + "differs from Dialog.ModalityType.TOOLKIT_MODAL " + + "after setting the modality type to that value"); + + d.setModal(false); + assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS, + "the modality type returned by Dialog differs from " + + "Dialog.ModalityType.MODELESS after calling setModal(false)"); + + d.setModal(true); + assertTrue(d.getModalityType() == Dialog.ModalityType.APPLICATION_MODAL, + "the modality type returned by Dialog differs from " + + "Dialog.ModalityType.APPLICATION_MODAL after calling setModal(true)"); + + w.setModalExclusionType(Dialog.ModalExclusionType.APPLICATION_EXCLUDE); + assertTrue(w.getModalExclusionType() == + Dialog.ModalExclusionType.APPLICATION_EXCLUDE, + "getModalExclusionType method for Window did not return " + + "Dialog.ModalExclusionType.APPLICATION_EXCLUDE after " + + "setting it to that value"); + + d = new Dialog((Frame) null); + d.setModalityType(Dialog.ModalityType.TOOLKIT_MODAL); + assertTrue(d.isModal(), "method isModal for Dialog " + + "returned false when the Dialog is toolkit modal"); + + d.setModalityType(Dialog.ModalityType.MODELESS); + assertFalse(d.isModal(), "method isModal for Dialog " + + "returned true when the Dialog is MODELESS"); + + d = new Dialog((Frame) null, (Dialog.ModalityType) null); + assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS, + "The modality type returned for a Dialog constructed " + + "with null modality type differs from MODELESS"); + + d = new Dialog((Frame) null); + d.setModalityType(null); + assertTrue(d.getModalityType() == Dialog.ModalityType.MODELESS, + "the modality type returned for a Dialog set with null " + + "modality type differs from MODELESS"); + + d.setModalExclusionType(null); + assertTrue(d.getModalExclusionType() == Dialog.ModalExclusionType.NO_EXCLUDE, + "The exlcusion type returned for a Dialog set with null " + + "exclusion type differs from NO_EXCLUDE"); + + try { + Dialog.ModalityType.valueOf("invalid"); + } catch (IllegalArgumentException iae) { + } catch (Exception e) { + unexpectedExc = true; + } + + assertFalse(unexpectedExc, "unexpected exception occured when an " + + "invalid value was passed to ModalityType.valueOf method"); + } + + public static void main(String[] args) throws Exception { + ModalitySettingsTest test = new ModalitySettingsTest(); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java b/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java new file mode 100644 index 00000000000..f8632ff14df --- /dev/null +++ b/jdk/test/java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.event.KeyEvent; + +import static jdk.testlibrary.Asserts.*; + + +/* + * @test + * @bug 8047367 + * @summary Check whether a Dialog set with null modality type + * behaves like a modeless dialog + * + * @library ../helpers ../../../../lib/testlibrary/ + * @build ExtendedRobot + * @build Flag + * @build TestDialog + * @build TestFrame + * @build TestWindow + * @run main NullModalityDialogTest + */ + + +public class NullModalityDialogTest { + + class CustomDialog extends TestDialog { + public CustomDialog(Frame f) { + super(f); + } + @Override + public void doOpenAction() { + if (frame != null) { + frame.setVisible(true); + } + if (window != null) { + window.setVisible(true); + } + } + } + + class CustomFrame extends TestFrame { + @Override + public void doOpenAction() { + if (dialog != null) { + dialog.setVisible(true); + } + } + } + + private TestFrame parent; + private TestDialog dialog; + private TestFrame frame; + private TestWindow window; + + private static final int delay = 1000; + + private final ExtendedRobot robot; + + NullModalityDialogTest() throws Exception { + + robot = new ExtendedRobot(); + EventQueue.invokeLater(this::createGUI); + } + + private void createGUI() { + + parent = new CustomFrame(); + parent.setTitle("Parent"); + parent.setLocation(50, 50); + + dialog = new CustomDialog(parent); + dialog.setTitle("Dialog"); + dialog.setModalityType((Dialog.ModalityType) null); + dialog.setLocation(250, 50); + + frame = new TestFrame(); + frame.setTitle("Frame"); + frame.setLocation(50, 250); + + window = new TestWindow(frame); + window.setLocation(250, 250); + + parent.setVisible(true); + } + + private void closeAll() { + if (parent != null) { parent.dispose(); } + if (dialog != null) { dialog.dispose(); } + if (frame != null) { frame.dispose(); } + if (window != null) { window.dispose(); } + } + + public void doTest() throws Exception { + + robot.waitForIdle(delay); + + parent.clickOpenButton(robot); + robot.waitForIdle(delay); + + dialog.activated.waitForFlagTriggered(); + assertTrue(dialog.activated.flag(), "Dialog did not trigger " + + "Window Activated event when it became visible"); + + dialog.closeGained.waitForFlagTriggered(); + assertTrue(dialog.closeGained.flag(), "the 1st button did not gain focus " + + "when the Dialog became visible"); + + assertTrue(dialog.closeButton.hasFocus(), "the 1st button in the Dialog " + + "gained focus but lost it afterwards"); + + dialog.openGained.reset(); + + robot.type(KeyEvent.VK_TAB); + + dialog.openGained.waitForFlagTriggered(); + assertTrue(dialog.openGained.flag(), + "Tab navigation did not happen properly on Dialog. Open button " + + "did not gain focus on tab press when parent frame is visible"); + + dialog.clickOpenButton(robot); + robot.waitForIdle(delay); + + frame.activated.waitForFlagTriggered(); + assertTrue(frame.activated.flag(), "Frame did not trigger activated when " + + "made visible. Dialog and its parent frame are visible"); + + frame.checkUnblockedFrame(robot, "Frame is the parent of a visible Dialog."); + window.checkUnblockedWindow(robot, "Frame and its child Dialog are visible."); + + robot.waitForIdle(delay); + + EventQueue.invokeAndWait(this::closeAll); + } + + public static void main(String[] args) throws Exception { + NullModalityDialogTest test = new NullModalityDialogTest(); + test.doTest(); + } +} diff --git a/jdk/test/java/awt/Modal/helpers/TestDialog.java b/jdk/test/java/awt/Modal/helpers/TestDialog.java index a3791778bc1..d547886cddc 100644 --- a/jdk/test/java/awt/Modal/helpers/TestDialog.java +++ b/jdk/test/java/awt/Modal/helpers/TestDialog.java @@ -332,35 +332,47 @@ public class TestDialog extends Dialog implements ActionListener, "button did not gain focus. " + message); } - public void checkCloseButtonFocusGained() { - checkCloseButtonFocusGained(Flag.ATTEMPTS); + public void checkCloseButtonFocusGained(boolean refState) { + checkCloseButtonFocusGained(refState, Flag.ATTEMPTS); } - public void checkCloseButtonFocusGained(int attempts) { + public void checkCloseButtonFocusGained(boolean refState, int attempts) { try { closeGained.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - assertTrue(closeGained.flag(), - "dialog Close button did not gain focus"); + + String msg = "dialog Close button "; + msg += (refState ? "did not gain focus" : + "gained focus when it should not"); + + assertTrue(closeGained.flag() == refState, msg); } - public void checkOpenButtonFocusGained() { + public void checkOpenButtonFocusGained(boolean refState) { try { openGained.waitForFlagTriggered(); } catch (InterruptedException e) {} - assertTrue(openGained.flag(), - "dialog Open button did not gain focus"); + + String msg = "dialog Open button "; + msg += (refState ? "did not gain focus" : + "gained focus when it should not"); + + assertTrue(openGained.flag() == refState, msg); } - public void checkOpenButtonFocusLost() { - checkOpenButtonFocusLost(Flag.ATTEMPTS); + public void checkOpenButtonFocusLost(boolean refState) { + checkOpenButtonFocusLost(refState, Flag.ATTEMPTS); } - public void checkOpenButtonFocusLost(int attempts) { + public void checkOpenButtonFocusLost(boolean refState, int attempts) { try { openLost.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - assertTrue(openLost.flag(), - "dialog Open button did not lose focus"); + + String msg = "dialog Open button "; + msg += (refState ? "did not lose focus" : + "lost focus when it should not"); + + assertTrue(openLost.flag() == refState, msg); } } diff --git a/jdk/test/java/awt/Modal/helpers/TestFrame.java b/jdk/test/java/awt/Modal/helpers/TestFrame.java index 8b646f82291..7af2a3bf686 100644 --- a/jdk/test/java/awt/Modal/helpers/TestFrame.java +++ b/jdk/test/java/awt/Modal/helpers/TestFrame.java @@ -324,46 +324,50 @@ public class TestFrame extends Frame implements ActionListener, "button did not gain focus on tab press. " + message); } - public void checkCloseButtonFocusGained() { - checkCloseButtonFocusGained(Flag.ATTEMPTS); + public void checkCloseButtonFocusGained(boolean refState) { + checkCloseButtonFocusGained(refState, Flag.ATTEMPTS); } - public void checkCloseButtonFocusGained(int attempts) { - + public void checkCloseButtonFocusGained(boolean refState, int attempts) { try { closeGained.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - if (closeGained.flag()) { - Component focusOwner = - KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - assertTrue(closeButton.equals(focusOwner), - "close button gained focus, but it is not the current focus owner"); - } else { - assertTrue(false, "frame Close button did not gain focus"); - } + String msg = "frame Close button "; + msg += (refState ? "did not gain focus" : + "gained focus when it should not"); + + assertTrue(closeGained.flag() == refState, msg); } - public void checkOpenButtonFocusGained() { - try { - openGained.waitForFlagTriggered(); - } catch (InterruptedException e) {} - - if (openGained.flag()) { - Component focusOwner = - KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - assertTrue(openButton.equals(focusOwner), - "open button gained focus, but it is not the current focus owner"); - } else { - assertTrue(false, "frame Open button did not gain focus"); - } + public void checkOpenButtonFocusGained(boolean refState) { + checkOpenButtonFocusGained(refState, Flag.ATTEMPTS); } - public void checkOpenButtonFocusLost() { + public void checkOpenButtonFocusGained(boolean refState, int attempts) { try { - openLost.waitForFlagTriggered(); + openGained.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - assertTrue(openLost.flag(), "frame Open button did not lose focus"); + String msg = "frame Open button "; + msg += (refState ? "did not gain focus" : + "gained focus when it should not"); + + assertTrue(openGained.flag() == refState, msg); + } + + public void checkOpenButtonFocusLost(boolean refState) { + checkOpenButtonFocusLost(refState, Flag.ATTEMPTS); + } + + public void checkOpenButtonFocusLost(boolean refState, int attempts) { + try { + openLost.waitForFlagTriggered(attempts); + } catch (InterruptedException e) {} + + String msg = "frame Open button "; + msg += (refState ? "did not lose focus" : + "lost focus when it should not"); + assertTrue(openLost.flag()== refState, msg); } } diff --git a/jdk/test/java/awt/Modal/helpers/TestWindow.java b/jdk/test/java/awt/Modal/helpers/TestWindow.java index c929aefbf73..4e7cdb6fe79 100644 --- a/jdk/test/java/awt/Modal/helpers/TestWindow.java +++ b/jdk/test/java/awt/Modal/helpers/TestWindow.java @@ -295,39 +295,51 @@ public class TestWindow extends Window implements ActionListener, "button did not gain focus on tab press. " + message); } - public void checkCloseButtonFocusGained() { - checkCloseButtonFocusGained(Flag.ATTEMPTS); + public void checkCloseButtonFocusGained(boolean refState) { + checkCloseButtonFocusGained(refState, Flag.ATTEMPTS); } - public void checkCloseButtonFocusGained(int attempts) { + public void checkCloseButtonFocusGained(boolean refState, int attempts) { try { closeGained.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - assertTrue(closeGained.flag(), - "window Close button did not gain focus"); + + String msg = "window Close button "; + msg += (refState ? "did not gain focus" : + "gained focus when it should not"); + + assertTrue(closeGained.flag() == refState, msg); } - public void checkOpenButtonFocusGained() { - checkOpenButtonFocusGained(Flag.ATTEMPTS); + + public void checkOpenButtonFocusGained(boolean refState) { + checkOpenButtonFocusGained(refState, Flag.ATTEMPTS); } - public void checkOpenButtonFocusGained(int attempts) { + public void checkOpenButtonFocusGained(boolean refState, int attempts) { try { openGained.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - assertTrue(openGained.flag(), - "window Open button did not gain focus"); + + String msg = "window Open button "; + msg += (refState ? "did not gain focus" : + "gained focus when it should not"); + + assertTrue(openGained.flag() == refState, msg); } - public void checkOpenButtonFocusLost() { - checkOpenButtonFocusLost(Flag.ATTEMPTS); + public void checkOpenButtonFocusLost(boolean refState) { + checkOpenButtonFocusLost(refState, Flag.ATTEMPTS); } - public void checkOpenButtonFocusLost(int attempts) { + public void checkOpenButtonFocusLost(boolean refState, int attempts) { try { openLost.waitForFlagTriggered(attempts); } catch (InterruptedException e) {} - assertTrue(openLost.flag(), - "window Open button did not lose focus"); + + String msg = "window Open button "; + msg += (refState ? "did not lose focus" : + "lost focus when it should not"); + assertTrue(openLost.flag()== refState, msg); } } From 54e8ddf594b3be09d986973a9dc01a8c96b76a21 Mon Sep 17 00:00:00 2001 From: Steve Sides Date: Wed, 9 Jul 2014 15:14:06 +0400 Subject: [PATCH 006/111] 8046597: fix doclint issues in swing classes, part 4 of 4 Reviewed-by: pchelko --- .../classes/javax/swing/AbstractAction.java | 4 + .../classes/javax/swing/CellRendererPane.java | 27 ++++ .../classes/javax/swing/DebugGraphics.java | 48 ++++-- .../javax/swing/DefaultBoundedRangeModel.java | 6 + .../javax/swing/DefaultDesktopManager.java | 2 +- .../swing/DefaultSingleSelectionModel.java | 1 + .../classes/javax/swing/DesktopManager.java | 141 +++++++++++++----- .../share/classes/javax/swing/GrayFilter.java | 5 +- jdk/src/share/classes/javax/swing/Icon.java | 7 +- .../share/classes/javax/swing/JApplet.java | 11 +- .../share/classes/javax/swing/JComponent.java | 28 ++++ .../classes/javax/swing/JDesktopPane.java | 5 +- .../share/classes/javax/swing/JDialog.java | 6 + jdk/src/share/classes/javax/swing/JLabel.java | 12 ++ .../share/classes/javax/swing/JPopupMenu.java | 8 + .../classes/javax/swing/JScrollPane.java | 7 +- .../share/classes/javax/swing/JSpinner.java | 3 + .../share/classes/javax/swing/JTextField.java | 3 + .../share/classes/javax/swing/JWindow.java | 2 + .../classes/javax/swing/ProgressMonitor.java | 6 + .../classes/javax/swing/SpinnerModel.java | 1 + jdk/src/share/classes/javax/swing/Timer.java | 19 ++- 22 files changed, 290 insertions(+), 62 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/AbstractAction.java b/jdk/src/share/classes/javax/swing/AbstractAction.java index 1f0ef990243..5c8f6e6626f 100644 --- a/jdk/src/share/classes/javax/swing/AbstractAction.java +++ b/jdk/src/share/classes/javax/swing/AbstractAction.java @@ -269,6 +269,10 @@ public abstract class AbstractAction implements Action, Cloneable, Serializable * when a bound property has changed and it will send the appropriate * PropertyChangeEvent to any registered * PropertyChangeListeners. + * + * @param propertyName the name of the property that has changed + * @param oldValue the old value of the property + * @param newValue the new value of the property */ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport == null || diff --git a/jdk/src/share/classes/javax/swing/CellRendererPane.java b/jdk/src/share/classes/javax/swing/CellRendererPane.java index 6050693eeeb..c21a282bf29 100644 --- a/jdk/src/share/classes/javax/swing/CellRendererPane.java +++ b/jdk/src/share/classes/javax/swing/CellRendererPane.java @@ -120,6 +120,18 @@ public class CellRendererPane extends Container implements Accessible * The Container p is the component we're actually drawing on, typically it's * equal to this.getParent(). If shouldValidate is true the component c will be * validated before painted. + * + * @param g the {@code Graphics} object to draw on + * @param c the {@code Component} to draw + * @param p the {@code Container} component actually drawn on + * @param x an int specifying the left side of the area draw in, in pixels, + * measured from the left edge of the graphics context + * @param y an int specifying the top of the area to draw in, in pixels + * measured down from the top edge of the graphics context + * @param w an int specifying the width of the area draw in, in pixels + * @param h an int specifying the height of the area draw in, in pixels + * @param shouldValidate if true, component {@code c} will be validated + * before being painted */ public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate) { if (c == null) { @@ -166,6 +178,16 @@ public class CellRendererPane extends Container implements Accessible /** * Calls this.paintComponent(g, c, p, x, y, w, h, false). + * + * @param g the {@code Graphics} object to draw on + * @param c the {@code Component} to draw + * @param p the {@code Container} component actually drawn on + * @param x an int specifying the left side of the area draw in, in pixels, + * measured from the left edge of the graphics context + * @param y an int specifying the top of the area to draw in, in pixels + * measured down from the top edge of the graphics context + * @param w an int specifying the width of the area draw in, in pixels + * @param h an int specifying the height of the area draw in, in pixels */ public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h) { paintComponent(g, c, p, x, y, w, h, false); @@ -174,6 +196,11 @@ public class CellRendererPane extends Container implements Accessible /** * Calls this.paintComponent() with the rectangles x,y,width,height fields. + * + * @param g the {@code Graphics} object to draw on + * @param c the {@code Component} to draw + * @param p the {@code Container} component actually drawn on + * @param r the {@code Rectangle} to draw in */ public void paintComponent(Graphics g, Component c, Container p, Rectangle r) { paintComponent(g, c, p, r.x, r.y, r.width, r.height); diff --git a/jdk/src/share/classes/javax/swing/DebugGraphics.java b/jdk/src/share/classes/javax/swing/DebugGraphics.java index 99a4f5b07ee..050ce604c69 100644 --- a/jdk/src/share/classes/javax/swing/DebugGraphics.java +++ b/jdk/src/share/classes/javax/swing/DebugGraphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -139,6 +139,8 @@ public class DebugGraphics extends Graphics { /** * Sets the Color used to flash drawing operations. + * + * @param flashColor the Color used to flash drawing operations */ public static void setFlashColor(Color flashColor) { info().flashColor = flashColor; @@ -146,6 +148,8 @@ public class DebugGraphics extends Graphics { /** * Returns the Color used to flash drawing operations. + * + * @return the Color used to flash drawing operations * @see #setFlashColor */ public static Color flashColor() { @@ -154,6 +158,8 @@ public class DebugGraphics extends Graphics { /** * Sets the time delay of drawing operation flashing. + * + * @param flashTime the time delay of drawing operation flashing */ public static void setFlashTime(int flashTime) { info().flashTime = flashTime; @@ -161,6 +167,8 @@ public class DebugGraphics extends Graphics { /** * Returns the time delay of drawing operation flashing. + * + * @return the time delay of drawing operation flashing * @see #setFlashTime */ public static int flashTime() { @@ -169,27 +177,38 @@ public class DebugGraphics extends Graphics { /** * Sets the number of times that drawing operations will flash. + * + * @param flashCount number of times that drawing operations will flash */ public static void setFlashCount(int flashCount) { info().flashCount = flashCount; } - /** Returns the number of times that drawing operations will flash. - * @see #setFlashCount - */ + /** + * Returns the number of times that drawing operations will flash. + * + * @return the number of times that drawing operations will flash + * @see #setFlashCount + */ public static int flashCount() { return info().flashCount; } - /** Sets the stream to which the DebugGraphics logs drawing operations. - */ + /** + * Sets the stream to which the DebugGraphics logs drawing operations. + * + * @param stream the stream to which the DebugGraphics logs drawing operations + */ public static void setLogStream(java.io.PrintStream stream) { info().stream = stream; } - /** Returns the stream to which the DebugGraphics logs drawing operations. - * @see #setLogStream - */ + /** + * Returns the stream to which the DebugGraphics logs drawing operations. + * + * @return the stream to which the DebugGraphics logs drawing operations + * @see #setLogStream + */ public static java.io.PrintStream logStream() { return info().stream; } @@ -1337,6 +1356,8 @@ public class DebugGraphics extends Graphics { * creates a new Frame that shows each operation on an * offscreen buffer. The value of options is bitwise OR'd into * the current value. To disable debugging use NONE_OPTION. + * + * @param options indicates how diagnostic information should be displayed */ public void setDebugOptions(int options) { if (options != 0) { @@ -1356,9 +1377,12 @@ public class DebugGraphics extends Graphics { } } - /** Returns the current debugging options for this DebugGraphics. - * @see #setDebugOptions - */ + /** + * Returns the current debugging options for this DebugGraphics. + * + * @return the current debugging options for this DebugGraphics + * @see #setDebugOptions + */ public int getDebugOptions() { return debugOptions; } diff --git a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java index b7b989e07fa..20f44a28ea3 100644 --- a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java @@ -88,6 +88,11 @@ public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable *

          * min <= value <= value+extent <= max
          * 
    + * + * @param value an int giving the current value + * @param extent the length of the inner range that begins at the model's value + * @param min an int giving the minimum value + * @param max an int giving the maximum value */ public DefaultBoundedRangeModel(int value, int extent, int min, int max) { @@ -403,6 +408,7 @@ public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable * If no such listeners exist, * this method returns an empty array. * + * @param the type of {@code EventListener} class being requested * @param listenerType the type of listeners requested; * this parameter should specify an interface * that descends from java.util.EventListener diff --git a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java index ebee71521d9..49eecf1e77c 100644 --- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java @@ -71,7 +71,7 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab private transient boolean didDrag; /** Normally this method will not be called. If it is, it - * try to determine the appropriate parent from the desktopIcon of the frame. + * tries to determine the appropriate parent from the desktopIcon of the frame. * Will remove the desktopIcon from its parent if it successfully adds the frame. */ public void openFrame(JInternalFrame f) { diff --git a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java index 75c522e79c9..532639c071f 100644 --- a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java @@ -155,6 +155,7 @@ Serializable { * If no such listeners exist, * this method returns an empty array. * + * @param the type of {@code EventListener} class being requested * @param listenerType the type of listeners requested; * this parameter should specify an interface * that descends from java.util.EventListener diff --git a/jdk/src/share/classes/javax/swing/DesktopManager.java b/jdk/src/share/classes/javax/swing/DesktopManager.java index edcfaf4fabb..5e08a6f139d 100644 --- a/jdk/src/share/classes/javax/swing/DesktopManager.java +++ b/jdk/src/share/classes/javax/swing/DesktopManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,73 +47,136 @@ package javax.swing; */ public interface DesktopManager { - /** If possible, display this frame in an appropriate location. - * Normally, this is not called, as the creator of the JInternalFrame - * will add the frame to the appropriate parent. - */ + /** + * If possible, display this frame in an appropriate location. + * Normally, this is not called, as the creator of the JInternalFrame + * will add the frame to the appropriate parent. + * + * @param f the {@code JInternalFrame} to be displayed + */ void openFrame(JInternalFrame f); - /** Generally, this call should remove the frame from it's parent. */ + /** + * Generally, this call should remove the frame from its parent. + * + * @param f the {@code JInternalFrame} to be removed + */ void closeFrame(JInternalFrame f); - /** Generally, the frame should be resized to match it's parents bounds. */ + /** + * Generally, the frame should be resized to match its parents bounds. + * + * @param f the {@code JInternalFrame} to be resized + */ void maximizeFrame(JInternalFrame f); - /** Generally, this indicates that the frame should be restored to it's - * size and position prior to a maximizeFrame() call. - */ + + /** + * Generally, this indicates that the frame should be restored to its + * size and position prior to a maximizeFrame() call. + * + * @param f the {@code JInternalFrame} to be restored + */ void minimizeFrame(JInternalFrame f); - /** Generally, remove this frame from it's parent and add an iconic representation. */ + + /** + * Generally, remove this frame from its parent and add an iconic representation. + * + * @param f the {@code JInternalFrame} to be iconified + */ void iconifyFrame(JInternalFrame f); - /** Generally, remove any iconic representation that is present and restore the - * frame to it's original size and location. - */ + + /** + * Generally, remove any iconic representation that is present and restore the + * frame to it's original size and location. + * + * @param f the {@code JInternalFrame} to be de-iconified + */ void deiconifyFrame(JInternalFrame f); /** * Generally, indicate that this frame has focus. This is usually called after * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true. + * + * @param f the {@code JInternalFrame} to be activated */ void activateFrame(JInternalFrame f); /** * Generally, indicate that this frame has lost focus. This is usually called * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false. + * + * @param f the {@code JInternalFrame} to be deactivated */ void deactivateFrame(JInternalFrame f); - /** This method is normally called when the user has indicated that - * they will begin dragging a component around. This method should be called - * prior to any dragFrame() calls to allow the DesktopManager to prepare any - * necessary state. Normally f will be a JInternalFrame. - */ + /** + * This method is normally called when the user has indicated that + * they will begin dragging a component around. This method should be called + * prior to any dragFrame() calls to allow the DesktopManager to prepare any + * necessary state. Normally f will be a JInternalFrame. + * + * @param f the {@code JComponent} being dragged + */ void beginDraggingFrame(JComponent f); - /** The user has moved the frame. Calls to this method will be preceded by calls - * to beginDraggingFrame(). - * Normally f will be a JInternalFrame. - */ + /** + * The user has moved the frame. Calls to this method will be preceded by calls + * to beginDraggingFrame(). + * Normally f will be a JInternalFrame. + * + * @param f the {@code JComponent} being dragged + * @param newX the new x-coordinate + * @param newY the new y-coordinate + */ void dragFrame(JComponent f, int newX, int newY); - /** This method signals the end of the dragging session. Any state maintained by - * the DesktopManager can be removed here. Normally f will be a JInternalFrame. - */ + + /** + * This method signals the end of the dragging session. Any state maintained by + * the DesktopManager can be removed here. Normally f will be a JInternalFrame. + * + * @param f the {@code JComponent} being dragged + */ void endDraggingFrame(JComponent f); - /** This methods is normally called when the user has indicated that - * they will begin resizing the frame. This method should be called - * prior to any resizeFrame() calls to allow the DesktopManager to prepare any - * necessary state. Normally f will be a JInternalFrame. - */ + /** + * This method is normally called when the user has indicated that + * they will begin resizing the frame. This method should be called + * prior to any resizeFrame() calls to allow the DesktopManager to prepare any + * necessary state. Normally f will be a JInternalFrame. + * + * @param f the {@code JComponent} being resized + */ void beginResizingFrame(JComponent f, int direction); - /** The user has resized the component. Calls to this method will be preceded by calls - * to beginResizingFrame(). - * Normally f will be a JInternalFrame. - */ + + /** + * The user has resized the component. Calls to this method will be preceded by calls + * to beginResizingFrame(). + * Normally f will be a JInternalFrame. + * + * @param f the {@code JComponent} being resized + * @param newX the new x-coordinate + * @param newY the new y-coordinate + * @param newWidth the new width + * @param newHeight the new height + */ void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight); - /** This method signals the end of the resize session. Any state maintained by - * the DesktopManager can be removed here. Normally f will be a JInternalFrame. - */ + + /** + * This method signals the end of the resize session. Any state maintained by + * the DesktopManager can be removed here. Normally f will be a JInternalFrame. + * + * @param f the {@code JComponent} being resized + */ void endResizingFrame(JComponent f); - /** This is a primitive reshape method.*/ + /** + * This is a primitive reshape method. + * + * @param f the {@code JComponent} being moved or resized + * @param newX the new x-coordinate + * @param newY the new y-coordinate + * @param newWidth the new width + * @param newHeight the new height + */ void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight); } diff --git a/jdk/src/share/classes/javax/swing/GrayFilter.java b/jdk/src/share/classes/javax/swing/GrayFilter.java index 573edbedb63..af5947e5eec 100644 --- a/jdk/src/share/classes/javax/swing/GrayFilter.java +++ b/jdk/src/share/classes/javax/swing/GrayFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,9 @@ public class GrayFilter extends RGBImageFilter { /** * Creates a disabled image + * + * @param i an {@code Image} to be created as disabled + * @return the new grayscale image created from {@code i} */ public static Image createDisabledImage (Image i) { GrayFilter filter = new GrayFilter(true, 50); diff --git a/jdk/src/share/classes/javax/swing/Icon.java b/jdk/src/share/classes/javax/swing/Icon.java index 87c53684711..4bad4d461d3 100644 --- a/jdk/src/share/classes/javax/swing/Icon.java +++ b/jdk/src/share/classes/javax/swing/Icon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,11 @@ public interface Icon * Draw the icon at the specified location. Icon implementations * may use the Component argument to get properties useful for * painting, e.g. the foreground or background color. + * + * @param c a {@code Component} to get properties useful for painting + * @param g the graphics context + * @param x the X coordinate of the icon's top-left corner + * @param y the Y coordinate of the icon's top-left corner */ void paintIcon(Component c, Graphics g, int x, int y); diff --git a/jdk/src/share/classes/javax/swing/JApplet.java b/jdk/src/share/classes/javax/swing/JApplet.java index 651d004660d..5f857076027 100644 --- a/jdk/src/share/classes/javax/swing/JApplet.java +++ b/jdk/src/share/classes/javax/swing/JApplet.java @@ -157,8 +157,11 @@ public class JApplet extends Applet implements Accessible, enableEvents(AWTEvent.KEY_EVENT_MASK); } - - /** Called by the constructor methods to create the default rootPane. */ + /** + * Called by the constructor methods to create the default rootPane. + * + * @return a new {@code JRootPane} + */ protected JRootPane createRootPane() { JRootPane rp = new JRootPane(); // NOTE: this uses setOpaque vs LookAndFeel.installProperty as there @@ -247,6 +250,7 @@ public class JApplet extends Applet implements Accessible, /** * Returns the menubar set on this applet. * + * @return the menubar set on this applet * @see #setJMenuBar */ public JMenuBar getJMenuBar() { @@ -542,6 +546,9 @@ public class JApplet extends Applet implements Accessible, // Accessibility support //////////////// + /** + * {@code AccessibleContext} associated with this {@code JApplet} + */ protected AccessibleContext accessibleContext = null; /** diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index 7d0b876dc9d..765610ebbad 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -496,6 +496,7 @@ public abstract class JComponent extends Container implements Serializable, /** * Returns true if the JPopupMenu should be inherited from the parent. * + * @return true if the JPopupMenu should be inherited from the parent * @see #setComponentPopupMenu * @since 1.5 */ @@ -1302,6 +1303,7 @@ public abstract class JComponent extends Container implements Serializable, * SortingFocusTraversalPolicy from considering descendants * of this JComponent when computing a focus traversal cycle. * + * @return false * @see java.awt.Component#setFocusTraversalKeys * @see SortingFocusTraversalPolicy * @deprecated As of 1.4, replaced by @@ -2213,6 +2215,13 @@ public abstract class JComponent extends Container implements Serializable, * This method is now obsolete, please use a combination of * getActionMap() and getInputMap() for * similar behavior. + * + * @param anAction action to be registered to given keystroke and condition + * @param aKeyStroke a {@code KeyStroke} + * @param aCondition the condition to be associated with given keystroke + * and action + * @see #getActionMap + * @see #getInputMap(int) */ public void registerKeyboardAction(ActionListener anAction,KeyStroke aKeyStroke,int aCondition) { registerKeyboardAction(anAction,null,aKeyStroke,aCondition); @@ -2231,6 +2240,9 @@ public abstract class JComponent extends Container implements Serializable, * Unregisters a keyboard action. * This will remove the binding from the ActionMap * (if it exists) as well as the InputMaps. + * + * @param aKeyStroke the keystroke for which to unregister its + * keyboard action */ public void unregisterKeyboardAction(KeyStroke aKeyStroke) { ActionMap am = getActionMap(false); @@ -2286,6 +2298,8 @@ public abstract class JComponent extends Container implements Serializable, * conditions WHEN_FOCUSED and * WHEN_IN_FOCUSED_WINDOW condition. * + * @param aKeyStroke the keystroke for which to request an + * action-keystroke condition * @return the action-keystroke condition */ public int getConditionForKeyStroke(KeyStroke aKeyStroke) { @@ -2302,6 +2316,7 @@ public abstract class JComponent extends Container implements Serializable, * Returns the object that will perform the action registered for a * given keystroke. * + * @param aKeyStroke the keystroke for which to return a listener * @return the ActionListener * object invoked when the keystroke occurs */ @@ -2610,6 +2625,8 @@ public abstract class JComponent extends Container implements Serializable, * FocusTraversalPolicy of this JComponent's * focus-cycle-root ancestor is used. * + * @return true if this component can request to get the input focus, + * false if it can not * @see java.awt.FocusTraversalPolicy#getDefaultComponent * @deprecated As of 1.4, replaced by * FocusTraversalPolicy.getDefaultComponent(Container).requestFocus() @@ -2821,6 +2838,8 @@ public abstract class JComponent extends Container implements Serializable, * normally override this method if they process some * key events themselves. If the event is processed, * it should be consumed. + * + * @param e the event to be processed */ protected void processComponentKeyEvent(KeyEvent e) { } @@ -3032,6 +3051,10 @@ public abstract class JComponent extends Container implements Serializable, * setToolTipText. If a component provides * more extensive API to support differing tooltips at different locations, * this method should be overridden. + * + * @param event the {@code MouseEvent} that initiated the + * {@code ToolTip} display + * @return a string containing the tooltip */ public String getToolTipText(MouseEvent event) { return getToolTipText(); @@ -3774,6 +3797,10 @@ public abstract class JComponent extends Container implements Serializable, * but not very pretty outside borders in compound border situations. * It's rather arbitrary, but hopefully decent UI programmers will * not create multiple titled borders for the same component. + * + * @param b the {@code Border} for which to retrieve its title + * @return the border's title as a {@code String}, null if it has + * no title */ protected String getBorderTitle(Border b) { String s; @@ -4198,6 +4225,7 @@ public abstract class JComponent extends Container implements Serializable, * Returns true if this component is lightweight, that is, if it doesn't * have a native window system peer. * + * @param c the {@code Component} to be checked * @return true if this component is lightweight */ @SuppressWarnings("deprecation") diff --git a/jdk/src/share/classes/javax/swing/JDesktopPane.java b/jdk/src/share/classes/javax/swing/JDesktopPane.java index 35d53d2d918..54142344e37 100644 --- a/jdk/src/share/classes/javax/swing/JDesktopPane.java +++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java @@ -208,8 +208,11 @@ public class JDesktopPane extends JLayeredPane implements Accessible } /** - * Returns the DesktopManger that handles + * Returns the {@code DesktopManger} that handles * desktop-specific UI actions. + * + * @return the {@code DesktopManger} that handles desktop-specific + * UI actions */ public DesktopManager getDesktopManager() { return desktopManager; diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java index ae0a3519e93..00e8198b03e 100644 --- a/jdk/src/share/classes/javax/swing/JDialog.java +++ b/jdk/src/share/classes/javax/swing/JDialog.java @@ -664,6 +664,8 @@ public class JDialog extends Dialog implements WindowConstants, /** * Called by the constructor methods to create the default * {@code rootPane}. + * + * @return a new {@code JRootPane} */ protected JRootPane createRootPane() { JRootPane rp = new JRootPane(); @@ -854,6 +856,7 @@ public class JDialog extends Dialog implements WindowConstants, /** * Returns the menubar set on this dialog. * + * @return the menubar set on this dialog * @see #setJMenuBar */ public JMenuBar getJMenuBar() { @@ -1225,6 +1228,9 @@ public class JDialog extends Dialog implements WindowConstants, // Accessibility support //////////////// + /** + * {@code AccessibleContext} associated with this {@code JDialog} + */ protected AccessibleContext accessibleContext = null; /** diff --git a/jdk/src/share/classes/javax/swing/JLabel.java b/jdk/src/share/classes/javax/swing/JLabel.java index 2b0be80b1c7..3191f84ccf5 100644 --- a/jdk/src/share/classes/javax/swing/JLabel.java +++ b/jdk/src/share/classes/javax/swing/JLabel.java @@ -128,6 +128,10 @@ public class JLabel extends JComponent implements SwingConstants, Accessible private int horizontalTextPosition = TRAILING; private int iconTextGap = 4; + /** + * The Component this label is for; null if the label + * is not the label for a component + */ protected Component labelFor = null; /** @@ -310,6 +314,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible *

    * This is a JavaBeans bound property. * + * @param text the single line of text this component will display * @see #setVerticalTextPosition * @see #setHorizontalTextPosition * @see #setIcon @@ -366,6 +371,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible *

    * This is a JavaBeans bound property. * + * @param icon the default icon this component will display * @see #setVerticalTextPosition * @see #setHorizontalTextPosition * @see #getIcon @@ -476,6 +482,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * call the requestFocus method of the component specified by the * labelFor property when the mnemonic is activated. * + * @param key a keycode that indicates a mnemonic key * @see #getLabelFor * @see #setLabelFor * @beaninfo @@ -592,6 +599,8 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * * @param key the property value to check * @param message the IllegalArgumentException detail message + * @return the key value if {@code key} is a a legal value for the + * horizontalAlignment properties * @exception IllegalArgumentException if key isn't LEFT, CENTER, RIGHT, * LEADING or TRAILING. * @see #setHorizontalTextPosition @@ -617,6 +626,8 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * * @param key the property value to check * @param message the IllegalArgumentException detail message + * @return the key value if {@code key} is a legal value for the + * verticalAlignment or verticalTextPosition properties * @exception IllegalArgumentException if key isn't TOP, CENTER, or BOTTOM. * @see #setVerticalAlignment * @see #setVerticalTextPosition @@ -652,6 +663,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible *

    * This is a JavaBeans bound property. * + * @param iconTextGap the space between the icon and text properties * @see #getIconTextGap * @beaninfo * bound: true diff --git a/jdk/src/share/classes/javax/swing/JPopupMenu.java b/jdk/src/share/classes/javax/swing/JPopupMenu.java index 3f2a57323a5..ca00144b774 100644 --- a/jdk/src/share/classes/javax/swing/JPopupMenu.java +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java @@ -298,6 +298,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { * it to the end of this menu. * * @param s the string for the menu item to be added + * @return a new {@code JMenuItem} created using {@code s} */ public JMenuItem add(String s) { return add(new JMenuItem(s)); @@ -452,6 +453,9 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { /** * Returns a properly configured PropertyChangeListener * which updates the control as changes to the Action occur. + * + * @param b the menu item for which to create a listener + * @return a properly configured {@code PropertyChangeListener} */ protected PropertyChangeListener createActionChangeListener(JMenuItem b) { return b.createActionPropertyChangeListener0(b.getAction()); @@ -1530,6 +1534,9 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { @SuppressWarnings("serial") static public class Separator extends JSeparator { + /** + * Constructs a popup menu-specific Separator. + */ public Separator( ) { super( JSeparator.HORIZONTAL ); @@ -1553,6 +1560,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { * Returns true if the MouseEvent is considered a popup trigger * by the JPopupMenu's currently installed UI. * + * @param e a {@code MouseEvent} * @return true if the mouse event is a popup trigger * @since 1.3 */ diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java index 373523e936e..39700a68429 100644 --- a/jdk/src/share/classes/javax/swing/JScrollPane.java +++ b/jdk/src/share/classes/javax/swing/JScrollPane.java @@ -1102,6 +1102,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * setColumnHeaderView * to add a column header component and its viewport to the scroll pane. * + * @param columnHeader a {@code JViewport} which is the new column header * @see #getColumnHeader * @see #setColumnHeaderView * @@ -1299,6 +1300,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * Indicates whether or not scrolling will take place in response to the * mouse wheel. Wheel scrolling is enabled by default. * + * @return true if mouse wheel scrolling is enabled, false otherwise * @see #setWheelScrollingEnabled * @since 1.4 * @beaninfo @@ -1448,9 +1450,12 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce protected class AccessibleJScrollPane extends AccessibleJComponent implements ChangeListener, PropertyChangeListener { + /** + * this {@code JScrollPane}'s current {@code JViewport} + */ protected JViewport viewPort = null; - /* + /** * Resets the viewport ChangeListener and PropertyChangeListener */ public void resetViewPort() { diff --git a/jdk/src/share/classes/javax/swing/JSpinner.java b/jdk/src/share/classes/javax/swing/JSpinner.java index 1643257dec5..2e51212ff3a 100644 --- a/jdk/src/share/classes/javax/swing/JSpinner.java +++ b/jdk/src/share/classes/javax/swing/JSpinner.java @@ -149,6 +149,7 @@ public class JSpinner extends JComponent implements Accessible * a set of previous/next buttons, and an editor appropriate * for the model. * + * @param model a model for the new spinner * @throws NullPointerException if the model is {@code null} */ public JSpinner(SpinnerModel model) { @@ -328,6 +329,7 @@ public class JSpinner extends JComponent implements Accessible * getModel().getValue() * * + * @return the current value of the model * @see #setValue * @see SpinnerModel#getValue */ @@ -349,6 +351,7 @@ public class JSpinner extends JComponent implements Accessible * getModel().setValue(value) * * + * @param value new value for the spinner * @throws IllegalArgumentException if value isn't allowed * @see #getValue * @see SpinnerModel#setValue diff --git a/jdk/src/share/classes/javax/swing/JTextField.java b/jdk/src/share/classes/javax/swing/JTextField.java index e90740362f5..94290052870 100644 --- a/jdk/src/share/classes/javax/swing/JTextField.java +++ b/jdk/src/share/classes/javax/swing/JTextField.java @@ -675,6 +675,9 @@ public class JTextField extends JTextComponent implements SwingConstants { * that of the Action. * * @param a the textfield's action + * @return a {@code PropertyChangeListener} that is responsible for + * listening for changes from the specified {@code Action} and + * updating the appropriate properties * @since 1.3 * @see Action * @see #setAction diff --git a/jdk/src/share/classes/javax/swing/JWindow.java b/jdk/src/share/classes/javax/swing/JWindow.java index cf95a417fd5..804d4e3edc7 100644 --- a/jdk/src/share/classes/javax/swing/JWindow.java +++ b/jdk/src/share/classes/javax/swing/JWindow.java @@ -272,6 +272,8 @@ public class JWindow extends Window implements Accessible, /** * Called by the constructor methods to create the default * rootPane. + * + * @return a new {@code JRootPane} */ protected JRootPane createRootPane() { JRootPane rp = new JRootPane(); diff --git a/jdk/src/share/classes/javax/swing/ProgressMonitor.java b/jdk/src/share/classes/javax/swing/ProgressMonitor.java index 506b443b4f5..e2af3ee44cd 100644 --- a/jdk/src/share/classes/javax/swing/ProgressMonitor.java +++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java @@ -369,6 +369,8 @@ public class ProgressMonitor implements Accessible /** * Returns true if the user hits the Cancel button in the progress dialog. + * + * @return true if the user hits the Cancel button in the progress dialog */ public boolean isCanceled() { if (pane == null) return false; @@ -396,6 +398,8 @@ public class ProgressMonitor implements Accessible * Returns the amount of time this object waits before deciding whether * or not to popup a progress monitor. * + * @return the amount of time in milliseconds this object waits before + * deciding whether or not to popup a progress monitor * @see #setMillisToDecideToPopup */ public int getMillisToDecideToPopup() { @@ -419,6 +423,8 @@ public class ProgressMonitor implements Accessible /** * Returns the amount of time it will take for the popup to appear. * + * @return the amont of time in milliseconds it will take for the + * popup to appear * @see #setMillisToPopup */ public int getMillisToPopup() { diff --git a/jdk/src/share/classes/javax/swing/SpinnerModel.java b/jdk/src/share/classes/javax/swing/SpinnerModel.java index 7c060248eac..57af106271f 100644 --- a/jdk/src/share/classes/javax/swing/SpinnerModel.java +++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java @@ -88,6 +88,7 @@ public interface SpinnerModel * that case, model.setValue(new Number(11)) * would throw an exception. * + * @param value new value for the spinner * @throws IllegalArgumentException if value isn't allowed * @see #getValue */ diff --git a/jdk/src/share/classes/javax/swing/Timer.java b/jdk/src/share/classes/javax/swing/Timer.java index 2c25598b88c..6caced7dd8d 100644 --- a/jdk/src/share/classes/javax/swing/Timer.java +++ b/jdk/src/share/classes/javax/swing/Timer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -154,6 +154,9 @@ public class Timer implements Serializable * NOTE: all fields need to be handled in readResolve */ + /** + * The collection of registered listeners + */ protected EventListenerList listenerList = new EventListenerList(); // The following field strives to maintain the following: @@ -335,6 +338,7 @@ public class Timer implements Serializable * If no such listeners exist, * this method returns an empty array. * + * @param the type of {@code EventListener} class being requested * @param listenerType the type of listeners requested; * this parameter should specify an interface * that descends from java.util.EventListener @@ -410,6 +414,7 @@ public class Timer implements Serializable * Returns the delay, in milliseconds, * between firings of action events. * + * @return the delay, in milliseconds, between firings of action events * @see #setDelay * @see #getInitialDelay */ @@ -441,8 +446,9 @@ public class Timer implements Serializable /** - * Returns the Timer's initial delay. + * Returns the {@code Timer}'s initial delay. * + * @return the {@code Timer}'s intial delay, in milliseconds * @see #setInitialDelay * @see #setDelay */ @@ -470,6 +476,8 @@ public class Timer implements Serializable * an action event * to its listeners multiple times. * + * @return true if the {@code Timer} will send an action event to its + * listeners multiple times * @see #setRepeats */ public boolean isRepeats() { @@ -506,9 +514,11 @@ public class Timer implements Serializable /** - * Returns true if the Timer coalesces + * Returns {@code true} if the {@code Timer} coalesces * multiple pending action events. * + * @return true if the {@code Timer} coalesces multiple pending + * action events * @see #setCoalesce */ public boolean isCoalesce() { @@ -555,8 +565,9 @@ public class Timer implements Serializable /** - * Returns true if the Timer is running. + * Returns {@code true} if the {@code Timer} is running. * + * @return true if the {@code Timer} is running, false otherwise * @see #start */ public boolean isRunning() { From 529b1b6422b88a3f590d88bf94d07ea6702cb2f5 Mon Sep 17 00:00:00 2001 From: Andrei Eremeev Date: Wed, 9 Jul 2014 17:11:53 +0400 Subject: [PATCH 007/111] 8043968: Fix doclint warnings from javax.swing.plaf.basic package, 1 of 7 Reviewed-by: pchelko --- .../swing/plaf/basic/BasicArrowButton.java | 2 + .../swing/plaf/basic/BasicButtonListener.java | 20 +++- .../plaf/basic/BasicCheckBoxMenuItemUI.java | 19 +++- .../swing/plaf/basic/BasicCheckBoxUI.java | 7 ++ .../swing/plaf/basic/BasicColorChooserUI.java | 47 +++++++++- .../swing/plaf/basic/BasicComboBoxEditor.java | 6 ++ .../plaf/basic/BasicComboBoxRenderer.java | 3 + .../swing/plaf/basic/BasicDesktopPaneUI.java | 40 ++++++++ .../swing/plaf/basic/BasicDirectoryModel.java | 43 ++++++++- .../swing/plaf/basic/BasicGraphicsUtils.java | 93 +++++++++++++++++-- .../javax/swing/plaf/basic/BasicHTML.java | 11 +++ .../swing/plaf/basic/BasicIconFactory.java | 40 ++++++++ .../swing/plaf/basic/BasicMenuBarUI.java | 48 +++++++++- .../javax/swing/plaf/basic/BasicMenuUI.java | 51 ++++++++++ .../javax/swing/plaf/basic/BasicPanelUI.java | 18 +++- .../plaf/basic/BasicPopupMenuSeparatorUI.java | 8 +- .../swing/plaf/basic/BasicPopupMenuUI.java | 38 +++++++- .../basic/BasicRadioButtonMenuItemUI.java | 16 +++- .../swing/plaf/basic/BasicRadioButtonUI.java | 24 ++++- .../swing/plaf/basic/BasicRootPaneUI.java | 48 +++++++++- .../swing/plaf/basic/BasicSeparatorUI.java | 39 +++++++- .../swing/plaf/basic/BasicSpinnerUI.java | 2 + .../swing/plaf/basic/BasicTableHeaderUI.java | 28 +++++- .../javax/swing/plaf/basic/BasicTextUI.java | 12 +++ .../swing/plaf/basic/BasicToggleButtonUI.java | 16 +++- .../plaf/basic/BasicToolBarSeparatorUI.java | 8 +- .../swing/plaf/basic/BasicToolTipUI.java | 39 +++++++- .../swing/plaf/basic/BasicViewportUI.java | 18 +++- .../javax/swing/plaf/basic/ComboPopup.java | 4 + .../swing/plaf/basic/DefaultMenuLayout.java | 11 +++ 30 files changed, 714 insertions(+), 45 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java index 750fe60c235..4c1e590779e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java @@ -99,6 +99,8 @@ public class BasicArrowButton extends JButton implements SwingConstants /** * Returns the direction of the arrow. + * + * @return the direction of the arrow */ public int getDirection() { return direction; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java index 1367e0c58a8..3278d33e4a9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,6 +58,11 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, } + /** + * Constructs a new instance of {@code BasicButtonListener}. + * + * @param b an abstract button + */ public BasicButtonListener(AbstractButton b) { } @@ -76,13 +81,20 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, } } + /** + * Checks the opacity of the {@code AbstractButton}. + * + * @param b an abstract button + */ protected void checkOpacity(AbstractButton b) { b.setOpaque( b.isContentAreaFilled() ); } /** * Register default key actions: pressing space to "click" a - * button and registring the keyboard mnemonic (if any). + * button and registering the keyboard mnemonic (if any). + * + * @param c a component */ public void installKeyboardActions(JComponent c) { AbstractButton b = (AbstractButton)c; @@ -98,7 +110,9 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, } /** - * Unregister's default key actions + * Unregister default key actions. + * + * @param c a component */ public void uninstallKeyboardActions(JComponent c) { SwingUtilities.replaceUIInputMap(c, JComponent. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java index 69a28c61723..99ffc834844 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,6 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.*; -import javax.swing.border.*; -import java.io.Serializable; - /** * BasicCheckboxMenuItem implementation @@ -42,6 +39,12 @@ import java.io.Serializable; */ public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI { + /** + * Constructs a new instance of {@code BasicCheckBoxMenuItemUI}. + * + * @param c a component + * @return a new instance of {@code BasicCheckBoxMenuItemUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicCheckBoxMenuItemUI(); } @@ -50,6 +53,14 @@ public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI { return "CheckBoxMenuItem"; } + /** + * Invoked when mouse event occurs. + * + * @param item a menu item + * @param e a mouse event + * @param path an array of {@code MenuElement} + * @param manager an instance of {@code MenuSelectionManager} + */ public void processMouseEvent(JMenuItem item,MouseEvent e,MenuElement path[],MenuSelectionManager manager) { Point p = e.getPoint(); if(p.x >= 0 && p.x < item.getWidth() && diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java index 256a3afbfcf..d0deeb59ca5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java @@ -59,6 +59,13 @@ public class BasicCheckBoxUI extends BasicRadioButtonUI { // ******************************** // Create PLAF // ******************************** + + /** + * Returns an instance of {@code BasicCheckBoxUI}. + * + * @param b a component + * @return an instance of {@code BasicCheckBoxUI} + */ public static ComponentUI createUI(JComponent b) { AppContext appContext = AppContext.getAppContext(); BasicCheckBoxUI checkboxUI = diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java index 42b9a0b6c8b..7ad582a0792 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java @@ -61,21 +61,45 @@ public class BasicColorChooserUI extends ColorChooserUI boolean isMultiPanel = false; private static TransferHandler defaultTransferHandler = new ColorTransferHandler(); + /** + * The array of default color choosers. + */ protected AbstractColorChooserPanel[] defaultChoosers; + /** + * The instance of {@code ChangeListener}. + */ protected ChangeListener previewListener; + + /** + * The instance of {@code PropertyChangeListener}. + */ protected PropertyChangeListener propertyChangeListener; private Handler handler; + /** + * Returns a new instance of {@code BasicColorChooserUI}. + * + * @param c a component + * @return a new instance of {@code BasicColorChooserUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicColorChooserUI(); } + /** + * Returns an array of default color choosers. + * + * @return an array of default color choosers + */ protected AbstractColorChooserPanel[] createDefaultChoosers() { AbstractColorChooserPanel[] panels = ColorChooserComponentFactory.getDefaultChooserPanels(); return panels; } + /** + * Uninstalls default color choosers. + */ protected void uninstallDefaultChoosers() { AbstractColorChooserPanel[] choosers = chooser.getChooserPanels(); for( int i = 0 ; i < choosers.length; i++) { @@ -138,6 +162,9 @@ public class BasicColorChooserUI extends ColorChooserUI handler = null; } + /** + * Installs preview panel. + */ protected void installPreviewPanel() { JComponent previewPanel = this.chooser.getPreviewPanel(); if (previewPanel == null) { @@ -169,6 +196,9 @@ public class BasicColorChooserUI extends ColorChooserUI this.chooser.remove(this.previewPanelHolder); } + /** + * Installs default properties. + */ protected void installDefaults() { LookAndFeel.installColorsAndFont(chooser, "ColorChooser.background", "ColorChooser.foreground", @@ -180,16 +210,21 @@ public class BasicColorChooserUI extends ColorChooserUI } } + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { if (chooser.getTransferHandler() instanceof UIResource) { chooser.setTransferHandler(null); } } - + /** + * Registers listeners. + */ protected void installListeners() { propertyChangeListener = createPropertyChangeListener(); - chooser.addPropertyChangeListener( propertyChangeListener ); + chooser.addPropertyChangeListener(propertyChangeListener); previewListener = getHandler(); chooser.getSelectionModel().addChangeListener(previewListener); @@ -202,10 +237,18 @@ public class BasicColorChooserUI extends ColorChooserUI return handler; } + /** + * Returns an instance of {@code PropertyChangeListener}. + * + * @return an instance of {@code PropertyChangeListener} + */ protected PropertyChangeListener createPropertyChangeListener() { return getHandler(); } + /** + * Unregisters listeners. + */ protected void uninstallListeners() { chooser.removePropertyChangeListener( propertyChangeListener ); chooser.getSelectionModel().removeChangeListener(previewListener); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java index e9248631d1f..c7534c1e0c1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java @@ -41,9 +41,15 @@ import sun.reflect.misc.MethodUtil; * @author Mark Davidson */ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener { + /** + * An instance of {@code JTextField}. + */ protected JTextField editor; private Object oldValue; + /** + * Constructs a new instance of {@code BasicComboBoxEditor}. + */ public BasicComboBoxEditor() { editor = createEditorComponent(); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java index 4b596dc4e19..231eced6f52 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java @@ -59,6 +59,9 @@ implements ListCellRenderer, Serializable { protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1); private final static Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1); + /** + * Constructs a new instance of {@code BasicComboBoxRenderer}. + */ public BasicComboBoxRenderer() { super(); setOpaque(true); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java index 695eb87bded..fe71487bdea 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java @@ -55,7 +55,14 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { private Handler handler; private PropertyChangeListener pcl; + /** + * The instance of {@code JDesktopPane}. + */ protected JDesktopPane desktop; + + /** + * The instance of {@code DesktopManager}. + */ protected DesktopManager desktopManager; /** @@ -109,10 +116,19 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { @Deprecated protected KeyStroke navigateKey2; + /** + * Constructs a new instance of {@code BasicDesktopPaneUI}. + * + * @param c a component + * @return a new instance of {@code BasicDesktopPaneUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicDesktopPaneUI(); } + /** + * Constructs a new instance of {@code BasicDesktopPaneUI}. + */ public BasicDesktopPaneUI() { } @@ -133,6 +149,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { handler = null; } + /** + * Installs default properties. + */ protected void installDefaults() { if (desktop.getBackground() == null || desktop.getBackground() instanceof UIResource) { @@ -141,6 +160,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE); } + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { } /** @@ -169,6 +191,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { pcl = null; } + /** + * Installs desktop manager. + */ protected void installDesktopManager() { desktopManager = desktop.getDesktopManager(); if(desktopManager == null) { @@ -177,6 +202,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { } } + /** + * Uninstalls desktop manager. + */ protected void uninstallDesktopManager() { if(desktop.getDesktopManager() instanceof UIResource) { desktop.setDesktopManager(null); @@ -184,6 +212,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { desktopManager = null; } + /** + * Installs keyboard actions. + */ protected void installKeyboardActions(){ InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); if (inputMap != null) { @@ -202,9 +233,15 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { registerKeyboardActions(); } + /** + * Registers keyboard actions. + */ protected void registerKeyboardActions(){ } + /** + * Unregisters keyboard actions. + */ protected void unregisterKeyboardActions(){ } @@ -253,6 +290,9 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { map.put(new Actions(Actions.NAVIGATE_PREVIOUS)); } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions(){ unregisterKeyboardActions(); SwingUtilities.replaceUIInputMap(desktop, JComponent. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java index 6875367c91e..c31332b15aa 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java @@ -55,6 +55,11 @@ public class BasicDirectoryModel extends AbstractListModel implements Pr private boolean busy = false; + /** + * Constructs a new instance of {@code BasicDirectoryModel}. + * + * @param filechooser an instance of {JFileChooser} + */ public BasicDirectoryModel(JFileChooser filechooser) { this.filechooser = filechooser; validateFileCache(); @@ -93,6 +98,11 @@ public class BasicDirectoryModel extends AbstractListModel implements Pr } } + /** + * Returns a list of directories. + * + * @return a list of directories + */ public Vector getDirectories() { synchronized(fileCache) { if (directories != null) { @@ -103,6 +113,11 @@ public class BasicDirectoryModel extends AbstractListModel implements Pr } } + /** + * Returns a list of files. + * + * @return a list of files + */ public Vector getFiles() { synchronized(fileCache) { if (files != null) { @@ -126,6 +141,9 @@ public class BasicDirectoryModel extends AbstractListModel implements Pr } } + /** + * Validates content of file cache. + */ public void validateFileCache() { File currentDirectory = filechooser.getCurrentDirectory(); if (currentDirectory == null) { @@ -163,20 +181,34 @@ public class BasicDirectoryModel extends AbstractListModel implements Pr } } - + /** + * Invoked when a content is changed. + */ public void fireContentsChanged() { - // System.out.println("BasicDirectoryModel: firecontentschanged"); - fireContentsChanged(this, 0, getSize()-1); + fireContentsChanged(this, 0, getSize() - 1); } public int getSize() { return fileCache.size(); } + /** + * Returns {@code true} if an element {@code o} is in file cache, + * otherwise, returns {@code false}. + * + * @param o an element + * @return {@code true} if an element {@code o} is in file cache + */ public boolean contains(Object o) { return fileCache.contains(o); } + /** + * Returns an index of element {@code o} in file cache. + * + * @param o an element + * @return an index of element {@code o} in file cache + */ public int indexOf(Object o) { return fileCache.indexOf(o); } @@ -197,6 +229,11 @@ public class BasicDirectoryModel extends AbstractListModel implements Pr public void intervalRemoved(ListDataEvent e) { } + /** + * Sorts a list of files. + * + * @param v a list of files + */ protected void sort(Vector v){ ShellFolder.sort(v); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java index d3e0bb795ec..941f09b28fb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,16 +40,30 @@ import java.awt.event.InputEvent; import sun.swing.SwingUtilities2; -/* +/** + * Convenient util class. + * * @author Hans Muller */ - public class BasicGraphicsUtils { private static final Insets GROOVE_INSETS = new Insets(2, 2, 2, 2); private static final Insets ETCHED_INSETS = new Insets(2, 2, 2, 2); + /** + * Draws an etched rectangle. + * + * @param g an instance of {@code Graphics} + * @param x an X coordinate + * @param y an Y coordinate + * @param w a width + * @param h a height + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color highlighting + * @param lightHighlight a color of light highlighting + */ public static void drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight) @@ -89,6 +103,17 @@ public class BasicGraphicsUtils } + /** + * Draws a groove. + * + * @param g an instance of {@code Graphics} + * @param x an X coordinate + * @param y an Y coordinate + * @param w a width + * @param h a height + * @param shadow a color of shadow + * @param highlight a color highlighting + */ public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight) { @@ -120,6 +145,21 @@ public class BasicGraphicsUtils } + /** + * Draws a bezel. + * + * @param g an instance of {@code Graphics} + * @param x an X coordinate + * @param y an Y coordinate + * @param w a width + * @param h a height + * @param isPressed is component pressed + * @param isDefault is default drawing + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color highlighting + * @param lightHighlight a color of light highlighting + */ public static void drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, @@ -176,6 +216,19 @@ public class BasicGraphicsUtils g.setColor(oldColor); } + /** + * Draws a lowered bezel. + * + * @param g an instance of {@code Graphics} + * @param x an X coordinate + * @param y an Y coordinate + * @param w a width + * @param h a height + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color highlighting + * @param lightHighlight a color of light highlighting + */ public static void drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight) { @@ -197,11 +250,17 @@ public class BasicGraphicsUtils } - /** Draw a string with the graphics g at location (x,y) - * just like g.drawString would. - * The first occurrence of underlineChar - * in text will be underlined. The matching algorithm is - * not case sensitive. + /** + * Draw a string with the graphics {@code g} at location (x,y) + * just like {@code g.drawString} would. The first occurrence + * of {@code underlineChar} in text will be underlined. + * The matching algorithm is not case sensitive. + * + * @param g an instance of {@code Graphics} + * @param text a text + * @param underlinedChar an underlined char + * @param x an X coordinate + * @param y an Y coordinate */ public static void drawString(Graphics g,String text,int underlinedChar,int x,int y) { int index=-1; @@ -244,9 +303,18 @@ public class BasicGraphicsUtils public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x,int y) { SwingUtilities2.drawStringUnderlineCharAt(null, g, text, - underlinedIndex, x, y); + underlinedIndex, x, y); } + /** + * Draws dashed rectangle. + * + * @param g an instance of {@code Graphics} + * @param x an X coordinate + * @param y an Y coordinate + * @param width a width of rectangle + * @param height a height of rectangle + */ public static void drawDashedRect(Graphics g,int x,int y,int width,int height) { int vx,vy; @@ -263,6 +331,13 @@ public class BasicGraphicsUtils } } + /** + * Returns the preferred size of the button. + * + * @param b an instance of {@code AbstractButton} + * @param textIconGap a gap between text and icon + * @return the preferred size of the button + */ public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap) { if(b.getComponentCount() > 0) { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java index 02719839496..0c0559948e5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicHTML.java @@ -48,6 +48,10 @@ public class BasicHTML { /** * Create an html renderer for the given component and * string of html. + * + * @param c a component + * @param html an HTML string + * @return an HTML renderer */ public static View createHTMLView(JComponent c, String html) { BasicEditorKit kit = getFactory(); @@ -178,6 +182,10 @@ public class BasicHTML { * Check the given string to see if it should trigger the * html rendering logic in a non-text component that supports * html rendering. + * + * @param s a text + * @return {@code true} if the given string should trigger the + * html rendering logic in a non-text component */ public static boolean isHTMLString(String s) { if (s != null) { @@ -198,6 +206,9 @@ public class BasicHTML { * This method is useful for ComponentUI implementations * that are static (i.e. shared) and get their state * entirely from the JComponent. + * + * @param c a component + * @param text a text */ public static void updateRenderer(JComponent c, String text) { View value = null; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java index ec27f18dac1..638885127b2 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java @@ -61,6 +61,11 @@ public class BasicIconFactory implements Serializable private static Icon menuItemArrowIcon; private static Icon menuArrowIcon; + /** + * Returns a menu item check icon. + * + * @return a menu item check icon + */ public static Icon getMenuItemCheckIcon() { if (menuItemCheckIcon == null) { menuItemCheckIcon = new MenuItemCheckIcon(); @@ -68,6 +73,11 @@ public class BasicIconFactory implements Serializable return menuItemCheckIcon; } + /** + * Returns a menu item arrow icon. + * + * @return a menu item arrow icon + */ public static Icon getMenuItemArrowIcon() { if (menuItemArrowIcon == null) { menuItemArrowIcon = new MenuItemArrowIcon(); @@ -75,6 +85,11 @@ public class BasicIconFactory implements Serializable return menuItemArrowIcon; } + /** + * Returns a menu arrow icon. + * + * @return a menu arrow icon + */ public static Icon getMenuArrowIcon() { if (menuArrowIcon == null) { menuArrowIcon = new MenuArrowIcon(); @@ -82,6 +97,11 @@ public class BasicIconFactory implements Serializable return menuArrowIcon; } + /** + * Returns a check box icon. + * + * @return a check box icon + */ public static Icon getCheckBoxIcon() { if (checkBoxIcon == null) { checkBoxIcon = new CheckBoxIcon(); @@ -89,6 +109,11 @@ public class BasicIconFactory implements Serializable return checkBoxIcon; } + /** + * Returns a radio button icon. + * + * @return a radio button icon + */ public static Icon getRadioButtonIcon() { if (radioButtonIcon == null) { radioButtonIcon = new RadioButtonIcon(); @@ -96,6 +121,11 @@ public class BasicIconFactory implements Serializable return radioButtonIcon; } + /** + * Returns a check box menu item icon. + * + * @return a check box menu item icon + */ public static Icon getCheckBoxMenuItemIcon() { if (checkBoxMenuItemIcon == null) { checkBoxMenuItemIcon = new CheckBoxMenuItemIcon(); @@ -103,6 +133,11 @@ public class BasicIconFactory implements Serializable return checkBoxMenuItemIcon; } + /** + * Returns a radio button menu item icon. + * + * @return a radio button menu item icon + */ public static Icon getRadioButtonMenuItemIcon() { if (radioButtonMenuItemIcon == null) { radioButtonMenuItemIcon = new RadioButtonMenuItemIcon(); @@ -110,6 +145,11 @@ public class BasicIconFactory implements Serializable return radioButtonMenuItemIcon; } + /** + * Returns an empty frame icon. + * + * @return an empty frame icon + */ public static Icon createEmptyFrameIcon() { if(frame_icon == null) frame_icon = new EmptyFrameIcon(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java index 75b10bef987..2892a49afc7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,11 +54,29 @@ import javax.swing.plaf.*; * @author Arnaud Weber */ public class BasicMenuBarUI extends MenuBarUI { + + /** + * The instance of {@code JMenuBar}. + */ protected JMenuBar menuBar = null; + + /** + * The instance of {@code ContainerListener}. + */ protected ContainerListener containerListener; + + /** + * The instance of {@code ChangeListener}. + */ protected ChangeListener changeListener; private Handler handler; + /** + * Returns a new instance of {@code BasicMenuBarUI}. + * + * @param x a component + * @return a new instance of {@code BasicMenuBarUI} + */ public static ComponentUI createUI(JComponent x) { return new BasicMenuBarUI(); } @@ -76,6 +94,9 @@ public class BasicMenuBarUI extends MenuBarUI { } + /** + * Installs default properties. + */ protected void installDefaults() { if (menuBar.getLayout() == null || menuBar.getLayout() instanceof UIResource) { @@ -90,6 +111,9 @@ public class BasicMenuBarUI extends MenuBarUI { "MenuBar.font"); } + /** + * Registers listeners. + */ protected void installListeners() { containerListener = createContainerListener(); changeListener = createChangeListener(); @@ -102,6 +126,9 @@ public class BasicMenuBarUI extends MenuBarUI { menuBar.addContainerListener(containerListener); } + /** + * Registers keyboard actions. + */ protected void installKeyboardActions() { InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); @@ -131,12 +158,18 @@ public class BasicMenuBarUI extends MenuBarUI { menuBar = null; } + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { if (menuBar!=null) { LookAndFeel.uninstallBorder(menuBar); } } + /** + * Unregisters listeners. + */ protected void uninstallListeners() { menuBar.removeContainerListener(containerListener); @@ -151,16 +184,29 @@ public class BasicMenuBarUI extends MenuBarUI { handler = null; } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions() { SwingUtilities.replaceUIInputMap(menuBar, JComponent. WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(menuBar, null); } + /** + * Returns an instance of {@code ContainerListener}. + * + * @return an instance of {@code ContainerListener} + */ protected ContainerListener createContainerListener() { return getHandler(); } + /** + * Returns an instance of {@code ChangeListener}. + * + * @return an instance of {@code ChangeListener} + */ protected ChangeListener createChangeListener() { return getHandler(); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 2ea9fb920ab..7231ae2a570 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -48,7 +48,14 @@ import java.util.ArrayList; */ public class BasicMenuUI extends BasicMenuItemUI { + /** + * The instance of {@code ChangeListener}. + */ protected ChangeListener changeListener; + + /** + * The instance of {@code MenuListener}. + */ protected MenuListener menuListener; private int lastMnemonic = 0; @@ -63,6 +70,12 @@ public class BasicMenuUI extends BasicMenuItemUI private static boolean crossMenuMnemonic = true; + /** + * Constructs a new instance of {@code BasicMenuUI}. + * + * @param x a component + * @return a new instance of {@code BasicMenuUI} + */ public static ComponentUI createUI(JComponent x) { return new BasicMenuUI(); } @@ -152,10 +165,22 @@ public class BasicMenuUI extends BasicMenuItemUI return getHandler(); } + /** + * Returns an instance of {@code MenuListener}. + * + * @param c a component + * @return an instance of {@code MenuListener} + */ protected MenuListener createMenuListener(JComponent c) { return null; } + /** + * Returns an instance of {@code ChangeListener}. + * + * @param c a component + * @return an instance of {@code ChangeListener} + */ protected ChangeListener createChangeListener(JComponent c) { return null; } @@ -208,6 +233,11 @@ public class BasicMenuUI extends BasicMenuItemUI return null; } + /** + * Sets timer to the {@code menu}. + * + * @param menu an instance of {@code JMenu}. + */ protected void setupPostTimer(JMenu menu) { Timer timer = new Timer(menu.getDelay(), new Actions( Actions.SELECT, menu,false)); @@ -388,11 +418,32 @@ public class BasicMenuUI extends BasicMenuItemUI * is now obsolete. KeyBindings are now managed by the popup menu. */ public class ChangeHandler implements ChangeListener { + /** + * The instance of {@code JMenu}. + */ public JMenu menu; + + /** + * The instance of {@code BasicMenuUI}. + */ public BasicMenuUI ui; + + /** + * {@code true} if an item of popup menu is selected. + */ public boolean isSelected = false; + + /** + * The component that was focused. + */ public Component wasFocused; + /** + * Constructs a new instance of {@code ChangeHandler}. + * + * @param m an instance of {@code JMenu} + * @param ui an instance of {@code BasicMenuUI} + */ public ChangeHandler(JMenu m, BasicMenuUI ui) { menu = m; this.ui = ui; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java index 985fae73f4f..46929bcca69 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPanelUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,12 @@ public class BasicPanelUI extends PanelUI { // Shared UI object private static PanelUI panelUI; + /** + * Returns an instance of {@code BasicPanelUI}. + * + * @param c a component + * @return an instance of {@code BasicPanelUI} + */ public static ComponentUI createUI(JComponent c) { if(panelUI == null) { panelUI = new BasicPanelUI(); @@ -62,6 +68,11 @@ public class BasicPanelUI extends PanelUI { super.uninstallUI(c); } + /** + * Method for installing panel properties. + * + * @param p an instance of {@code JPanel} + */ protected void installDefaults(JPanel p) { LookAndFeel.installColorsAndFont(p, "Panel.background", @@ -71,6 +82,11 @@ public class BasicPanelUI extends PanelUI { LookAndFeel.installProperty(p, "opaque", Boolean.TRUE); } + /** + * Method for uninstalling panel properties. + * + * @param p an instance of {@code JPanel} + */ protected void uninstallDefaults(JPanel p) { LookAndFeel.uninstallBorder(p); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java index ded6ad243d2..9122beae1f0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,12 @@ import javax.swing.plaf.ComponentUI; public class BasicPopupMenuSeparatorUI extends BasicSeparatorUI { + /** + * Returns a new instance of {@code BasicPopupMenuSeparatorUI}. + * + * @param c a component + * @return a new instance of {@code BasicPopupMenuSeparatorUI} + */ public static ComponentUI createUI( JComponent c ) { return new BasicPopupMenuSeparatorUI(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java index 517615ac846..e9d878a2ca2 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,6 +66,9 @@ public class BasicPopupMenuUI extends PopupMenuUI { static final StringBuilder MENU_KEYBOARD_HELPER_KEY = new StringBuilder( "javax.swing.plaf.basic.BasicPopupMenuUI.MenuKeyboardHelper"); + /** + * The instance of {@code JPopupMenu}. + */ protected JPopupMenu popupMenu = null; private transient PopupMenuListener popupMenuListener = null; private MenuKeyListener menuKeyListener = null; @@ -73,10 +76,19 @@ public class BasicPopupMenuUI extends PopupMenuUI { private static boolean checkedUnpostPopup; private static boolean unpostPopup; + /** + * Constructs a new instance of {@code BasicPopupMenuUI}. + * + * @param x a component + * @return a new instance of {@code BasicPopupMenuUI} + */ public static ComponentUI createUI(JComponent x) { return new BasicPopupMenuUI(); } + /** + * Constructs a new instance of {@code BasicPopupMenuUI}. + */ public BasicPopupMenuUI() { BasicLookAndFeel.needsEventHelper = true; LookAndFeel laf = UIManager.getLookAndFeel(); @@ -93,6 +105,9 @@ public class BasicPopupMenuUI extends PopupMenuUI { installKeyboardActions(); } + /** + * Installs default properties. + */ public void installDefaults() { if (popupMenu.getLayout() == null || popupMenu.getLayout() instanceof UIResource) @@ -101,11 +116,14 @@ public class BasicPopupMenuUI extends PopupMenuUI { LookAndFeel.installProperty(popupMenu, "opaque", Boolean.TRUE); LookAndFeel.installBorder(popupMenu, "PopupMenu.border"); LookAndFeel.installColorsAndFont(popupMenu, - "PopupMenu.background", - "PopupMenu.foreground", - "PopupMenu.font"); + "PopupMenu.background", + "PopupMenu.foreground", + "PopupMenu.font"); } + /** + * Registers listeners. + */ protected void installListeners() { if (popupMenuListener == null) { popupMenuListener = new BasicPopupMenuListener(); @@ -138,6 +156,9 @@ public class BasicPopupMenuUI extends PopupMenuUI { } } + /** + * Registers keyboard actions. + */ protected void installKeyboardActions() { } @@ -181,10 +202,16 @@ public class BasicPopupMenuUI extends PopupMenuUI { popupMenu = null; } + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { LookAndFeel.uninstallBorder(popupMenu); } + /** + * Unregisters listeners. + */ protected void uninstallListeners() { if (popupMenuListener != null) { popupMenu.removePopupMenuListener(popupMenuListener); @@ -194,6 +221,9 @@ public class BasicPopupMenuUI extends PopupMenuUI { } } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions() { SwingUtilities.replaceUIActionMap(popupMenu, null); SwingUtilities.replaceUIInputMap(popupMenu, diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java index 99c8e3aaabb..6030aa743e1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,12 @@ import javax.swing.border.*; */ public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI { + /** + * Returns a new instance of {@code BasicRadioButtonMenuItemUI}. + * + * @param b a component + * @return a new instance of {@code BasicRadioButtonMenuItemUI} + */ public static ComponentUI createUI(JComponent b) { return new BasicRadioButtonMenuItemUI(); } @@ -47,6 +53,14 @@ public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI return "RadioButtonMenuItem"; } + /** + * Invoked when mouse event occurs. + * + * @param item a menu item + * @param e a mouse event + * @param path an array of {@code MenuElement} + * @param manager an instance of {@code MenuSelectionManager} + */ public void processMouseEvent(JMenuItem item,MouseEvent e,MenuElement path[],MenuSelectionManager manager) { Point p = e.getPoint(); if(p.x >= 0 && p.x < item.getWidth() && diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java index 47c9b7d75f8..ec9e88defe1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRadioButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,9 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI { private static final Object BASIC_RADIO_BUTTON_UI_KEY = new Object(); + /** + * The icon. + */ protected Icon icon; private boolean defaults_initialized = false; @@ -53,6 +56,13 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI // ******************************** // Create PLAF // ******************************** + + /** + * Returns an instance of {@code BasicRadioButtonUI}. + * + * @param b a component + * @return an instance of {@code BasicRadioButtonUI} + */ public static ComponentUI createUI(JComponent b) { AppContext appContext = AppContext.getAppContext(); BasicRadioButtonUI radioButtonUI = @@ -87,6 +97,11 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI defaults_initialized = false; } + /** + * Returns the default icon. + * + * @return the default icon + */ public Icon getDefaultIcon() { return icon; } @@ -195,6 +210,13 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI } } + /** + * Paints focused radio button. + * + * @param g an instance of {@code Graphics} + * @param textRect bounds + * @param size the size of radio button + */ protected void paintFocus(Graphics g, Rectangle textRect, Dimension size){ } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java index 5c999e0089d..300e46a2e7b 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java @@ -48,6 +48,12 @@ public class BasicRootPaneUI extends RootPaneUI implements PropertyChangeListener { private static RootPaneUI rootPaneUI = new BasicRootPaneUI(); + /** + * Returns a new instance of {@code BasicRootPaneUI}. + * + * @param c a component + * @return a new instance of {@code BasicRootPaneUI} + */ public static ComponentUI createUI(JComponent c) { return rootPaneUI; } @@ -67,17 +73,37 @@ public class BasicRootPaneUI extends RootPaneUI implements uninstallKeyboardActions((JRootPane)c); } + /** + * Installs default properties. + * + * @param c an instance of {@code JRootPane} + */ protected void installDefaults(JRootPane c){ LookAndFeel.installProperty(c, "opaque", Boolean.FALSE); } + /** + * Installs components. + * + * @param root an instance of {@code JRootPane} + */ protected void installComponents(JRootPane root) { } + /** + * Registers listeners. + * + * @param root an instance of {@code JRootPane} + */ protected void installListeners(JRootPane root) { root.addPropertyChangeListener(this); } + /** + * Registers keyboard actions. + * + * @param root an instance of {@code JRootPane} + */ protected void installKeyboardActions(JRootPane root) { InputMap km = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, root); SwingUtilities.replaceUIInputMap(root, @@ -92,19 +118,39 @@ public class BasicRootPaneUI extends RootPaneUI implements updateDefaultButtonBindings(root); } + /** + * Uninstalls default properties. + * + * @param root an instance of {@code JRootPane} + */ protected void uninstallDefaults(JRootPane root) { } + /** + * Unregisters components. + * + * @param root an instance of {@code JRootPane} + */ protected void uninstallComponents(JRootPane root) { } + /** + * Unregisters listeners. + * + * @param root an instance of {@code JRootPane} + */ protected void uninstallListeners(JRootPane root) { root.removePropertyChangeListener(this); } + /** + * Unregisters keyboard actions. + * + * @param root an instance of {@code JRootPane} + */ protected void uninstallKeyboardActions(JRootPane root) { SwingUtilities.replaceUIInputMap(root, JComponent. - WHEN_IN_FOCUSED_WINDOW, null); + WHEN_IN_FOCUSED_WINDOW, null); SwingUtilities.replaceUIActionMap(root, null); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java index 0a83867618c..8df41cb647a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,9 +45,22 @@ import javax.swing.plaf.SeparatorUI; public class BasicSeparatorUI extends SeparatorUI { + /** + * The color of the shadow. + */ protected Color shadow; + + /** + * The color of the highlighting. + */ protected Color highlight; + /** + * Returns a new instance of {@code BasicSeparatorUI}. + * + * @param c a component + * @return a new instance of {@code BasicSeparatorUI} + */ public static ComponentUI createUI( JComponent c ) { return new BasicSeparatorUI(); @@ -65,20 +78,40 @@ public class BasicSeparatorUI extends SeparatorUI uninstallListeners( (JSeparator)c ); } + /** + * Installs default properties. + * + * @param s an instance of {@code JSeparator} + */ protected void installDefaults( JSeparator s ) { - LookAndFeel.installColors( s, "Separator.background", "Separator.foreground" ); - LookAndFeel.installProperty( s, "opaque", Boolean.FALSE); + LookAndFeel.installColors(s, "Separator.background", "Separator.foreground"); + LookAndFeel.installProperty(s, "opaque", Boolean.FALSE); } + /** + * Uninstalls default properties. + * + * @param s an instance of {@code JSeparator} + */ protected void uninstallDefaults( JSeparator s ) { } + /** + * Registers listeners. + * + * @param s an instance of {@code JSeparator} + */ protected void installListeners( JSeparator s ) { } + /** + * Unregisters listeners. + * + * @param s an instance of {@code JSeparator} + */ protected void uninstallListeners( JSeparator s ) { } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java index 01c408382cd..ee9cdefbe90 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java @@ -400,6 +400,8 @@ public class BasicSpinnerUI extends SpinnerUI * The implementation of replaceEditor should be coordinated * with the createEditor method. * + * @param oldEditor an old instance of editor + * @param newEditor a new instance of editor * @see #createEditor * @see #createPropertyChangeListener */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java index cdf38579fc8..4c8bb1d94d5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -49,11 +49,19 @@ public class BasicTableHeaderUI extends TableHeaderUI { // Instance Variables // - /** The JTableHeader that is delegating the painting to this UI. */ + /** + * The {@code JTableHeader} that is delegating the painting to this UI. + */ protected JTableHeader header; + + /** + * The instance of {@code CellRendererPane}. + */ protected CellRendererPane rendererPane; - // Listeners that are attached to the JTable + /** + * Listeners that are attached to the {@code JTable} + */ protected MouseInputListener mouseInputListener; // The column header over which the mouse currently is. @@ -300,7 +308,9 @@ public class BasicTableHeaderUI extends TableHeaderUI { // /** - * Creates the mouse listener for the JTableHeader. + * Creates the mouse listener for the {@code JTableHeader}. + * + * @return the mouse listener for the {@code JTableHeader} */ protected MouseInputListener createMouseInputListener() { return new MouseInputHandler(); @@ -310,6 +320,12 @@ public class BasicTableHeaderUI extends TableHeaderUI { // The installation/uninstall procedures and support // + /** + * Returns a new instance of {@code BasicTableHeaderUI}. + * + * @param h a component. + * @return a new instance of {@code BasicTableHeaderUI} + */ public static ComponentUI createUI(JComponent h) { return new BasicTableHeaderUI(); } @@ -376,8 +392,14 @@ public class BasicTableHeaderUI extends TableHeaderUI { header = null; } + /** + * Uninstalls default properties + */ protected void uninstallDefaults() {} + /** + * Unregisters listeners. + */ protected void uninstallListeners() { header.removeMouseListener(mouseInputListener); header.removeMouseMotionListener(mouseInputListener); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java index 0965c77789f..2b23f9c0a0e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java @@ -443,6 +443,9 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { protected void uninstallListeners() { } + /** + * Registers keyboard actions. + */ protected void installKeyboardActions() { // backward compatibility support... keymaps for the UI // are now installed in the more friendly input map. @@ -637,6 +640,9 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { return map; } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions() { editor.setKeymap(null); SwingUtilities.replaceUIInputMap(editor, JComponent. @@ -1280,8 +1286,14 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { return null; } + /** + * Default implementation of the interface {@code Caret}. + */ public static class BasicCaret extends DefaultCaret implements UIResource {} + /** + * Default implementation of the interface {@code Highlighter}. + */ public static class BasicHighlighter extends DefaultHighlighter implements UIResource {} static class BasicCursor extends Cursor implements UIResource { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java index 163a5cd2b46..5f394dbbefb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToggleButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,6 +51,13 @@ public class BasicToggleButtonUI extends BasicButtonUI { // ******************************** // Create PLAF // ******************************** + + /** + * Returns an instance of {@code BasicToggleButtonUI}. + * + * @param b a component + * @return an instance of {@code BasicToggleButtonUI} + */ public static ComponentUI createUI(JComponent b) { AppContext appContext = AppContext.getAppContext(); BasicToggleButtonUI toggleButtonUI = @@ -127,6 +134,13 @@ public class BasicToggleButtonUI extends BasicButtonUI { } } + /** + * Paints an icon in the specified location. + * + * @param g an instance of {@code Graphics} + * @param b an instance of {@code Button} + * @param iconRect bounds of an icon + */ protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect) { ButtonModel model = b.getModel(); Icon icon = null; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java index 1f2aac7e597..4a5dd209df0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarSeparatorUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,12 @@ import javax.swing.plaf.basic.BasicSeparatorUI; public class BasicToolBarSeparatorUI extends BasicSeparatorUI { + /** + * Returns a new instance of {@code BasicToolBarSeparatorUI}. + * + * @param c a component + * @return a new instance of {@code BasicToolBarSeparatorUI} + */ public static ComponentUI createUI( JComponent c ) { return new BasicToolBarSeparatorUI(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java index 95a951cc6f9..8f79c7566fe 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,10 +55,19 @@ public class BasicToolTipUI extends ToolTipUI private PropertyChangeListener propertyChangeListener; + /** + * Returns the instance of {@code BasicToolTipUI}. + * + * @param c a component + * @return the instance of {@code BasicToolTipUI} + */ public static ComponentUI createUI(JComponent c) { return sharedInstance; } + /** + * Constructs a new instance of {@code BasicToolTipUI}. + */ public BasicToolTipUI() { super(); } @@ -76,22 +85,32 @@ public class BasicToolTipUI extends ToolTipUI uninstallListeners(c); } + /** + * Installs default properties. + * + * @param c a component + */ protected void installDefaults(JComponent c){ LookAndFeel.installColorsAndFont(c, "ToolTip.background", - "ToolTip.foreground", - "ToolTip.font"); + "ToolTip.foreground", + "ToolTip.font"); LookAndFeel.installProperty(c, "opaque", Boolean.TRUE); componentChanged(c); } - protected void uninstallDefaults(JComponent c){ + /** + * Uninstalls default properties. + * + * @param c a component + */ + protected void uninstallDefaults(JComponent c){ LookAndFeel.uninstallBorder(c); } /* Unfortunately this has to remain private until we can make API additions. */ private void installComponents(JComponent c){ - BasicHTML.updateRenderer(c, ((JToolTip)c).getTipText()); + BasicHTML.updateRenderer(c, ((JToolTip) c).getTipText()); } /* Unfortunately this has to remain private until we can make API additions. @@ -100,12 +119,22 @@ public class BasicToolTipUI extends ToolTipUI BasicHTML.updateRenderer(c, ""); } + /** + * Registers listeners. + * + * @param c a component + */ protected void installListeners(JComponent c) { propertyChangeListener = createPropertyChangeListener(c); c.addPropertyChangeListener(propertyChangeListener); } + /** + * Unregisters listeners. + * + * @param c a component + */ protected void uninstallListeners(JComponent c) { c.removePropertyChangeListener(propertyChangeListener); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java index 70dad3c3c0d..3620bdbcff8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,12 @@ public class BasicViewportUI extends ViewportUI { // Shared UI object private static ViewportUI viewportUI; + /** + * Returns an instance of {@code BasicViewportUI}. + * + * @param c a component + * @return an instance of {@code BasicViewportUI} + */ public static ComponentUI createUI(JComponent c) { if(viewportUI == null) { viewportUI = new BasicViewportUI(); @@ -60,6 +66,11 @@ public class BasicViewportUI extends ViewportUI { super.uninstallUI(c); } + /** + * Installs view port properties. + * + * @param c a component + */ protected void installDefaults(JComponent c) { LookAndFeel.installColorsAndFont(c, "Viewport.background", @@ -68,6 +79,11 @@ public class BasicViewportUI extends ViewportUI { LookAndFeel.installProperty(c, "opaque", Boolean.TRUE); } + /** + * Uninstall view port properties. + * + * @param c a component + */ protected void uninstallDefaults(JComponent c) { } } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java index bd520c6e38e..f9c260d0653 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java @@ -69,6 +69,8 @@ public interface ComboPopup { * Returns the list that is being used to draw the items in the combo box. * This method is highly implementation specific and should not be used * for general list manipulation. + * + * @return the list that is being used to draw the items in the combo box */ public JList getList(); @@ -91,6 +93,8 @@ public interface ComboPopup { /** * Returns a key listener that will be added to the combo box or null. * If this method returns null then it will not be added to the combo box. + * + * @return a key listener that will be added to the combo box or null */ public KeyListener getKeyListener(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java index 627c3702a73..730897a93d8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java @@ -41,6 +41,17 @@ import java.awt.Dimension; */ @SuppressWarnings("serial") // Superclass is not serializable across versions public class DefaultMenuLayout extends BoxLayout implements UIResource { + + /** + * Constructs a new instance of {@code DefaultMenuLayout}. + * + * @param target the container that needs to be laid out + * @param axis the axis to lay out components along. Can be one of: + * {@code BoxLayout.X_AXIS}, + * {@code BoxLayout.Y_AXIS}, + * {@code BoxLayout.LINE_AXIS} or + * {@code BoxLayout.PAGE_AXIS} + */ public DefaultMenuLayout(Container target, int axis) { super(target, axis); } From 91a46ed171d2db67765dca7dabee2042a3acbcb5 Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Fri, 27 Jun 2014 10:29:08 -0700 Subject: [PATCH 008/111] 8044862: Fix raw and unchecked lint warnings in macosx specific code Reviewed-by: darcy, pchelko --- .../classes/apple/security/KeychainStore.java | 32 +++++++-------- .../com/apple/eawt/_AppDockIconHandler.java | 2 +- .../classes/com/apple/laf/AquaBorder.java | 2 +- .../com/apple/laf/AquaComboBoxButton.java | 11 +++-- .../com/apple/laf/AquaComboBoxPopup.java | 8 ++-- .../com/apple/laf/AquaComboBoxRenderer.java | 4 +- .../laf/AquaComboBoxRendererInternal.java | 11 +++-- .../classes/com/apple/laf/AquaComboBoxUI.java | 29 ++++++------- .../com/apple/laf/AquaFileChooserUI.java | 41 +++++++++++-------- .../com/apple/laf/AquaFocusHandler.java | 4 +- .../classes/com/apple/laf/AquaListUI.java | 6 +-- .../laf/AquaTabbedPaneCopyFromBasicUI.java | 2 +- .../com/apple/laf/AquaTableHeaderUI.java | 1 + .../com/apple/laf/AquaUtilControlSize.java | 2 +- .../classes/com/apple/laf/AquaUtils.java | 6 ++- .../apple/laf/ClientPropertyApplicator.java | 1 + .../classes/com/apple/laf/ScreenMenuBar.java | 1 + .../lwawt/macosx/CDragSourceContextPeer.java | 6 +-- .../sun/lwawt/macosx/CInputMethod.java | 13 +++--- .../lwawt/macosx/CInputMethodDescriptor.java | 4 +- .../sun/lwawt/macosx/CPlatformWindow.java | 2 +- .../classes/sun/lwawt/macosx/LWCToolkit.java | 4 +- 22 files changed, 107 insertions(+), 85 deletions(-) diff --git a/jdk/src/macosx/classes/apple/security/KeychainStore.java b/jdk/src/macosx/classes/apple/security/KeychainStore.java index 8df45d7bea7..8d04ee976f6 100644 --- a/jdk/src/macosx/classes/apple/security/KeychainStore.java +++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java @@ -74,19 +74,19 @@ public final class KeychainStore extends KeyStoreSpi { * Entries that have been deleted. When something calls engineStore we'll * remove them from the keychain. */ - private Hashtable deletedEntries = new Hashtable(); + private Hashtable deletedEntries = new Hashtable<>(); /** * Entries that have been added. When something calls engineStore we'll * add them to the keychain. */ - private Hashtable addedEntries = new Hashtable(); + private Hashtable addedEntries = new Hashtable<>(); /** * Private keys and certificates are stored in a hashtable. * Hash entries are keyed by alias names. */ - private Hashtable entries = new Hashtable(); + private Hashtable entries = new Hashtable<>(); /** * Algorithm identifiers and corresponding OIDs for the contents of the PKCS12 bag we get from the Keychain. @@ -471,7 +471,7 @@ public final class KeychainStore extends KeyStoreSpi { // This will be slow, but necessary. Enumerate the values and then see if the cert matches the one in the trusted cert entry. // Security framework doesn't support the same certificate twice in a keychain. - Collection allValues = entries.values(); + Collection allValues = entries.values(); for (Object value : allValues) { if (value instanceof TrustedCertEntry) { @@ -517,7 +517,7 @@ public final class KeychainStore extends KeyStoreSpi { * * @return enumeration of the alias names */ - public Enumeration engineAliases() { + public Enumeration engineAliases() { permissionCheck(); return entries.keys(); } @@ -598,8 +598,8 @@ public final class KeychainStore extends KeyStoreSpi { permissionCheck(); Certificate certElem; - for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = entries.get(alias); if (entry instanceof TrustedCertEntry) { certElem = ((TrustedCertEntry)entry).cert; @@ -634,8 +634,8 @@ public final class KeychainStore extends KeyStoreSpi { permissionCheck(); // Delete items that do have a keychain item ref. - for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = deletedEntries.get(alias); if (entry instanceof TrustedCertEntry) { if (((TrustedCertEntry)entry).certRef != 0) { @@ -664,8 +664,8 @@ public final class KeychainStore extends KeyStoreSpi { // Add all of the certs or keys in the added entries. // No need to check for 0 refs, as they are in the added list. - for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = addedEntries.get(alias); if (entry instanceof TrustedCertEntry) { TrustedCertEntry tce = (TrustedCertEntry)entry; @@ -730,8 +730,8 @@ public final class KeychainStore extends KeyStoreSpi { // Release any stray keychain references before clearing out the entries. synchronized(entries) { - for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = entries.get(alias); if (entry instanceof TrustedCertEntry) { if (((TrustedCertEntry)entry).certRef != 0) { @@ -816,7 +816,7 @@ public final class KeychainStore extends KeyStoreSpi { // Next, create X.509 Certificate objects from the raw data. This is complicated // because a certificate's public key may be too long for Java's default encryption strength. - List createdCerts = new ArrayList(); + List createdCerts = new ArrayList<>(); try { CertificateFactory cf = CertificateFactory.getInstance("X.509"); @@ -842,12 +842,12 @@ public final class KeychainStore extends KeyStoreSpi { // We have our certificates in the List, so now extract them into an array of // Certificates and SecCertificateRefs. - Object[] objArray = createdCerts.toArray(); + CertKeychainItemPair[] objArray = createdCerts.toArray(new CertKeychainItemPair[0]); Certificate[] certArray = new Certificate[objArray.length]; long[] certRefArray = new long[objArray.length]; for (int i = 0; i < objArray.length; i++) { - CertKeychainItemPair addedItem = (CertKeychainItemPair)objArray[i]; + CertKeychainItemPair addedItem = objArray[i]; certArray[i] = addedItem.mCert; certRefArray[i] = addedItem.mCertificateRef; } diff --git a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java index e91efeaa009..76dea3a7ed3 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java +++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java @@ -95,7 +95,7 @@ class _AppDockIconHandler { static Creator getCImageCreator() { try { - final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); + final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); return (Creator)getCreatorMethod.invoke(null, new Object[] {}); } catch (final Throwable e) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java index dfb6fddd5ce..e9eda68094c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java @@ -75,7 +75,7 @@ public abstract class AquaBorder implements Border, UIResource { protected AquaBorder deriveBorderForSize(final Size size) { try { final Class clazz = getClass(); - final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this }); + final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this }); border.setSize(size); return border; } catch (final Throwable e) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java index 2867245ee1e..c87bcb78c04 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java @@ -35,8 +35,8 @@ import apple.laf.JRSUIConstants.*; @SuppressWarnings("serial") // Superclass is not serializable across versions class AquaComboBoxButton extends JButton { - final protected JComboBox comboBox; - final protected JList list; + final protected JComboBox comboBox; + final protected JList list; final protected CellRendererPane rendererPane; final protected AquaComboBoxUI ui; @@ -45,7 +45,10 @@ class AquaComboBoxButton extends JButton { boolean isSquare; @SuppressWarnings("serial") // anonymous class - protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, final JList list) { + protected AquaComboBoxButton(final AquaComboBoxUI ui, + final JComboBox comboBox, + final CellRendererPane rendererPane, + final JList list) { super(""); putClientProperty("JButton.buttonType", "comboboxInternal"); @@ -163,7 +166,7 @@ class AquaComboBoxButton extends JButton { } protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) { - final ListCellRenderer renderer = comboBox.getRenderer(); + final ListCellRenderer renderer = comboBox.getRenderer(); // fake it out! not renderPressed final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java index dde9b1be337..0f466e188e6 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java @@ -43,7 +43,7 @@ class AquaComboBoxPopup extends BasicComboPopup { protected Component bottomStrut; protected boolean isPopDown = false; - public AquaComboBoxPopup(final JComboBox cBox) { + public AquaComboBoxPopup(final JComboBox cBox) { super(cBox); } @@ -93,7 +93,7 @@ class AquaComboBoxPopup extends BasicComboPopup { final int rowCount = Math.min(maxRowCount, currentElementCount); final Dimension popupSize = new Dimension(); - final ListCellRenderer renderer = list.getCellRenderer(); + final ListCellRenderer renderer = list.getCellRenderer(); for (int i = 0; i < rowCount; i++) { final Object value = list.getModel().getElementAt(i); @@ -149,8 +149,8 @@ class AquaComboBoxPopup extends BasicComboPopup { @Override @SuppressWarnings("serial") // anonymous class - protected JList createList() { - return new JList(comboBox.getModel()) { + protected JList createList() { + return new JList(comboBox.getModel()) { @Override public void processMouseEvent(MouseEvent e) { if (e.isMetaDown()) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java index 6161eb6447c..f4d4225efe0 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java @@ -29,8 +29,8 @@ import javax.swing.*; import javax.swing.plaf.UIResource; @SuppressWarnings("serial") // Superclass is not serializable across versions -class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { - public AquaComboBoxRenderer(final JComboBox comboBox) { +class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { + public AquaComboBoxRenderer(final JComboBox comboBox) { super(comboBox); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java index 2ed6dcfcf70..cf1025f6a85 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java @@ -31,8 +31,8 @@ import javax.swing.*; import java.awt.*; @SuppressWarnings("serial") // Superclass is not serializable across versions -class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { - final JComboBox fComboBox; +class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { + final JComboBox fComboBox; boolean fSelected; boolean fChecked; boolean fInList; @@ -40,7 +40,7 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { boolean fDrawCheckedItem = true; // Provides space for a checkbox, and is translucent - public AquaComboBoxRendererInternal(final JComboBox comboBox) { + public AquaComboBoxRendererInternal(final JComboBox comboBox) { super(); fComboBox = comboBox; } @@ -72,7 +72,10 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { } // Really means is the one with the mouse over it - public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { + public Component getListCellRendererComponent(final JList list, + final E value, int index, + final boolean isSelected, + final boolean cellHasFocus) { fInList = (index >= 0); // When the button wants the item painted, it passes in -1 fSelected = isSelected; if (index < 0) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java index 75c7babb58a..80ca6ff5b49 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -102,13 +102,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { if (now - 1000 < lastBlink) return; lastBlink = now; - final JList itemList = popup.getList(); + final JList itemList = popup.getList(); final ListUI listUI = itemList.getUI(); if (!(listUI instanceof AquaListUI)) return; final AquaListUI aquaListUI = (AquaListUI)listUI; final int selectedIndex = comboBox.getSelectedIndex(); - final ListModel dataModel = itemList.getModel(); + final ListModel dataModel = itemList.getModel(); if (dataModel == null) return; final Object value = dataModel.getElementAt(selectedIndex); @@ -125,7 +125,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { // this space intentionally left blank } - protected ListCellRenderer createRenderer() { + protected ListCellRenderer createRenderer() { return new AquaComboBoxRenderer(comboBox); } @@ -185,7 +185,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { final Object text = editor.getText(); - final ListModel model = listBox.getModel(); + final ListModel model = listBox.getModel(); final int items = model.getSize(); for (int i = 0; i < items; i++) { final Object element = model.getElementAt(i); @@ -423,7 +423,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { return; } - final JComboBox cb = (JComboBox)parent; + final JComboBox cb = (JComboBox) parent; final int width = cb.getWidth(); final int height = cb.getHeight(); @@ -450,11 +450,11 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { return Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.IS_TABLE_CELL_EDITOR)); } - protected static boolean isPopdown(final JComboBox c) { + protected static boolean isPopdown(final JComboBox c) { return c.isEditable() || Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.POPDOWN_CLIENT_PROPERTY_KEY)); } - protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) { + protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) { if (!comboBox.isEnabled()) return; final AquaComboBoxUI aquaUi = (AquaComboBoxUI)comboBox.getUI(); @@ -505,7 +505,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { @SuppressWarnings("serial") // anonymous class private static final Action toggleSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { - final JComboBox comboBox = (JComboBox)e.getSource(); + final JComboBox comboBox = (JComboBox) e.getSource(); if (!comboBox.isEnabled()) return; if (comboBox.isEditable()) return; @@ -525,7 +525,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { private final Action hideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { - final JComboBox comboBox = (JComboBox)e.getSource(); + final JComboBox comboBox = (JComboBox) e.getSource(); comboBox.firePopupMenuCanceled(); comboBox.setPopupVisible(false); } @@ -588,10 +588,11 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } @SuppressWarnings("unchecked") - static final RecyclableSingleton> APPLICATOR = new RecyclableSingleton>() { + static final RecyclableSingleton, AquaComboBoxUI>> APPLICATOR = new + RecyclableSingleton, AquaComboBoxUI>>() { @Override - protected ClientPropertyApplicator getInstance() { - return new ClientPropertyApplicator( + protected ClientPropertyApplicator, AquaComboBoxUI> getInstance() { + return new ClientPropertyApplicator, AquaComboBoxUI>( new Property(AquaFocusHandler.FRAME_ACTIVE_PROPERTY) { public void applyProperty(final AquaComboBoxUI target, final Object value) { if (Boolean.FALSE.equals(value)) { @@ -633,7 +634,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } } ) { - public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) { + public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) { final ComboBoxUI comboUI = combo.getUI(); if (comboUI instanceof AquaComboBoxUI) return (AquaComboBoxUI)comboUI; return null; @@ -641,7 +642,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { }; } }; - static ClientPropertyApplicator getApplicator() { + static ClientPropertyApplicator, AquaComboBoxUI> getApplicator() { return APPLICATOR.get(); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java index 3fae5e20310..ebb3b4b6433 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -724,6 +724,7 @@ public class AquaFileChooserUI extends FileChooserUI { final Transferable transferable = dtde.getTransferable(); try { + @SuppressWarnings("unchecked") final java.util.List fileList = (java.util.List)transferable.getTransferData(DataFlavor.javaFileListFlavor); dropFiles(fileList.toArray(new File[fileList.size()])); dtde.dropComplete(true); @@ -1144,11 +1145,14 @@ public class AquaFileChooserUI extends FileChooserUI { } @SuppressWarnings("serial") // anonymous class - protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { - return new AquaComboBoxRendererInternal(directoryComboBox) { - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final File directory = (File)value; + protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { + return new AquaComboBoxRendererInternal(directoryComboBox) { + public Component getListCellRendererComponent(final JList list, + final File directory, + final int index, + final boolean isSelected, + final boolean cellHasFocus) { + super.getListCellRendererComponent(list, directory, index, isSelected, cellHasFocus); if (directory == null) { setText(""); return this; @@ -1173,7 +1177,7 @@ public class AquaFileChooserUI extends FileChooserUI { * Data model for a type-face selection combo-box. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { + protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { Vector fDirectories = new Vector(); int topIndex = -1; int fPathCount = 0; @@ -1248,7 +1252,7 @@ public class AquaFileChooserUI extends FileChooserUI { return fDirectories.size(); } - public Object getElementAt(final int index) { + public File getElementAt(final int index) { return fDirectories.elementAt(index); } } @@ -1257,11 +1261,14 @@ public class AquaFileChooserUI extends FileChooserUI { // Renderer for Types ComboBox // @SuppressWarnings("serial") // anonymous class - protected ListCellRenderer createFilterComboBoxRenderer() { - return new AquaComboBoxRendererInternal(filterComboBox) { - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final FileFilter filter = (FileFilter)value; + protected ListCellRenderer createFilterComboBoxRenderer() { + return new AquaComboBoxRendererInternal(filterComboBox) { + public Component getListCellRendererComponent(final JList list, + final FileFilter filter, + final int index, + final boolean isSelected, + final boolean cellHasFocus) { + super.getListCellRendererComponent(list, filter, index, isSelected, cellHasFocus); if (filter != null) setText(filter.getDescription()); return this; } @@ -1356,7 +1363,7 @@ public class AquaFileChooserUI extends FileChooserUI { } public void actionPerformed(final ActionEvent e) { - getFileChooser().setFileFilter((FileFilter)filterComboBox.getSelectedItem()); + getFileChooser().setFileFilter((FileFilter) filterComboBox.getSelectedItem()); } } @@ -1503,7 +1510,7 @@ public class AquaFileChooserUI extends FileChooserUI { fTextfieldPanel.add(tPanel, BorderLayout.CENTER); // DirectoryComboBox, left-justified, 200x20 not including drop shadow - directoryComboBox = new JComboBox(); + directoryComboBox = new JComboBox<>(); directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight"); fDirectoryComboBoxModel = createDirectoryComboBoxModel(fc); directoryComboBox.setModel(fDirectoryComboBoxModel); @@ -1551,7 +1558,7 @@ public class AquaFileChooserUI extends FileChooserUI { // Combobox filterComboBoxModel = createFilterComboBoxModel(); fc.addPropertyChangeListener(filterComboBoxModel); - filterComboBox = new JComboBox(filterComboBoxModel); + filterComboBox = new JComboBox<>(filterComboBoxModel); formatLabel.setLabelFor(filterComboBox); filterComboBox.setRenderer(createFilterComboBoxRenderer()); d = new Dimension(220, (int)filterComboBox.getMinimumSize().getHeight()); @@ -1788,7 +1795,7 @@ public class AquaFileChooserUI extends FileChooserUI { } } - JComboBox directoryComboBox; + JComboBox directoryComboBox; DirectoryComboBoxModel fDirectoryComboBoxModel; private final Action directoryComboBoxAction = new DirectoryComboBoxAction(); @@ -1797,7 +1804,7 @@ public class AquaFileChooserUI extends FileChooserUI { JTableExtension fFileList; private FilterComboBoxModel filterComboBoxModel; - JComboBox filterComboBox; + JComboBox filterComboBox; private final Action filterComboBoxAction = new FilterComboBoxAction(); private static final Dimension hstrut10 = new Dimension(10, 1); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java index d5fec4e292c..1438d2c118c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java @@ -131,7 +131,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener { c.setSelectionBackground(UIManager.getColor(bgName)); } - static void swapSelectionColors(final String prefix, final JList c, final Object value) { + static void swapSelectionColors(final String prefix, final JList c, final Object value) { if (!isComponentValid(c)) return; final Color bg = c.getSelectionBackground(); @@ -149,7 +149,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener { } } - static void setSelectionColors(final JList c, final String fgName, final String bgName) { + static void setSelectionColors(final JList c, final String fgName, final String bgName) { c.setSelectionForeground(UIManager.getColor(fgName)); c.setSelectionBackground(UIManager.getColor(bgName)); } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java index 85d06468912..24217af311c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java @@ -79,7 +79,7 @@ public class AquaListUI extends BasicListUI { * For a Home action, scrolls to the top. Otherwise, scroll to the end. */ public void actionPerformed(final ActionEvent e) { - final JList list = (JList)e.getSource(); + final JList list = (JList)e.getSource(); if (fHomeAction) { list.ensureIndexIsVisible(0); @@ -135,7 +135,7 @@ public class AquaListUI extends BasicListUI { }*/ } - JList getComponent() { + JList getComponent() { return list; } @@ -144,7 +144,7 @@ public class AquaListUI extends BasicListUI { final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex); if (rowBounds == null) return; - final ListCellRenderer renderer = list.getCellRenderer(); + final ListCellRenderer renderer = list.getCellRenderer(); if (renderer == null) return; final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index dd65433283f..8dd4fa60d2d 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -3820,7 +3820,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing _loader = null; final Class klass = (Class)loader; try { - final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class }); + final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class }); method.invoke(klass, new Object[] { this }); } catch (final NoSuchMethodException nsme) { assert false : "LazyActionMap unable to load actions " + klass; diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java index 5d847e98ef2..dbc8c8c86ad 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java @@ -69,6 +69,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI { final static RecyclableSingleton> TABLE_HEADER_APPLICATORS = new RecyclableSingleton>() { @Override + @SuppressWarnings("unchecked") protected ClientPropertyApplicator getInstance() { return new ClientPropertyApplicator( new Property("JTableHeader.selectedColumn") { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java index b64595f4245..17b372af858 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java @@ -121,7 +121,7 @@ public class AquaUtilControlSize { try { // see if this component has a "getUI" method final Class clazz = c.getClass(); - final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); + final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); // see if that UI is one of ours that understands sizing final Object ui = getUIMethod.invoke(c, new Object[0]); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java index 078435b161b..faa670345c7 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java @@ -82,7 +82,8 @@ final class AquaUtils { @Override public Creator run() { try { - final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); + final Method getCreatorMethod = CImage.class.getDeclaredMethod( + "getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); return (Creator)getCreatorMethod.invoke(null, new Object[] {}); } catch (final Exception ignored) { @@ -383,7 +384,8 @@ final class AquaUtils { @Override public Method run() { try { - final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class }); + final Method method = JComponent.class.getDeclaredMethod( + "getFlag", new Class[] { int.class }); method.setAccessible(true); return method; } catch (final Throwable ignored) { diff --git a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java index 665c9319cc1..908c63c2c3e 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java +++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java @@ -33,6 +33,7 @@ import javax.swing.JComponent; public class ClientPropertyApplicator implements PropertyChangeListener { private final Map> properties = new HashMap>(); + @SuppressWarnings("unchecked") public ClientPropertyApplicator(final Property... propertyList) { for (final Property p : propertyList) { properties.put(p.name, p); diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java index 1735b444ea5..f4c0aaf4ee8 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java @@ -273,6 +273,7 @@ public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenM try { if (stolenFields == null) return m; + @SuppressWarnings("unchecked") final Vector menus = (Vector)stolenFields[0].get(this); menus.insertElementAt(m, index); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java index 67570c18a6f..c6c75bc82c6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java @@ -88,7 +88,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { super.startDrag(dsc, cursor, dragImage, dragImageOffset); } - protected void startDrag(Transferable transferable, long[] formats, Map formatMap) { + protected void startDrag(Transferable transferable, long[] formats, Map formatMap) { DragGestureEvent trigger = getTrigger(); InputEvent triggerEvent = trigger.getTriggerEvent(); @@ -311,7 +311,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { } } - private void setDefaultDragImage(JList component) { + private void setDefaultDragImage(JList component) { Rectangle selectedOutline = null; // This code actually works, even under the (non-existant) multiple-selections, because we only draw a union outline @@ -485,7 +485,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable, InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp, long nsDragImagePtr, int dragImageOffsetX, int dragImageOffsetY, - int sourceActions, long[] formats, Map formatMap); + int sourceActions, long[] formats, Map formatMap); private native void doDragging(long nativeDragSource); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java index eef5284175b..077b156d806 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -44,13 +44,14 @@ import sun.lwawt.*; public class CInputMethod extends InputMethodAdapter { private InputMethodContext fIMContext; private Component fAwtFocussedComponent; - private LWComponentPeer fAwtFocussedComponentPeer; + private LWComponentPeer fAwtFocussedComponentPeer; private boolean isActive; private static Map[] sHighlightStyles; // Intitalize highlight mapping table and its mapper. static { + @SuppressWarnings({"rawtypes", "unchecked"}) Map styles[] = new Map[4]; HashMap map; @@ -242,7 +243,7 @@ public class CInputMethod extends InputMethodAdapter { public void hideWindows() { } - long getNativeViewPtr(LWComponentPeer peer) { + long getNativeViewPtr(LWComponentPeer peer) { if (peer.getPlatformWindow() instanceof CPlatformWindow) { CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow(); CPlatformView platformView = platformWindow.getContentView(); @@ -272,7 +273,7 @@ public class CInputMethod extends InputMethodAdapter { * to talk to when responding to key events. */ protected void setAWTFocussedComponent(Component component) { - LWComponentPeer peer = null; + LWComponentPeer peer = null; long modelPtr = 0; CInputMethod imInstance = this; @@ -305,7 +306,7 @@ public class CInputMethod extends InputMethodAdapter { /** * @see java.awt.Toolkit#mapInputMethodHighlight */ - public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { int index; int state = highlight.getState(); if (state == InputMethodHighlight.RAW_TEXT) { @@ -384,7 +385,7 @@ public class CInputMethod extends InputMethodAdapter { // java.awt.Toolkit#getNativeContainer() is not available // from this package - private LWComponentPeer getNearestNativePeer(Component comp) { + private LWComponentPeer getNearestNativePeer(Component comp) { if (comp==null) return null; @@ -796,7 +797,7 @@ public class CInputMethod extends InputMethodAdapter { // these calls will be ignored. private native void nativeNotifyPeer(long nativePeer, CInputMethod imInstance); private native void nativeEndComposition(long nativePeer); - private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event); + private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event); // Returns the locale of the active input method. static native Locale getNativeLocale(); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java index d922d029b33..3deba1e33f9 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java @@ -57,7 +57,7 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { } static Object[] getAvailableLocalesInternal() { - List workList = nativeGetAvailableLocales(); + List workList = nativeGetAvailableLocales(); if (workList != null) { return workList.toArray(); @@ -119,5 +119,5 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { } private static native void nativeInit(); - private static native List nativeGetAvailableLocales(); + private static native List nativeGetAvailableLocales(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 534cf0dd744..5af2cdfe1d0 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -151,7 +151,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return (bits & mask) != 0; } - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "rawtypes"}) static ClientPropertyApplicator CLIENT_PROPERTY_APPLICATOR = new ClientPropertyApplicator(new Property[] { new Property(WINDOW_DOCUMENT_MODIFIED) { public void applyProperty(final CPlatformWindow c, final Object value) { c.setStyleBits(DOCUMENT_MODIFIED, value == null ? false : Boolean.parseBoolean(value.toString())); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index edbebbacb67..e2cafca01b6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -32,6 +32,7 @@ import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.event.InputEvent; import java.awt.event.InvocationEvent; import java.awt.event.KeyEvent; +import java.awt.font.TextAttribute; import java.awt.im.InputMethodHighlight; import java.awt.im.spi.InputMethodDescriptor; import java.awt.peer.*; @@ -691,6 +692,7 @@ public final class LWCToolkit extends LWToolkit { } @Override + @SuppressWarnings("unchecked") public T createDragGestureRecognizer( Class abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { @@ -743,7 +745,7 @@ public final class LWCToolkit extends LWToolkit { * @since 1.3 */ @Override - public Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public Map mapInputMethodHighlight(InputMethodHighlight highlight) { return CInputMethod.mapInputMethodHighlight(highlight); } From 61b92329697c34a6f0e13a70ffb6e651e5b89c1b Mon Sep 17 00:00:00 2001 From: Andrei Eremeev Date: Thu, 10 Jul 2014 12:21:29 +0400 Subject: [PATCH 009/111] 8049704: Fix doclint warnings from javax.swing.plaf.basic package, 2 of 7 Reviewed-by: pchelko --- .../javax/swing/plaf/basic/BasicButtonUI.java | 104 +++++++++++++++- .../swing/plaf/basic/BasicComboBoxUI.java | 66 ++++++++-- .../swing/plaf/basic/BasicComboPopup.java | 52 ++++++++ .../swing/plaf/basic/BasicDesktopIconUI.java | 61 ++++++++- .../javax/swing/plaf/basic/BasicLabelUI.java | 82 +++++++++++-- .../swing/plaf/basic/BasicScrollPaneUI.java | 116 +++++++++++++++--- .../plaf/basic/BasicSplitPaneDivider.java | 85 ++++++++++--- .../javax/swing/plaf/basic/BasicTableUI.java | 46 ++++++- 8 files changed, 556 insertions(+), 56 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java index 34595149b95..0e1aa403fac 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,9 @@ public class BasicButtonUI extends ButtonUI{ // Visual constants // NOTE: This is not used or set any where. Were we allowed to remove // fields, this would be removed. + /** + * The default gap between a text and an icon. + */ protected int defaultTextIconGap; // Amount to offset text, the value of this comes from @@ -56,6 +59,9 @@ public class BasicButtonUI extends ButtonUI{ private int shiftOffset = 0; // Value that is set in shiftOffset once setTextShiftOffset has been // invoked. The value of this comes from the defaults table. + /** + * The default offset of a text. + */ protected int defaultTextShiftOffset; private final static String propertyPrefix = "Button" + "."; @@ -65,6 +71,12 @@ public class BasicButtonUI extends ButtonUI{ // ******************************** // Create PLAF // ******************************** + /** + * Returns an instance of {@code BasicButtonUI}. + * + * @param c a component + * @return an instance of {@code BasicButtonUI} + */ public static ComponentUI createUI(JComponent c) { AppContext appContext = AppContext.getAppContext(); BasicButtonUI buttonUI = @@ -76,6 +88,11 @@ public class BasicButtonUI extends ButtonUI{ return buttonUI; } + /** + * Returns the property prefix. + * + * @return the property prefix + */ protected String getPropertyPrefix() { return propertyPrefix; } @@ -91,6 +108,11 @@ public class BasicButtonUI extends ButtonUI{ BasicHTML.updateRenderer(c, ((AbstractButton) c).getText()); } + /** + * Installs default properties. + * + * @param b an abstract button + */ protected void installDefaults(AbstractButton b) { // load shared instance defaults String pp = getPropertyPrefix(); @@ -120,6 +142,11 @@ public class BasicButtonUI extends ButtonUI{ LookAndFeel.installProperty(b, "iconTextGap", Integer.valueOf(4)); } + /** + * Registers listeners. + * + * @param b an abstract button + */ protected void installListeners(AbstractButton b) { BasicButtonListener listener = createButtonListener(b); if(listener != null) { @@ -131,6 +158,11 @@ public class BasicButtonUI extends ButtonUI{ } } + /** + * Registers keyboard actions. + * + * @param b an abstract button + */ protected void installKeyboardActions(AbstractButton b){ BasicButtonListener listener = getButtonListener(b); @@ -150,6 +182,11 @@ public class BasicButtonUI extends ButtonUI{ BasicHTML.updateRenderer(c, ""); } + /** + * Unregisters keyboard actions. + * + * @param b an abstract button + */ protected void uninstallKeyboardActions(AbstractButton b) { BasicButtonListener listener = getButtonListener(b); if(listener != null) { @@ -157,6 +194,11 @@ public class BasicButtonUI extends ButtonUI{ } } + /** + * Unregisters listeners. + * + * @param b an abstract button + */ protected void uninstallListeners(AbstractButton b) { BasicButtonListener listener = getButtonListener(b); if(listener != null) { @@ -168,6 +210,11 @@ public class BasicButtonUI extends ButtonUI{ } } + /** + * Uninstalls default properties. + * + * @param b an abstract button + */ protected void uninstallDefaults(AbstractButton b) { LookAndFeel.uninstallBorder(b); } @@ -175,10 +222,22 @@ public class BasicButtonUI extends ButtonUI{ // ******************************** // Create Listeners // ******************************** + /** + * Returns a new instance of {@code BasicButtonListener}. + * + * @param b an abstract button + * @return a new instance of {@code BasicButtonListener} + */ protected BasicButtonListener createButtonListener(AbstractButton b) { return new BasicButtonListener(b); } + /** + * Returns the default gap between a text and an icon. + * + * @param b an abstract button + * @return the default gap between text and an icon + */ public int getDefaultTextIconGap(AbstractButton b) { return defaultTextIconGap; } @@ -231,6 +290,13 @@ public class BasicButtonUI extends ButtonUI{ } } + /** + * Paints an icon of the current button. + * + * @param g an instance of {@code Graphics} + * @param c a component + * @param iconRect a bounding rectangle to render the icon + */ protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect){ AbstractButton b = (AbstractButton) c; ButtonModel model = b.getModel(); @@ -295,8 +361,15 @@ public class BasicButtonUI extends ButtonUI{ } /** + * Method which renders the text of the current button. + * * As of Java 2 platform v 1.4 this method should not be used or overriden. * Use the paintText method which takes the AbstractButton argument. + * + * @param g an instance of {@code Graphics} + * @param c a component + * @param textRect a bounding rectangle to render the text + * @param text a string to render */ protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) { AbstractButton b = (AbstractButton) c; @@ -328,7 +401,7 @@ public class BasicButtonUI extends ButtonUI{ * * @param g Graphics context * @param b Current button to render - * @param textRect Bounding rectangle to render the text. + * @param textRect Bounding rectangle to render the text * @param text String to render * @since 1.4 */ @@ -338,23 +411,48 @@ public class BasicButtonUI extends ButtonUI{ // Method signature defined here overriden in subclasses. // Perhaps this class should be abstract? + /** + * Paints a focused button. + * + * @param g an instance of {@code Graphics} + * @param b an abstract button + * @param viewRect a bounding rectangle to render the button + * @param textRect a bounding rectangle to render the text + * @param iconRect a bounding rectangle to render the icon + */ protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect){ } - + /** + * Paints a pressed button. + * + * @param g an instance of {@code Graphics} + * @param b an abstract button + */ protected void paintButtonPressed(Graphics g, AbstractButton b){ } + /** + * Clears the offset of the text. + */ protected void clearTextShiftOffset(){ this.shiftOffset = 0; } + /** + * Sets the offset of the text. + */ protected void setTextShiftOffset(){ this.shiftOffset = defaultTextShiftOffset; } + /** + * Returns the offset of the text. + * + * @return the offset of the text + */ protected int getTextShiftOffset() { return shiftOffset; } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index de26e386efd..a144ce120e7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -61,6 +61,10 @@ import sun.swing.UIAction; * @author Mark Davidson */ public class BasicComboBoxUI extends ComboBoxUI { + + /** + * The instance of {@code JComboBox}. + */ protected JComboBox comboBox; /** * This protected field is implementation specific. Do not access directly @@ -73,20 +77,30 @@ public class BasicComboBoxUI extends ComboBoxUI { private boolean isTableCellEditor = false; private static final String IS_TABLE_CELL_EDITOR = "JComboBox.isTableCellEditor"; - // This list is for drawing the current item in the combo box. + /** + * This list is for drawing the current item in the combo box. + */ protected JList listBox; - // Used to render the currently selected item in the combo box. - // It doesn't have anything to do with the popup's rendering. + /** + * Used to render the currently selected item in the combo box. + * It doesn't have anything to do with the popup's rendering. + */ protected CellRendererPane currentValuePane = new CellRendererPane(); - // The implementation of ComboPopup that is used to show the popup. + /** + * The implementation of {@code ComboPopup} that is used to show the popup. + */ protected ComboPopup popup; - // The Component that the ComboBoxEditor uses for editing + /** + * The Component that the @{code ComboBoxEditor} uses for editing. + */ protected Component editor; - // The arrow button that invokes the popup. + /** + * The arrow button that invokes the popup. + */ protected JButton arrowButton; // Listeners that are attached to the JComboBox @@ -121,8 +135,19 @@ public class BasicComboBoxUI extends ComboBoxUI { protected ItemListener itemListener; // Listeners that the ComboPopup produces. + /** + * The {@code MouseListener} listens to events. + */ protected MouseListener popupMouseListener; + + /** + * The {@code MouseMotionListener} listens to events. + */ protected MouseMotionListener popupMouseMotionListener; + + /** + * The {@code KeyListener} listens to events. + */ protected KeyListener popupKeyListener; // This is used for knowing when to cache the minimum preferred size. @@ -160,10 +185,14 @@ public class BasicComboBoxUI extends ComboBoxUI { */ JComboBox.KeySelectionManager keySelectionManager; - // Flag for recalculating the minimum preferred size. + /** + * The flag for recalculating the minimum preferred size. + */ protected boolean isMinimumSizeDirty = true; - // Cached minimum preferred size. + /** + * The cached minimum preferred size. + */ protected Dimension cachedMinimumSize = new Dimension( 0, 0 ); // Flag for calculating the display size @@ -238,6 +267,12 @@ public class BasicComboBoxUI extends ComboBoxUI { // begin UI Initialization // + /** + * Constructs a new instance of {@code BasicComboBoxUI}. + * + * @param c a component + * @return a new instance of {@code BasicComboBoxUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicComboBoxUI(); } @@ -1090,6 +1125,9 @@ public class BasicComboBoxUI extends ComboBoxUI { * navigation. This is used for optimizing key input by only passing non- * navigation keys to the type-ahead mechanism. Subclasses should override this * if they change the navigation keys. + * + * @param keyCode a key code + * @return {@code true} if the supplied {@code keyCode} maps to a navigation key */ protected boolean isNavigationKey( int keyCode ) { return keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN || @@ -1167,6 +1205,8 @@ public class BasicComboBoxUI extends ComboBoxUI { /** * Returns the area that is reserved for drawing the currently selected item. + * + * @return the area that is reserved for drawing the currently selected item */ protected Rectangle rectangleForCurrentValue() { int width = comboBox.getWidth(); @@ -1190,6 +1230,8 @@ public class BasicComboBoxUI extends ComboBoxUI { /** * Gets the insets from the JComboBox. + * + * @return the insets */ protected Insets getInsets() { return comboBox.getInsets(); @@ -1206,6 +1248,10 @@ public class BasicComboBoxUI extends ComboBoxUI { /** * Paints the currently selected item. + * + * @param g an instance of {@code Graphics} + * @param bounds a bounding rectangle to render to + * @param hasFocus is focused */ public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) { ListCellRenderer renderer = comboBox.getRenderer(); @@ -1263,6 +1309,10 @@ public class BasicComboBoxUI extends ComboBoxUI { /** * Paints the background of the currently selected item. + * + * @param g an instance of {@code Graphics} + * @param bounds a bounding rectangle to render to + * @param hasFocus is focused */ public void paintCurrentValueBackground(Graphics g,Rectangle bounds,boolean hasFocus) { Color t = g.getColor(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java index 2f0cd03923d..9e06857d4b3 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java @@ -75,6 +75,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { private static Border LIST_BORDER = new LineBorder(Color.BLACK, 1); + /** + * The instance of {@code JComboBox}. + */ protected JComboBox comboBox; /** * This protected field is implementation specific. Do not access directly @@ -186,11 +189,30 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { * or override. */ protected Timer autoscrollTimer; + + /** + * {@code true} if the mouse cursor is in the popup. + */ protected boolean hasEntered = false; + + /** + * If {@code true} the auto-scrolling is enabled. + */ protected boolean isAutoScrolling = false; + + /** + * The direction of scrolling. + */ protected int scrollDirection = SCROLL_UP; + /** + * The direction of scrolling up. + */ protected static final int SCROLL_UP = 0; + + /** + * The direction of scrolling down. + */ protected static final int SCROLL_DOWN = 1; @@ -309,6 +331,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { } } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions() { // XXX - shouldn't call this method // comboBox.unregisterKeyboardAction( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ) ); @@ -319,6 +344,12 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { //=================================================================== // begin Initialization routines // + + /** + * Constructs a new instance of {@code BasicComboPopup}. + * + * @param combo an instance of {@code JComboBox} + */ public BasicComboPopup( JComboBox combo ) { super(); setName("ComboPopup.popup"); @@ -555,6 +586,8 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { /** * Creates the scroll pane which houses the scrollable list. + * + * @return the scroll pane which houses the scrollable list */ protected JScrollPane createScroller() { JScrollPane sp = new JScrollPane( list, @@ -616,6 +649,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { } } + /** + * Registers keyboard actions. + */ protected void installKeyboardActions() { /* XXX - shouldn't call this method. take it out for testing. @@ -1007,6 +1043,8 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { /** * This protected method is implementation specific and should be private. * do not call or override. + * + * @param direction the direction of scrolling */ protected void startAutoScrolling( int direction ) { // XXX - should be a private method within InvocationMouseMotionHandler @@ -1107,6 +1145,8 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { * send the focus when the popup is brought up. The standard implementation * delegates the focus to the editor (if the combo box is editable) or to * the JComboBox if it is not editable. + * + * @param e a mouse event */ protected void delegateFocus( MouseEvent e ) { if ( comboBox.isEditable() ) { @@ -1150,6 +1190,12 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { } } + /** + * Converts mouse event. + * + * @param e a mouse event + * @return converted mouse event + */ protected MouseEvent convertMouseEvent( MouseEvent e ) { Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(), e.getPoint(), list ); @@ -1171,6 +1217,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { /** * Retrieves the height of the popup based on the current * ListCellRenderer and the maximum row count. + * + * @param maxRowCount the row count + * @return the height of the popup */ protected int getPopupHeightForRowCount(int maxRowCount) { // Set the cached value of the minimum row count @@ -1272,6 +1321,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { /** * A utility method used by the event listeners. Given a mouse event, it changes * the list selection to the list item below the mouse. + * + * @param anEvent a mouse event + * @param shouldScroll if {@code true} list should be scrolled. */ protected void updateListBoxSelectionForEvent(MouseEvent anEvent,boolean shouldScroll) { // XXX - only seems to be called from this class. shouldScroll flag is diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java index 8d68668af6a..262f36ee7d8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,14 @@ import java.beans.*; */ public class BasicDesktopIconUI extends DesktopIconUI { + /** + * The instance of {@code JInternalFrame.JDesktopIcon}. + */ protected JInternalFrame.JDesktopIcon desktopIcon; + + /** + * The instance of {@code JInternalFrame}. + */ protected JInternalFrame frame; /** @@ -53,12 +60,19 @@ public class BasicDesktopIconUI extends DesktopIconUI { protected JComponent iconPane; MouseInputListener mouseInputListener; - - + /** + * Constructs a new instance of {@code BasicDesktopIconUI}. + * + * @param c a component + * @return a new instance of {@code BasicDesktopIconUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicDesktopIconUI(); } + /** + * Constructs a new instance of {@code BasicDesktopIconUI}. + */ public BasicDesktopIconUI() { } @@ -108,39 +122,62 @@ public class BasicDesktopIconUI extends DesktopIconUI { desktopIcon = null; } + /** + * Registers components. + */ protected void installComponents() { iconPane = new BasicInternalFrameTitlePane(frame); desktopIcon.setLayout(new BorderLayout()); desktopIcon.add(iconPane, BorderLayout.CENTER); } + /** + * Unregisters components. + */ protected void uninstallComponents() { desktopIcon.remove(iconPane); desktopIcon.setLayout(null); iconPane = null; } + /** + * Registers listeners. + */ protected void installListeners() { mouseInputListener = createMouseInputListener(); desktopIcon.addMouseMotionListener(mouseInputListener); desktopIcon.addMouseListener(mouseInputListener); } + /** + * Unregisters listeners. + */ protected void uninstallListeners() { desktopIcon.removeMouseMotionListener(mouseInputListener); desktopIcon.removeMouseListener(mouseInputListener); mouseInputListener = null; } + /** + * Installs default properties. + */ protected void installDefaults() { LookAndFeel.installBorder(desktopIcon, "DesktopIcon.border"); LookAndFeel.installProperty(desktopIcon, "opaque", Boolean.TRUE); } + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { LookAndFeel.uninstallBorder(desktopIcon); } + /** + * Returns a new instance of {@code MouseInputListener}. + * + * @return a new instance of {@code MouseInputListener} + */ protected MouseInputListener createMouseInputListener() { return new MouseInputHandler(); } @@ -170,6 +207,12 @@ public class BasicDesktopIconUI extends DesktopIconUI { return iconPane.getMaximumSize(); } + /** + * Returns the insets. + * + * @param c a component + * @return the insets + */ public Insets getInsets(JComponent c) { JInternalFrame iframe = desktopIcon.getInternalFrame(); Border border = iframe.getBorder(); @@ -179,6 +222,9 @@ public class BasicDesktopIconUI extends DesktopIconUI { return new Insets(0,0,0,0); } + /** + * De-iconifies the internal frame. + */ public void deiconize() { try { frame.setIcon(false); } catch (PropertyVetoException e2) { } } @@ -284,6 +330,15 @@ public class BasicDesktopIconUI extends DesktopIconUI { return; } + /** + * Moves and repaints a component {@code f}. + * + * @param f a component + * @param newX a new X coordinate + * @param newY a new Y coordinate + * @param newWidth a new width + * @param newHeight a new height + */ public void moveAndRepaint(JComponent f, int newX, int newY, int newWidth, int newHeight) { Rectangle r = f.getBounds(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java index 9c31265d180..e5576c2aca9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,6 +80,14 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener * This method is here so that a subclass could do Label specific * layout and to shorten the method name a little. * + * @param label an instance of {@code JLabel} + * @param fontMetrics a font metrics + * @param text a text + * @param icon an icon + * @param viewR a bounding rectangle to lay out label + * @param iconR a bounding rectangle to lay out icon + * @param textR a bounding rectangle to lay out text + * @return a possibly clipped version of the compound labels string * @see SwingUtilities#layoutCompoundLabel */ protected String layoutCL( @@ -109,6 +117,11 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener /** * Paint clippedText at textX, textY with the labels foreground color. * + * @param l an instance of {@code JLabel} + * @param g an instance of {@code Graphics} + * @param s a text + * @param textX an X coordinate + * @param textY an Y coordinate * @see #paint * @see #paintDisabledText */ @@ -125,6 +138,11 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener * Paint clippedText at textX, textY with background.lighter() and then * shifted down and to the right by one pixel with background.darker(). * + * @param l an instance of {@code JLabel} + * @param g an instance of {@code Graphics} + * @param s a text + * @param textX an X coordinate + * @param textY an Y coordinate * @see #paint * @see #paintEnabledText */ @@ -329,26 +347,46 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener public void uninstallUI(JComponent c) { - uninstallDefaults((JLabel)c); - uninstallComponents((JLabel)c); - uninstallListeners((JLabel)c); - uninstallKeyboardActions((JLabel)c); + uninstallDefaults((JLabel) c); + uninstallComponents((JLabel) c); + uninstallListeners((JLabel) c); + uninstallKeyboardActions((JLabel) c); } - protected void installDefaults(JLabel c){ - LookAndFeel.installColorsAndFont(c, "Label.background", "Label.foreground", "Label.font"); - LookAndFeel.installProperty(c, "opaque", Boolean.FALSE); - } + /** + * Installs default properties. + * + * @param c an instance of {@code JLabel} + */ + protected void installDefaults(JLabel c){ + LookAndFeel.installColorsAndFont(c, "Label.background", "Label.foreground", "Label.font"); + LookAndFeel.installProperty(c, "opaque", Boolean.FALSE); + } + /** + * Registers listeners. + * + * @param c an instance of {@code JLabel} + */ protected void installListeners(JLabel c){ c.addPropertyChangeListener(this); } + /** + * Registers components. + * + * @param c an instance of {@code JLabel} + */ protected void installComponents(JLabel c){ BasicHTML.updateRenderer(c, c.getText()); c.setInheritsPopupMenu(true); } + /** + * Registers keyboard actions. + * + * @param l an instance of {@code JLabel} + */ protected void installKeyboardActions(JLabel l) { int dka = l.getDisplayedMnemonic(); Component lf = l.getLabelFor(); @@ -374,17 +412,37 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener } } + /** + * Uninstalls default properties. + * + * @param c an instance of {@code JLabel} + */ protected void uninstallDefaults(JLabel c){ } + /** + * Unregisters listeners. + * + * @param c an instance of {@code JLabel} + */ protected void uninstallListeners(JLabel c){ c.removePropertyChangeListener(this); } + /** + * Unregisters components. + * + * @param c an instance of {@code JLabel} + */ protected void uninstallComponents(JLabel c){ BasicHTML.updateRenderer(c, ""); } + /** + * Unregisters keyboard actions. + * + * @param c an instance of {@code JLabel} + */ protected void uninstallKeyboardActions(JLabel c) { SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_FOCUSED, null); SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_IN_FOCUSED_WINDOW, @@ -392,6 +450,12 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener SwingUtilities.replaceUIActionMap(c, null); } + /** + * Returns an instance of {@code BasicLabelUI}. + * + * @param c a component + * @return an instance of {@code BasicLabelUI} + */ public static ComponentUI createUI(JComponent c) { if (System.getSecurityManager() != null) { AppContext appContext = AppContext.getAppContext(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java index 646282046b3..18df8abf202 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,21 +52,40 @@ import java.awt.event.*; public class BasicScrollPaneUI extends ScrollPaneUI implements ScrollPaneConstants { + /** + * The instance of {@code JScrollPane}. + */ protected JScrollPane scrollpane; + + /** + * {@code ChangeListener} installed on the vertical scrollbar. + */ protected ChangeListener vsbChangeListener; + + /** + * {@code ChangeListener} installed on the horizontal scrollbar. + */ protected ChangeListener hsbChangeListener; + + /** + * {@code ChangeListener} installed on the viewport. + */ protected ChangeListener viewportChangeListener; + + /** + * {@code PropertyChangeListener} installed on the scroll pane. + */ protected PropertyChangeListener spPropertyChangeListener; private MouseWheelListener mouseScrollListener; private int oldExtent = Integer.MIN_VALUE; /** - * PropertyChangeListener installed on the vertical scrollbar. + * {@code PropertyChangeListener} installed on the vertical scrollbar. */ private PropertyChangeListener vsbPropertyChangeListener; /** - * PropertyChangeListener installed on the horizontal scrollbar. + * {@code PropertyChangeListener} installed on the horizontal scrollbar. */ private PropertyChangeListener hsbPropertyChangeListener; @@ -79,7 +98,12 @@ public class BasicScrollPaneUI */ private boolean setValueCalled = false; - + /** + * Returns a new instance of {@code BasicScrollPaneUI}. + * + * @param x a component. + * @return a new instance of {@code BasicScrollPaneUI} + */ public static ComponentUI createUI(JComponent x) { return new BasicScrollPaneUI(); } @@ -115,7 +139,11 @@ public class BasicScrollPaneUI return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE); } - + /** + * Installs default properties. + * + * @param scrollpane an instance of {@code JScrollPane} + */ protected void installDefaults(JScrollPane scrollpane) { LookAndFeel.installBorder(scrollpane, "ScrollPane.border"); @@ -132,7 +160,11 @@ public class BasicScrollPaneUI LookAndFeel.installProperty(scrollpane, "opaque", Boolean.TRUE); } - + /** + * Registers listeners. + * + * @param c an instance of {@code JScrollPane} + */ protected void installListeners(JScrollPane c) { vsbChangeListener = createVSBChangeListener(); @@ -165,6 +197,11 @@ public class BasicScrollPaneUI } + /** + * Registers keyboard actions. + * + * @param c an instance of {@code JScrollPane} + */ protected void installKeyboardActions(JScrollPane c) { InputMap inputMap = getInputMap(JComponent. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); @@ -201,7 +238,11 @@ public class BasicScrollPaneUI installKeyboardActions(scrollpane); } - + /** + * Uninstalls default properties. + * + * @param c an instance of {@code JScrollPane} + */ protected void uninstallDefaults(JScrollPane c) { LookAndFeel.uninstallBorder(scrollpane); @@ -210,7 +251,11 @@ public class BasicScrollPaneUI } } - + /** + * Unregisters listeners. + * + * @param c a component + */ protected void uninstallListeners(JComponent c) { JViewport viewport = scrollpane.getViewport(); JScrollBar vsb = scrollpane.getVerticalScrollBar(); @@ -242,7 +287,11 @@ public class BasicScrollPaneUI handler = null; } - + /** + * Unregisters keyboard actions. + * + * @param c an instance of {@code JScrollPane} + */ protected void uninstallKeyboardActions(JScrollPane c) { SwingUtilities.replaceUIActionMap(c, null); SwingUtilities.replaceUIInputMap(c, JComponent. @@ -264,6 +313,9 @@ public class BasicScrollPaneUI return handler; } + /** + * Synchronizes the {@code JScrollPane} with {@code Viewport}. + */ protected void syncScrollPaneWithViewport() { JViewport viewport = scrollpane.getViewport(); @@ -453,6 +505,11 @@ public class BasicScrollPaneUI } } + /** + * Returns an instance of viewport {@code ChangeListener}. + * + * @return an instance of viewport {@code ChangeListener} + */ protected ChangeListener createViewportChangeListener() { return getHandler(); } @@ -483,6 +540,11 @@ public class BasicScrollPaneUI return getHandler(); } + /** + * Returns an instance of horizontal scroll bar {@code ChangeListener}. + * + * @return an instance of horizontal scroll bar {@code ChangeListener} + */ protected ChangeListener createHSBChangeListener() { return getHandler(); } @@ -514,6 +576,11 @@ public class BasicScrollPaneUI return getHandler(); } + /** + * Returns an instance of vertical scroll bar {@code ChangeListener}. + * + * @return an instance of vertical scroll bar {@code ChangeListener} + */ protected ChangeListener createVSBChangeListener() { return getHandler(); } @@ -565,12 +632,21 @@ public class BasicScrollPaneUI return getHandler(); } + /** + * Updates a scroll bar display policy. + * + * @param e the property change event + */ protected void updateScrollBarDisplayPolicy(PropertyChangeEvent e) { scrollpane.revalidate(); scrollpane.repaint(); } - + /** + * Updates viewport. + * + * @param e the property change event + */ protected void updateViewport(PropertyChangeEvent e) { JViewport oldViewport = (JViewport)(e.getOldValue()); @@ -599,7 +675,11 @@ public class BasicScrollPaneUI } } - + /** + * Updates row header. + * + * @param e the property change event + */ protected void updateRowHeader(PropertyChangeEvent e) { JViewport newRowHead = (JViewport)(e.getNewValue()); @@ -611,7 +691,11 @@ public class BasicScrollPaneUI } } - + /** + * Updates column header. + * + * @param e the property change event + */ protected void updateColumnHeader(PropertyChangeEvent e) { JViewport newColHead = (JViewport)(e.getNewValue()); @@ -679,9 +763,9 @@ public class BasicScrollPaneUI /** - * Creates an instance of PropertyChangeListener that's added to - * the JScrollPane by installUI(). Subclasses can override this method - * to return a custom PropertyChangeListener, e.g. + * Creates an instance of {@code PropertyChangeListener} that's added to + * the {@code JScrollPane} by {@code installUI()}. Subclasses can override + * this method to return a custom {@code PropertyChangeListener}, e.g. *
          * class MyScrollPaneUI extends BasicScrollPaneUI {
          *    protected PropertyChangeListener createPropertyChangeListener() {
    @@ -698,6 +782,8 @@ public class BasicScrollPaneUI
          * }
          * 
    * + * @return an instance of {@code PropertyChangeListener} + * * @see java.beans.PropertyChangeListener * @see #installUI */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java index 36b4129598c..34dfeb5710a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java @@ -65,9 +65,13 @@ public class BasicSplitPaneDivider extends Container { /** * Width or height of the divider based on orientation - * BasicSplitPaneUI adds two to this. + * {@code BasicSplitPaneUI} adds two to this. */ protected static final int ONE_TOUCH_SIZE = 6; + + /** + * The offset of the divider. + */ protected static final int ONE_TOUCH_OFFSET = 2; /** @@ -136,8 +140,10 @@ public class BasicSplitPaneDivider extends Container /** - * Creates an instance of BasicSplitPaneDivider. Registers this + * Creates an instance of {@code BasicSplitPaneDivider}. Registers this * instance for mouse events and mouse dragged events. + * + * @param ui an instance of {@code BasicSplitPaneUI} */ public BasicSplitPaneDivider(BasicSplitPaneUI ui) { oneTouchSize = DefaultLookup.getInt(ui.getSplitPane(), ui, @@ -163,7 +169,9 @@ public class BasicSplitPaneDivider extends Container } /** - * Sets the SplitPaneUI that is using the receiver. + * Sets the {@code SplitPaneUI} that is using the receiver. + * + * @param newUI the new {@code SplitPaneUI} */ public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) { if (splitPane != null) { @@ -198,8 +206,9 @@ public class BasicSplitPaneDivider extends Container /** - * Returns the SplitPaneUI the receiver is currently - * in. + * Returns the {@code SplitPaneUI} the receiver is currently in. + * + * @return the {@code SplitPaneUI} the receiver is currently in */ public BasicSplitPaneUI getBasicSplitPaneUI() { return splitPaneUI; @@ -207,9 +216,11 @@ public class BasicSplitPaneDivider extends Container /** - * Sets the size of the divider to newSize. That is - * the width if the splitpane is HORIZONTAL_SPLIT, or - * the height of VERTICAL_SPLIT. + * Sets the size of the divider to {@code newSize}. That is + * the width if the splitpane is {@code HORIZONTAL_SPLIT}, or + * the height of {@code VERTICAL_SPLIT}. + * + * @param newSize a new size */ public void setDividerSize(int newSize) { dividerSize = newSize; @@ -219,6 +230,8 @@ public class BasicSplitPaneDivider extends Container /** * Returns the size of the divider, that is the width if the splitpane * is HORIZONTAL_SPLIT, or the height of VERTICAL_SPLIT. + * + * @return the size of the divider */ public int getDividerSize() { return dividerSize; @@ -227,6 +240,8 @@ public class BasicSplitPaneDivider extends Container /** * Sets the border of this component. + * + * @param border a new border * @since 1.3 */ public void setBorder(Border border) { @@ -382,8 +397,10 @@ public class BasicSplitPaneDivider extends Container /** - * Creates and return an instance of JButton that can be used to + * Creates and return an instance of {@code JButton} that can be used to * collapse the left component in the split pane. + * + * @return an instance of {@code JButton} */ protected JButton createLeftOneTouchButton() { JButton b = new JButton() { @@ -438,8 +455,10 @@ public class BasicSplitPaneDivider extends Container /** - * Creates and return an instance of JButton that can be used to + * Creates and return an instance of {@code JButton} that can be used to * collapse the right component in the split pane. + * + * @return an instance of {@code JButton} */ protected JButton createRightOneTouchButton() { JButton b = new JButton() { @@ -503,6 +522,8 @@ public class BasicSplitPaneDivider extends Container /** * Messages the BasicSplitPaneUI with dragDividerTo that this instance * is contained in. + * + * @param location a location */ protected void dragDividerTo(int location) { splitPaneUI.dragDividerTo(location); @@ -512,6 +533,8 @@ public class BasicSplitPaneDivider extends Container /** * Messages the BasicSplitPaneUI with finishDraggingTo that this instance * is contained in. + * + * @param location a location */ protected void finishDraggingTo(int location) { splitPaneUI.finishDraggingTo(location); @@ -694,7 +717,11 @@ public class BasicSplitPaneDivider extends Container */ int offset; - + /** + * Constructs a new instance of {@code DragController}. + * + * @param e a mouse event + */ protected DragController(MouseEvent e) { JSplitPane splitPane = splitPaneUI.getSplitPane(); Component leftC = splitPane.getLeftComponent(); @@ -741,7 +768,9 @@ public class BasicSplitPaneDivider extends Container /** - * Returns true if the dragging session is valid. + * Returns {@code true} if the dragging session is valid. + * + * @return {@code true} if the dragging session is valid */ protected boolean isValid() { return (maxX > 0); @@ -751,6 +780,9 @@ public class BasicSplitPaneDivider extends Container /** * Returns the new position to put the divider at based on * the passed in MouseEvent. + * + * @param e a mouse event + * @return the new position */ protected int positionForMouseEvent(MouseEvent e) { int newX = (e.getSource() == BasicSplitPaneDivider.this) ? @@ -764,6 +796,10 @@ public class BasicSplitPaneDivider extends Container /** * Returns the x argument, since this is used for horizontal * splits. + * + * @param x an X coordinate + * @param y an Y coordinate + * @return the X argument */ protected int getNeededLocation(int x, int y) { int newX; @@ -772,7 +808,13 @@ public class BasicSplitPaneDivider extends Container return newX; } - + /** + * Messages dragDividerTo with the new location for the mouse + * event. + * + * @param newX an X coordinate + * @param newY an Y coordinate + */ protected void continueDrag(int newX, int newY) { dragDividerTo(getNeededLocation(newX, newY)); } @@ -781,12 +823,20 @@ public class BasicSplitPaneDivider extends Container /** * Messages dragDividerTo with the new location for the mouse * event. + * + * @param e a mouse event */ protected void continueDrag(MouseEvent e) { dragDividerTo(positionForMouseEvent(e)); } - + /** + * Messages finishDraggingTo with the new location for the mouse + * event. + * + * @param x an X coordinate + * @param y an Y coordinate + */ protected void completeDrag(int x, int y) { finishDraggingTo(getNeededLocation(x, y)); } @@ -795,6 +845,8 @@ public class BasicSplitPaneDivider extends Container /** * Messages finishDraggingTo with the new location for the mouse * event. + * + * @param e a mouse event */ protected void completeDrag(MouseEvent e) { finishDraggingTo(positionForMouseEvent(e)); @@ -813,6 +865,11 @@ public class BasicSplitPaneDivider extends Container protected class VerticalDragController extends DragController { /* DragControllers ivars are now in terms of y, not x. */ + /** + * Constructs a new instance of {@code VerticalDragController}. + * + * @param e a mouse event + */ protected VerticalDragController(MouseEvent e) { super(e); JSplitPane splitPane = splitPaneUI.getSplitPane(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java index ba92184b436..bff514b57ff 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java @@ -64,12 +64,29 @@ public class BasicTableUI extends TableUI // // The JTable that is delegating the painting to this UI. + /** + * The instance of {@code JTable}. + */ protected JTable table; + + /** + * The instance of {@code CellRendererPane}. + */ protected CellRendererPane rendererPane; - // Listeners that are attached to the JTable + /** + * {@code KeyListener} that are attached to the {@code JTable}. + */ protected KeyListener keyListener; + + /** + * {@code FocusListener} that are attached to the {@code JTable}. + */ protected FocusListener focusListener; + + /** + * {@code MouseInputListener} that are attached to the {@code JTable}. + */ protected MouseInputListener mouseInputListener; private Handler handler; @@ -1350,21 +1367,27 @@ public class BasicTableUI extends TableUI } /** - * Creates the key listener for handling keyboard navigation in the JTable. + * Creates the key listener for handling keyboard navigation in the {@code JTable}. + * + * @return the key listener for handling keyboard navigation in the {@code JTable} */ protected KeyListener createKeyListener() { return null; } /** - * Creates the focus listener for handling keyboard navigation in the JTable. + * Creates the focus listener for handling keyboard navigation in the {@code JTable}. + * + * @return the focus listener for handling keyboard navigation in the {@code JTable} */ protected FocusListener createFocusListener() { return getHandler(); } /** - * Creates the mouse listener for the JTable. + * Creates the mouse listener for the {@code JTable}. + * + * @return the mouse listener for the {@code JTable} */ protected MouseInputListener createMouseInputListener() { return getHandler(); @@ -1374,6 +1397,12 @@ public class BasicTableUI extends TableUI // The installation/uninstall procedures and support // + /** + * Returns a new instance of {@code BasicTableUI}. + * + * @param c a component + * @return a new instance of {@code BasicTableUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicTableUI(); } @@ -1616,12 +1645,18 @@ public class BasicTableUI extends TableUI table = null; } + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { if (table.getTransferHandler() instanceof UIResource) { table.setTransferHandler(null); } } + /** + * Unregisters listeners. + */ protected void uninstallListeners() { table.removeFocusListener(focusListener); table.removeKeyListener(keyListener); @@ -1638,6 +1673,9 @@ public class BasicTableUI extends TableUI handler = null; } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions() { SwingUtilities.replaceUIInputMap(table, JComponent. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); From f77b84ddc6fd4688ad15e53d4df9fbc388ff3f15 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 10 Jul 2014 15:08:50 +0400 Subject: [PATCH 010/111] 8049830: Remove reflection from ScreenMenuBar Reviewed-by: anthony, serb --- .../classes/com/apple/laf/ScreenMenuBar.java | 51 +++++-------------- .../share/classes/java/awt/MenuComponent.java | 8 +++ .../share/classes/sun/awt/AWTAccessor.java | 7 ++- 3 files changed, 26 insertions(+), 40 deletions(-) diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java index f4c0aaf4ee8..2d56499ebb3 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java @@ -25,6 +25,9 @@ package com.apple.laf; +import sun.awt.AWTAccessor; +import sun.lwawt.macosx.CMenuBar; + import java.awt.*; import java.awt.event.*; import java.lang.reflect.*; @@ -243,55 +246,25 @@ public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenM fSubmenus.remove(menu); } - private static Field[] stolenFields = null; - - static { - stolenFields = AccessController.doPrivileged(new PrivilegedAction() { - public Field[] run() { - try { - final Field[] localFields = new Field[2]; - localFields[0] = MenuBar.class.getDeclaredField("menus"); - localFields[1] = MenuComponent.class.getDeclaredField("parent"); - AccessibleObject.setAccessible(localFields, true); - return localFields; - } catch (final NoSuchFieldException nsf) { - // If this happens, Sun changed the definition of MenuBar and MenuComponent! - nsf.printStackTrace(System.err); - return null; - } - } - }); - }; - public Menu add(final Menu m, final int index) { synchronized (getTreeLock()) { if (m.getParent() != null) { m.getParent().remove(m); } - // Use nasty reflection to get at the menus array and parent fields. - try { - if (stolenFields == null) return m; + final Vector menus = AWTAccessor.getMenuBarAccessor().getMenus(this); + menus.insertElementAt(m, index); + AWTAccessor.getMenuComponentAccessor().setParent(m, this); - @SuppressWarnings("unchecked") - final Vector menus = (Vector)stolenFields[0].get(this); - menus.insertElementAt(m, index); + final CMenuBar peer = (CMenuBar)getPeer(); + if (peer == null) return m; - stolenFields[1].set(m, this); - - final sun.lwawt.macosx.CMenuBar peer = (sun.lwawt.macosx.CMenuBar)getPeer(); - if (peer == null) return m; - - peer.setNextInsertionIndex(index); - if (m.getPeer() == null) { - m.addNotify(); - } - - peer.setNextInsertionIndex(-1); - } catch (final IllegalAccessException iae) { - iae.printStackTrace(System.err); + peer.setNextInsertionIndex(index); + if (m.getPeer() == null) { + m.addNotify(); } + peer.setNextInsertionIndex(-1); return m; } } diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java index 4ea95bf5969..64b1db9bf06 100644 --- a/jdk/src/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/share/classes/java/awt/MenuComponent.java @@ -132,16 +132,24 @@ public abstract class MenuComponent implements java.io.Serializable { static { AWTAccessor.setMenuComponentAccessor( new AWTAccessor.MenuComponentAccessor() { + @Override public AppContext getAppContext(MenuComponent menuComp) { return menuComp.appContext; } + @Override public void setAppContext(MenuComponent menuComp, AppContext appContext) { menuComp.appContext = appContext; } + @Override public MenuContainer getParent(MenuComponent menuComp) { return menuComp.parent; } + @Override + public void setParent(MenuComponent menuComp, MenuContainer menuContainer) { + menuComp.parent = menuContainer; + } + @Override public Font getFont_NoClientCode(MenuComponent menuComp) { return menuComp.getFont_NoClientCode(); } diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java index 0bec70b332a..ddf88d39c79 100644 --- a/jdk/src/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java @@ -481,10 +481,15 @@ public final class AWTAccessor { void setAppContext(MenuComponent menuComp, AppContext appContext); /** - * Returns the menu container of the menu component + * Returns the menu container of the menu component. */ MenuContainer getParent(MenuComponent menuComp); + /** + * Sets the menu container of the menu component. + */ + void setParent(MenuComponent menuComp, MenuContainer menuContainer); + /** * Gets the font used for this menu component. */ From 2194d4368fe67e9aca7092d22ccc2608373cb30f Mon Sep 17 00:00:00 2001 From: Andrei Eremeev Date: Thu, 10 Jul 2014 17:20:56 +0400 Subject: [PATCH 011/111] 8049808: Fix doclint warnings from javax.swing.plaf.basic package, 3 of 7 Reviewed-by: pchelko --- .../javax/swing/plaf/basic/BasicBorders.java | 150 ++++++++++++- .../javax/swing/plaf/basic/BasicListUI.java | 129 ++++++++--- .../swing/plaf/basic/BasicMenuItemUI.java | 138 +++++++++++- .../swing/plaf/basic/BasicProgressBarUI.java | 79 ++++++- .../swing/plaf/basic/BasicSplitPaneUI.java | 204 ++++++++++++------ 5 files changed, 599 insertions(+), 101 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java index 05a3093e254..633b2f91ee4 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java @@ -45,6 +45,11 @@ import java.awt.Graphics; public class BasicBorders { + /** + * Returns a border instance for a {@code JButton}. + * + * @return a border instance for a {@code JButton} + */ public static Border getButtonBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border buttonBorder = new BorderUIResource.CompoundBorderUIResource( @@ -57,6 +62,11 @@ public class BasicBorders { return buttonBorder; } + /** + * Returns a border instance for a {@code JRadioButton}. + * + * @return a border instance for a {@code JRadioButton} + */ public static Border getRadioButtonBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border radioButtonBorder = new BorderUIResource.CompoundBorderUIResource( @@ -69,6 +79,11 @@ public class BasicBorders { return radioButtonBorder; } + /** + * Returns a border instance for a {@code JToggleButton}. + * + * @return a border instance for a {@code JToggleButton} + */ public static Border getToggleButtonBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource( @@ -81,6 +96,11 @@ public class BasicBorders { return toggleButtonBorder; } + /** + * Returns a border instance for a {@code JMenuBar}. + * + * @return a border instance for a {@code JMenuBar} + */ public static Border getMenuBarBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border menuBarBorder = new BasicBorders.MenuBarBorder( @@ -90,6 +110,11 @@ public class BasicBorders { return menuBarBorder; } + /** + * Returns a border instance for a {@code JSplitPane}. + * + * @return a border instance for a {@code JSplitPane} + */ public static Border getSplitPaneBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border splitPaneBorder = new BasicBorders.SplitPaneBorder( @@ -99,7 +124,9 @@ public class BasicBorders { } /** - * Returns a border instance for a JSplitPane divider + * Returns a border instance for a {@code JSplitPane} divider. + * + * @return a border instance for a {@code JSplitPane} divider * @since 1.3 */ public static Border getSplitPaneDividerBorder() { @@ -110,6 +137,11 @@ public class BasicBorders { return splitPaneBorder; } + /** + * Returns a border instance for a {@code JTextField}. + * + * @return a border instance for a {@code JTextField} + */ public static Border getTextFieldBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border textFieldBorder = new BasicBorders.FieldBorder( @@ -120,12 +152,22 @@ public class BasicBorders { return textFieldBorder; } + /** + * Returns a border instance for a {@code JProgressBar}. + * + * @return a border instance for a {@code JProgressBar} + */ public static Border getProgressBarBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border progressBarBorder = new BorderUIResource.LineBorderUIResource(Color.green, 2); return progressBarBorder; } + /** + * Returns a border instance for a {@code JInternalFrame}. + * + * @return a border instance for a {@code JInternalFrame} + */ public static Border getInternalFrameBorder() { UIDefaults table = UIManager.getLookAndFeelDefaults(); Border internalFrameBorder = new BorderUIResource.CompoundBorderUIResource( @@ -147,6 +189,14 @@ public class BasicBorders { @SuppressWarnings("serial") // Superclass is not serializable across versions public static class RolloverButtonBorder extends ButtonBorder { + /** + * Constructs a new instance of a {@code RolloverButtonBorder}. + * + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color of highlight + * @param lightHighlight a color of light highlight + */ public RolloverButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) { super(shadow, darkShadow, highlight, lightHighlight); @@ -227,13 +277,36 @@ public class BasicBorders { } } + /** + * Draws a border around a button. + */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class ButtonBorder extends AbstractBorder implements UIResource { + /** + * The color of shadow. + */ protected Color shadow; + /** + * The color of dark shadow. + */ protected Color darkShadow; + /** + * The color of highlight. + */ protected Color highlight; + /** + * The color of light highlight. + */ protected Color lightHighlight; + /** + * Constructs a new instance of a {@code ButtonBorder}. + * + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color of highlight + * @param lightHighlight a color of light highlight + */ public ButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) { this.shadow = shadow; @@ -270,9 +343,20 @@ public class BasicBorders { } + /** + * Draws the border around a toggle button. + */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class ToggleButtonBorder extends ButtonBorder { + /** + * Constructs a new instance of a {@code ToggleButtonBorder}. + * + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color of highlight + * @param lightHighlight a color of light highlight + */ public ToggleButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) { super(shadow, darkShadow, highlight, lightHighlight); @@ -292,9 +376,20 @@ public class BasicBorders { } } + /** + * Draws the border around a radio button. + */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class RadioButtonBorder extends ButtonBorder { + /** + * Constructs a new instance of a {@code RadioButtonBorder}. + * + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color of highlight + * @param lightHighlight a color of light highlight + */ public RadioButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) { super(shadow, darkShadow, highlight, lightHighlight); @@ -329,11 +424,26 @@ public class BasicBorders { } } + /** + * Draws the border around a menu bar. + */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class MenuBarBorder extends AbstractBorder implements UIResource { + /** + * The color of shadow. + */ private Color shadow; + /** + * The color of highlight. + */ private Color highlight; + /** + * Constructs a new instance of a {@code MenuBarBorder}. + * + * @param shadow a color of shadow + * @param highlight a color of highlight + */ public MenuBarBorder(Color shadow, Color highlight) { this.shadow = shadow; this.highlight = highlight; @@ -356,6 +466,9 @@ public class BasicBorders { } } + /** + * Draws the border around components which support margins. + */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class MarginBorder extends AbstractBorder implements UIResource { public Insets getBorderInsets(Component c, Insets insets) { @@ -384,13 +497,36 @@ public class BasicBorders { } } + /** + * Draws the border around a field. + */ @SuppressWarnings("serial") // Superclass is not serializable across versions public static class FieldBorder extends AbstractBorder implements UIResource { + /** + * The color of shadow. + */ protected Color shadow; + /** + * The color of dark shadow. + */ protected Color darkShadow; + /** + * The color of highlight. + */ protected Color highlight; + /** + * The color of light highlight. + */ protected Color lightHighlight; + /** + * Constructs a new instance of a {@code FieldBorder}. + * + * @param shadow a color of shadow + * @param darkShadow a color of dark shadow + * @param highlight a color of highlight + * @param lightHighlight a color of light highlight + */ public FieldBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight) { this.shadow = shadow; @@ -509,9 +645,21 @@ public class BasicBorders { * also install a border on the divider (property SplitPaneDivider.border). */ public static class SplitPaneBorder implements Border, UIResource { + /** + * The color of highlight + */ protected Color highlight; + /** + * The color of shadow + */ protected Color shadow; + /** + * Constructs a new instance of a {@code SplitPaneBorder}. + * + * @param highlight a color of highlight + * @param shadow a color of shadow + */ public SplitPaneBorder(Color highlight, Color shadow) { this.highlight = highlight; this.shadow = shadow; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java index c66069e0ae6..fd4292e6350 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -59,20 +59,53 @@ public class BasicListUI extends ListUI private static final StringBuilder BASELINE_COMPONENT_KEY = new StringBuilder("List.baselineComponent"); + /** + * The instance of {@code JList}. + */ protected JList list = null; + /** + * The instance of {@code CellRendererPane}. + */ protected CellRendererPane rendererPane; // Listeners that this UI attaches to the JList + /** + * {@code FocusListener} that attached to {@code JList}. + */ protected FocusListener focusListener; + /** + * {@code MouseInputListener} that attached to {@code JList}. + */ protected MouseInputListener mouseInputListener; + /** + * {@code ListSelectionListener} that attached to {@code JList}. + */ protected ListSelectionListener listSelectionListener; + /** + * {@code ListDataListener} that attached to {@code JList}. + */ protected ListDataListener listDataListener; + /** + * {@code PropertyChangeListener} that attached to {@code JList}. + */ protected PropertyChangeListener propertyChangeListener; private Handler handler; + /** + * The array of cells' height + */ protected int[] cellHeights = null; + /** + * The height of cell. + */ protected int cellHeight = -1; + /** + * The width of cell. + */ protected int cellWidth = -1; + /** + * The value represents changes to {@code JList} model. + */ protected int updateLayoutStateNeeded = modelChanged; /** * Height of the list. When asked to paint, if the current size of @@ -131,12 +164,33 @@ public class BasicListUI extends ListUI * models length changed, are handled similarly, see DataListener. */ + /** + * The bit relates to model changed property. + */ protected final static int modelChanged = 1 << 0; + /** + * The bit relates to selection model changed property. + */ protected final static int selectionModelChanged = 1 << 1; + /** + * The bit relates to font changed property. + */ protected final static int fontChanged = 1 << 2; + /** + * The bit relates to fixed cell width changed property. + */ protected final static int fixedCellWidthChanged = 1 << 3; + /** + * The bit relates to fixed cell height changed property. + */ protected final static int fixedCellHeightChanged = 1 << 4; + /** + * The bit relates to prototype cell value changed property. + */ protected final static int prototypeCellValueChanged = 1 << 5; + /** + * The bit relates to cell renderer changed property. + */ protected final static int cellRendererChanged = 1 << 6; private final static int layoutOrientationChanged = 1 << 7; private final static int heightChanged = 1 << 8; @@ -187,9 +241,16 @@ public class BasicListUI extends ListUI /** * Paint one List cell: compute the relevant state, get the "rubber stamp" - * cell renderer component, and then use the CellRendererPane to paint it. - * Subclasses may want to override this method rather than paint(). + * cell renderer component, and then use the {@code CellRendererPane} to paint it. + * Subclasses may want to override this method rather than {@code paint()}. * + * @param g an instance of {@code Graphics} + * @param row a row + * @param rowBounds a bounding rectangle to render to + * @param cellRenderer a list of {@code ListCellRenderer} + * @param dataModel a list model + * @param selModel a selection model + * @param leadIndex a lead index * @see #paint */ protected void paintCell( @@ -916,10 +977,11 @@ public class BasicListUI extends ListUI /** - * Returns a new instance of BasicListUI. BasicListUI delegates are - * allocated one per JList. + * Returns a new instance of {@code BasicListUI}. + * {@code BasicListUI} delegates are allocated one per {@code JList}. * - * @return A new ListUI implementation for the Windows look and feel. + * @param list a component + * @return a new {@code ListUI} implementation for the Windows look and feel. */ public static ComponentUI createUI(JComponent list) { return new BasicListUI(); @@ -1046,7 +1108,8 @@ public class BasicListUI extends ListUI /** * Returns the height of the specified row based on the current layout. * - * @return The specified row height or -1 if row isn't valid. + * @param row a row + * @return the specified row height or -1 if row isn't valid * @see #convertYToRow * @see #convertRowToY * @see #updateLayoutState @@ -1058,11 +1121,12 @@ public class BasicListUI extends ListUI /** - * Convert the JList relative coordinate to the row that contains it, - * based on the current layout. If y0 doesn't fall within any row, + * Convert the {@code JList} relative coordinate to the row that contains it, + * based on the current layout. If {@code y0} doesn't fall within any row, * return -1. * - * @return The row that contains y0, or -1. + * @param y0 a relative Y coordinate + * @return the row that contains y0, or -1 * @see #getRowHeight * @see #updateLayoutState */ @@ -1073,10 +1137,11 @@ public class BasicListUI extends ListUI /** - * Return the JList relative Y coordinate of the origin of the specified + * Return the {@code JList} relative Y coordinate of the origin of the specified * row or -1 if row isn't valid. * - * @return The Y coordinate of the origin of row, or -1. + * @param row a row + * @return the Y coordinate of the origin of row, or -1 * @see #getRowHeight * @see #updateLayoutState */ @@ -1535,10 +1600,10 @@ public class BasicListUI extends ListUI /** - * Creates a delegate that implements MouseInputListener. - * The delegate is added to the corresponding java.awt.Component listener - * lists at installUI() time. Subclasses can override this method to return - * a custom MouseInputListener, e.g. + * Creates a delegate that implements {@code MouseInputListener}. + * The delegate is added to the corresponding {@code java.awt.Component} listener + * lists at {@code installUI()} time. Subclasses can override this method to return + * a custom {@code MouseInputListener}, e.g. *
          * class MyListUI extends BasicListUI {
          *    protected MouseInputListener createMouseInputListener() {
    @@ -1553,6 +1618,7 @@ public class BasicListUI extends ListUI
          * }
          * 
    * + * @return an instance of {@code MouseInputListener} * @see MouseInputHandler * @see #installUI */ @@ -1566,6 +1632,9 @@ public class BasicListUI extends ListUI */ public class FocusHandler implements FocusListener { + /** + * Repaints focused cells. + */ protected void repaintCellFocus() { getHandler().repaintCellFocus(); @@ -1584,6 +1653,11 @@ public class BasicListUI extends ListUI } } + /** + * Returns an instance of {@code FocusListener}. + * + * @return an instance of {@code FocusListener} + */ protected FocusListener createFocusListener() { return getHandler(); } @@ -1617,9 +1691,9 @@ public class BasicListUI extends ListUI /** - * Creates an instance of ListSelectionHandler that's added to - * the JLists by selectionModel as needed. Subclasses can override - * this method to return a custom ListSelectionListener, e.g. + * Creates an instance of {@code ListSelectionHandler} that's added to + * the {@code JLists} by selectionModel as needed. Subclasses can override + * this method to return a custom {@code ListSelectionListener}, e.g. *
          * class MyListUI extends BasicListUI {
          *    protected ListSelectionListener createListSelectionListener() {
    @@ -1634,6 +1708,7 @@ public class BasicListUI extends ListUI
          * }
          * 
    * + * @return an instance of {@code ListSelectionHandler} * @see ListSelectionHandler * @see #installUI */ @@ -1649,8 +1724,8 @@ public class BasicListUI extends ListUI /** - * The ListDataListener that's added to the JLists model at - * installUI time, and whenever the JList.model property changes. + * The {@code ListDataListener} that's added to the {@code JLists} model at + * {@code installUI time}, and whenever the JList.model property changes. *

    * Warning: * Serialized objects of this class will not be compatible with @@ -1687,9 +1762,9 @@ public class BasicListUI extends ListUI /** - * Creates an instance of ListDataListener that's added to - * the JLists by model as needed. Subclasses can override - * this method to return a custom ListDataListener, e.g. + * Creates an instance of {@code ListDataListener} that's added to + * the {@code JLists} by model as needed. Subclasses can override + * this method to return a custom {@code ListDataListener}, e.g. *

          * class MyListUI extends BasicListUI {
          *    protected ListDataListener createListDataListener() {
    @@ -1704,6 +1779,7 @@ public class BasicListUI extends ListUI
          * }
          * 
    * + * @return an instance of {@code ListDataListener} * @see ListDataListener * @see JList#getModel * @see #installUI @@ -1744,9 +1820,9 @@ public class BasicListUI extends ListUI /** - * Creates an instance of PropertyChangeHandler that's added to - * the JList by installUI(). Subclasses can override this method - * to return a custom PropertyChangeListener, e.g. + * Creates an instance of {@code PropertyChangeHandler} that's added to + * the {@code JList} by {@code installUI()}. Subclasses can override this method + * to return a custom {@code PropertyChangeListener}, e.g. *
          * class MyListUI extends BasicListUI {
          *    protected PropertyChangeListener createPropertyChangeListener() {
    @@ -1763,6 +1839,7 @@ public class BasicListUI extends ListUI
          * }
          * 
    * + * @return an instance of {@code PropertyChangeHandler} * @see PropertyChangeListener * @see #installUI */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java index 9562a2089d6..d8e73a71290 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,11 +47,29 @@ import sun.swing.*; */ public class BasicMenuItemUI extends MenuItemUI { + /** + * The instance of {@code JMenuItem}. + */ protected JMenuItem menuItem = null; + /** + * The color of the selection background. + */ protected Color selectionBackground; + /** + * The color of the selection foreground. + */ protected Color selectionForeground; + /** + * The color of the disabled foreground. + */ protected Color disabledForeground; + /** + * The color of the accelerator foreground. + */ protected Color acceleratorForeground; + /** + * The color of the accelerator selection. + */ protected Color acceleratorSelectionForeground; /** @@ -60,18 +78,33 @@ public class BasicMenuItemUI extends MenuItemUI */ protected String acceleratorDelimiter; + /** + * The gap between the text and the icon. + */ protected int defaultTextIconGap; + /** + * The accelerator font. + */ protected Font acceleratorFont; + /** + * The instance of {@code MouseInputListener}. + */ protected MouseInputListener mouseInputListener; + /** + * The instance of {@code MenuDragMouseListener}. + */ protected MenuDragMouseListener menuDragMouseListener; + /** + * The instance of {@code MenuKeyListener}. + */ protected MenuKeyListener menuKeyListener; /** - * PropertyChangeListener returned from - * createPropertyChangeListener. You should not + * {@code PropertyChangeListener} returned from + * {@code createPropertyChangeListener}. You should not * need to access this field, rather if you want to customize the - * PropertyChangeListener override - * createPropertyChangeListener. + * {@code PropertyChangeListener} override + * {@code createPropertyChangeListener}. * * @since 1.6 * @see #createPropertyChangeListener @@ -79,10 +112,17 @@ public class BasicMenuItemUI extends MenuItemUI protected PropertyChangeListener propertyChangeListener; // BasicMenuUI also uses this. Handler handler; - + /** + * The arrow icon. + */ protected Icon arrowIcon = null; + /** + * The check icon. + */ protected Icon checkIcon = null; - + /** + * The value represents if the old border is painted. + */ protected boolean oldBorderPainted; /* diagnostic aids -- should be false for production builds. */ @@ -97,6 +137,12 @@ public class BasicMenuItemUI extends MenuItemUI BasicLookAndFeel.installAudioActionMap(map); } + /** + * Returns a new instance of {@code BasicMenuItemUI}. + * + * @param c a component + * @return a new instance of {@code BasicMenuItemUI} + */ public static ComponentUI createUI(JComponent c) { return new BasicMenuItemUI(); } @@ -110,7 +156,9 @@ public class BasicMenuItemUI extends MenuItemUI installKeyboardActions(); } - + /** + * Installs default properties. + */ protected void installDefaults() { String prefix = getPropertyPrefix(); @@ -202,16 +250,26 @@ public class BasicMenuItemUI extends MenuItemUI } /** + * + * @param menuItem a menu item * @since 1.3 */ protected void installComponents(JMenuItem menuItem){ BasicHTML.updateRenderer(menuItem, menuItem.getText()); } + /** + * Returns a property prefix. + * + * @return a property prefix + */ protected String getPropertyPrefix() { return "MenuItem"; } + /** + * Registers listeners. + */ protected void installListeners() { if ((mouseInputListener = createMouseInputListener(menuItem)) != null) { menuItem.addMouseListener(mouseInputListener); @@ -228,6 +286,9 @@ public class BasicMenuItemUI extends MenuItemUI } } + /** + * Registers keyboard action. + */ protected void installKeyboardActions() { installLazyActionMap(); updateAcceleratorBinding(); @@ -248,7 +309,9 @@ public class BasicMenuItemUI extends MenuItemUI menuItem = null; } - + /** + * Uninstalls default properties. + */ protected void uninstallDefaults() { LookAndFeel.uninstallBorder(menuItem); LookAndFeel.installProperty(menuItem, "borderPainted", oldBorderPainted); @@ -261,12 +324,18 @@ public class BasicMenuItemUI extends MenuItemUI } /** + * Unregisters components. + * + * @param menuItem a menu item * @since 1.3 */ protected void uninstallComponents(JMenuItem menuItem){ BasicHTML.updateRenderer(menuItem, ""); } + /** + * Unregisters listeners. + */ protected void uninstallListeners() { if (mouseInputListener != null) { menuItem.removeMouseListener(mouseInputListener); @@ -289,30 +358,52 @@ public class BasicMenuItemUI extends MenuItemUI handler = null; } + /** + * Unregisters keyboard actions. + */ protected void uninstallKeyboardActions() { SwingUtilities.replaceUIActionMap(menuItem, null); SwingUtilities.replaceUIInputMap(menuItem, JComponent. WHEN_IN_FOCUSED_WINDOW, null); } + /** + * Returns an instance of {@code MouseInputListener}. + * + * @param c a component + * @return an instance of {@code MouseInputListener} + */ protected MouseInputListener createMouseInputListener(JComponent c) { return getHandler(); } + /** + * Returns an instance of {@code MenuDragMouseListener}. + * + * @param c a component + * @return an instance of {@code MenuDragMouseListener} + */ protected MenuDragMouseListener createMenuDragMouseListener(JComponent c) { return getHandler(); } + /** + * Returns an instance of {@code MenuKeyListener}. + * + * @param c a component + * @return an instance of {@code MenuKeyListener} + */ protected MenuKeyListener createMenuKeyListener(JComponent c) { return null; } /** - * Creates a PropertyChangeListener which will be added to + * Creates a {@code PropertyChangeListener} which will be added to * the menu item. * If this method returns null then it will not be added to the menu item. * - * @return an instance of a PropertyChangeListener or null + * @param c a component + * @return an instance of a {@code PropertyChangeListener} or null * @since 1.6 */ protected PropertyChangeListener @@ -380,6 +471,15 @@ public class BasicMenuItemUI extends MenuItemUI return d; } + /** + * Returns the preferred size of a menu item. + * + * @param c a component + * @param checkIcon a check icon + * @param arrowIcon an arrow icon + * @param defaultTextIconGap a gap between a text and an icon + * @return the preferred size of a menu item + */ protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, @@ -477,6 +577,17 @@ public class BasicMenuItemUI extends MenuItemUI defaultTextIconGap); } + /** + * Paints a menu item. + * + * @param g an instance of {@code Graphics} + * @param c a component + * @param checkIcon a check icon + * @param arrowIcon an arrow icon + * @param background a background color + * @param foreground a foreground color + * @param defaultTextIconGap a gap between a text and an icon + */ protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, @@ -701,6 +812,11 @@ public class BasicMenuItemUI extends MenuItemUI } } + /** + * Returns a menu element path. + * + * @return a menu element path + */ public MenuElement[] getPath() { MenuSelectionManager m = MenuSelectionManager.defaultManager(); MenuElement oldPath[] = m.getSelectedPath(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java index 8c4dbb1126c..caebdfe1688 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,7 +53,13 @@ public class BasicProgressBarUI extends ProgressBarUI { private Animator animator; + /** + * The instance of {@code JProgressBar}. + */ protected JProgressBar progressBar; + /** + * The instance of {@code ChangeListener}. + */ protected ChangeListener changeListener; private Handler handler; @@ -127,7 +133,12 @@ public class BasicProgressBarUI extends ProgressBarUI { private int maxPosition = 0; //maximum X (horiz) or Y box location - + /** + * Returns a new instance of {@code BasicProgressBarUI}. + * + * @param x a component + * @return a new instance of {@code BasicProgressBarUI} + */ public static ComponentUI createUI(JComponent x) { return new BasicProgressBarUI(); } @@ -150,6 +161,9 @@ public class BasicProgressBarUI extends ProgressBarUI { progressBar = null; } + /** + * Installs default properties. + */ protected void installDefaults() { LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE); LookAndFeel.installBorder(progressBar,"ProgressBar.border"); @@ -164,10 +178,16 @@ public class BasicProgressBarUI extends ProgressBarUI { selectionBackground = UIManager.getColor("ProgressBar.selectionBackground"); } + /** + * Unintalls default properties. + */ protected void uninstallDefaults() { LookAndFeel.uninstallBorder(progressBar); } + /** + * Registers listeners. + */ protected void installListeners() { //Listen for changes in the progress bar's data. changeListener = getHandler(); @@ -291,6 +311,11 @@ public class BasicProgressBarUI extends ProgressBarUI { // protected void installKeyboardActions() // protected void uninstallKeyboardActions() + /** + * Returns preferred size of the horizontal {@code JProgressBar}. + * + * @return preferred size of the horizontal {@code JProgressBar} + */ protected Dimension getPreferredInnerHorizontal() { Dimension horizDim = (Dimension)DefaultLookup.get(progressBar, this, "ProgressBar.horizontalSize"); @@ -300,6 +325,11 @@ public class BasicProgressBarUI extends ProgressBarUI { return horizDim; } + /** + * Returns preferred size of the vertical {@code JProgressBar}. + * + * @return preferred size of the vertical {@code JProgressBar} + */ protected Dimension getPreferredInnerVertical() { Dimension vertDim = (Dimension)DefaultLookup.get(progressBar, this, "ProgressBar.verticalSize"); @@ -312,6 +342,8 @@ public class BasicProgressBarUI extends ProgressBarUI { /** * The "selectionForeground" is the color of the text when it is painted * over a filled area of the progress bar. + * + * @return the color of the selected foreground */ protected Color getSelectionForeground() { return selectionForeground; @@ -320,6 +352,8 @@ public class BasicProgressBarUI extends ProgressBarUI { /** * The "selectionBackground" is the color of the text when it is painted * over an unfilled area of the progress bar. + * + * @return the color of the selected background */ protected Color getSelectionBackground() { return selectionBackground; @@ -352,6 +386,11 @@ public class BasicProgressBarUI extends ProgressBarUI { } } + /** + * Sets the cell length. + * + * @param cellLen a new cell length + */ protected void setCellLength(int cellLen) { this.cellLength = cellLen; } @@ -374,6 +413,11 @@ public class BasicProgressBarUI extends ProgressBarUI { } } + /** + * Sets the cell spacing. + * + * @param cellSpace a new cell spacing + */ protected void setCellSpacing(int cellSpace) { this.cellSpacing = cellSpace; } @@ -384,6 +428,11 @@ public class BasicProgressBarUI extends ProgressBarUI { * operation so it was abstracted out. It assumes that your progress bar * is linear. That is, if you are making a circular progress indicator, * you will want to override this method. + * + * @param b insets + * @param width a width + * @param height a height + * @return the amount of the progress bar that should be filled */ protected int getAmountFull(Insets b, int width, int height) { int amountFull = 0; @@ -577,6 +626,8 @@ public class BasicProgressBarUI extends ProgressBarUI { * Override this if you are making another kind of * progress bar. * + * @param g an instance of {@code Graphics} + * @param c a component * @see #paintDeterminate * * @since 1.4 @@ -628,6 +679,8 @@ public class BasicProgressBarUI extends ProgressBarUI { * Naturally, override this if you are making a circular or * semi-circular progress bar. * + * @param g an instance of {@code Graphics} + * @param c a component * @see #paintIndeterminate * * @since 1.4 @@ -703,7 +756,18 @@ public class BasicProgressBarUI extends ProgressBarUI { } } - + /** + * Paints the progress string. + * + * @param g an instance of {@code Graphics} + * @param x X location of bounding box + * @param y Y location of bounding box + * @param width width of bounding box + * @param height height of bounding box + * @param amountFull size of the fill region, either width or height + * depending upon orientation. + * @param b Insets of the progress bar. + */ protected void paintString(Graphics g, int x, int y, int width, int height, int amountFull, Insets b) { @@ -793,6 +857,14 @@ public class BasicProgressBarUI extends ProgressBarUI { * bar (in both x and y). Override this if you want to right, * left, top, or bottom align the progress string or if you need * to nudge it around for any reason. + * + * @param g an instance of {@code Graphics} + * @param progressString a text + * @param x an X coordinate + * @param y an Y coordinate + * @param width a width + * @param height a height + * @return the place where the progress string will be painted */ protected Point getStringPlacement(Graphics g, String progressString, int x,int y,int width,int height) { @@ -894,6 +966,7 @@ public class BasicProgressBarUI extends ProgressBarUI { /** * Gets the index of the current animation frame. * + * @return the index of the current animation frame * @since 1.4 */ protected int getAnimationIndex() { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index 405795b985d..133325ff9b7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -286,7 +286,10 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Creates a new BasicSplitPaneUI instance + * Creates a new instance of {@code BasicSplitPaneUI}. + * + * @param x a component + * @return a new instance of {@code BasicSplitPaneUI} */ public static ComponentUI createUI(JComponent x) { return new BasicSplitPaneUI(); @@ -503,7 +506,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Creates a PropertyChangeListener for the JSplitPane UI. + * Creates a {@code PropertyChangeListener} for the {@code JSplitPane} UI. + * + * @return an instance of {@code PropertyChangeListener} */ protected PropertyChangeListener createPropertyChangeListener() { return getHandler(); @@ -518,7 +523,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Creates a FocusListener for the JSplitPane UI. + * Creates a {@code FocusListener} for the {@code JSplitPane} UI. + * + * @return an instance of {@code FocusListener} */ protected FocusListener createFocusListener() { return getHandler(); @@ -526,16 +533,17 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * As of Java 2 platform v1.3 this method is no - * longer used. Subclassers previously using this method should - * instead create an Action wrapping the ActionListener, and register - * that Action by overriding installKeyboardActions and - * placing the Action in the SplitPane's ActionMap. Please refer to - * the key bindings specification for further details. + * As of Java 2 platform v1.3 this method is no longer used. + * Subclassers previously using this method should instead create + * an {@code Action} wrapping the {@code ActionListener}, and register + * that {@code Action} by overriding {@code installKeyboardActions} + * and placing the {@code Action} in the {@code SplitPane's ActionMap}. + * Please refer to the key bindings specification for further details. *

    - * Creates a ActionListener for the JSplitPane UI that listens for - * specific key presses. + * Creates an {@code ActionListener} for the {@code JSplitPane} UI that + * listens for specific key presses. * + * @return an instance of {@code ActionListener} * @deprecated As of Java 2 platform v1.3. */ @Deprecated @@ -545,16 +553,17 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * As of Java 2 platform v1.3 this method is no - * longer used. Subclassers previously using this method should - * instead create an Action wrapping the ActionListener, and register - * that Action by overriding installKeyboardActions and - * placing the Action in the SplitPane's ActionMap. Please refer to - * the key bindings specification for further details. + * As of Java 2 platform v1.3 this method is no longer used. + * Subclassers previously using this method should instead create + * an {@code Action} wrapping the {@code ActionListener}, and register + * that {@code Action} by overriding {@code installKeyboardActions} + * and placing the {@code Action} in the {@code SplitPane's ActionMap}. + * Please refer to the key bindings specification for further details. *

    - * Creates a ActionListener for the JSplitPane UI that listens for - * specific key presses. + * Creates an {@code ActionListener} for the {@code JSplitPane} UI that + * listens for specific key presses. * + * @return an instance of {@code ActionListener} * @deprecated As of Java 2 platform v1.3. */ @Deprecated @@ -564,16 +573,17 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * As of Java 2 platform v1.3 this method is no - * longer used. Subclassers previously using this method should - * instead create an Action wrapping the ActionListener, and register - * that Action by overriding installKeyboardActions and - * placing the Action in the SplitPane's ActionMap. Please refer to - * the key bindings specification for further details. + * As of Java 2 platform v1.3 this method is no longer used. + * Subclassers previously using this method should instead create + * an {@code Action} wrapping the {@code ActionListener}, and register + * that {@code Action} by overriding {@code installKeyboardActions} + * and placing the {@code Action} in the {@code SplitPane's ActionMap}. + * Please refer to the key bindings specification for further details. *

    - * Creates a ActionListener for the JSplitPane UI that listens for - * specific key presses. + * Creates an {@code ActionListener} for the {@code JSplitPane} UI that + * listens for specific key presses. * + * @return an instance of {@code ActionListener} * @deprecated As of Java 2 platform v1.3. */ @Deprecated @@ -583,16 +593,17 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * As of Java 2 platform v1.3 this method is no - * longer used. Subclassers previously using this method should - * instead create an Action wrapping the ActionListener, and register - * that Action by overriding installKeyboardActions and - * placing the Action in the SplitPane's ActionMap. Please refer to - * the key bindings specification for further details. + * As of Java 2 platform v1.3 this method is no longer used. + * Subclassers previously using this method should instead create + * an {@code Action} wrapping the {@code ActionListener}, and register + * that {@code Action} by overriding {@code installKeyboardActions} + * and placing the {@code Action} in the {@code SplitPane's ActionMap}. + * Please refer to the key bindings specification for further details. *

    - * Creates a ActionListener for the JSplitPane UI that listens for - * specific key presses. + * Creates an {@code ActionListener} for the {@code JSplitPane} UI that + * listens for specific key presses. * + * @return an instance of {@code ActionListener} * @deprecated As of Java 2 platform v1.3. */ @Deprecated @@ -602,16 +613,17 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * As of Java 2 platform v1.3 this method is no - * longer used. Subclassers previously using this method should - * instead create an Action wrapping the ActionListener, and register - * that Action by overriding installKeyboardActions and - * placing the Action in the SplitPane's ActionMap. Please refer to - * the key bindings specification for further details. + * As of Java 2 platform v1.3 this method is no longer used. + * Subclassers previously using this method should instead create + * an {@code Action} wrapping the {@code ActionListener}, and register + * that {@code Action} by overriding {@code installKeyboardActions} + * and placing the {@code Action} in the {@code SplitPane's ActionMap}. + * Please refer to the key bindings specification for further details. *

    - * Creates a ActionListener for the JSplitPane UI that listens for - * specific key presses. + * Creates an {@code ActionListener} for the {@code JSplitPane} UI that + * listens for specific key presses. * + * @return an instance of {@code ActionListener} * @deprecated As of Java 2 platform v1.3. */ @Deprecated @@ -621,7 +633,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Returns the orientation for the JSplitPane. + * Returns the orientation for the {@code JSplitPane}. + * + * @return the orientation */ public int getOrientation() { return orientation; @@ -629,7 +643,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Set the orientation for the JSplitPane. + * Set the orientation for the {@code JSplitPane}. + * + * @param orientation the orientation */ public void setOrientation(int orientation) { this.orientation = orientation; @@ -637,7 +653,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Determines whether the JSplitPane is set to use a continuous layout. + * Determines whether the {@code JSplitPane} is set to use a continuous layout. + * + * @return {@code true} if a continuous layout is set */ public boolean isContinuousLayout() { return continuousLayout; @@ -646,6 +664,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Turn continuous layout on/off. + * + * @param b if {@code true} the continuous layout turns on */ public void setContinuousLayout(boolean b) { continuousLayout = b; @@ -653,7 +673,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Returns the last drag location of the JSplitPane. + * Returns the last drag location of the {@code JSplitPane}. + * + * @return the last drag location */ public int getLastDragLocation() { return lastDragLocation; @@ -661,7 +683,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Set the last drag location of the JSplitPane. + * Set the last drag location of the {@code JSplitPane}. + * + * @param l the drag location */ public void setLastDragLocation(int l) { lastDragLocation = l; @@ -819,6 +843,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the divider between the top Components. + * + * @return the divider between the top Components */ public BasicSplitPaneDivider getDivider() { return divider; @@ -828,6 +854,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the default non continuous layout divider, which is an * instance of {@code Canvas} that fills in the background with dark gray. + * + * @return the default non continuous layout divider */ @SuppressWarnings("serial") // anonymous class protected Component createDefaultNonContinuousLayoutDivider() { @@ -849,10 +877,12 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Sets the divider to use when the splitPane is configured to + * Sets the divider to use when the {@code JSplitPane} is configured to * not continuously layout. This divider will only be used during a * dragging session. It is recommended that the passed in component * be a heavy weight. + * + * @param newDivider the new divider */ protected void setNonContinuousLayoutDivider(Component newDivider) { setNonContinuousLayoutDivider(newDivider, true); @@ -861,6 +891,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Sets the divider to use. + * + * @param newDivider the new divider + * @param rememberSizes if {@code true} the pane size is remembered */ protected void setNonContinuousLayoutDivider(Component newDivider, boolean rememberSizes) { @@ -903,9 +936,11 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Returns the divider to use when the splitPane is configured to + * Returns the divider to use when the {@code JSplitPane} is configured to * not continuously layout. This divider will only be used during a * dragging session. + * + * @return the divider */ public Component getNonContinuousLayoutDivider() { return nonContinuousLayoutDivider; @@ -913,8 +948,10 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Returns the splitpane this instance is currently contained + * Returns the {@code JSplitPane} this instance is currently contained * in. + * + * @return the instance of {@code JSplitPane} */ public JSplitPane getSplitPane() { return splitPane; @@ -923,6 +960,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Creates the default divider. + * + * @return the default divider */ public BasicSplitPaneDivider createDefaultDivider() { return new BasicSplitPaneDivider(this); @@ -1108,6 +1147,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the insets. The insets are returned from the border insets * of the current border. + * + * @param jc a component + * @return the insets */ public Insets getInsets(JComponent jc) { return null; @@ -1187,8 +1229,10 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Messaged during a dragging session to move the divider to the - * passed in location. If continuousLayout is true the location is - * reset and the splitPane validated. + * passed in {@code location}. If {@code continuousLayout} is {@code true} + * the location is reset and the splitPane validated. + * + * @param location the location of divider */ protected void dragDividerTo(int location) { if(getLastDragLocation() != location) { @@ -1230,7 +1274,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Messaged to finish the dragging session. If not continuous display - * the dividers location will be reset. + * the dividers {@code location} will be reset. + * + * @param location the location of divider */ protected void finishDraggingTo(int location) { dragDividerTo(location); @@ -1259,6 +1305,7 @@ public class BasicSplitPaneUI extends SplitPaneUI *

    * Returns the width of one side of the divider border. * + * @return the width of one side of the divider border * @deprecated As of Java 2 platform v1.3, instead set the border on the * divider. */ @@ -1275,7 +1322,13 @@ public class BasicSplitPaneUI extends SplitPaneUI public class BasicHorizontalLayoutManager implements LayoutManager2 { /* left, right, divider. (in this exact order) */ + /** + * The size of components. + */ protected int[] sizes; + /** + * The components. + */ protected Component[] components; /** Size of the splitpane the last time laid out. */ private int lastSplitPaneSize; @@ -1596,6 +1649,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Resets the size of the Component at the passed in location. + * + * @param index the index of a component */ protected void resetSizeAt(int index) { sizes[index] = 0; @@ -1604,7 +1659,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Sets the sizes to newSizes. + * Sets the sizes to {@code newSizes}. + * + * @param newSizes the new sizes */ protected void setSizes(int[] newSizes) { System.arraycopy(newSizes, 0, sizes, 0, 3); @@ -1613,6 +1670,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the sizes of the components. + * + * @return the sizes of the components */ protected int[] getSizes() { int[] retSizes = new int[3]; @@ -1624,6 +1683,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the width of the passed in Components preferred size. + * + * @param c a component + * @return the preferred width of the component */ protected int getPreferredSizeOfComponent(Component c) { return getSizeForPrimaryAxis(c.getPreferredSize()); @@ -1632,6 +1694,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the width of the passed in Components minimum size. + * + * @param c a component + * @return the minimum width of the component */ int getMinimumSizeOfComponent(Component c) { return getSizeForPrimaryAxis(c.getMinimumSize()); @@ -1640,6 +1705,9 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the width of the passed in component. + * + * @param c a component + * @return the width of the component */ protected int getSizeOfComponent(Component c) { return getSizeForPrimaryAxis(c.getSize()); @@ -1648,7 +1716,11 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the available width based on the container size and - * Insets. + * {@code Insets}. + * + * @param containerSize a container size + * @param insets an insets + * @return the available width */ protected int getAvailableSize(Dimension containerSize, Insets insets) { @@ -1661,8 +1733,11 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Returns the left inset, unless the Insets are null in which case + * Returns the left inset, unless the {@code Insets} are null in which case * 0 is returned. + * + * @param insets the insets + * @return the left inset */ protected int getInitialLocation(Insets insets) { if(insets != null) @@ -1672,9 +1747,15 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Sets the width of the component c to be size, placing its - * x location at location, y to the insets.top and height - * to the containersize.height less the top and bottom insets. + * Sets the width of the component {@code c} to be {@code size}, placing its + * x location at {@code location}, y to the {@code insets.top} and height + * to the {@code containerSize.height} less the top and bottom insets. + * + * @param c a component + * @param size a new width + * @param location a new X coordinate + * @param insets an insets + * @param containerSize a container size */ protected void setComponentToSize(Component c, int size, int location, Insets insets, @@ -2021,6 +2102,9 @@ public class BasicSplitPaneUI extends SplitPaneUI public class BasicVerticalLayoutManager extends BasicHorizontalLayoutManager { + /** + * Constructs a new instance of {@code BasicVerticalLayoutManager}. + */ public BasicVerticalLayoutManager() { super(1); } From cb14edb87e27fd501b7e32bb752d0be055a1921f Mon Sep 17 00:00:00 2001 From: Mikhail Cherkasov Date: Thu, 10 Jul 2014 18:46:40 +0400 Subject: [PATCH 012/111] 4991647: PNGMetadata.getAsTree() sets bitDepth to invalid value Reviewed-by: prr, bae --- .../sun/imageio/plugins/png/PNGMetadata.java | 7 +- .../imageio/plugins/png/PngDitDepthTest.java | 74 +++++++++++++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java index 11018ec4015..110bd9e2def 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java @@ -1254,8 +1254,11 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { if (name.equals("IHDR")) { IHDR_width = getIntAttribute(node, "width"); IHDR_height = getIntAttribute(node, "height"); - IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth", - IHDR_bitDepths); + IHDR_bitDepth = + Integer.valueOf(IHDR_bitDepths[ + getEnumeratedAttribute(node, + "bitDepth", + IHDR_bitDepths)]); IHDR_colorType = getEnumeratedAttribute(node, "colorType", IHDR_colorTypeNames); IHDR_compressionMethod = diff --git a/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java b/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java new file mode 100644 index 00000000000..7317f87c503 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/png/PngDitDepthTest.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* +* @test +* @bug 4991647 +* @summary PNGMetadata.getAsTree() sets bitDepth to invalid value +* @run main PngDitDepthTest +*/ + +import org.w3c.dom.Node; + +import javax.imageio.ImageIO; +import javax.imageio.ImageTypeSpecifier; +import javax.imageio.ImageWriter; +import javax.imageio.metadata.IIOInvalidTreeException; +import javax.imageio.metadata.IIOMetadata; +import java.awt.image.ColorModel; +import java.awt.image.SampleModel; +import java.util.Iterator; + +public class PngDitDepthTest { + + public static void main(String[] args) throws IIOInvalidTreeException { + + // getting the writer for the png format + Iterator iter = ImageIO.getImageWritersByFormatName("png"); + ImageWriter writer = (ImageWriter) iter.next(); + + // creating a color model + ColorModel colorModel = ColorModel.getRGBdefault(); + + // creating a sample model + SampleModel sampleModel = colorModel.createCompatibleSampleModel(640, 480); + + // creating a default metadata object + IIOMetadata metaData = writer.getDefaultImageMetadata(new ImageTypeSpecifier(colorModel, sampleModel), null); + String formatName = metaData.getNativeMetadataFormatName(); + + // first call + Node metaDataNode = metaData.getAsTree(formatName); + try { + metaData.setFromTree(formatName, metaDataNode); + } catch (Exception ex) { + ex.printStackTrace(); + } + + // second call (bitdepht is already set to an invalid value) + metaDataNode = metaData.getAsTree(formatName); + + metaData.setFromTree(formatName, metaDataNode); + + } +} From be41c05edc0bfafc89fb36956cc5fa434e44fc14 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 10 Jul 2014 15:27:02 -0700 Subject: [PATCH 013/111] 8049797: Fix raw and unchecked lint warnings in javax.swing.SortingFocusTraversalPolicy Reviewed-by: prr --- .../classes/javax/swing/SortingFocusTraversalPolicy.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java index 797f6f35524..7199531c61b 100644 --- a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java +++ b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java @@ -109,11 +109,12 @@ public class SortingFocusTraversalPolicy AccessController.doPrivileged(new PrivilegedAction() { public Method run() { try { - Class c = Class.forName("java.util.Arrays"); - Method m = c.getDeclaredMethod("legacyMergeSort", new Class[]{Object[].class, Comparator.class}); + Method m = java.util.Arrays.class.getDeclaredMethod("legacyMergeSort", + new Class[]{Object[].class, + Comparator.class}); m.setAccessible(true); return m; - } catch (ClassNotFoundException | NoSuchMethodException e) { + } catch (NoSuchMethodException e) { // using default sorting algo return null; } From f5a99dfd8f8355c507d0c95dc3d0b35ef9b08236 Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Mon, 23 Jun 2014 10:54:10 -0700 Subject: [PATCH 014/111] 8042872: Fix raw and unchecked warnings in sun.applet Reviewed-by: darcy, herrick --- .../classes/sun/applet/AppletClassLoader.java | 39 +++++----- .../classes/sun/applet/AppletImageRef.java | 6 +- .../sun/applet/AppletObjectInputStream.java | 6 +- .../share/classes/sun/applet/AppletPanel.java | 50 ++++++------ .../share/classes/sun/applet/AppletProps.java | 8 +- .../classes/sun/applet/AppletSecurity.java | 63 +++++++-------- .../classes/sun/applet/AppletViewer.java | 76 ++++++++++--------- .../sun/applet/AppletViewerFactory.java | 3 +- .../classes/sun/applet/AppletViewerPanel.java | 6 +- jdk/src/share/classes/sun/applet/Main.java | 10 +-- 10 files changed, 138 insertions(+), 129 deletions(-) diff --git a/jdk/src/share/classes/sun/applet/AppletClassLoader.java b/jdk/src/share/classes/sun/applet/AppletClassLoader.java index fe3459771b2..83684cb36f2 100644 --- a/jdk/src/share/classes/sun/applet/AppletClassLoader.java +++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java @@ -137,7 +137,7 @@ public class AppletClassLoader extends URLClassLoader { * Override loadClass so that class loading errors can be caught in * order to print better error messages. */ - public synchronized Class loadClass(String name, boolean resolve) + public synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { // First check if we have permission to access the package. This @@ -166,7 +166,7 @@ public class AppletClassLoader extends URLClassLoader { * Finds the applet class with the specified name. First searches * loaded JAR files then the applet code base for the class. */ - protected Class findClass(String name) throws ClassNotFoundException { + protected Class findClass(String name) throws ClassNotFoundException { int index = name.indexOf(';'); String cookie = ""; @@ -192,9 +192,9 @@ public class AppletClassLoader extends URLClassLoader { String encodedName = ParseUtil.encodePath(name.replace('.', '/'), false); final String path = (new StringBuffer(encodedName)).append(".class").append(cookie).toString(); try { - byte[] b = (byte[]) AccessController.doPrivileged( - new PrivilegedExceptionAction() { - public Object run() throws IOException { + byte[] b = AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public byte[] run() throws IOException { try { URL finalURL = new URL(base, path); @@ -556,9 +556,10 @@ public class AppletClassLoader extends URLClassLoader { * name. First checks loaded JAR files then the applet code base for all * available resources. */ - public Enumeration findResources(String name) throws IOException { + @Override + public Enumeration findResources(String name) throws IOException { - final Enumeration e = super.findResources(name); + final Enumeration e = super.findResources(name); // 6215746: Disable META-INF/* lookup from codebase in // applet/plugin classloader. [stanley.ho] @@ -576,9 +577,9 @@ public class AppletClassLoader extends URLClassLoader { } final URL url = u; - return new Enumeration() { + return new Enumeration() { private boolean done; - public Object nextElement() { + public URL nextElement() { if (!done) { if (e.hasMoreElements()) { return e.nextElement(); @@ -601,7 +602,7 @@ public class AppletClassLoader extends URLClassLoader { * attribute. The argument can either be the relative path * of the class file itself or just the name of the class. */ - Class loadCode(String name) throws ClassNotFoundException { + Class loadCode(String name) throws ClassNotFoundException { // first convert any '/' or native file separator to . name = name.replace('/', '.'); name = name.replace(File.separatorChar, '.'); @@ -646,7 +647,7 @@ public class AppletClassLoader extends URLClassLoader { public ThreadGroup getThreadGroup() { synchronized (threadGroupSynchronizer) { if (threadGroup == null || threadGroup.isDestroyed()) { - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction() { public Object run() { threadGroup = new AppletThreadGroup(base + "-threadGroup"); // threadGroup.setDaemon(true); @@ -770,8 +771,8 @@ public void grab() { // Hash map to store applet compatibility info - private HashMap jdk11AppletInfo = new HashMap(); - private HashMap jdk12AppletInfo = new HashMap(); + private HashMap jdk11AppletInfo = new HashMap<>(); + private HashMap jdk12AppletInfo = new HashMap<>(); /** * Set applet target level as JDK 1.1. @@ -780,7 +781,7 @@ public void grab() { * @param bool true if JDK is targeted for JDK 1.1; * false otherwise. */ - void setJDK11Target(Class clazz, boolean bool) + void setJDK11Target(Class clazz, boolean bool) { jdk11AppletInfo.put(clazz.toString(), Boolean.valueOf(bool)); } @@ -792,7 +793,7 @@ public void grab() { * @param bool true if JDK is targeted for JDK 1.2; * false otherwise. */ - void setJDK12Target(Class clazz, boolean bool) + void setJDK12Target(Class clazz, boolean bool) { jdk12AppletInfo.put(clazz.toString(), Boolean.valueOf(bool)); } @@ -805,9 +806,9 @@ public void grab() { * FALSE if applet is not; * null if applet is unknown. */ - Boolean isJDK11Target(Class clazz) + Boolean isJDK11Target(Class clazz) { - return (Boolean) jdk11AppletInfo.get(clazz.toString()); + return jdk11AppletInfo.get(clazz.toString()); } /** @@ -818,9 +819,9 @@ public void grab() { * FALSE if applet is not; * null if applet is unknown. */ - Boolean isJDK12Target(Class clazz) + Boolean isJDK12Target(Class clazz) { - return (Boolean) jdk12AppletInfo.get(clazz.toString()); + return jdk12AppletInfo.get(clazz.toString()); } private static AppletMessageHandler mh = diff --git a/jdk/src/share/classes/sun/applet/AppletImageRef.java b/jdk/src/share/classes/sun/applet/AppletImageRef.java index f264e890351..e3eb5a26fb1 100644 --- a/jdk/src/share/classes/sun/applet/AppletImageRef.java +++ b/jdk/src/share/classes/sun/applet/AppletImageRef.java @@ -65,7 +65,7 @@ class AppletImageRef { * invoke reconstitute(). */ public synchronized void flush() { - SoftReference s = soft; + SoftReference s = soft; if (s != null) s.clear(); soft = null; } @@ -74,9 +74,9 @@ class AppletImageRef { * Sets the thing to the specified object. * @param thing the specified object */ - public synchronized void setThing(Object thing) { + public synchronized void setThing(Image thing) { flush(); - soft = new SoftReference(thing); + soft = new SoftReference<>(thing); } /** diff --git a/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java b/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java index 36bd8156e5b..0906136bfec 100644 --- a/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java +++ b/jdk/src/share/classes/sun/applet/AppletObjectInputStream.java @@ -59,7 +59,7 @@ class AppletObjectInputStream extends ObjectInputStream * Make a primitive array class */ - private Class primitiveType(char type) { + private Class primitiveType(char type) { switch (type) { case 'B': return byte.class; case 'C': return char.class; @@ -76,13 +76,13 @@ class AppletObjectInputStream extends ObjectInputStream /** * Use the given ClassLoader rather than using the system class */ - protected Class resolveClass(ObjectStreamClass classDesc) + protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException { String cname = classDesc.getName(); if (cname.startsWith("[")) { // An array - Class component; // component class + Class component; // component class int dcount; // dimension for (dcount=1; cname.charAt(dcount)=='['; dcount++) ; if (cname.charAt(dcount) == 'L') { diff --git a/jdk/src/share/classes/sun/applet/AppletPanel.java b/jdk/src/share/classes/sun/applet/AppletPanel.java index 15ba72b288c..89514ddbcd3 100644 --- a/jdk/src/share/classes/sun/applet/AppletPanel.java +++ b/jdk/src/share/classes/sun/applet/AppletPanel.java @@ -179,7 +179,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { handler = new Thread(appletGroup, this, "thread " + nm); // set the context class loader for this thread - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { handler.setContextClassLoader(loader); @@ -253,7 +253,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { /** * AppletEvent Queue */ - private Queue queue = null; + private Queue queue = null; synchronized public void addAppletListener(AppletListener l) { @@ -282,7 +282,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { synchronized(this) { if (queue == null) { //System.out.println("SEND0= " + id); - queue = new Queue(); + queue = new Queue<>(); } Integer eventId = Integer.valueOf(id); queue.enqueue(eventId); @@ -309,7 +309,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { while (queue == null || queue.isEmpty()) { wait(); } - Integer eventId = (Integer)queue.dequeue(); + Integer eventId = queue.dequeue(); return new AppletEvent(this, eventId.intValue(), null); } @@ -631,14 +631,15 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { * calls KeyboardFocusManager directly. */ private Component getMostRecentFocusOwnerForWindow(Window w) { - Method meth = (Method)AccessController.doPrivileged(new PrivilegedAction() { + Method meth = AccessController.doPrivileged( + new PrivilegedAction() { @Override - public Object run() { + public Method run() { Method meth = null; try { meth = KeyboardFocusManager.class.getDeclaredMethod( "getMostRecentFocusOwner", - new Class[]{Window.class}); + new Class[]{Window.class}); meth.setAccessible(true); } catch (Exception e) { // Must never happen @@ -988,7 +989,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { /** * The class loaders */ - private static HashMap classloaders = new HashMap(); + private static HashMap classloaders = new HashMap<>(); /** * Flush a class loader. @@ -1001,7 +1002,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { * Flush all class loaders. */ public static synchronized void flushClassLoaders() { - classloaders = new HashMap(); + classloaders = new HashMap<>(); } /** @@ -1018,14 +1019,14 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { * Get a class loader. Create in a restricted context */ synchronized AppletClassLoader getClassLoader(final URL codebase, final String key) { - AppletClassLoader c = (AppletClassLoader)classloaders.get(key); + AppletClassLoader c = classloaders.get(key); if (c == null) { AccessControlContext acc = getAccessControlContext(codebase); - c = (AppletClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { + c = AccessController.doPrivileged( + new PrivilegedAction() { @Override - public Object run() { + public AppletClassLoader run() { AppletClassLoader ac = createClassLoader(codebase); /* Should the creation of the classloader be * within the class synchronized block? Since @@ -1043,8 +1044,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { * (which timeout when called from the browser). */ synchronized (getClass()) { - AppletClassLoader res = - (AppletClassLoader)classloaders.get(key); + AppletClassLoader res = classloaders.get(key); if (res == null) { classloaders.put(key, ac); return ac; @@ -1066,10 +1066,10 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { */ private AccessControlContext getAccessControlContext(final URL codebase) { - PermissionCollection perms = (PermissionCollection) - AccessController.doPrivileged(new PrivilegedAction() { + PermissionCollection perms = AccessController.doPrivileged( + new PrivilegedAction() { @Override - public Object run() { + public PermissionCollection run() { Policy p = java.security.Policy.getPolicy(); if (p != null) { return p.getPermissions(new CodeSource(null, @@ -1172,13 +1172,15 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { // critical section of the window list in AppContext. synchronized (Window.class) { - WeakReference weakRef = null; + WeakReference weakRef = null; // Remove frame from the Window list in wrong AppContext { // Lookup current frame's AppContext - Vector> windowList = (Vector>)oldAppContext.get(Window.class); + @SuppressWarnings("unchecked") + Vector> windowList = + (Vector>)oldAppContext.get(Window.class); if (windowList != null) { - for (WeakReference ref : windowList) { + for (WeakReference ref : windowList) { if (ref.get() == frame) { weakRef = ref; break; @@ -1195,7 +1197,9 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { // Insert frame into the Window list in the applet's AppContext map { - Vector> windowList = (Vector)newAppContext.get(Window.class); + @SuppressWarnings("unchecked") + Vector> windowList = + (Vector>)newAppContext.get(Window.class); if (windowList == null) { windowList = new Vector>(); newAppContext.put(Window.class, windowList); @@ -1224,7 +1228,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { // synchronized on applet class object, so calling from // different instances of the same applet will be // serialized. - Class appletClass = applet.getClass(); + Class appletClass = applet.getClass(); synchronized(appletClass) { // Determine if the JDK level of an applet has been diff --git a/jdk/src/share/classes/sun/applet/AppletProps.java b/jdk/src/share/classes/sun/applet/AppletProps.java index 466aa83735b..161bc79a8c3 100644 --- a/jdk/src/share/classes/sun/applet/AppletProps.java +++ b/jdk/src/share/classes/sun/applet/AppletProps.java @@ -105,9 +105,9 @@ class AppletProps extends Frame { String proxyPortValue = proxyPort.getText().trim(); // Get properties - final Properties props = (Properties) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + final Properties props = AccessController.doPrivileged( + new PrivilegedAction() { + public Properties run() { return System.getProperties(); } }); @@ -148,7 +148,7 @@ class AppletProps extends Frame { // Save properties try { reset(); - AccessController.doPrivileged(new PrivilegedExceptionAction() { + AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws IOException { File dotAV = Main.theUserPropertiesFile; FileOutputStream out = new FileOutputStream(dotAV); diff --git a/jdk/src/share/classes/sun/applet/AppletSecurity.java b/jdk/src/share/classes/sun/applet/AppletSecurity.java index 9fb20e9662e..2f11d43d19f 100644 --- a/jdk/src/share/classes/sun/applet/AppletSecurity.java +++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java @@ -80,7 +80,7 @@ class AppletSecurity extends AWTSecurityManager { } // Cache to store known restricted packages - private HashSet restrictedPackages = new HashSet(); + private HashSet restrictedPackages = new HashSet<>(); /** * Reset from Properties @@ -90,11 +90,11 @@ class AppletSecurity extends AWTSecurityManager { // Clear cache restrictedPackages.clear(); - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction() { public Object run() { // Enumerate system properties - Enumeration e = System.getProperties().propertyNames(); + Enumeration e = System.getProperties().propertyNames(); while (e.hasMoreElements()) { @@ -130,7 +130,7 @@ class AppletSecurity extends AWTSecurityManager { return (AppletClassLoader)loader; // if that fails, get all the classes on the stack and check them. - Class[] context = getClassContext(); + Class[] context = getClassContext(); for (int i = 0; i < context.length; i++) { loader = context[i].getClassLoader(); if (loader instanceof AppletClassLoader) @@ -148,37 +148,38 @@ class AppletSecurity extends AWTSecurityManager { final ClassLoader currentLoader = context[i].getClassLoader(); if (currentLoader instanceof URLClassLoader) { - loader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + loader = AccessController.doPrivileged( + new PrivilegedAction() { + public ClassLoader run() { - AccessControlContext acc = null; - ProtectionDomain[] pds = null; + AccessControlContext acc = null; + ProtectionDomain[] pds = null; - try { - acc = (AccessControlContext) facc.get(currentLoader); - if (acc == null) { - return null; + try { + acc = (AccessControlContext) facc.get(currentLoader); + if (acc == null) { + return null; + } + + pds = (ProtectionDomain[]) fcontext.get(acc); + if (pds == null) { + return null; + } + } catch (Exception e) { + throw new UnsupportedOperationException(e); } - pds = (ProtectionDomain[]) fcontext.get(acc); - if (pds == null) { - return null; + for (int i=0; i iter = restrictedPackages.iterator(); iter.hasNext();) { - String pkg = (String) iter.next(); + String pkg = iter.next(); // Prevent matching "sun" and "sunir" even if they // starts with similar beginning characters diff --git a/jdk/src/share/classes/sun/applet/AppletViewer.java b/jdk/src/share/classes/sun/applet/AppletViewer.java index 92c4fc17f77..b58579fd096 100644 --- a/jdk/src/share/classes/sun/applet/AppletViewer.java +++ b/jdk/src/share/classes/sun/applet/AppletViewer.java @@ -94,7 +94,7 @@ final class StdAppletViewerFactory implements AppletViewerFactory { @Override public AppletViewer createAppletViewer(int x, int y, - URL doc, Hashtable atts) { + URL doc, Hashtable atts) { return new AppletViewer(x, y, doc, atts, System.out, this); } @@ -156,7 +156,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { /** * Create the applet viewer. */ - public AppletViewer(int x, int y, URL doc, Hashtable atts, + public AppletViewer(int x, int y, URL doc, Hashtable atts, PrintStream statusMsgStream, AppletViewerFactory factory) { this.factory = factory; this.statusMsgStream = statusMsgStream; @@ -350,7 +350,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { * s. Whitespace not stripped. */ private String [] splitSeparator(String sep, String s) { - Vector v = new Vector(); + Vector v = new Vector<>(); int tokenStart = 0; int tokenEnd = 0; @@ -370,7 +370,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { * Methods for java.applet.AppletContext */ - private static Map audioClips = new HashMap(); + private static Map audioClips = new HashMap<>(); /** * Get an audio clip. @@ -379,7 +379,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { public AudioClip getAudioClip(URL url) { checkConnect(url); synchronized (audioClips) { - AudioClip clip = (AudioClip)audioClips.get(url); + AudioClip clip = audioClips.get(url); if (clip == null) { audioClips.put(url, clip = new AppletAudioClip(url)); } @@ -387,7 +387,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { } } - private static Map imageRefs = new HashMap(); + private static Map imageRefs = new HashMap<>(); /** * Get an image. @@ -403,7 +403,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { static Image getCachedImage(URL url) { // System.getSecurityManager().checkConnection(url.getHost(), url.getPort()); synchronized (imageRefs) { - AppletImageRef ref = (AppletImageRef)imageRefs.get(url); + AppletImageRef ref = imageRefs.get(url); if (ref == null) { ref = new AppletImageRef(url); imageRefs.put(url, ref); @@ -419,7 +419,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { imageRefs.clear(); } - static Vector appletPanels = new Vector(); + static Vector appletPanels = new Vector<>(); /** * Get an applet by name. @@ -430,8 +430,8 @@ public class AppletViewer extends Frame implements AppletContext, Printable { name = name.toLowerCase(); SocketPermission panelSp = new SocketPermission(panel.getCodeBase().getHost(), "connect"); - for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { - AppletPanel p = (AppletPanel)e.nextElement(); + for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { + AppletPanel p = e.nextElement(); String param = p.getParameter("name"); if (param != null) { param = param.toLowerCase(); @@ -455,14 +455,14 @@ public class AppletViewer extends Frame implements AppletContext, Printable { * applets on this page. */ @Override - public Enumeration getApplets() { + public Enumeration getApplets() { AppletSecurity security = (AppletSecurity)System.getSecurityManager(); - Vector v = new Vector(); + Vector v = new Vector<>(); SocketPermission panelSp = new SocketPermission(panel.getCodeBase().getHost(), "connect"); - for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { - AppletPanel p = (AppletPanel)e.nextElement(); + for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { + AppletPanel p = e.nextElement(); if (p.getDocumentBase().equals(panel.getDocumentBase())) { SocketPermission sp = @@ -509,7 +509,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { } @Override - public Iterator getStreamKeys(){ + public Iterator getStreamKeys(){ // We do nothing. return null; } @@ -517,7 +517,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { /** * System parameters. */ - static Hashtable systemParam = new Hashtable(); + static Hashtable systemParam = new Hashtable<>(); static { systemParam.put("codebase", "codebase"); @@ -533,32 +533,32 @@ public class AppletViewer extends Frame implements AppletContext, Printable { /** * Print the HTML tag. */ - public static void printTag(PrintStream out, Hashtable atts) { + public static void printTag(PrintStream out, Hashtable atts) { out.print(" e = atts.keys() ; e.hasMoreElements() ;) { + String param = e.nextElement(); int i = 0; for (; i < len ; i++) { if (params[i].compareTo(param) >= 0) { @@ -649,7 +649,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { * Save the applet to a well known file (for now) as a serialized object */ void appletSave() { - AccessController.doPrivileged(new PrivilegedAction() { + AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { @@ -702,8 +702,10 @@ public class AppletViewer extends Frame implements AppletContext, Printable { void appletClone() { Point p = location(); updateAtts(); + @SuppressWarnings("unchecked") + Hashtable tmp = (Hashtable) panel.atts.clone(); factory.createAppletViewer(p.x + XDELTA, p.y + YDELTA, - panel.documentURL, (Hashtable)panel.atts.clone()); + panel.documentURL, tmp); } /** @@ -884,8 +886,8 @@ public class AppletViewer extends Frame implements AppletContext, Printable { @Override public void run() { - for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { - AppletPanel p = (AppletPanel)e.nextElement(); + for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { + AppletPanel p = e.nextElement(); appletShutdown(p); } appletSystemExit(); @@ -1016,8 +1018,8 @@ public class AppletViewer extends Frame implements AppletContext, Printable { /** * Scan tag */ - public static Hashtable scanTag(Reader in) throws IOException { - Hashtable atts = new Hashtable(); + public static Hashtable scanTag(Reader in) throws IOException { + Hashtable atts = new Hashtable<>(); skipSpace(in); while (c >= 0 && c != '>') { String att = scanIdentifier(in); @@ -1122,7 +1124,7 @@ public class AppletViewer extends Frame implements AppletContext, Printable { url = conn.getURL(); int ydisp = 1; - Hashtable atts = null; + Hashtable atts = null; while(true) { c = in.read(); @@ -1172,12 +1174,12 @@ public class AppletViewer extends Frame implements AppletContext, Printable { else { String nm = scanIdentifier(in); if (nm.equalsIgnoreCase("param")) { - Hashtable t = scanTag(in); - String att = (String)t.get("name"); + Hashtable t = scanTag(in); + String att = t.get("name"); if (att == null) { statusMsgStream.println(requiresNameWarning); } else { - String val = (String)t.get("value"); + String val = t.get("value"); if (val == null) { statusMsgStream.println(requiresNameWarning); } else if (atts != null) { @@ -1235,13 +1237,13 @@ public class AppletViewer extends Frame implements AppletContext, Printable { } else if (nm.equalsIgnoreCase("app")) { statusMsgStream.println(appNotLongerSupportedWarning); - Hashtable atts2 = scanTag(in); - nm = (String)atts2.get("class"); + Hashtable atts2 = scanTag(in); + nm = atts2.get("class"); if (nm != null) { atts2.remove("class"); atts2.put("code", nm + ".class"); } - nm = (String)atts2.get("src"); + nm = atts2.get("src"); if (nm != null) { atts2.remove("src"); atts2.put("codebase", nm); diff --git a/jdk/src/share/classes/sun/applet/AppletViewerFactory.java b/jdk/src/share/classes/sun/applet/AppletViewerFactory.java index 6fcfaa2ee44..16b6db4679d 100644 --- a/jdk/src/share/classes/sun/applet/AppletViewerFactory.java +++ b/jdk/src/share/classes/sun/applet/AppletViewerFactory.java @@ -35,7 +35,8 @@ import java.awt.MenuBar; public interface AppletViewerFactory { - public AppletViewer createAppletViewer(int x, int y, URL doc, Hashtable atts); + public AppletViewer createAppletViewer(int x, int y, URL doc, + Hashtable atts); public MenuBar getBaseMenuBar(); public boolean isStandalone(); } diff --git a/jdk/src/share/classes/sun/applet/AppletViewerPanel.java b/jdk/src/share/classes/sun/applet/AppletViewerPanel.java index 93f064bb36d..1a8354c0035 100644 --- a/jdk/src/share/classes/sun/applet/AppletViewerPanel.java +++ b/jdk/src/share/classes/sun/applet/AppletViewerPanel.java @@ -59,7 +59,7 @@ class AppletViewerPanel extends AppletPanel { /** * The attributes of the applet. */ - Hashtable atts; + Hashtable atts; /* * JDK 1.1 serialVersionUID @@ -69,7 +69,7 @@ class AppletViewerPanel extends AppletPanel { /** * Construct an applet viewer and start the applet. */ - AppletViewerPanel(URL documentURL, Hashtable atts) { + AppletViewerPanel(URL documentURL, Hashtable atts) { this.documentURL = documentURL; this.atts = atts; @@ -105,7 +105,7 @@ class AppletViewerPanel extends AppletPanel { * Get an applet parameter. */ public String getParameter(String name) { - return (String)atts.get(name.toLowerCase()); + return atts.get(name.toLowerCase()); } /** diff --git a/jdk/src/share/classes/sun/applet/Main.java b/jdk/src/share/classes/sun/applet/Main.java index a95a36f2688..d29ed5ffd23 100644 --- a/jdk/src/share/classes/sun/applet/Main.java +++ b/jdk/src/share/classes/sun/applet/Main.java @@ -84,7 +84,7 @@ public class Main { /** * The list of valid URLs passed in to AppletViewer. */ - private static Vector urlList = new Vector(1); + private static Vector urlList = new Vector<>(1); // This is used in init(). Getting rid of this is desirable but depends // on whether the property that uses it is necessary/standard. @@ -153,7 +153,7 @@ public class Main { // XXX 5/17 this parsing method should be changed/fixed so that // it doesn't do both parsing of the html file and launching of // the AppletPanel - AppletViewer.parse((URL) urlList.elementAt(i), encoding); + AppletViewer.parse(urlList.elementAt(i), encoding); } catch (IOException e) { System.err.println(lookup("main.err.io", e.getMessage())); return 1; @@ -307,10 +307,10 @@ public class Main { // 2) Reflection removes any build dependency between appletviewer // and jdb. try { - Class c = Class.forName("com.sun.tools.example.debug.tty.TTY", true, + Class c = Class.forName("com.sun.tools.example.debug.tty.TTY", true, ClassLoader.getSystemClassLoader()); Method m = c.getDeclaredMethod("main", - new Class[] { String[].class }); + new Class[] { String[].class }); m.invoke(null, new Object[] { newArgs }); } catch (ClassNotFoundException cnfe) { System.err.println(lookup("main.debug.cantfinddebug")); @@ -367,7 +367,7 @@ public class Main { // Read in the System properties. If something is going to be // over-written, warn about it. Properties sysProps = System.getProperties(); - for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) { + for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) { String key = (String) e.nextElement(); String val = sysProps.getProperty(key); String oldVal; From 09fde7dc5d1f32648d9714500c00d16f0baf2d73 Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Wed, 2 Jul 2014 14:38:36 -0700 Subject: [PATCH 015/111] 8049109: Add @since 1.9 to new packages added in jaxp Reviewed-by: darcy, joehw --- jaxp/src/org/w3c/dom/ranges/DocumentRange.java | 2 +- jaxp/src/org/w3c/dom/ranges/Range.java | 2 +- jaxp/src/org/w3c/dom/ranges/RangeException.java | 2 +- jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java | 2 +- jaxp/src/org/w3c/dom/traversal/NodeFilter.java | 2 +- jaxp/src/org/w3c/dom/traversal/NodeIterator.java | 2 +- jaxp/src/org/w3c/dom/traversal/TreeWalker.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jaxp/src/org/w3c/dom/ranges/DocumentRange.java b/jaxp/src/org/w3c/dom/ranges/DocumentRange.java index 342f9e3ace8..ed51624fc11 100644 --- a/jaxp/src/org/w3c/dom/ranges/DocumentRange.java +++ b/jaxp/src/org/w3c/dom/ranges/DocumentRange.java @@ -43,7 +43,7 @@ package org.w3c.dom.ranges; /** *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface DocumentRange { /** diff --git a/jaxp/src/org/w3c/dom/ranges/Range.java b/jaxp/src/org/w3c/dom/ranges/Range.java index d42fad0c0fe..0efefe21945 100644 --- a/jaxp/src/org/w3c/dom/ranges/Range.java +++ b/jaxp/src/org/w3c/dom/ranges/Range.java @@ -47,7 +47,7 @@ import org.w3c.dom.DocumentFragment; /** *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface Range { /** diff --git a/jaxp/src/org/w3c/dom/ranges/RangeException.java b/jaxp/src/org/w3c/dom/ranges/RangeException.java index 198a135111c..69551a81c95 100644 --- a/jaxp/src/org/w3c/dom/ranges/RangeException.java +++ b/jaxp/src/org/w3c/dom/ranges/RangeException.java @@ -45,7 +45,7 @@ package org.w3c.dom.ranges; * Range operations may throw a RangeException as specified in * their method descriptions. *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public class RangeException extends RuntimeException { public RangeException(short code, String message) { diff --git a/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java b/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java index 80938886afe..bbb53740235 100644 --- a/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java +++ b/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java @@ -53,7 +53,7 @@ import org.w3c.dom.DOMException; * Traversal feature, DocumentTraversal will be implemented by * the same objects that implement the Document interface. *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface DocumentTraversal { /** diff --git a/jaxp/src/org/w3c/dom/traversal/NodeFilter.java b/jaxp/src/org/w3c/dom/traversal/NodeFilter.java index e6f22b2b917..5cc8177eeac 100644 --- a/jaxp/src/org/w3c/dom/traversal/NodeFilter.java +++ b/jaxp/src/org/w3c/dom/traversal/NodeFilter.java @@ -59,7 +59,7 @@ import org.w3c.dom.Node; * filter may be used with a number of different kinds of traversals, * encouraging code reuse. *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface NodeFilter { // Constants returned by acceptNode diff --git a/jaxp/src/org/w3c/dom/traversal/NodeIterator.java b/jaxp/src/org/w3c/dom/traversal/NodeIterator.java index 0f6aebf0821..70ef322254f 100644 --- a/jaxp/src/org/w3c/dom/traversal/NodeIterator.java +++ b/jaxp/src/org/w3c/dom/traversal/NodeIterator.java @@ -55,7 +55,7 @@ import org.w3c.dom.DOMException; * NodeIterators are created by calling * DocumentTraversal.createNodeIterator(). *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface NodeIterator { /** diff --git a/jaxp/src/org/w3c/dom/traversal/TreeWalker.java b/jaxp/src/org/w3c/dom/traversal/TreeWalker.java index f0876e5206d..262fd96d167 100644 --- a/jaxp/src/org/w3c/dom/traversal/TreeWalker.java +++ b/jaxp/src/org/w3c/dom/traversal/TreeWalker.java @@ -60,7 +60,7 @@ import org.w3c.dom.DOMException; * nodes will be siblings and appear as direct children of the root node, no * matter how deeply nested the structure of the original document. *

    See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface TreeWalker { /** From 25f33c005dddc7c2eff5a9e0b1fc14f4b2b338a4 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 4 Jul 2014 11:46:01 +0200 Subject: [PATCH 016/111] 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories Introduce and clean up umbrella headers for the files in the cpu subdirectories. Reviewed-by: lfoltan, coleenp, dholmes --- hotspot/src/cpu/ppc/vm/frame_ppc.cpp | 1 - hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp | 3 +- hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp | 5 +- hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp | 1 + hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp | 1 + hotspot/src/cpu/ppc/vm/ppc.ad | 4 +- hotspot/src/cpu/ppc/vm/register_ppc.hpp | 15 +++--- hotspot/src/cpu/ppc/vm/runtime_ppc.cpp | 6 +-- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 5 +- hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 8 +-- .../cpu/ppc/vm/templateInterpreter_ppc.cpp | 1 + .../src/cpu/ppc/vm/templateTable_ppc_64.cpp | 1 + hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp | 26 ++++++++-- hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp | 23 --------- .../src/cpu/sparc/vm/c1_Runtime1_sparc.cpp | 3 +- hotspot/src/cpu/sparc/vm/frame_sparc.cpp | 1 + .../src/cpu/sparc/vm/frame_sparc.inline.hpp | 3 +- .../src/cpu/sparc/vm/interpreterRT_sparc.cpp | 1 + .../src/cpu/sparc/vm/interpreter_sparc.cpp | 3 +- .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 2 +- .../src/cpu/sparc/vm/methodHandles_sparc.cpp | 3 +- hotspot/src/cpu/sparc/vm/register_sparc.hpp | 7 ++- .../sparc/vm/templateInterpreter_sparc.cpp | 3 +- .../src/cpu/sparc/vm/templateTable_sparc.cpp | 3 +- hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp | 33 ++++++++++-- .../src/cpu/sparc/vm/vmreg_sparc.inline.hpp | 30 ----------- hotspot/src/cpu/x86/vm/frame_x86.inline.hpp | 3 +- hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 3 +- hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 1 + hotspot/src/cpu/x86/vm/register_x86.hpp | 10 ++-- .../cpu/x86/vm/templateInterpreter_x86_32.cpp | 3 +- .../cpu/x86/vm/templateInterpreter_x86_64.cpp | 3 +- .../src/cpu/x86/vm/templateTable_x86_32.cpp | 3 +- .../src/cpu/x86/vm/templateTable_x86_64.cpp | 3 +- hotspot/src/cpu/x86/vm/vmreg_x86.hpp | 48 +++++++++++++++--- hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp | 44 ---------------- hotspot/src/cpu/x86/vm/x86.ad | 4 +- hotspot/src/os/aix/vm/os_aix.cpp | 1 + hotspot/src/os/solaris/vm/os_solaris.cpp | 1 + hotspot/src/os/windows/vm/os_windows.cpp | 1 + .../aix_ppc/vm/atomic_aix_ppc.inline.hpp | 5 +- .../aix_ppc/vm/orderAccess_aix_ppc.inline.hpp | 5 +- .../bsd_x86/vm/atomic_bsd_x86.inline.hpp | 3 +- .../bsd_x86/vm/orderAccess_bsd_x86.inline.hpp | 3 +- .../bsd_zero/vm/atomic_bsd_zero.inline.hpp | 3 +- .../vm/orderAccess_bsd_zero.inline.hpp | 3 +- .../linux_ppc/vm/atomic_linux_ppc.inline.hpp | 5 +- .../vm/orderAccess_linux_ppc.inline.hpp | 5 +- .../vm/atomic_linux_sparc.inline.hpp | 3 +- .../vm/orderAccess_linux_sparc.inline.hpp | 3 +- .../linux_x86/vm/atomic_linux_x86.inline.hpp | 3 +- .../vm/orderAccess_linux_x86.inline.hpp | 3 +- .../vm/atomic_linux_zero.inline.hpp | 3 +- .../vm/orderAccess_linux_zero.inline.hpp | 3 +- .../vm/atomic_solaris_sparc.inline.hpp | 3 +- .../vm/orderAccess_solaris_sparc.inline.hpp | 3 +- .../solaris_sparc/vm/os_solaris_sparc.cpp | 1 + .../vm/atomic_solaris_x86.inline.hpp | 3 +- .../vm/orderAccess_solaris_x86.inline.hpp | 3 +- .../vm/atomic_windows_x86.inline.hpp | 3 +- .../vm/orderAccess_windows_x86.inline.hpp | 3 +- hotspot/src/share/vm/adlc/main.cpp | 22 ++------ hotspot/src/share/vm/asm/assembler.hpp | 25 ++-------- hotspot/src/share/vm/asm/codeBuffer.cpp | 1 + hotspot/src/share/vm/c1/c1_CodeStubs.hpp | 3 +- hotspot/src/share/vm/c1/c1_Defs.hpp | 18 +------ hotspot/src/share/vm/c1/c1_FrameMap.cpp | 20 +------- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 3 +- hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 23 +-------- hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 3 +- hotspot/src/share/vm/c1/c1_LinearScan.cpp | 19 +------ hotspot/src/share/vm/c1/c1_Runtime1.cpp | 1 + .../share/vm/classfile/bytecodeAssembler.cpp | 19 +------ .../share/vm/classfile/classFileStream.hpp | 16 +----- .../src/share/vm/classfile/stackMapTable.hpp | 18 +------ hotspot/src/share/vm/classfile/verifier.cpp | 16 +----- hotspot/src/share/vm/code/codeBlob.cpp | 15 ------ hotspot/src/share/vm/code/compiledIC.hpp | 18 +------ hotspot/src/share/vm/code/nativeInst.hpp | 44 ++++++++++++++++ hotspot/src/share/vm/code/vmreg.hpp | 27 ++-------- hotspot/src/share/vm/code/vmreg.inline.hpp | 46 +++++++++++++++++ hotspot/src/share/vm/compiler/compileLog.cpp | 1 + hotspot/src/share/vm/compiler/oopMap.cpp | 3 ++ .../vm/interpreter/abstractInterpreter.hpp | 23 ++------- hotspot/src/share/vm/interpreter/bytecode.hpp | 18 +------ .../vm/interpreter/bytecodeInterpreter.hpp | 19 ++----- .../share/vm/interpreter/bytecodeStream.hpp | 18 +------ .../src/share/vm/interpreter/bytecodes.cpp | 18 +------ .../src/share/vm/interpreter/interp_masm.hpp | 49 ++++++++++++++++++ .../src/share/vm/interpreter/interpreter.cpp | 29 ++++++++++- .../src/share/vm/interpreter/interpreter.hpp | 46 +++++------------ .../vm/interpreter/interpreterRuntime.cpp | 16 +----- .../vm/interpreter/templateInterpreter.cpp | 2 + .../vm/interpreter/templateInterpreter.hpp | 4 +- .../share/vm/interpreter/templateTable.cpp | 3 +- .../share/vm/interpreter/templateTable.hpp | 21 +------- hotspot/src/share/vm/memory/filemap.cpp | 1 + .../vm/memory/threadLocalAllocBuffer.hpp | 3 +- hotspot/src/share/vm/oops/constantPool.hpp | 16 +----- hotspot/src/share/vm/oops/oop.inline.hpp | 15 ------ hotspot/src/share/vm/opto/ad.hpp | 50 +++++++++++++++++++ hotspot/src/share/vm/opto/buildOopMap.cpp | 18 +------ hotspot/src/share/vm/opto/c2compiler.cpp | 24 +-------- hotspot/src/share/vm/opto/compile.cpp | 21 -------- hotspot/src/share/vm/opto/gcm.cpp | 22 -------- hotspot/src/share/vm/opto/lcm.cpp | 24 +-------- hotspot/src/share/vm/opto/library_call.cpp | 1 + hotspot/src/share/vm/opto/locknode.hpp | 26 ++-------- hotspot/src/share/vm/opto/matcher.cpp | 22 +------- hotspot/src/share/vm/opto/optoreg.hpp | 26 +++++++++- hotspot/src/share/vm/opto/output.cpp | 4 +- hotspot/src/share/vm/opto/output.hpp | 24 +-------- hotspot/src/share/vm/opto/regmask.cpp | 22 +------- hotspot/src/share/vm/opto/regmask.hpp | 23 +-------- hotspot/src/share/vm/opto/runtime.cpp | 23 +-------- hotspot/src/share/vm/opto/runtime.hpp | 1 + .../src/share/vm/precompiled/precompiled.hpp | 4 ++ hotspot/src/share/vm/prims/jniCheck.cpp | 15 ------ hotspot/src/share/vm/prims/jvm.cpp | 1 + .../vm/prims/jvmtiClassFileReconstituter.cpp | 19 ++----- hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 3 +- hotspot/src/share/vm/prims/unsafe.cpp | 1 + hotspot/src/share/vm/prims/whitebox.cpp | 3 ++ .../vm/runtime/advancedThresholdPolicy.cpp | 3 +- hotspot/src/share/vm/runtime/arguments.cpp | 1 + .../src/share/vm/runtime/deoptimization.cpp | 39 +-------------- hotspot/src/share/vm/runtime/dtraceJSDT.cpp | 1 + hotspot/src/share/vm/runtime/dtraceJSDT.hpp | 17 +------ hotspot/src/share/vm/runtime/fprofiler.cpp | 1 + hotspot/src/share/vm/runtime/frame.cpp | 17 +------ hotspot/src/share/vm/runtime/frame.hpp | 25 +--------- hotspot/src/share/vm/runtime/frame.inline.hpp | 17 +------ hotspot/src/share/vm/runtime/java.cpp | 15 ------ hotspot/src/share/vm/runtime/os.cpp | 2 + hotspot/src/share/vm/runtime/registerMap.hpp | 17 +------ hotspot/src/share/vm/runtime/relocator.hpp | 18 +------ hotspot/src/share/vm/runtime/rframe.cpp | 1 + hotspot/src/share/vm/runtime/safepoint.cpp | 20 -------- .../src/share/vm/runtime/sharedRuntime.cpp | 21 +------- .../share/vm/runtime/stackValueCollection.cpp | 15 ------ hotspot/src/share/vm/runtime/statSampler.cpp | 18 +------ hotspot/src/share/vm/runtime/stubRoutines.hpp | 15 ------ hotspot/src/share/vm/runtime/thread.cpp | 2 + hotspot/src/share/vm/runtime/vframeArray.cpp | 1 + hotspot/src/share/vm/runtime/vmStructs.cpp | 22 +------- .../src/share/vm/runtime/vm_operations.cpp | 1 + hotspot/src/share/vm/runtime/vm_version.cpp | 16 +----- hotspot/src/share/vm/runtime/vm_version.hpp | 18 ++++++- .../share/vm/services/diagnosticCommand.hpp | 11 ++-- .../share/vm/services/diagnosticFramework.hpp | 3 +- hotspot/src/share/vm/utilities/bytes.hpp | 44 ++++++++++++++++ hotspot/src/share/vm/utilities/debug.cpp | 1 + hotspot/src/share/vm/utilities/ostream.cpp | 1 + hotspot/src/share/vm/utilities/vmError.cpp | 1 + 154 files changed, 637 insertions(+), 1175 deletions(-) create mode 100644 hotspot/src/share/vm/code/nativeInst.hpp create mode 100644 hotspot/src/share/vm/code/vmreg.inline.hpp create mode 100644 hotspot/src/share/vm/interpreter/interp_masm.hpp create mode 100644 hotspot/src/share/vm/opto/ad.hpp create mode 100644 hotspot/src/share/vm/utilities/bytes.hpp diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index ff177e6231a..6898907b6d4 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -36,7 +36,6 @@ #include "runtime/signature.hpp" #include "runtime/stubCodeGenerator.hpp" #include "runtime/stubRoutines.hpp" -#include "vmreg_ppc.inline.hpp" #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #include "runtime/vframeArray.hpp" diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 6186906a860..11bbf69fd2e 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ #define CPU_PPC_VM_FRAME_PPC_INLINE_HPP #include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for ppc64 frames: diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp index 144ef50bfa8..da98715a102 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #ifndef CPU_PPC_VM_INTERPRETERRT_PPC_HPP #define CPU_PPC_VM_INTERPRETERRT_PPC_HPP +#include "asm/macroAssembler.hpp" #include "memory/allocation.hpp" // native method calls diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index a35b1ebb7a1..96814188f03 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index ce10145ed90..4366af19626 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -32,6 +32,7 @@ #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/objectMonitor.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 9087959fe1e..18870359ad9 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -267,7 +267,7 @@ register %{ // It's worth about 1% on SPEC geomean to get this right. // Chunk0, chunk1, and chunk2 form the MachRegisterNumbers enumeration -// in adGlobals_ppc64.hpp which defines the _num values, e.g. +// in adGlobals_ppc.hpp which defines the _num values, e.g. // R3_num. Therefore, R3_num may not be (and in reality is not) // the same as R3->encoding()! Furthermore, we cannot make any // assumptions on ordering, e.g. R3_num may be less than R2_num. @@ -1632,7 +1632,7 @@ enum RC { rc_bad, rc_int, rc_float, rc_stack }; static enum RC rc_class(OptoReg::Name reg) { // Return the register class for the given register. The given register // reg is a _num value, which is an index into the MachRegisterNumbers - // enumeration in adGlobals_ppc64.hpp. + // enumeration in adGlobals_ppc.hpp. if (reg == OptoReg::Bad) return rc_bad; diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index 107c5bab8b8..9dc765ab4a2 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define CPU_PPC_VM_REGISTER_PPC_HPP #include "asm/register.hpp" -#include "vm_version_ppc.hpp" // forward declaration class Address; @@ -92,8 +91,8 @@ class RegisterImpl: public AbstractRegisterImpl { inline friend Register as_Register(int encoding); // accessors - int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + int encoding() const { assert(is_valid(), "invalid register"); return value(); } + inline VMReg as_VMReg(); Register successor() const { return as_Register(encoding() + 1); } // testers @@ -208,8 +207,8 @@ class ConditionRegisterImpl: public AbstractRegisterImpl { inline friend ConditionRegister as_ConditionRegister(int encoding); // accessors - int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + int encoding() const { assert(is_valid(), "invalid register"); return value(); } + inline VMReg as_VMReg(); // testers bool is_valid() const { return (0 <= value() && value() < number_of_registers); } @@ -264,7 +263,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + inline VMReg as_VMReg(); FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } // testers @@ -365,7 +364,7 @@ class SpecialRegisterImpl: public AbstractRegisterImpl { // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + inline VMReg as_VMReg(); // testers bool is_valid() const { return 0 <= value() && value() < number_of_registers; } diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp index 0e5898381c2..404df938777 100644 --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "classfile/systemDictionary.hpp" #include "code/vmreg.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "nativeInst_ppc.hpp" #include "opto/runtime.hpp" #include "runtime/interfaceSupport.hpp" @@ -37,7 +38,6 @@ #include "runtime/stubRoutines.hpp" #include "runtime/vframeArray.hpp" #include "utilities/globalDefinitions.hpp" -#include "vmreg_ppc.inline.hpp" #endif #define __ masm-> diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 15a5812e881..68dda7d3e2b 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,16 +29,17 @@ #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "oops/compiledICHolder.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/vframeArray.hpp" #include "vmreg_ppc.inline.hpp" -#include "adfiles/ad_ppc_64.hpp" #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif #ifdef COMPILER2 +#include "adfiles/ad_ppc_64.hpp" #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index d452b27038c..6918228fe60 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -401,11 +401,11 @@ class StubGenerator: public StubCodeGenerator { __ load_const(exception_file, (void*)__FILE__); __ load_const(exception_line, (void*)__LINE__); - __ std(R3_ARG1, thread_(pending_exception)); + __ std(R3_ARG1, in_bytes(JavaThread::pending_exception_offset()), R16_thread); // store into `char *' - __ std(exception_file, thread_(exception_file)); + __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread); // store into `int' - __ stw(exception_line, thread_(exception_line)); + __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread); // complete return to VM assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before"); diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 8a9fae04770..b787fecc7d5 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index 367e8fef7d7..0b375da582e 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -27,6 +27,7 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp index 92c4d088de8..4fe7bdb62e1 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp @@ -26,10 +26,28 @@ #ifndef CPU_PPC_VM_VMREG_PPC_HPP #define CPU_PPC_VM_VMREG_PPC_HPP - bool is_Register(); - Register as_Register(); +inline bool is_Register() { + return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr; +} - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); +inline bool is_FloatRegister() { + return value() >= ConcreteRegisterImpl::max_gpr && + value() < ConcreteRegisterImpl::max_fpr; +} + +inline Register as_Register() { + assert(is_Register() && is_even(value()), "even-aligned GPR name"); + return ::as_Register(value()>>1); +} + +inline FloatRegister as_FloatRegister() { + assert(is_FloatRegister() && is_even(value()), "must be"); + return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); + return is_even(value()); +} #endif // CPU_PPC_VM_VMREG_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp index d097c5bc5cb..16e5e5d8fd7 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp @@ -44,28 +44,5 @@ inline VMReg SpecialRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg((encoding()) + ConcreteRegisterImpl::max_cnd); } -inline bool VMRegImpl::is_Register() { - return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr; -} - -inline bool VMRegImpl::is_FloatRegister() { - return value() >= ConcreteRegisterImpl::max_gpr && - value() < ConcreteRegisterImpl::max_fpr; -} - -inline Register VMRegImpl::as_Register() { - assert(is_Register() && is_even(value()), "even-aligned GPR name"); - return ::as_Register(value()>>1); -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert(is_FloatRegister() && is_even(value()), "must be"); - return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); - return is_even(value()); -} #endif // CPU_PPC_VM_VMREG_PPC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 1eeca870804..9f9fc75bd1b 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ #include "oops/compiledICHolder.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" -#include "register_sparc.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/vframeArray.hpp" diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 17b4d9e05ac..de161ecd9eb 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "interpreter/interpreter.hpp" #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 8aa0105bf0d..da6c4b25c71 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP #include "asm/macroAssembler.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for SPARC frames: diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp index 41bdd88f7f5..8cbe422a4af 100644 --- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index 132c5292a06..debdaeae7a4 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index e43d77665ac..79ca56aecd3 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "asm/assembler.inline.hpp" +#include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp index af2e4e1e96c..4cd5b2a93c3 100644 --- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "memory/allocation.inline.hpp" #include "prims/methodHandles.hpp" diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp index 7d0096ccf59..22cb0283825 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #define CPU_SPARC_VM_REGISTER_SPARC_HPP #include "asm/register.hpp" -#include "vm_version_sparc.hpp" // forward declaration class Address; @@ -65,7 +64,7 @@ class RegisterImpl: public AbstractRegisterImpl { friend Register as_oRegister(int number); friend Register as_gRegister(int number); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } @@ -234,7 +233,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { }; // construction - VMReg as_VMReg( ); + inline VMReg as_VMReg( ); // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index c281e3bc005..018ff0e08aa 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index d4eb74f3204..f85864df878 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp index ce8cb4c3d3a..29f38a8d8ca 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp @@ -25,10 +25,35 @@ #ifndef CPU_SPARC_VM_VMREG_SPARC_HPP #define CPU_SPARC_VM_VMREG_SPARC_HPP - bool is_Register(); - Register as_Register(); +inline bool is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; } +inline bool is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr && + value() < ConcreteRegisterImpl::max_fpr; } +inline Register as_Register() { - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); + assert( is_Register() && is_even(value()), "even-aligned GPR name" ); + // Yuk + return ::as_Register(value()>>1); +} + +inline FloatRegister as_FloatRegister() { + assert( is_FloatRegister(), "must be" ); + // Yuk + return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr ); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); + int v = value(); + if ( v < ConcreteRegisterImpl::max_gpr ) { + return is_even(v); + } + // F0..F31 + if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true; + if ( v < ConcreteRegisterImpl::max_fpr) { + return is_even(v); + } + assert(false, "what register?"); + return false; +} #endif // CPU_SPARC_VM_VMREG_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp index 993216fc12d..936d39db68b 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp @@ -33,35 +33,5 @@ inline VMReg RegisterImpl::as_VMReg() { inline VMReg FloatRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg( ConcreteRegisterImpl::max_gpr + encoding() ); } -inline bool VMRegImpl::is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; } -inline bool VMRegImpl::is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr && - value() < ConcreteRegisterImpl::max_fpr; } -inline Register VMRegImpl::as_Register() { - - assert( is_Register() && is_even(value()), "even-aligned GPR name" ); - // Yuk - return ::as_Register(value()>>1); -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert( is_FloatRegister(), "must be" ); - // Yuk - return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr ); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); - int v = value(); - if ( v < ConcreteRegisterImpl::max_gpr ) { - return is_even(v); - } - // F0..F31 - if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true; - if ( v < ConcreteRegisterImpl::max_fpr) { - return is_even(v); - } - assert(false, "what register?"); - return false; -} #endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 9b875b83499..da05e8868bb 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #define CPU_X86_VM_FRAME_X86_INLINE_HPP #include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for Intel frames: diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index 3c66bf4fb45..abe354360ff 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index e9c1ef782d8..65ffc6d2e97 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/register_x86.hpp b/hotspot/src/cpu/x86/vm/register_x86.hpp index 680dd900a48..b5e6989d5d9 100644 --- a/hotspot/src/cpu/x86/vm/register_x86.hpp +++ b/hotspot/src/cpu/x86/vm/register_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #define CPU_X86_VM_REGISTER_X86_HPP #include "asm/register.hpp" -#include "vm_version_x86.hpp" class VMRegImpl; typedef VMRegImpl* VMReg; @@ -59,7 +58,7 @@ class RegisterImpl: public AbstractRegisterImpl { // construction inline friend Register as_Register(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // accessors int encoding() const { assert(is_valid(), "invalid register"); return (intptr_t)this; } @@ -110,9 +109,10 @@ class FloatRegisterImpl: public AbstractRegisterImpl { // construction inline friend FloatRegister as_FloatRegister(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // derived registers, offsets, and addresses + FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } // accessors @@ -152,7 +152,7 @@ class XMMRegisterImpl: public AbstractRegisterImpl { // construction friend XMMRegister as_XMMRegister(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // derived registers, offsets, and addresses XMMRegister successor() const { return as_XMMRegister(encoding() + 1); } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 1e49ce1c6a4..c9be17caab1 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 201,4 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 12b0d0568f9..7d836127da2 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 7fc8d33c42f..da56c1449cd 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 60f62077e55..00d2d58cdfb 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp index 38d47dccfc3..f31e1c5c9fd 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp @@ -25,13 +25,49 @@ #ifndef CPU_X86_VM_VMREG_X86_HPP #define CPU_X86_VM_VMREG_X86_HPP - bool is_Register(); - Register as_Register(); - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); - bool is_XMMRegister(); - XMMRegister as_XMMRegister(); +inline bool is_Register() { + return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; +} + +inline bool is_FloatRegister() { + return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; +} + +inline bool is_XMMRegister() { + return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm; +} + +inline Register as_Register() { + + assert( is_Register(), "must be"); + // Yuk +#ifdef AMD64 + return ::as_Register(value() >> 1); +#else + return ::as_Register(value()); +#endif // AMD64 +} + +inline FloatRegister as_FloatRegister() { + assert( is_FloatRegister() && is_even(value()), "must be" ); + // Yuk + return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); +} + +inline XMMRegister as_XMMRegister() { + assert( is_XMMRegister() && is_even(value()), "must be" ); + // Yuk + return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); +#ifndef AMD64 + if (is_Register()) return true; +#endif // AMD64 + return is_even(value()); +} #endif // CPU_X86_VM_VMREG_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp index 0608d3edbff..bc94e4839af 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp @@ -42,48 +42,4 @@ inline VMReg XMMRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg((encoding() << 3) + ConcreteRegisterImpl::max_fpr); } - -inline bool VMRegImpl::is_Register() { - return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -} - -inline bool VMRegImpl::is_FloatRegister() { - return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -} - -inline bool VMRegImpl::is_XMMRegister() { - return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm; -} - -inline Register VMRegImpl::as_Register() { - - assert( is_Register(), "must be"); - // Yuk -#ifdef AMD64 - return ::as_Register(value() >> 1); -#else - return ::as_Register(value()); -#endif // AMD64 -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert( is_FloatRegister() && is_even(value()), "must be" ); - // Yuk - return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -} - -inline XMMRegister VMRegImpl::as_XMMRegister() { - assert( is_XMMRegister() && is_even(value()), "must be" ); - // Yuk - return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); -#ifndef AMD64 - if (is_Register()) return true; -#endif // AMD64 - return is_even(value()); -} - #endif // CPU_X86_VM_VMREG_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad index b575a98a816..42cc708a610 100644 --- a/hotspot/src/cpu/x86/vm/x86.ad +++ b/hotspot/src/cpu/x86/vm/x86.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -487,6 +487,8 @@ source_hpp %{ // To keep related declarations/definitions/uses close together, // we switch between source %{ }% and source_hpp %{ }% freely as needed. +class NativeJump; + class CallStubImpl { //-------------------------------------------------------------- diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index b774455a454..e6b92b76f12 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -66,6 +66,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/runtimeService.hpp" #include "utilities/decoder.hpp" diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 744ff23408b..e963aeec5ad 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -59,6 +59,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/runtimeService.hpp" diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 0b2bf13383a..86d6913299c 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -62,6 +62,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/runtimeService.hpp" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index 744bb7c38d4..046912a2c24 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_ppc.hpp" #ifndef _LP64 #error "Atomic currently only impleneted for PPC64" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp index 93e5ed159cd..36ca820a6bd 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #define OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_ppc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp index ab7fab3dd13..0a9feddfec4 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp index c7459d5a514..834efd2bbf7 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp index 4ed2934463b..60969caa962 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_zero.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp index 7f8e78bbff8..ecc4c752777 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_zero.hpp" #ifdef ARM diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index c8fcf1f64d2..39ed85ea361 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_ppc.hpp" #ifndef PPC64 #error "Atomic currently only implemented for PPC64" diff --git a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp index dcc2375f878..dff21c6bf6a 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_ppc.hpp" #ifndef PPC64 #error "OrderAccess currently only implemented for PPC64" diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp index 331eed7a67f..29b51d70f7f 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_sparc.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp index 6833c1f4e61..f5215f187e8 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_sparc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp index 2d0d5197344..679dd614523 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp index 10240a0b1c2..a71a53cfa8c 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp index 33ce50dc73f..d9df41034d4 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_zero.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp index 773fd643ab7..e15041e76a7 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_zero.hpp" #ifdef ARM diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp index 7d17fdf39cd..83a07ce3fe5 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_sparc.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp index 7e633fd95cb..f9321f2bac2 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" -#include "vm_version_sparc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index ed7b2538280..f22bdcb923e 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -27,6 +27,7 @@ #include "classfile/classLoader.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp index 27c0d396b72..e00d5be1ff0 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp index e7238c27549..e211c060552 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp index 7ba00f7aaeb..072b61f07d3 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // The following alternative implementations are needed because // Windows 95 doesn't support (some of) the corresponding Windows NT diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp index ea0ed143e98..37e5126e066 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp index 614f0d43f10..6c4553f4b8f 100644 --- a/hotspot/src/share/vm/adlc/main.cpp +++ b/hotspot/src/share/vm/adlc/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,7 +213,8 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp"); AD.addInclude(AD._CPP_file, "asm/macroAssembler.inline.hpp"); AD.addInclude(AD._CPP_file, "code/compiledIC.hpp"); - AD.addInclude(AD._CPP_file, "code/vmreg.hpp"); + AD.addInclude(AD._CPP_file, "code/nativeInst.hpp"); + AD.addInclude(AD._CPP_file, "code/vmreg.inline.hpp"); AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp"); AD.addInclude(AD._CPP_file, "oops/compiledICHolder.hpp"); AD.addInclude(AD._CPP_file, "oops/markOop.hpp"); @@ -230,23 +231,8 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "runtime/sharedRuntime.hpp"); AD.addInclude(AD._CPP_file, "runtime/stubRoutines.hpp"); AD.addInclude(AD._CPP_file, "utilities/growableArray.hpp"); -#ifdef TARGET_ARCH_x86 - AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp"); -#endif -#ifdef TARGET_ARCH_sparc - AD.addInclude(AD._CPP_file, "nativeInst_sparc.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_sparc.inline.hpp"); -#endif -#ifdef TARGET_ARCH_arm - AD.addInclude(AD._CPP_file, "nativeInst_arm.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_arm.inline.hpp"); -#endif -#ifdef TARGET_ARCH_ppc - AD.addInclude(AD._CPP_file, "nativeInst_ppc.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_ppc.inline.hpp"); -#endif AD.addInclude(AD._HPP_file, "memory/allocation.hpp"); + AD.addInclude(AD._HPP_file, "code/nativeInst.hpp"); AD.addInclude(AD._HPP_file, "opto/machnode.hpp"); AD.addInclude(AD._HPP_file, "opto/node.hpp"); AD.addInclude(AD._HPP_file, "opto/regalloc.hpp"); diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp index ec8ec5eb435..3b9c012e02f 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,34 +26,15 @@ #define SHARE_VM_ASM_ASSEMBLER_HPP #include "asm/codeBuffer.hpp" +#include "asm/register.hpp" #include "code/oopRecorder.hpp" #include "code/relocInfo.hpp" #include "memory/allocation.hpp" +#include "runtime/vm_version.hpp" #include "utilities/debug.hpp" #include "utilities/growableArray.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -# include "vm_version_ppc.hpp" -#endif - // This file contains platform-independent assembler declarations. class MacroAssembler; diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index 60d405b35f4..9c4bc206158 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -28,6 +28,7 @@ #include "memory/gcLocker.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" +#include "runtime/icache.hpp" #include "utilities/copy.hpp" #include "utilities/xmlstream.hpp" diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp index 2d0c31e2afe..e3a4f4d5680 100644 --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "c1/c1_Instruction.hpp" #include "c1/c1_LIR.hpp" #include "c1/c1_Runtime1.hpp" +#include "code/nativeInst.hpp" #include "utilities/array.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp index bebb3b0bebe..7504bbf7ce7 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.hpp +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,21 +26,7 @@ #define SHARE_VM_C1_C1_DEFS_HPP #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -#endif +#include "asm/register.hpp" // set frame size and return address offset to these values in blobs // (if the compiled frame uses ebp as link pointer on IA; otherwise, diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp index f9e46f30132..a164d8ccb00 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,24 +25,8 @@ #include "precompiled.hpp" #include "c1/c1_FrameMap.hpp" #include "c1/c1_LIR.hpp" +#include "code/vmreg.inline.hpp" #include "runtime/sharedRuntime.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif - - //----------------------------------------------------- diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index cada65e1a94..6798e615e56 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ #include "interpreter/bytecode.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/compilationPolicy.hpp" +#include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" class BlockListBuilder VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 5697e9046aa..48b560840e3 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,27 +30,6 @@ #include "c1/c1_MacroAssembler.hpp" #include "c1/c1_ValueStack.hpp" #include "ci/ciInstance.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif - void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { // we must have enough patching space so that call can be inserted diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index bf0b6f2f1ea..57b76803b42 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "ci/ciObjArray.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 91bef59ef17..afed1de995f 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,23 +31,8 @@ #include "c1/c1_LIRGenerator.hpp" #include "c1/c1_LinearScan.hpp" #include "c1/c1_ValueStack.hpp" +#include "code/vmreg.inline.hpp" #include "utilities/bitMap.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif - #ifndef PRODUCT diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index a472718a64e..b78b787fc5b 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -56,6 +56,7 @@ #include "runtime/threadCritical.hpp" #include "runtime/vframe.hpp" #include "runtime/vframeArray.hpp" +#include "runtime/vm_version.hpp" #include "utilities/copy.hpp" #include "utilities/events.hpp" diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp index cbf3baf7945..0d8cfc7878a 100644 --- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,22 +28,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/oopFactory.hpp" #include "oops/constantPool.hpp" - -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) { u2 index; diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp index 691ed808fec..de392e7fa13 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -25,22 +25,8 @@ #ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP #define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP +#include "utilities/bytes.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // Input stream for reading .class file // diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp index ee8b33f6219..385aef3a7e6 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,22 +30,8 @@ #include "memory/allocation.hpp" #include "oops/constantPool.hpp" #include "oops/method.hpp" +#include "utilities/bytes.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif class StackMapReader; diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index c7eca2d011b..60eab975142 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -45,21 +45,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" #define NOFAILOVER_MAJOR_VERSION 51 #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51 diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index f9e78bfb9e2..710ca948ddc 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -39,21 +39,6 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/vframe.hpp" #include "services/memoryService.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index 0d522af63fe..ec36381b1f2 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,23 +25,9 @@ #ifndef SHARE_VM_CODE_COMPILEDIC_HPP #define SHARE_VM_CODE_COMPILEDIC_HPP +#include "code/nativeInst.hpp" #include "interpreter/linkResolver.hpp" #include "oops/compiledICHolder.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. diff --git a/hotspot/src/share/vm/code/nativeInst.hpp b/hotspot/src/share/vm/code/nativeInst.hpp new file mode 100644 index 00000000000..6e4ece7d01a --- /dev/null +++ b/hotspot/src/share/vm/code/nativeInst.hpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_CODE_NATIVEINST_HPP +#define SHARE_VM_CODE_NATIVEINST_HPP + +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif + +#endif // SHARE_VM_CODE_NATIVEINST_HPP diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp index 1ef07ec199c..0b2edd19fd9 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,34 +25,13 @@ #ifndef SHARE_VM_CODE_VMREG_HPP #define SHARE_VM_CODE_VMREG_HPP +#include "asm/register.hpp" #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" -#include "asm/register.hpp" #ifdef COMPILER2 #include "opto/adlcVMDeps.hpp" #include "utilities/ostream.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif #endif //------------------------------VMReg------------------------------------------ @@ -107,7 +86,7 @@ public: // also a register you could use in the assembler. On machines with // 64bit registers only one half of the VMReg (and OptoReg) is considered // concrete. - bool is_concrete(); + // bool is_concrete(); // VMRegs are 4 bytes wide on all platforms static const int stack_slot_size; diff --git a/hotspot/src/share/vm/code/vmreg.inline.hpp b/hotspot/src/share/vm/code/vmreg.inline.hpp new file mode 100644 index 00000000000..6204f9df39f --- /dev/null +++ b/hotspot/src/share/vm/code/vmreg.inline.hpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_CODE_VMREG_INLINE_HPP +#define SHARE_VM_CODE_VMREG_INLINE_HPP + +#include "asm/register.hpp" +#include "code/vmreg.hpp" +#ifdef TARGET_ARCH_x86 +# include "vmreg_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vmreg_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vmreg_zero.inline.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif + +#endif // SHARE_VM_CODE_VMREG_INLINE_HPP diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp index f2c04b6e4ff..340251f3265 100644 --- a/hotspot/src/share/vm/compiler/compileLog.cpp +++ b/hotspot/src/share/vm/compiler/compileLog.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "ci/ciMethod.hpp" +#include "code/codeCache.hpp" #include "compiler/compileLog.hpp" #include "memory/allocation.inline.hpp" #include "oops/method.hpp" diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 5e1801584c2..556966bc9bf 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -36,6 +36,9 @@ #ifdef COMPILER1 #include "c1/c1_Defs.hpp" #endif +#ifdef COMPILER2 +#include "opto/optoreg.hpp" +#endif // OopMapStream diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index d5d1b150134..783066e0adb 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,12 @@ #ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP #define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP +#include "asm/macroAssembler.hpp" #include "code/stubs.hpp" #include "interpreter/bytecodes.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vmThread.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "interp_masm_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "interp_masm_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "interp_masm_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif // This file contains the platform-independent parts // of the abstract interpreter and the abstract interpreter generator. @@ -75,6 +58,8 @@ //------------------------------------------------------------------------------------------------------------------------ // The C++ interface to the bytecode interpreter(s). +class InterpreterMacroAssembler; + class AbstractInterpreter: AllStatic { friend class VMStructs; friend class Interpreter; diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index 10b5a567b24..0708816ff51 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,21 +28,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" class ciBytecodeStream; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index b2a1c49683f..49fc1703d50 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,21 +32,6 @@ #include "runtime/frame.hpp" #include "runtime/globals.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif #ifdef CC_INTERP @@ -56,6 +41,8 @@ // CVM definitions find hotspot equivalents... +class InterpreterMacroAssembler; + union VMJavaVal64 { jlong l; jdouble d; diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp index cf5500a7e33..1f657b98bc2 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,21 +29,7 @@ #include "memory/allocation.hpp" #include "oops/method.hpp" #include "runtime/handles.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" // A BytecodeStream is used for fast iteration over the bytecodes // of a Method*. diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 5c26a4a751f..7fcd6543984 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,21 +26,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/resourceArea.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600)) diff --git a/hotspot/src/share/vm/interpreter/interp_masm.hpp b/hotspot/src/share/vm/interpreter/interp_masm.hpp new file mode 100644 index 00000000000..6e647835448 --- /dev/null +++ b/hotspot/src/share/vm/interpreter/interp_masm.hpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_INTERPRETER_INTERP_MASM_HPP +#define SHARE_VM_INTERPRETER_INTERP_MASM_HPP + +#include "asm/macroAssembler.hpp" + +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "interp_masm_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "interp_masm_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "interp_masm_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "interp_masm_ppc_64.hpp" +#endif + +#endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 7ce4bdbb3ec..4807cd08398 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -30,6 +30,7 @@ #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" @@ -80,9 +81,35 @@ void InterpreterCodelet::print_on(outputStream* st) const { } } +CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm, + const char* description, + Bytecodes::Code bytecode) : + _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), + _cb(_clet->code_begin(), _clet->code_size()) { + // Request all space (add some slack for Codelet data). + assert(_clet != NULL, "we checked not enough space already"); + + // Initialize Codelet attributes. + _clet->initialize(description, bytecode); + // Create assembler for code generation. + masm = new InterpreterMacroAssembler(&_cb); + _masm = &masm; +} + +CodeletMark::~CodeletMark() { + // Align so printing shows nop's instead of random code at the end (Codelets are aligned). + (*_masm)->align(wordSize); + // Make sure all code is in code buffer. + (*_masm)->flush(); + + // Commit Codelet. + AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings()); + // Make sure nobody can use _masm outside a CodeletMark lifespan. + *_masm = NULL; +} //------------------------------------------------------------------------------------------------------------------------ -// Implementation of platform independent aspects of Interpreter +// Implementation of platform independent aspects of Interpreter void AbstractInterpreter::initialize() { if (_code != NULL) return; diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index cc26b378d73..2a81daf205d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,8 @@ // This file contains the platform-independent parts // of the interpreter and the interpreter generator. +class InterpreterMacroAssembler; + //------------------------------------------------------------------------------------------------------------------------ // An InterpreterCodelet is a piece of interpreter code. All // interpreter code is generated into little codelets which @@ -99,42 +101,17 @@ class CodeletMark: ResourceMark { int codelet_size = AbstractInterpreter::code()->available_space() - 2*K; // Guarantee there's a little bit of code space left. - guarantee (codelet_size > 0 && (size_t)codelet_size > 2*K, - "not enough space for interpreter generation"); + guarantee(codelet_size > 0 && (size_t)codelet_size > 2*K, + "not enough space for interpreter generation"); return codelet_size; } public: - CodeletMark( - InterpreterMacroAssembler*& masm, - const char* description, - Bytecodes::Code bytecode = Bytecodes::_illegal): - _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), - _cb(_clet->code_begin(), _clet->code_size()) - - { // request all space (add some slack for Codelet data) - assert (_clet != NULL, "we checked not enough space already"); - - // initialize Codelet attributes - _clet->initialize(description, bytecode); - // create assembler for code generation - masm = new InterpreterMacroAssembler(&_cb); - _masm = &masm; - } - - ~CodeletMark() { - // align so printing shows nop's instead of random code at the end (Codelets are aligned) - (*_masm)->align(wordSize); - // make sure all code is in code buffer - (*_masm)->flush(); - - - // commit Codelet - AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings()); - // make sure nobody can use _masm outside a CodeletMark lifespan - *_masm = NULL; - } + CodeletMark(InterpreterMacroAssembler*& masm, + const char* description, + Bytecodes::Code bytecode = Bytecodes::_illegal); + ~CodeletMark(); }; // Wrapper classes to produce Interpreter/InterpreterGenerator from either @@ -142,9 +119,10 @@ class CodeletMark: ResourceMark { class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) { - public: + public: // Debugging/printing - static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } + static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } + #ifdef TARGET_ARCH_x86 # include "interpreter_x86.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 42a721839a8..b736d8edbdb 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -48,6 +48,7 @@ #include "runtime/deoptimization.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" #include "runtime/jfieldIDWorkaround.hpp" @@ -57,21 +58,6 @@ #include "runtime/synchronizer.hpp" #include "runtime/threadCritical.hpp" #include "utilities/events.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif #ifdef COMPILER2 #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 66eb63eafb6..9f28e20f9b7 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -26,6 +26,8 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreter.hpp" #include "interpreter/templateTable.hpp" #ifndef CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 48e0e217091..c72fafdbada 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ #ifndef CC_INTERP +class InterpreterMacroAssembler; + //------------------------------------------------------------------------------------------------------------------------ // A little wrapper class to group tosca-specific entry points into a unit. // (tosca = Top-Of-Stack CAche) diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp index 05b8a069691..8449321d9f3 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.cpp +++ b/hotspot/src/share/vm/interpreter/templateTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc_interface/collectedHeap.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "runtime/timer.hpp" diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index c6ea51537a2..e6d334005e1 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,24 +28,6 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "runtime/frame.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "interp_masm_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "interp_masm_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "interp_masm_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif #ifndef CC_INTERP // All the necessary definitions used for (bytecode) template generation. Instead of @@ -53,6 +35,7 @@ // and the snippet generator, a template is assigned to each bytecode which can be // used to generate the bytecode's implementation if needed. +class InterpreterMacroAssembler; // A Template describes the properties of a code template for a given bytecode // and provides a generator to generate the code template. diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index 47527f21e9f..2f5c0165893 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -30,6 +30,7 @@ #include "runtime/arguments.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" diff --git a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp index e0dc61a73f6..a54de2bf0a3 100644 --- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "gc_implementation/shared/gcUtil.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/perfData.hpp" +#include "runtime/vm_version.hpp" class GlobalTLABStats; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index 5c5ea1c76e2..5e26ec5e622 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -31,22 +31,8 @@ #include "oops/symbol.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/handles.hpp" +#include "utilities/bytes.hpp" #include "utilities/constantTag.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // A ConstantPool is an array containing class constants as described in the // class file. diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 0dc0db8e946..08839267e01 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -42,21 +42,6 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "utilities/macros.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references diff --git a/hotspot/src/share/vm/opto/ad.hpp b/hotspot/src/share/vm/opto/ad.hpp new file mode 100644 index 00000000000..29308f8b10c --- /dev/null +++ b/hotspot/src/share/vm/opto/ad.hpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_OPTO_AD_HPP +#define SHARE_VM_OPTO_AD_HPP + +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/ad_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/ad_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/ad_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/ad_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "adfiles/ad_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "adfiles/ad_ppc_64.hpp" +#endif + +#endif // SHARE_VM_OPTO_AD_HPP diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 9f2dd674e2f..1fa98978f26 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/vmreg.inline.hpp" #include "compiler/oopMap.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" @@ -32,21 +33,6 @@ #include "opto/phase.hpp" #include "opto/regalloc.hpp" #include "opto/rootnode.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif // The functions in this file builds OopMaps after all scheduling is done. // diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index dced2e00f34..795b0ec1fe5 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,28 +24,8 @@ #include "precompiled.hpp" #include "opto/c2compiler.hpp" +#include "opto/optoreg.hpp" #include "opto/runtime.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // register information defined by ADLC extern const char register_save_policy[]; diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 9c8ae35a04e..86f566c5877 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -68,27 +68,6 @@ #include "runtime/timer.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // -------------------- Compile::mach_constant_base_node ----------------------- diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 4aa770d5af5..0486bf6885b 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -35,28 +35,6 @@ #include "opto/rootnode.hpp" #include "opto/runtime.hpp" #include "runtime/deoptimization.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif - // Portions of code courtesy of Clifford Click diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 10daf5694f9..a601752d4cd 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,33 +24,13 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/block.hpp" #include "opto/c2compiler.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/machnode.hpp" #include "opto/runtime.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // Optimization - Graph Style diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index e0a09d27ff1..8e01709fcda 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index 8bd6f35afd8..515a40c4663 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,27 +28,9 @@ #include "opto/node.hpp" #include "opto/opcodes.hpp" #include "opto/subnode.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif + +class BiasedLockingCounters; +class RTMLockingCounters; //------------------------------BoxLockNode------------------------------------ class BoxLockNode : public Node { diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index a8321b07753..cce4a739473 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/idealGraphPrinter.hpp" @@ -37,27 +38,6 @@ #include "opto/type.hpp" #include "opto/vectornode.hpp" #include "runtime/os.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif OptoReg::Name OptoReg::c_frame_pointer; diff --git a/hotspot/src/share/vm/opto/optoreg.hpp b/hotspot/src/share/vm/opto/optoreg.hpp index 0d45c7a50ab..cc383393946 100644 --- a/hotspot/src/share/vm/opto/optoreg.hpp +++ b/hotspot/src/share/vm/opto/optoreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,30 @@ #ifndef SHARE_VM_OPTO_OPTOREG_HPP #define SHARE_VM_OPTO_OPTOREG_HPP +// AdGlobals contains c2 specific register handling code as specified +// in the .ad files. +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/adGlobals_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/adGlobals_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/adGlobals_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/adGlobals_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "adfiles/adGlobals_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "adfiles/adGlobals_ppc_64.hpp" +#endif + //------------------------------OptoReg---------------------------------------- // We eventually need Registers for the Real World. Registers are essentially // non-SSA names. A Register is represented as a number. Non-regular values diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index be29ce452f8..d6768a7fdf8 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,10 +30,12 @@ #include "compiler/compileBroker.hpp" #include "compiler/oopMap.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/locknode.hpp" #include "opto/machnode.hpp" +#include "opto/optoreg.hpp" #include "opto/output.hpp" #include "opto/regalloc.hpp" #include "opto/runtime.hpp" diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp index 298de0fec67..ab3c1a30457 100644 --- a/hotspot/src/share/vm/opto/output.hpp +++ b/hotspot/src/share/vm/opto/output.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,9 @@ #ifndef SHARE_VM_OPTO_OUTPUT_HPP #define SHARE_VM_OPTO_OUTPUT_HPP +#include "opto/ad.hpp" #include "opto/block.hpp" #include "opto/node.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif class Arena; class Bundle; diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp index a30678dadf2..06a245a12f0 100644 --- a/hotspot/src/share/vm/opto/regmask.cpp +++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -23,29 +23,9 @@ */ #include "precompiled.hpp" +#include "opto/ad.hpp" #include "opto/compile.hpp" #include "opto/regmask.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp index ff0d0b96dc2..15f687ac38e 100644 --- a/hotspot/src/share/vm/opto/regmask.hpp +++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,27 +27,6 @@ #include "code/vmreg.hpp" #include "opto/optoreg.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif // Some fun naming (textual) substitutions: // diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index dba4f047b5a..2a2fb131dfd 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/icBuffer.hpp" #include "code/nmethod.hpp" @@ -45,6 +46,7 @@ #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" +#include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" @@ -68,27 +70,6 @@ #include "runtime/vframe_hp.hpp" #include "utilities/copy.hpp" #include "utilities/preserveException.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // For debugging purposes: diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index b8ad0105dfc..b5e8bc34d98 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -27,6 +27,7 @@ #include "code/codeBlob.hpp" #include "opto/machnode.hpp" +#include "opto/optoreg.hpp" #include "opto/type.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/rtmLocking.hpp" diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp index e8d014430df..be70cfffd6e 100644 --- a/hotspot/src/share/vm/precompiled/precompiled.hpp +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp @@ -70,6 +70,7 @@ # include "code/exceptionHandlerTable.hpp" # include "code/jvmticmlr.h" # include "code/location.hpp" +# include "code/nativeInst.hpp" # include "code/nmethod.hpp" # include "code/oopRecorder.hpp" # include "code/pcDesc.hpp" @@ -106,6 +107,7 @@ # include "interpreter/bytecodes.hpp" # include "interpreter/cppInterpreter.hpp" # include "interpreter/interpreter.hpp" +# include "interpreter/interp_masm.hpp" # include "interpreter/invocationCounter.hpp" # include "interpreter/linkResolver.hpp" # include "interpreter/templateInterpreter.hpp" @@ -228,6 +230,7 @@ # include "utilities/array.hpp" # include "utilities/bitMap.hpp" # include "utilities/bitMap.inline.hpp" +# include "utilities/bytes.hpp" # include "utilities/constantTag.hpp" # include "utilities/copy.hpp" # include "utilities/debug.hpp" @@ -250,6 +253,7 @@ # include "libadt/dict.hpp" # include "libadt/set.hpp" # include "libadt/vectset.hpp" +# include "opto/ad.hpp" # include "opto/addnode.hpp" # include "opto/adlcVMDeps.hpp" # include "opto/block.hpp" diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index cdce2643775..73a2965004e 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -37,21 +37,6 @@ #include "runtime/interfaceSupport.hpp" #include "runtime/jfieldIDWorkaround.hpp" #include "runtime/thread.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif // Complain every extra number of unplanned local refs #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32 diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 1cd19a56332..6e03e784952 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -59,6 +59,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" #include "services/threadService.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp index 92ff86fcd6d..c6633bf34a9 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,21 +28,8 @@ #include "oops/fieldStreams.hpp" #include "prims/jvmtiClassFileReconstituter.hpp" #include "runtime/signature.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" + // FIXME: add Deprecated attribute // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes() diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index aeb8f58e7ca..70e9a98e30a 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "jvmtifiles/jvmtiEnv.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/objArrayKlass.hpp" diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 955e34d5034..c0e4f30d2a2 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -38,6 +38,7 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/reflection.hpp" #include "runtime/synchronizer.hpp" +#include "runtime/vm_version.hpp" #include "services/threadService.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 15f316aa6c2..683ac097c3f 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -24,6 +24,8 @@ #include "precompiled.hpp" +#include "code/codeCache.hpp" + #include "memory/universe.hpp" #include "oops/oop.inline.hpp" @@ -37,6 +39,7 @@ #include "runtime/arguments.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "utilities/debug.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index 1b97c18b7f7..5c765ec21b8 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "runtime/advancedThresholdPolicy.hpp" #include "runtime/simpleThresholdPolicy.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 7accd0c0b18..9497164e819 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -38,6 +38,7 @@ #include "runtime/globals_extension.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "services/management.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index b15664f4b52..a7ad943cf7c 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" #include "code/debugInfoRec.hpp" #include "code/nmethod.hpp" #include "code/pcDesc.hpp" @@ -50,44 +51,6 @@ #include "runtime/vframe_hp.hpp" #include "utilities/events.hpp" #include "utilities/xmlstream.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif -#ifdef COMPILER2 -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif -#endif // COMPILER2 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp index 1a5f4fe5286..51ae25d0c34 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" #include "code/codeBlob.hpp" +#include "code/nativeInst.hpp" #include "memory/allocation.hpp" #include "prims/jvm.h" #include "runtime/dtraceJSDT.hpp" diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp index 67b766ae944..7e7592a5406 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,21 +26,6 @@ #define SHARE_VM_RUNTIME_DTRACEJSDT_HPP #include "code/nmethod.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif class RegisteredProbes; typedef jlong OpaqueProbes; diff --git a/hotspot/src/share/vm/runtime/fprofiler.cpp b/hotspot/src/share/vm/runtime/fprofiler.cpp index 58cb6e89daa..aec76268824 100644 --- a/hotspot/src/share/vm/runtime/fprofiler.cpp +++ b/hotspot/src/share/vm/runtime/fprofiler.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" +#include "code/codeCache.hpp" #include "code/vtableStubs.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index 0e6d22eb01f..7c4f96824f2 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -23,6 +23,8 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" #include "compiler/abstractCompiler.hpp" #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.inline.hpp" @@ -48,21 +50,6 @@ #include "runtime/thread.inline.hpp" #include "utilities/decoder.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp index f715f68b52d..51306dafc9c 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,29 +30,6 @@ #include "runtime/monitorChunk.hpp" #include "runtime/registerMap.hpp" #include "utilities/top.hpp" -#ifdef COMPILER2 -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif -#endif // COMPILER2 #ifdef ZERO #ifdef TARGET_ARCH_zero # include "stack_zero.hpp" diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp index ce725956dee..28cd2f83a5b 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,21 +31,6 @@ #include "oops/method.hpp" #include "runtime/frame.hpp" #include "runtime/signature.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif #ifdef ZERO #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 3a075117afe..cfecf0a5d57 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -65,21 +65,6 @@ #include "utilities/histogram.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 86bf1d6ba4d..d24c688bf13 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "gc_implementation/shared/vmGCOperations.hpp" @@ -49,6 +50,7 @@ #include "runtime/os.inline.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/threadService.hpp" diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp index b0f536fb95c..e27b745ff7c 100644 --- a/hotspot/src/share/vm/runtime/registerMap.hpp +++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,6 @@ #include "code/vmreg.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -#endif class JavaThread; diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp index bbc0600f739..6ea9ab4c819 100644 --- a/hotspot/src/share/vm/runtime/relocator.hpp +++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,7 @@ #include "interpreter/bytecodes.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code diff --git a/hotspot/src/share/vm/runtime/rframe.cpp b/hotspot/src/share/vm/runtime/rframe.cpp index c52d16ff3d5..f3ef5504b37 100644 --- a/hotspot/src/share/vm/runtime/rframe.cpp +++ b/hotspot/src/share/vm/runtime/rframe.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "interpreter/interpreter.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index b0dc8863e83..05bb2224a53 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -56,26 +56,6 @@ #include "services/runtimeService.hpp" #include "utilities/events.hpp" #include "utilities/macros.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/shared/suspendibleThreadSet.hpp" diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index c717e61c8c6..1656cdc1cd5 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/scopeDesc.hpp" #include "code/vtableStubs.hpp" @@ -59,26 +60,6 @@ #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" #include "utilities/xmlstream.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp index 3794f64d78c..fdf448b3718 100644 --- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp +++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -24,21 +24,6 @@ #include "precompiled.hpp" #include "runtime/stackValueCollection.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp index 082cc4ec45e..55fda6fb3f9 100644 --- a/hotspot/src/share/vm/runtime/statSampler.cpp +++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,21 +33,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/os.hpp" #include "runtime/statSampler.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif +#include "runtime/vm_version.hpp" // -------------------------------------------------------- // StatSamplerTask diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index 78381168fc4..46d93a52916 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -31,21 +31,6 @@ #include "runtime/mutexLocker.hpp" #include "runtime/stubCodeGenerator.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 9a2cbca09e0..69c2326a6ff 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/scopeDesc.hpp" #include "compiler/compileBroker.hpp" #include "interpreter/interpreter.hpp" @@ -74,6 +75,7 @@ #include "runtime/vframe_hp.hpp" #include "runtime/vmThread.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" #include "services/memTracker.hpp" diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp index 72e2e8717cb..e35114bb619 100644 --- a/hotspot/src/share/vm/runtime/vframeArray.cpp +++ b/hotspot/src/share/vm/runtime/vframeArray.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/vmSymbols.hpp" +#include "code/vmreg.inline.hpp" #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 33fe915e7fe..3ff41705843 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -193,33 +193,13 @@ #include "opto/movenode.hpp" #include "opto/narrowptrnode.hpp" #include "opto/opaquenode.hpp" +#include "opto/optoreg.hpp" #include "opto/phaseX.hpp" #include "opto/parse.hpp" #include "opto/regalloc.hpp" #include "opto/rootnode.hpp" #include "opto/subnode.hpp" #include "opto/vectornode.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif #endif // COMPILER2 // Note: the cross-product of (c1, c2, product, nonproduct, ...), diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index 6f27fe3fecc..2e913c5015f 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/symbolTable.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compilerOracle.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index a1779a85fe2..b5e3c674228 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -26,21 +26,7 @@ #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif +#include "runtime/vm_version.hpp" const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index 27a5717d383..96d2bf5e683 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -123,4 +123,20 @@ class Abstract_VM_Version: AllStatic { static unsigned int calc_parallel_worker_threads(); }; +#ifdef TARGET_ARCH_x86 +# include "vm_version_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vm_version_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vm_version_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif + #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 7a6d3402809..73e8673dddb 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,17 +25,16 @@ #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP -#include "runtime/arguments.hpp" #include "classfile/vmSymbols.hpp" -#include "utilities/ostream.hpp" -#include "runtime/vm_version.hpp" -#include "runtime/vmThread.hpp" +#include "runtime/arguments.hpp" #include "runtime/os.hpp" +#include "runtime/vmThread.hpp" #include "services/diagnosticArgument.hpp" #include "services/diagnosticCommand.hpp" -#include "services/diagnosticFramework.hpp" #include "services/diagnosticCommand_ext.hpp" +#include "services/diagnosticFramework.hpp" #include "utilities/macros.hpp" +#include "utilities/ostream.hpp" class HelpDCmd : public DCmdWithParser { protected: diff --git a/hotspot/src/share/vm/services/diagnosticFramework.hpp b/hotspot/src/share/vm/services/diagnosticFramework.hpp index ca60f53ebc8..4c9fe98da9d 100644 --- a/hotspot/src/share/vm/services/diagnosticFramework.hpp +++ b/hotspot/src/share/vm/services/diagnosticFramework.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ #include "memory/allocation.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" -#include "runtime/vm_version.hpp" #include "runtime/vmThread.hpp" #include "utilities/ostream.hpp" diff --git a/hotspot/src/share/vm/utilities/bytes.hpp b/hotspot/src/share/vm/utilities/bytes.hpp new file mode 100644 index 00000000000..7da269a4775 --- /dev/null +++ b/hotspot/src/share/vm/utilities/bytes.hpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_UTILITIES_BYTES_HPP +#define SHARE_VM_UTILITIES_BYTES_HPP + +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif + +#endif // SHARE_VM_UTILITIES_BYTES_HPP diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 0fc7d6af3a1..58e84e23a16 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -48,6 +48,7 @@ #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" +#include "runtime/vm_version.hpp" #include "services/heapDumper.hpp" #include "utilities/defaultStream.hpp" #include "utilities/events.hpp" diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index 4a807a0662d..59943c4b161 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -28,6 +28,7 @@ #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "utilities/defaultStream.hpp" #include "utilities/ostream.hpp" #include "utilities/top.hpp" diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index d18df9ad4e3..2d2d4284260 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "gc_interface/collectedHeap.hpp" #include "prims/whitebox.hpp" From f429e5b86c1bccd0472d42777b5d98b166cc14e3 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Fri, 11 Jul 2014 12:08:43 +0400 Subject: [PATCH 017/111] 8049198: [macosx] Incorrect thread access when showing splash screen Reviewed-by: serb, pchelko --- .../native/sun/awt/splashscreen/splashscreen_sys.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m index affb6577d64..25b00545a74 100644 --- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m +++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m @@ -45,6 +45,7 @@ #include #include +#import "ThreadUtilities.h" static NSScreen* SplashNSScreen() { @@ -130,8 +131,12 @@ char* SplashGetScaledImageName(const char* jar, const char* file, NSAutoreleasePool *pool = [NSAutoreleasePool new]; *scaleFactor = 1; char* scaledFile = nil; - float screenScaleFactor = [SplashNSScreen() backingScaleFactor]; - + __block float screenScaleFactor = 1; + + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + screenScaleFactor = [SplashNSScreen() backingScaleFactor]; + }]; + if (screenScaleFactor > 1) { NSString *fileName = [NSString stringWithUTF8String: file]; NSUInteger length = [fileName length]; From a3d9307fb978fa1641c43e24c048689e10cb30a4 Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Fri, 11 Jul 2014 12:51:14 +0400 Subject: [PATCH 018/111] 8037511: Tidy warnings cleanup for java.awt - 2d part Reviewed-by: prr --- jdk/src/share/classes/java/awt/Color.java | 4 ++-- jdk/src/share/classes/java/awt/Font.java | 3 +-- jdk/src/share/classes/java/awt/Graphics.java | 4 ++-- jdk/src/share/classes/java/awt/Polygon.java | 4 ++-- jdk/src/share/classes/java/awt/Rectangle.java | 11 +++++------ .../share/classes/java/awt/color/ColorSpace.java | 10 +++++----- .../classes/java/awt/color/ICC_ColorSpace.java | 10 +++++----- .../share/classes/java/awt/font/TextAttribute.java | 2 +- jdk/src/share/classes/java/awt/geom/Arc2D.java | 6 +++--- .../classes/java/awt/image/AffineTransformOp.java | 2 +- .../classes/java/awt/image/BufferedImageFilter.java | 4 ++-- .../share/classes/java/awt/image/ImageFilter.java | 2 +- .../classes/java/awt/image/WritableRaster.java | 4 ++-- .../share/classes/java/awt/print/PrinterJob.java | 1 - jdk/src/share/classes/javax/imageio/package.html | 4 ++-- jdk/src/share/classes/javax/print/Doc.java | 6 +++--- jdk/src/share/classes/javax/print/DocFlavor.java | 13 ++----------- jdk/src/share/classes/javax/print/PrintService.java | 3 +-- .../classes/javax/print/PrintServiceLookup.java | 4 +--- jdk/src/share/classes/javax/print/ServiceUI.java | 5 ++--- .../share/classes/javax/print/ServiceUIFactory.java | 4 ++-- jdk/src/share/classes/javax/print/SimpleDoc.java | 6 +++--- .../javax/print/StreamPrintServiceFactory.java | 6 +++--- .../classes/javax/print/attribute/Attribute.java | 3 +-- .../javax/print/attribute/DateTimeSyntax.java | 3 +-- .../classes/javax/print/attribute/DocAttribute.java | 3 +-- .../javax/print/attribute/DocAttributeSet.java | 3 +-- .../classes/javax/print/attribute/EnumSyntax.java | 3 +-- .../javax/print/attribute/HashAttributeSet.java | 1 - .../javax/print/attribute/HashDocAttributeSet.java | 3 +-- .../print/attribute/HashPrintJobAttributeSet.java | 3 +-- .../attribute/HashPrintRequestAttributeSet.java | 3 +-- .../attribute/HashPrintServiceAttributeSet.java | 3 +-- .../javax/print/attribute/IntegerSyntax.java | 3 +-- .../javax/print/attribute/PrintJobAttribute.java | 3 +-- .../javax/print/attribute/PrintJobAttributeSet.java | 3 +-- .../print/attribute/PrintRequestAttribute.java | 3 +-- .../print/attribute/PrintRequestAttributeSet.java | 3 +-- .../print/attribute/PrintServiceAttribute.java | 3 +-- .../print/attribute/PrintServiceAttributeSet.java | 3 +-- .../javax/print/attribute/ResolutionSyntax.java | 3 +-- .../javax/print/attribute/SetOfIntegerSyntax.java | 3 +-- .../classes/javax/print/attribute/Size2DSyntax.java | 3 +-- .../print/attribute/SupportedValuesAttribute.java | 3 +-- .../classes/javax/print/attribute/TextSyntax.java | 3 +-- .../classes/javax/print/attribute/URISyntax.java | 3 +-- .../classes/javax/print/attribute/package.html | 4 ++-- .../print/attribute/standard/ColorSupported.java | 3 +-- .../javax/print/attribute/standard/Compression.java | 1 - .../print/attribute/standard/CopiesSupported.java | 3 +-- .../attribute/standard/DateTimeAtCompleted.java | 3 +-- .../attribute/standard/DateTimeAtCreation.java | 3 +-- .../attribute/standard/DateTimeAtProcessing.java | 3 +-- .../javax/print/attribute/standard/Destination.java | 3 +-- .../attribute/standard/DialogTypeSelection.java | 5 ++--- .../print/attribute/standard/DocumentName.java | 3 +-- .../print/attribute/standard/JobHoldUntil.java | 3 +-- .../print/attribute/standard/JobImpressions.java | 3 +-- .../attribute/standard/JobImpressionsCompleted.java | 3 +-- .../attribute/standard/JobImpressionsSupported.java | 3 +-- .../javax/print/attribute/standard/JobKOctets.java | 3 +-- .../attribute/standard/JobKOctetsProcessed.java | 3 +-- .../attribute/standard/JobKOctetsSupported.java | 3 +-- .../print/attribute/standard/JobMediaSheets.java | 3 +-- .../attribute/standard/JobMediaSheetsCompleted.java | 3 +-- .../attribute/standard/JobMediaSheetsSupported.java | 3 +-- .../attribute/standard/JobMessageFromOperator.java | 3 +-- .../javax/print/attribute/standard/JobName.java | 3 +-- .../attribute/standard/JobOriginatingUserName.java | 3 +-- .../javax/print/attribute/standard/JobPriority.java | 3 +-- .../attribute/standard/JobPrioritySupported.java | 3 +-- .../javax/print/attribute/standard/JobSheets.java | 1 - .../javax/print/attribute/standard/JobState.java | 3 +-- .../print/attribute/standard/JobStateReason.java | 1 - .../print/attribute/standard/JobStateReasons.java | 1 - .../javax/print/attribute/standard/Media.java | 3 +-- .../javax/print/attribute/standard/MediaSize.java | 3 +-- .../print/attribute/standard/NumberOfDocuments.java | 3 +-- .../attribute/standard/NumberOfInterveningJobs.java | 3 +-- .../print/attribute/standard/NumberUpSupported.java | 3 +-- .../attribute/standard/OrientationRequested.java | 3 +-- .../attribute/standard/OutputDeviceAssigned.java | 3 +-- .../attribute/standard/PDLOverrideSupported.java | 1 - .../print/attribute/standard/PagesPerMinute.java | 3 +-- .../attribute/standard/PagesPerMinuteColor.java | 3 +-- .../attribute/standard/PresentationDirection.java | 3 +-- .../print/attribute/standard/PrintQuality.java | 1 - .../javax/print/attribute/standard/PrinterInfo.java | 3 +-- .../attribute/standard/PrinterIsAcceptingJobs.java | 3 +-- .../print/attribute/standard/PrinterLocation.java | 3 +-- .../attribute/standard/PrinterMakeAndModel.java | 3 +-- .../standard/PrinterMessageFromOperator.java | 3 +-- .../print/attribute/standard/PrinterMoreInfo.java | 3 +-- .../standard/PrinterMoreInfoManufacturer.java | 3 +-- .../javax/print/attribute/standard/PrinterName.java | 3 +-- .../print/attribute/standard/PrinterResolution.java | 3 +-- .../print/attribute/standard/PrinterState.java | 3 +-- .../attribute/standard/PrinterStateReason.java | 1 - .../attribute/standard/PrinterStateReasons.java | 3 +-- .../javax/print/attribute/standard/PrinterURI.java | 3 +-- .../print/attribute/standard/QueuedJobCount.java | 3 +-- .../standard/ReferenceUriSchemesSupported.java | 3 +-- .../attribute/standard/RequestingUserName.java | 3 +-- .../javax/print/attribute/standard/Severity.java | 3 +-- .../print/attribute/standard/SheetCollate.java | 3 +-- .../javax/print/attribute/standard/package.html | 4 ++-- .../share/classes/javax/print/event/package.html | 4 ++-- jdk/src/share/classes/javax/print/package.html | 4 ++-- 108 files changed, 133 insertions(+), 230 deletions(-) diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java index e80e991aa15..3a94d73ac74 100644 --- a/jdk/src/share/classes/java/awt/Color.java +++ b/jdk/src/share/classes/java/awt/Color.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ import java.awt.color.ColorSpace; * see * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html * . - *

    + * * @version 10 Feb 1997 * @author Sami Shaio * @author Arthur van Hoff diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 41d143522dc..d9faf3d3e80 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -542,7 +542,6 @@ public class Font implements java.io.Serializable * compatible alternative, then the font system will map the Font * instance to "Dialog", such that for example, the family as reported * by {@link #getFamily() getFamily} will be "Dialog". - *

    * * @param name the font name. This can be a font face name or a font * family name, and may represent either a logical font or a physical diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java index 4f03e1c61dd..3be860cab31 100644 --- a/jdk/src/share/classes/java/awt/Graphics.java +++ b/jdk/src/share/classes/java/awt/Graphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,7 +151,7 @@ public abstract class Graphics { * is specified by the width and height * arguments. * - *

    + * * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the clipping rectangle. diff --git a/jdk/src/share/classes/java/awt/Polygon.java b/jdk/src/share/classes/java/awt/Polygon.java index e714428c0d1..0d89e6045be 100644 --- a/jdk/src/share/classes/java/awt/Polygon.java +++ b/jdk/src/share/classes/java/awt/Polygon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -351,7 +351,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are inside this * Polygon. - *

    + * * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested * @return {@code true} if this {@code Polygon} contains diff --git a/jdk/src/share/classes/java/awt/Rectangle.java b/jdk/src/share/classes/java/awt/Rectangle.java index d64deaf2f0e..727fe8e7ba8 100644 --- a/jdk/src/share/classes/java/awt/Rectangle.java +++ b/jdk/src/share/classes/java/awt/Rectangle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,14 +41,13 @@ import java.beans.Transient; *

    * * A {@code Rectangle} whose width or height is exactly zero has location - * along those axes with zero dimension, but is otherwise considered empty. + * along those axes with zero dimension, but is otherwise considered empty. * The {@link #isEmpty} method will return true for such a {@code Rectangle}. * Methods which test if an empty {@code Rectangle} contains or intersects * a point or rectangle will always return false if either dimension is zero. * Methods which combine such a {@code Rectangle} with a point or rectangle * will include the location of the {@code Rectangle} on that axis in the * result as if the {@link #add(Point)} method were being called. - * *

    * * A {@code Rectangle} whose width or height is negative has neither @@ -422,7 +421,7 @@ public class Rectangle extends Rectangle2D * Rectangle to the specified * x, y, width, * and height. - *

    + * * @param x the new X coordinate for the upper-left * corner of this Rectangle * @param y the new Y coordinate for the upper-left @@ -488,7 +487,7 @@ public class Rectangle extends Rectangle2D /** * Moves this Rectangle to the specified location. - *

    + * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @deprecated As of JDK version 1.1, @@ -629,7 +628,7 @@ public class Rectangle extends Rectangle2D /** * Sets the size of this Rectangle to the specified * width and height. - *

    + * * @param width the new width for this Rectangle * @param height the new height for this Rectangle * @deprecated As of JDK version 1.1, diff --git a/jdk/src/share/classes/java/awt/color/ColorSpace.java b/jdk/src/share/classes/java/awt/color/ColorSpace.java index ac21273d415..08feedd844e 100644 --- a/jdk/src/share/classes/java/awt/color/ColorSpace.java +++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -388,7 +388,7 @@ public abstract class ColorSpace implements java.io.Serializable { * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. - *

    + * * @param colorvalue a float array with length of at least the number * of components in this ColorSpace * @return a float array of length 3 @@ -412,7 +412,7 @@ public abstract class ColorSpace implements java.io.Serializable { * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. - *

    + * * @param rgbvalue a float array with length of at least 3 * @return a float array with length equal to the number of * components in this ColorSpace @@ -439,7 +439,7 @@ public abstract class ColorSpace implements java.io.Serializable { * that would be measured using current CIE recommended practices. * See the {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of * ICC_ColorSpace for further information. - *

    + * * @param colorvalue a float array with length of at least the number * of components in this ColorSpace * @return a float array of length 3 @@ -467,7 +467,7 @@ public abstract class ColorSpace implements java.io.Serializable { * relative values before being passed to this method. * See the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of * ICC_ColorSpace for further information. - *

    + * * @param colorvalue a float array with length of at least 3 * @return a float array with length equal to the number of * components in this ColorSpace diff --git a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java index ee2ed1a43a5..c64177658f1 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java +++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -149,7 +149,7 @@ public class ICC_ColorSpace extends ColorSpace { * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. - *

    + * * @param colorvalue a float array with length of at least the number * of components in this ColorSpace. * @return a float array of length 3. @@ -201,7 +201,7 @@ public class ICC_ColorSpace extends ColorSpace { * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. - *

    + * * @param rgbvalue a float array with length of at least 3. * @return a float array with length equal to the number of * components in this ColorSpace. @@ -336,7 +336,7 @@ public class ICC_ColorSpace extends ColorSpace { * will result in a measured device XYZ value of D65. This will not * be the same as the media white point tag XYZ value in the ICC * profile for an sRGB device. - *

    + * * @param colorvalue a float array with length of at least the number * of components in this ColorSpace. * @return a float array of length 3. @@ -480,7 +480,7 @@ public class ICC_ColorSpace extends ColorSpace { * will result in a measured device XYZ value of D65. This will not * be the same as the media white point tag XYZ value in the ICC * profile for an sRGB device. - *

    + * * @param colorvalue a float array with length of at least 3. * @return a float array with length equal to the number of * components in this ColorSpace. diff --git a/jdk/src/share/classes/java/awt/font/TextAttribute.java b/jdk/src/share/classes/java/awt/font/TextAttribute.java index 3a7714ba1dd..280e1934693 100644 --- a/jdk/src/share/classes/java/awt/font/TextAttribute.java +++ b/jdk/src/share/classes/java/awt/font/TextAttribute.java @@ -96,7 +96,7 @@ import sun.misc.SharedSecrets; * * *

    Summary of attributes

    - * * diff --git a/jdk/src/share/classes/java/awt/geom/Arc2D.java b/jdk/src/share/classes/java/awt/geom/Arc2D.java index 3d92306f618..be51e8a4bc3 100644 --- a/jdk/src/share/classes/java/awt/geom/Arc2D.java +++ b/jdk/src/share/classes/java/awt/geom/Arc2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,8 @@ import java.io.Serializable; *

    * * The arc is a partial section of a full ellipse which - * inscribes the framing rectangle of its parent {@link RectangularShape}. - * + * inscribes the framing rectangle of its parent {@link RectangularShape}. + * * * The angles are specified relative to the non-square * framing rectangle such that 45 degrees always falls on the line from diff --git a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java index 9e6a66eea5c..d9216606b73 100644 --- a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java +++ b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java @@ -324,7 +324,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp { * this part of the rectangle is not drawn. If the coordinates * of the rectangle are positive then the filtered image is drawn at * that position in the destination Raster. - *

    + * * @param src The Raster to transform. * @param dst The Raster in which to store the results of the * transformation. diff --git a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java index bac63a8f066..e848fd9c206 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,7 +85,7 @@ public class BufferedImageFilter extends ImageFilter implements Cloneable { * an image should avoid calling this method directly since that * operation could result in problems with retrieving the requested * pixels. - *

    + * * @param width the width to which to set the width of this * BufferedImageFilter * @param height the height to which to set the height of this diff --git a/jdk/src/share/classes/java/awt/image/ImageFilter.java b/jdk/src/share/classes/java/awt/image/ImageFilter.java index 33198346e03..04077b6d6a5 100644 --- a/jdk/src/share/classes/java/awt/image/ImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java @@ -225,7 +225,7 @@ public class ImageFilter implements ImageConsumer, Cloneable { * *

  • * Override the method to simply send the data. - * This is appropriate if the filter can handle the request itself — + * This is appropriate if the filter can handle the request itself — * for example, * if the generated pixels have been saved in some sort of buffer. * diff --git a/jdk/src/share/classes/java/awt/image/WritableRaster.java b/jdk/src/share/classes/java/awt/image/WritableRaster.java index 6ad950288ee..65ff74aa4f9 100644 --- a/jdk/src/share/classes/java/awt/image/WritableRaster.java +++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -394,7 +394,7 @@ public class WritableRaster extends Raster { * is first converted to a 32-bit int (if necessary), using the above * rules for integral types, and then the int is cast to float or * double. - *

    + * * @param srcRaster The Raster from which to copy pixels. * * @throws NullPointerException if srcRaster is null. diff --git a/jdk/src/share/classes/java/awt/print/PrinterJob.java b/jdk/src/share/classes/java/awt/print/PrinterJob.java index 0c80d1490d4..41d39ce10ec 100644 --- a/jdk/src/share/classes/java/awt/print/PrinterJob.java +++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java @@ -546,7 +546,6 @@ public abstract class PrinterJob { * user settings returned from * printDialog(PrintRequestAttributeSet attributes to * this print() method. - *

    * * @param attributes a set of attributes for the job * @exception PrinterException an error in the print system diff --git a/jdk/src/share/classes/javax/imageio/package.html b/jdk/src/share/classes/javax/imageio/package.html index f0927fa147b..f8254b11284 100644 --- a/jdk/src/share/classes/javax/imageio/package.html +++ b/jdk/src/share/classes/javax/imageio/package.html @@ -131,8 +131,8 @@ standard plug-ins.

  • the number of bands is 1;
  • the number of bits per sample is not greater than 8;
  • the size of a color component is not greater than 8; -

    - + +

    By default the GIF writer plug-in creates version "89a" images. This can be changed to "87a" by explicitly setting the version in the diff --git a/jdk/src/share/classes/javax/print/Doc.java b/jdk/src/share/classes/javax/print/Doc.java index d28a3e565ef..873aac594a6 100644 --- a/jdk/src/share/classes/javax/print/Doc.java +++ b/jdk/src/share/classes/javax/print/Doc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -168,7 +168,7 @@ public interface Doc { * from the print data representation object. * However, if the print data representation object is itself a Reader, * then the print data representation object is simply returned. - *

    + * * @return Reader for reading the print data characters from this doc. * If a reader cannot be provided because this doc does not meet * the criteria stated above, null is returned. @@ -192,7 +192,7 @@ public interface Doc { * object as a stream of bytes is created and returned. However, if the * print data representation object is itself an input stream, then the * print data representation object is simply returned. - *

    + * * @return Input stream for reading the print data bytes from this doc. If * an input stream cannot be provided because this doc does not * meet the criteria stated above, null is returned. diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java index eac9d38954d..cb00e00753b 100644 --- a/jdk/src/share/classes/javax/print/DocFlavor.java +++ b/jdk/src/share/classes/javax/print/DocFlavor.java @@ -381,7 +381,6 @@ import java.io.Serializable; *

  • * A line feed (LF) character standing by itself means * "go to column 1 of the next line." - *
  • * *

    * The client must itself perform all plain text print data formatting not @@ -436,7 +435,6 @@ import java.io.Serializable; * Java Print Service instance supports without having * to load the representation classes, which may be problematic for * limited-resource clients. - *

    * * @author Alan Kaminsky */ @@ -536,7 +534,7 @@ public class DocFlavor implements Serializable, Cloneable { * The charset for text types is a commonly useful example. * This convenience method will return the value of the specified * parameter if one was specified in the mime type for this flavor. - *

    + * * @param paramName the name of the paramater. This name is internally * converted to the canonical lower case format before performing * the match. @@ -638,7 +636,6 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.BYTE_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a byte array * (byte[]) as the print data representation class. - *

    * * @author Alan Kaminsky */ @@ -836,7 +833,6 @@ public class DocFlavor implements Serializable, Cloneable { * DocFlavor objects for example doc flavors using a byte stream ({@link * java.io.InputStream java.io.InputStream}) as the print * data representation class. - *

    * * @author Alan Kaminsky */ @@ -1038,8 +1034,7 @@ public class DocFlavor implements Serializable, Cloneable { * objects. * For example doc flavors using a Uniform Resource Locator ({@link * java.net.URL java.net.URL}) as the print data - * representation class. - *

    + * representation class. * * @author Alan Kaminsky */ @@ -1229,7 +1224,6 @@ public class DocFlavor implements Serializable, Cloneable { * DocFlavor objects for example doc flavors using a character array * (char[]) as the print data representation class. As such, * the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1279,7 +1273,6 @@ public class DocFlavor implements Serializable, Cloneable { * objects for example doc flavors using a string ({@link java.lang.String * java.lang.String}) as the print data representation class. * As such, the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1327,7 +1320,6 @@ public class DocFlavor implements Serializable, Cloneable { * objects for example doc flavors using a character stream ({@link * java.io.Reader java.io.Reader}) as the print data * representation class. As such, the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1376,7 +1368,6 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant * DocFlavor objects for example doc flavors for service formatted print * data. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/PrintService.java b/jdk/src/share/classes/javax/print/PrintService.java index f52eb72a0d2..a003e730880 100644 --- a/jdk/src/share/classes/javax/print/PrintService.java +++ b/jdk/src/share/classes/javax/print/PrintService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -327,7 +327,6 @@ public interface PrintService { * that indicates bounds on the legal values -- used, for example, by an * integer-valued attribute that must lie within a certain range. * - *

    * * @param category Printing attribute category to test. It must be a * {@link java.lang.Class Class} that implements diff --git a/jdk/src/share/classes/javax/print/PrintServiceLookup.java b/jdk/src/share/classes/javax/print/PrintServiceLookup.java index aece5d1205a..70695a995f8 100644 --- a/jdk/src/share/classes/javax/print/PrintServiceLookup.java +++ b/jdk/src/share/classes/javax/print/PrintServiceLookup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -199,7 +199,6 @@ public abstract class PrintServiceLookup { * available that is not part of the installation. * If the lookup service is already registered, or cannot be registered, * the method returns false. - *

    * * @param sp an implementation of a lookup service. * @return true if the new lookup service is newly @@ -305,7 +304,6 @@ public abstract class PrintServiceLookup { *

    * Locates MultiDoc print services which can be positively confirmed * to support the combination of attributes and DocFlavors specified. - *

    * * @param flavors of documents required. If null or empty it is ignored. * @param attributes required to be supported. If null this diff --git a/jdk/src/share/classes/javax/print/ServiceUI.java b/jdk/src/share/classes/javax/print/ServiceUI.java index 20b23611ed1..c6ba370a064 100644 --- a/jdk/src/share/classes/javax/print/ServiceUI.java +++ b/jdk/src/share/classes/javax/print/ServiceUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,8 +131,7 @@ public class ServiceUI { * } * } * } - *

    - + * * @param gc used to select screen. null means primary or default screen. * @param x location of dialog including border in screen coordinates * @param y location of dialog including border in screen coordinates diff --git a/jdk/src/share/classes/javax/print/ServiceUIFactory.java b/jdk/src/share/classes/javax/print/ServiceUIFactory.java index d293a8cadc7..06deb02e5e8 100644 --- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java +++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,7 @@ public abstract class ServiceUIFactory { /** * Get a UI object which may be cast to the requested UI type * by the application and used in its user interface. - *

    + * * @param role requested. Must be one of the standard roles or * a private role supported by this factory. * @param ui type in which the role is requested. diff --git a/jdk/src/share/classes/javax/print/SimpleDoc.java b/jdk/src/share/classes/javax/print/SimpleDoc.java index 3cf0d779086..f73d794f76b 100644 --- a/jdk/src/share/classes/javax/print/SimpleDoc.java +++ b/jdk/src/share/classes/javax/print/SimpleDoc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -176,7 +176,7 @@ public final class SimpleDoc implements Doc { * However, if the print data representation object is itself a * Reader then the print data representation object is * simply returned. - *

    + * * @return a Reader for reading the print data * characters from this doc. * If a reader cannot be provided because this doc does not meet @@ -224,7 +224,7 @@ public final class SimpleDoc implements Doc { * However, if the print data representation object is itself an * input stream then the print data representation object is simply * returned. - *

    + * * @return an InputStream for reading the print data * bytes from this doc. If an input stream cannot be * provided because this doc does not meet diff --git a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java index dfa91a70fcb..f1f7f28c410 100644 --- a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java +++ b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,7 @@ public abstract class StreamPrintServiceFactory { * Although null is an acceptable value to use in the lookup of stream * printing services, it's typical to search for a particular * desired format, such as Postscript(TM). - *

    + * * @param flavor of the input document type - null means match all * types. * @param outputMimeType representing the required output format, used to @@ -153,7 +153,7 @@ public abstract class StreamPrintServiceFactory { * Implementations which allocate resources on construction should examine * the stream and may wish to only allocate resources if the stream is * non-null. - *

    + * * @param out destination stream for generated output. * @return a PrintService which will generate the format specified by the * DocFlavor supported by this Factory. diff --git a/jdk/src/share/classes/javax/print/attribute/Attribute.java b/jdk/src/share/classes/javax/print/attribute/Attribute.java index 5226f9cb80d..a6c58e6f933 100644 --- a/jdk/src/share/classes/javax/print/attribute/Attribute.java +++ b/jdk/src/share/classes/javax/print/attribute/Attribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ import java.io.Serializable; * Interface Attribute is the base interface implemented by any and every * printing attribute class to indicate that the class represents a * printing attribute. All printing attributes are serializable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java index d78c8f2004a..72e583a0347 100644 --- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,6 @@ import java.util.Date; * rather than a java.util.Calendar because it typically takes * less memory to store and less time to compare a java.util.Date * than a java.util.Calendar. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java index e99c09d6bcb..994208f0a9e 100644 --- a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ package javax.print.attribute; * PrintRequestAttribute} as well as DocAttribute, the client may include the * attribute in a attribute set which specifies a print job * to specify a characteristic for all the docs in that job. - *

    * * @see DocAttributeSet * @see PrintRequestAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java index b4482d2e455..bacc1074f2c 100644 --- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java index 85ee7d8b402..f774066e592 100644 --- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,7 +102,6 @@ import java.io.Serializable; * uses some of the same integer values as the superclass. However, the * application in which the enumeration class and subclass are used may need to * have distinct integer values in the superclass and subclass. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java index 7956794d304..e4928a8196d 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java @@ -34,7 +34,6 @@ import java.util.HashMap; /** * Class HashAttributeSet provides an AttributeSet * implementation with characteristics of a hash map. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java index d4bc20e27d3..0b915ba2ca9 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface {@link * DocAttributeSet DocAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java index 980693694e6..f39c85883d5 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * which inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface * {@link PrintJobAttributeSet PrintJobAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java index 53708f0259c..fde4ebb6945 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * class {@link HashAttributeSet HashAttributeSet} and enforces the * semantic restrictions of interface * {@link PrintRequestAttributeSet PrintRequestAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java index 64e5b9e48f3..d98430d0d75 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ import java.io.Serializable; * which inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface * {@link PrintServiceAttributeSet PrintServiceAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java index 7675a8327e7..1fbd3b2556d 100644 --- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,6 @@ import java.io.Serializable; * established when it is constructed (see {@link #IntegerSyntax(int) * IntegerSyntax(int)}). Once constructed, an integer attribute's * value is immutable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java index af8258090ba..ad9a0d7217a 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,6 @@ package javax.print.attribute; * PrintRequestAttribute PrintRequestAttribute} as well as PrintJobAttribute, * the client may include the attribute in a attribute set to * specify the attribute's value for the Print Job. - *

    * * @see PrintRequestAttributeSet * @see PrintJobAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java index 5bce73513e9..4c920a1b48a 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java index 78fe37ccb76..48249480e60 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ package javax.print.attribute; * as well as PrintRequestAttribute, the client may include the * attribute in a Doc}'s attribute set to specify * a job setting which pertains just to that doc. - *

    * * @see DocAttributeSet * @see PrintRequestAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java index eac683b194c..bde6c0cce8b 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java index 8ac2b656d18..f09b38870ed 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ package javax.print.attribute; * of a Print Service or some other characteristic of a Print Service. A Print * Service instance adds a number of PrintServiceAttributes to a Print * service's attribute set to report the Print Service's status. - *

    * * @see PrintServiceAttributeSet * diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java index badde734218..3d3296ed405 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java index 1089381d1c6..7e9c40835b5 100644 --- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,6 @@ import java.io.Serializable; * mind, there is no guarantee that the conversion factor for the client's units * will be an exact integer. If the conversion factor isn't an exact integer, * resolution values in the client's units won't be stored precisely. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java index 0aed773fe6e..8ba9303135a 100644 --- a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,6 @@ import java.util.Vector; * Class SetOfIntegerSyntax has operations to return the set's members in * canonical array form, to test whether a given integer is a member of the * set, and to iterate through the members of the set. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java index 0f6a5dfe6c4..76832508c94 100644 --- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,6 @@ import java.io.Serializable; * client's units will be an exact integer. If the conversion factor isn't an * exact integer, resolution values in the client's units won't be stored * precisely. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java index 61e4bd57e62..ca8736b1315 100644 --- a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ package javax.print.attribute; * which is a SupportedValuesAttribute giving the legal values a client may * specify for the {@link javax.print.attribute.standard.Copies Copies} * attribute. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java index 20e27fa314f..7b91de24d0f 100644 --- a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,6 @@ import java.util.Locale; * includes a locale to indicate the natural language. Thus, a text attribute * always represents a localized string. Once constructed, a text attribute's * value is immutable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/URISyntax.java b/jdk/src/share/classes/javax/print/attribute/URISyntax.java index 118b1c0cd8d..770ba8a9592 100644 --- a/jdk/src/share/classes/javax/print/attribute/URISyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/URISyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.net.URI; * Class URISyntax is an abstract base class providing the common * implementation of all attributes whose value is a Uniform Resource * Identifier (URI). Once constructed, a URI attribute's value is immutable. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/package.html b/jdk/src/share/classes/javax/print/attribute/package.html index fa9851655a8..aeedb0df2c2 100644 --- a/jdk/src/share/classes/javax/print/attribute/package.html +++ b/jdk/src/share/classes/javax/print/attribute/package.html @@ -3,7 +3,7 @@ javax.print.attribute package True has no effect for the serializer + private final static int INFOSET = 0x1 << 7; + + // Parameter namespaces, true [required] (default) + private final static int NAMESPACES = 0x1 << 8; + + // Parameter namespace-declarations, true [required] (default) + private final static int NAMESPACEDECLS = 0x1 << 9; + + // Parameter normalize-characters, true [optional] - NOT SUPPORTED + private final static int NORMALIZECHARS = 0x1 << 10; + + // Parameter split-cdata-sections, true [required] (default) + private final static int SPLITCDATA = 0x1 << 11; + + // Parameter validate, true [optional] - NOT SUPPORTED + private final static int VALIDATE = 0x1 << 12; + + // Parameter validate-if-schema, true [optional] - NOT SUPPORTED + private final static int SCHEMAVALIDATE = 0x1 << 13; + + // Parameter split-cdata-sections, true [required] (default) + private final static int WELLFORMED = 0x1 << 14; + + // Parameter discard-default-content, true [required] (default) + // Not sure how this will be used in level 2 Documents + private final static int DISCARDDEFAULT = 0x1 << 15; + + // Parameter format-pretty-print, true [optional] + private final static int PRETTY_PRINT = 0x1 << 16; + + // Parameter ignore-unknown-character-denormalizations, true [required] (default) + // We currently do not support XML 1.1 character normalization + private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17; + + // Parameter discard-default-content, true [required] (default) + private final static int XMLDECL = 0x1 << 18; + + /** + * Constructor. + * @param contentHandler serialHandler The implemention of the SerializationHandler interface + */ + DOM3TreeWalker( + SerializationHandler serialHandler, + DOMErrorHandler errHandler, + LSSerializerFilter filter, + String newLine) { + fSerializer = serialHandler; + //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default? + fErrorHandler = errHandler; + fFilter = filter; + fLexicalHandler = null; + fNewLine = newLine; + + fNSBinder = new NamespaceSupport(); + fLocalNSBinder = new NamespaceSupport(); + + fDOMConfigProperties = fSerializer.getOutputFormat(); + fSerializer.setDocumentLocator(fLocator); + initProperties(fDOMConfigProperties); + + try { + // Bug see Bugzilla 26741 + fLocator.setSystemId( + System.getProperty("user.dir") + File.separator + "dummy.xsl"); + } catch (SecurityException se) { // user.dir not accessible from applet + + } + } + + /** + * Perform a pre-order traversal non-recursive style. + * + * Note that TreeWalker assumes that the subtree is intended to represent + * a complete (though not necessarily well-formed) document and, during a + * traversal, startDocument and endDocument will always be issued to the + * SAX listener. + * + * @param pos Node in the tree where to start traversal + * + * @throws TransformerException + */ + public void traverse(Node pos) throws org.xml.sax.SAXException { + this.fSerializer.startDocument(); + + // Determine if the Node is a DOM Level 3 Core Node. + if (pos.getNodeType() != Node.DOCUMENT_NODE) { + Document ownerDoc = pos.getOwnerDocument(); + if (ownerDoc != null + && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } else { + if (((Document) pos) + .getImplementation() + .hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } + + if (fSerializer instanceof LexicalHandler) { + fLexicalHandler = ((LexicalHandler) this.fSerializer); + } + + if (fFilter != null) + fWhatToShowFilter = fFilter.getWhatToShow(); + + Node top = pos; + + while (null != pos) { + startNode(pos); + + Node nextNode = null; + + nextNode = pos.getFirstChild(); + + while (null == nextNode) { + endNode(pos); + + if (top.equals(pos)) + break; + + nextNode = pos.getNextSibling(); + + if (null == nextNode) { + pos = pos.getParentNode(); + + if ((null == pos) || (top.equals(pos))) { + if (null != pos) + endNode(pos); + + nextNode = null; + + break; + } + } + } + + pos = nextNode; + } + this.fSerializer.endDocument(); + } + + /** + * Perform a pre-order traversal non-recursive style. + + * Note that TreeWalker assumes that the subtree is intended to represent + * a complete (though not necessarily well-formed) document and, during a + * traversal, startDocument and endDocument will always be issued to the + * SAX listener. + * + * @param pos Node in the tree where to start traversal + * @param top Node in the tree where to end traversal + * + * @throws TransformerException + */ + public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { + + this.fSerializer.startDocument(); + + // Determine if the Node is a DOM Level 3 Core Node. + if (pos.getNodeType() != Node.DOCUMENT_NODE) { + Document ownerDoc = pos.getOwnerDocument(); + if (ownerDoc != null + && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } else { + if (((Document) pos) + .getImplementation() + .hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } + + if (fSerializer instanceof LexicalHandler) { + fLexicalHandler = ((LexicalHandler) this.fSerializer); + } + + if (fFilter != null) + fWhatToShowFilter = fFilter.getWhatToShow(); + + while (null != pos) { + startNode(pos); + + Node nextNode = null; + + nextNode = pos.getFirstChild(); + + while (null == nextNode) { + endNode(pos); + + if ((null != top) && top.equals(pos)) + break; + + nextNode = pos.getNextSibling(); + + if (null == nextNode) { + pos = pos.getParentNode(); + + if ((null == pos) || ((null != top) && top.equals(pos))) { + nextNode = null; + + break; + } + } + } + + pos = nextNode; + } + this.fSerializer.endDocument(); + } + + /** + * Optimized dispatch of characters. + */ + private final void dispatachChars(Node node) + throws org.xml.sax.SAXException { + if (fSerializer != null) { + this.fSerializer.characters(node); + } else { + String data = ((Text) node).getData(); + this.fSerializer.characters(data.toCharArray(), 0, data.length()); + } + } + + /** + * Start processing given node + * + * @param node Node to process + * + * @throws org.xml.sax.SAXException + */ + protected void startNode(Node node) throws org.xml.sax.SAXException { + if (node instanceof Locator) { + Locator loc = (Locator) node; + fLocator.setColumnNumber(loc.getColumnNumber()); + fLocator.setLineNumber(loc.getLineNumber()); + fLocator.setPublicId(loc.getPublicId()); + fLocator.setSystemId(loc.getSystemId()); + } else { + fLocator.setColumnNumber(0); + fLocator.setLineNumber(0); + } + + switch (node.getNodeType()) { + case Node.DOCUMENT_TYPE_NODE : + serializeDocType((DocumentType) node, true); + break; + case Node.COMMENT_NODE : + serializeComment((Comment) node); + break; + case Node.DOCUMENT_FRAGMENT_NODE : + // Children are traversed + break; + case Node.DOCUMENT_NODE : + break; + case Node.ELEMENT_NODE : + serializeElement((Element) node, true); + break; + case Node.PROCESSING_INSTRUCTION_NODE : + serializePI((ProcessingInstruction) node); + break; + case Node.CDATA_SECTION_NODE : + serializeCDATASection((CDATASection) node); + break; + case Node.TEXT_NODE : + serializeText((Text) node); + break; + case Node.ENTITY_REFERENCE_NODE : + serializeEntityReference((EntityReference) node, true); + break; + default : + } + } + + /** + * End processing of given node + * + * + * @param node Node we just finished processing + * + * @throws org.xml.sax.SAXException + */ + protected void endNode(Node node) throws org.xml.sax.SAXException { + + switch (node.getNodeType()) { + case Node.DOCUMENT_NODE : + break; + case Node.DOCUMENT_TYPE_NODE : + serializeDocType((DocumentType) node, false); + break; + case Node.ELEMENT_NODE : + serializeElement((Element) node, false); + break; + case Node.CDATA_SECTION_NODE : + break; + case Node.ENTITY_REFERENCE_NODE : + serializeEntityReference((EntityReference) node, false); + break; + default : + } + } + + // *********************************************************************** + // Node serialization methods + // *********************************************************************** + /** + * Applies a filter on the node to serialize + * + * @param node The Node to serialize + * @return True if the node is to be serialized else false if the node + * is to be rejected or skipped. + */ + protected boolean applyFilter(Node node, int nodeType) { + if (fFilter != null && (fWhatToShowFilter & nodeType) != 0) { + + short code = fFilter.acceptNode(node); + switch (code) { + case NodeFilter.FILTER_REJECT : + case NodeFilter.FILTER_SKIP : + return false; // skip the node + default : // fall through.. + } + } + return true; + } + + /** + * Serializes a Document Type Node. + * + * @param node The Docuemnt Type Node to serialize + * @param bStart Invoked at the start or end of node. Default true. + */ + protected void serializeDocType(DocumentType node, boolean bStart) + throws SAXException { + // The DocType and internalSubset can not be modified in DOM and is + // considered to be well-formed as the outcome of successful parsing. + String docTypeName = node.getNodeName(); + String publicId = node.getPublicId(); + String systemId = node.getSystemId(); + String internalSubset = node.getInternalSubset(); + + //DocumentType nodes are never passed to the filter + + if (internalSubset != null && !"".equals(internalSubset)) { + + if (bStart) { + try { + // The Serializer does not provide a way to write out the + // DOCTYPE internal subset via an event call, so we write it + // out here. + Writer writer = fSerializer.getWriter(); + StringBuffer dtd = new StringBuffer(); + + dtd.append(""); + dtd.append(fNewLine); + + writer.write(dtd.toString()); + writer.flush(); + + } catch (IOException e) { + throw new SAXException(Utils.messages.createMessage( + MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); + } + } // else if !bStart do nothing + + } else { + + if (bStart) { + if (fLexicalHandler != null) { + fLexicalHandler.startDTD(docTypeName, publicId, systemId); + } + } else { + if (fLexicalHandler != null) { + fLexicalHandler.endDTD(); + } + } + } + } + + /** + * Serializes a Comment Node. + * + * @param node The Comment Node to serialize + */ + protected void serializeComment(Comment node) throws SAXException { + // comments=true + if ((fFeatures & COMMENTS) != 0) { + String data = node.getData(); + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isCommentWellFormed(data); + } + + if (fLexicalHandler != null) { + // apply the LSSerializer filter after the operations requested by the + // DOMConfiguration parameters have been applied + if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) { + return; + } + + fLexicalHandler.comment(data.toCharArray(), 0, data.length()); + } + } + } + + /** + * Serializes an Element Node. + * + * @param node The Element Node to serialize + * @param bStart Invoked at the start or end of node. + */ + protected void serializeElement(Element node, boolean bStart) + throws SAXException { + if (bStart) { + fElementDepth++; + + // We use the Xalan specific startElement and starPrefixMapping calls + // (and addAttribute and namespaceAfterStartElement) as opposed to + // SAX specific, for performance reasons as they reduce the overhead + // of creating an AttList object upfront. + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isElementWellFormed(node); + } + + // REVISIT: We apply the LSSerializer filter for elements before + // namesapce fixup + if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { + return; + } + + // namespaces=true, record and fixup namspaced element + if ((fFeatures & NAMESPACES) != 0) { + fNSBinder.pushContext(); + fLocalNSBinder.reset(); + + recordLocalNSDecl(node); + fixupElementNS(node); + } + + // Namespace normalization + fSerializer.startElement( + node.getNamespaceURI(), + node.getLocalName(), + node.getNodeName()); + + serializeAttList(node); + + } else { + fElementDepth--; + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { + return; + } + + this.fSerializer.endElement( + node.getNamespaceURI(), + node.getLocalName(), + node.getNodeName()); + // since endPrefixMapping was not used by SerializationHandler it was removed + // for performance reasons. + + if ((fFeatures & NAMESPACES) != 0 ) { + fNSBinder.popContext(); + } + + } + } + + /** + * Serializes the Attr Nodes of an Element. + * + * @param node The OwnerElement whose Attr Nodes are to be serialized. + */ + protected void serializeAttList(Element node) throws SAXException { + NamedNodeMap atts = node.getAttributes(); + int nAttrs = atts.getLength(); + + for (int i = 0; i < nAttrs; i++) { + Node attr = atts.item(i); + + String localName = attr.getLocalName(); + String attrName = attr.getNodeName(); + String attrPrefix = attr.getPrefix() == null ? "" : attr.getPrefix(); + String attrValue = attr.getNodeValue(); + + // Determine the Attr's type. + String type = null; + if (fIsLevel3DOM) { + type = ((Attr) attr).getSchemaTypeInfo().getTypeName(); + } + type = type == null ? "CDATA" : type; + + String attrNS = attr.getNamespaceURI(); + if (attrNS !=null && attrNS.length() == 0) { + attrNS=null; + // we must remove prefix for this attribute + attrName=attr.getLocalName(); + } + + boolean isSpecified = ((Attr) attr).getSpecified(); + boolean addAttr = true; + boolean applyFilter = false; + boolean xmlnsAttr = + attrName.equals("xmlns") || attrName.startsWith("xmlns:"); + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isAttributeWellFormed(attr); + } + + //----------------------------------------------------------------- + // start Attribute namespace fixup + //----------------------------------------------------------------- + // namespaces=true, normalize all non-namespace attributes + // Step 3. Attribute + if ((fFeatures & NAMESPACES) != 0 && !xmlnsAttr) { + + // If the Attr has a namespace URI + if (attrNS != null) { + attrPrefix = attrPrefix == null ? "" : attrPrefix; + + String declAttrPrefix = fNSBinder.getPrefix(attrNS); + String declAttrNS = fNSBinder.getURI(attrPrefix); + + // attribute has no prefix (default namespace decl does not apply to + // attributes) + // OR + // attribute prefix is not declared + // OR + // conflict: attribute has a prefix that conflicts with a binding + if ("".equals(attrPrefix) || "".equals(declAttrPrefix) + || !attrPrefix.equals(declAttrPrefix)) { + + // namespaceURI matches an in scope declaration of one or + // more prefixes + if (declAttrPrefix != null && !"".equals(declAttrPrefix)) { + // pick the prefix that was found and change attribute's + // prefix and nodeName. + attrPrefix = declAttrPrefix; + + if (declAttrPrefix.length() > 0 ) { + attrName = declAttrPrefix + ":" + localName; + } else { + attrName = localName; + } + } else { + // The current prefix is not null and it has no in scope + // declaration + if (attrPrefix != null && !"".equals(attrPrefix) + && declAttrNS == null) { + // declare this prefix + if ((fFeatures & NAMESPACEDECLS) != 0) { + fSerializer.addAttribute(XMLNS_URI, attrPrefix, + XMLNS_PREFIX + ":" + attrPrefix, "CDATA", + attrNS); + fNSBinder.declarePrefix(attrPrefix, attrNS); + fLocalNSBinder.declarePrefix(attrPrefix, attrNS); + } + } else { + // find a prefix following the pattern "NS" +index + // (starting at 1) + // make sure this prefix is not declared in the current + // scope. + int counter = 1; + attrPrefix = "NS" + counter++; + + while (fLocalNSBinder.getURI(attrPrefix) != null) { + attrPrefix = "NS" + counter++; + } + // change attribute's prefix and Name + attrName = attrPrefix + ":" + localName; + + // create a local namespace declaration attribute + // Add the xmlns declaration attribute + if ((fFeatures & NAMESPACEDECLS) != 0) { + + fSerializer.addAttribute(XMLNS_URI, attrPrefix, + XMLNS_PREFIX + ":" + attrPrefix, "CDATA", + attrNS); + fNSBinder.declarePrefix(attrPrefix, attrNS); + fLocalNSBinder.declarePrefix(attrPrefix, attrNS); + } + } + } + } + + } else { // if the Attr has no namespace URI + // Attr has no localName + if (localName == null) { + // DOM Level 1 node! + String msg = Utils.messages.createMessage( + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + new Object[] { attrName }); + + if (fErrorHandler != null) { + fErrorHandler + .handleError(new DOMErrorImpl( + DOMError.SEVERITY_ERROR, msg, + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null, + null, null)); + } + + } else { // uri=null and no colon + // attr has no namespace URI and no prefix + // no action is required, since attrs don't use default + } + } + + } + + + // discard-default-content=true + // Default attr's are not passed to the filter and this contraint + // is applied only when discard-default-content=true + // What about default xmlns attributes???? check for xmlnsAttr + if ((((fFeatures & DISCARDDEFAULT) != 0) && isSpecified) + || ((fFeatures & DISCARDDEFAULT) == 0)) { + applyFilter = true; + } else { + addAttr = false; + } + + if (applyFilter) { + // apply the filter for Attributes that are not default attributes + // or namespace decl attributes + if (fFilter != null + && (fFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE) + != 0) { + + if (!xmlnsAttr) { + short code = fFilter.acceptNode(attr); + switch (code) { + case NodeFilter.FILTER_REJECT : + case NodeFilter.FILTER_SKIP : + addAttr = false; + break; + default : //fall through.. + } + } + } + } + + // if the node is a namespace node + if (addAttr && xmlnsAttr) { + // If namespace-declarations=true, add the node , else don't add it + if ((fFeatures & NAMESPACEDECLS) != 0) { + // The namespace may have been fixed up, in that case don't add it. + if (localName != null && !"".equals(localName)) { + fSerializer.addAttribute(attrNS, localName, attrName, type, attrValue); + } + } + } else if ( + addAttr && !xmlnsAttr) { // if the node is not a namespace node + // If namespace-declarations=true, add the node with the Attr nodes namespaceURI + // else add the node setting it's namespace to null or else the serializer will later + // attempt to add a xmlns attr for the prefixed attribute + if (((fFeatures & NAMESPACEDECLS) != 0) && (attrNS != null)) { + fSerializer.addAttribute( + attrNS, + localName, + attrName, + type, + attrValue); + } else { + fSerializer.addAttribute( + "", + localName, + attrName, + type, + attrValue); + } + } + + // + if (xmlnsAttr && ((fFeatures & NAMESPACEDECLS) != 0)) { + int index; + // Use "" instead of null, as Xerces likes "" for the + // name of the default namespace. Fix attributed + // to "Steven Murray" . + String prefix = + (index = attrName.indexOf(":")) < 0 + ? "" + : attrName.substring(index + 1); + + if (!"".equals(prefix)) { + fSerializer.namespaceAfterStartElement(prefix, attrValue); + } + } + } + + } + + /** + * Serializes an ProcessingInstruction Node. + * + * @param node The ProcessingInstruction Node to serialize + */ + protected void serializePI(ProcessingInstruction node) + throws SAXException { + ProcessingInstruction pi = node; + String name = pi.getNodeName(); + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isPIWellFormed(node); + } + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) { + return; + } + + // String data = pi.getData(); + if (name.equals("xslt-next-is-raw")) { + fNextIsRaw = true; + } else { + this.fSerializer.processingInstruction(name, pi.getData()); + } + } + + /** + * Serializes an CDATASection Node. + * + * @param node The CDATASection Node to serialize + */ + protected void serializeCDATASection(CDATASection node) + throws SAXException { + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isCDATASectionWellFormed(node); + } + + // cdata-sections = true + if ((fFeatures & CDATA) != 0) { + + // split-cdata-sections = true + // Assumption: This parameter has an effect only when + // cdata-sections=true + // ToStream, by default splits cdata-sections. Hence the check + // below. + String nodeValue = node.getNodeValue(); + int endIndex = nodeValue.indexOf("]]>"); + if ((fFeatures & SPLITCDATA) != 0) { + if (endIndex >= 0) { + // The first node split will contain the ]] markers + String relatedData = nodeValue.substring(0, endIndex + 2); + + String msg = + Utils.messages.createMessage( + MsgKey.ER_CDATA_SECTIONS_SPLIT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_WARNING, + msg, + MsgKey.ER_CDATA_SECTIONS_SPLIT, + null, + relatedData, + null)); + } + } + } else { + if (endIndex >= 0) { + // The first node split will contain the ]] markers + String relatedData = nodeValue.substring(0, endIndex + 2); + + String msg = + Utils.messages.createMessage( + MsgKey.ER_CDATA_SECTIONS_SPLIT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_ERROR, + msg, + MsgKey.ER_CDATA_SECTIONS_SPLIT)); + } + // Report an error and return. What error??? + return; + } + } + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_CDATA_SECTION)) { + return; + } + + // splits the cdata-section + if (fLexicalHandler != null) { + fLexicalHandler.startCDATA(); + } + dispatachChars(node); + if (fLexicalHandler != null) { + fLexicalHandler.endCDATA(); + } + } else { + dispatachChars(node); + } + } + + /** + * Serializes an Text Node. + * + * @param node The Text Node to serialize + */ + protected void serializeText(Text node) throws SAXException { + if (fNextIsRaw) { + fNextIsRaw = false; + fSerializer.processingInstruction( + javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, + ""); + dispatachChars(node); + fSerializer.processingInstruction( + javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, + ""); + } else { + // keep track of dispatch or not to avoid duplicaiton of filter code + boolean bDispatch = false; + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isTextWellFormed(node); + } + + // if the node is whitespace + // Determine the Attr's type. + boolean isElementContentWhitespace = false; + if (fIsLevel3DOM) { + isElementContentWhitespace = + node.isElementContentWhitespace(); + } + + if (isElementContentWhitespace) { + // element-content-whitespace=true + if ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) { + bDispatch = true; + } + } else { + bDispatch = true; + } + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_TEXT)) { + return; + } + + if (bDispatch) { + dispatachChars(node); + } + } + } + + /** + * Serializes an EntityReference Node. + * + * @param node The EntityReference Node to serialize + * @param bStart Inicates if called from start or endNode + */ + protected void serializeEntityReference( + EntityReference node, + boolean bStart) + throws SAXException { + if (bStart) { + EntityReference eref = node; + // entities=true + if ((fFeatures & ENTITIES) != 0) { + + // perform well-formedness and other checking only if + // entities = true + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isEntityReferneceWellFormed(node); + } + + // check "unbound-prefix-in-entity-reference" [fatal] + // Raised if the configuration parameter "namespaces" is set to true + if ((fFeatures & NAMESPACES) != 0) { + checkUnboundPrefixInEntRef(node); + } + + // The filter should not apply in this case, since the + // EntityReference is not being expanded. + // should we pass entity reference nodes to the filter??? + } + + if (fLexicalHandler != null) { + + // startEntity outputs only Text but not Element, Attr, Comment + // and PI child nodes. It does so by setting the m_inEntityRef + // in ToStream and using this to decide if a node is to be + // serialized or not. + fLexicalHandler.startEntity(eref.getNodeName()); + } + + } else { + EntityReference eref = node; + // entities=true or false, + if (fLexicalHandler != null) { + fLexicalHandler.endEntity(eref.getNodeName()); + } + } + } + + + // *********************************************************************** + // Methods to check well-formedness + // *********************************************************************** + /** + * Taken from org.apache.xerces.dom.CoreDocumentImpl + * + * Check the string against XML's definition of acceptable names for + * elements and attributes and so on using the XMLCharacterProperties + * utility class + */ + protected boolean isXMLName(String s, boolean xml11Version) { + + if (s == null) { + return false; + } + if (!xml11Version) + return XMLChar.isValidName(s); + else + return XML11Char.isXML11ValidName(s); + } + + /** + * Taken from org.apache.xerces.dom.CoreDocumentImpl + * + * Checks if the given qualified name is legal with respect + * to the version of XML to which this document must conform. + * + * @param prefix prefix of qualified name + * @param local local part of qualified name + */ + protected boolean isValidQName( + String prefix, + String local, + boolean xml11Version) { + + // check that both prefix and local part match NCName + if (local == null) + return false; + boolean validNCName = false; + + if (!xml11Version) { + validNCName = + (prefix == null || XMLChar.isValidNCName(prefix)) + && XMLChar.isValidNCName(local); + } else { + validNCName = + (prefix == null || XML11Char.isXML11ValidNCName(prefix)) + && XML11Char.isXML11ValidNCName(local); + } + + return validNCName; + } + + /** + * Checks if a XML character is well-formed + * + * @param characters A String of characters to be checked for Well-Formedness + * @param refInvalidChar A reference to the character to be returned that was determined invalid. + */ + protected boolean isWFXMLChar(String chardata, Character refInvalidChar) { + if (chardata == null || (chardata.length() == 0)) { + return true; + } + + char[] dataarray = chardata.toCharArray(); + int datalength = dataarray.length; + + // version of the document is XML 1.1 + if (fIsXMLVersion11) { + //we need to check all characters as per production rules of XML11 + int i = 0; + while (i < datalength) { + if (XML11Char.isXML11Invalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return false; + } + } + } // version of the document is XML 1.0 + else { + // we need to check all characters as per production rules of XML 1.0 + int i = 0; + while (i < datalength) { + if (XMLChar.isInvalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return false; + } + } + } // end-else fDocument.isXMLVersion() + + return true; + } // isXMLCharWF + + /** + * Checks if a XML character is well-formed. If there is a problem with + * the character a non-null Character is returned else null is returned. + * + * @param characters A String of characters to be checked for Well-Formedness + * @return Character A reference to the character to be returned that was determined invalid. + */ + protected Character isWFXMLChar(String chardata) { + Character refInvalidChar; + if (chardata == null || (chardata.length() == 0)) { + return null; + } + + char[] dataarray = chardata.toCharArray(); + int datalength = dataarray.length; + + // version of the document is XML 1.1 + if (fIsXMLVersion11) { + //we need to check all characters as per production rules of XML11 + int i = 0; + while (i < datalength) { + if (XML11Char.isXML11Invalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return refInvalidChar; + } + } + } // version of the document is XML 1.0 + else { + // we need to check all characters as per production rules of XML 1.0 + int i = 0; + while (i < datalength) { + if (XMLChar.isInvalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return refInvalidChar; + } + } + } // end-else fDocument.isXMLVersion() + + return null; + } // isXMLCharWF + + /** + * Checks if a comment node is well-formed + * + * @param data The contents of the comment node + * @return a boolean indiacating if the comment is well-formed or not. + */ + protected void isCommentWellFormed(String data) { + if (data == null || (data.length() == 0)) { + return; + } + + char[] dataarray = data.toCharArray(); + int datalength = dataarray.length; + + // version of the document is XML 1.1 + if (fIsXMLVersion11) { + // we need to check all chracters as per production rules of XML11 + int i = 0; + while (i < datalength) { + char c = dataarray[i++]; + if (XML11Char.isXML11Invalid(c)) { + // check if this is a supplemental character + if (XMLChar.isHighSurrogate(c) && i < datalength) { + char c2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(c2) + && XMLChar.isSupplemental( + XMLChar.supplemental(c, c2))) { + continue; + } + } + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + new Object[] { new Character(c)}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } else if (c == '-' && i < datalength && dataarray[i] == '-') { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_DASH_IN_COMMENT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + } // version of the document is XML 1.0 + else { + // we need to check all chracters as per production rules of XML 1.0 + int i = 0; + while (i < datalength) { + char c = dataarray[i++]; + if (XMLChar.isInvalid(c)) { + // check if this is a supplemental character + if (XMLChar.isHighSurrogate(c) && i < datalength) { + char c2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(c2) + && XMLChar.isSupplemental( + XMLChar.supplemental(c, c2))) { + continue; + } + } + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + new Object[] { new Character(c)}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } else if (c == '-' && i < datalength && dataarray[i] == '-') { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_DASH_IN_COMMENT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + } + return; + } + + /** + * Checks if an element node is well-formed, by checking its Name for well-formedness. + * + * @param data The contents of the comment node + * @return a boolean indiacating if the comment is well-formed or not. + */ + protected void isElementWellFormed(Node node) { + boolean isNameWF = false; + if ((fFeatures & NAMESPACES) != 0) { + isNameWF = + isValidQName( + node.getPrefix(), + node.getLocalName(), + fIsXMLVersion11); + } else { + isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11); + } + + if (!isNameWF) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "Element", node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + } + + /** + * Checks if an attr node is well-formed, by checking it's Name and value + * for well-formedness. + * + * @param data The contents of the comment node + * @return a boolean indiacating if the comment is well-formed or not. + */ + protected void isAttributeWellFormed(Node node) { + boolean isNameWF = false; + if ((fFeatures & NAMESPACES) != 0) { + isNameWF = + isValidQName( + node.getPrefix(), + node.getLocalName(), + fIsXMLVersion11); + } else { + isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11); + } + + if (!isNameWF) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "Attr", node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + + // Check the Attr's node value + // WFC: No < in Attribute Values + String value = node.getNodeValue(); + if (value.indexOf('<') >= 0) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_LT_IN_ATTVAL, + new Object[] { + ((Attr) node).getOwnerElement().getNodeName(), + node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_LT_IN_ATTVAL, + null, + null, + null)); + } + } + + // we need to loop through the children of attr nodes and check their values for + // well-formedness + NodeList children = node.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + // An attribute node with no text or entity ref child for example + // doc.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns"); + // followes by + // element.setAttributeNodeNS(attribute); + // can potentially lead to this situation. If the attribute + // was a prefix Namespace attribute declaration then then DOM Core + // should have some exception defined for this. + if (child == null) { + // we should probably report an error + continue; + } + switch (child.getNodeType()) { + case Node.TEXT_NODE : + isTextWellFormed((Text) child); + break; + case Node.ENTITY_REFERENCE_NODE : + isEntityReferneceWellFormed((EntityReference) child); + break; + default : + } + } + + // TODO: + // WFC: Check if the attribute prefix is bound to + // http://www.w3.org/2000/xmlns/ + + // WFC: Unique Att Spec + // Perhaps pass a seen boolean value to this method. serializeAttList will determine + // if the attr was seen before. + } + + /** + * Checks if a PI node is well-formed, by checking it's Name and data + * for well-formedness. + * + * @param data The contents of the comment node + */ + protected void isPIWellFormed(ProcessingInstruction node) { + // Is the PI Target a valid XML name + if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "ProcessingInstruction", node.getTarget()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + + // Does the PI Data carry valid XML characters + + // REVISIT: Should we check if the PI DATA contains a ?> ??? + Character invalidChar = isWFXMLChar(node.getData()); + if (invalidChar != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + + /** + * Checks if an CDATASection node is well-formed, by checking it's data + * for well-formedness. Note that the presence of a CDATA termination mark + * in the contents of a CDATASection is handled by the parameter + * spli-cdata-sections + * + * @param data The contents of the comment node + */ + protected void isCDATASectionWellFormed(CDATASection node) { + // Does the data valid XML character data + Character invalidChar = isWFXMLChar(node.getData()); + //if (!isWFXMLChar(node.getData(), invalidChar)) { + if (invalidChar != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + + /** + * Checks if an Text node is well-formed, by checking if it contains invalid + * XML characters. + * + * @param data The contents of the comment node + */ + protected void isTextWellFormed(Text node) { + // Does the data valid XML character data + Character invalidChar = isWFXMLChar(node.getData()); + if (invalidChar != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + + /** + * Checks if an EntityRefernece node is well-formed, by checking it's node name. Then depending + * on whether it is referenced in Element content or in an Attr Node, checks if the EntityReference + * references an unparsed entity or a external entity and if so throws raises the + * appropriate well-formedness error. + * + * @param data The contents of the comment node + * @parent The parent of the EntityReference Node + */ + protected void isEntityReferneceWellFormed(EntityReference node) { + // Is the EntityReference name a valid XML name + if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "EntityReference", node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + + // determine the parent node + Node parent = node.getParentNode(); + + // Traverse the declared entities and check if the nodeName and namespaceURI + // of the EntityReference matches an Entity. If so, check the if the notationName + // is not null, if so, report an error. + DocumentType docType = node.getOwnerDocument().getDoctype(); + if (docType != null) { + NamedNodeMap entities = docType.getEntities(); + for (int i = 0; i < entities.getLength(); i++) { + Entity ent = (Entity) entities.item(i); + + String nodeName = + node.getNodeName() == null ? "" : node.getNodeName(); + String nodeNamespaceURI = + node.getNamespaceURI() == null + ? "" + : node.getNamespaceURI(); + String entName = + ent.getNodeName() == null ? "" : ent.getNodeName(); + String entNamespaceURI = + ent.getNamespaceURI() == null ? "" : ent.getNamespaceURI(); + // If referenced in Element content + // WFC: Parsed Entity + if (parent.getNodeType() == Node.ELEMENT_NODE) { + if (entNamespaceURI.equals(nodeNamespaceURI) + && entName.equals(nodeName)) { + + if (ent.getNotationName() != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + new Object[] { node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + null, + null, + null)); + } + } + } + } // end if WFC: Parsed Entity + + // If referenced in an Attr value + // WFC: No External Entity References + if (parent.getNodeType() == Node.ATTRIBUTE_NODE) { + if (entNamespaceURI.equals(nodeNamespaceURI) + && entName.equals(nodeName)) { + + if (ent.getPublicId() != null + || ent.getSystemId() != null + || ent.getNotationName() != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + new Object[] { node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + null, + null, + null)); + } + } + } + } //end if WFC: No External Entity References + } + } + } // isEntityReferneceWellFormed + + /** + * If the configuration parameter "namespaces" is set to true, this methods + * checks if an entity whose replacement text contains unbound namespace + * prefixes is referenced in a location where there are no bindings for + * the namespace prefixes and if so raises a LSException with the error-type + * "unbound-prefix-in-entity-reference" + * + * @param Node, The EntityReference nodes whose children are to be checked + */ + protected void checkUnboundPrefixInEntRef(Node node) { + Node child, next; + for (child = node.getFirstChild(); child != null; child = next) { + next = child.getNextSibling(); + + if (child.getNodeType() == Node.ELEMENT_NODE) { + + //If a NamespaceURI is not declared for the current + //node's prefix, raise a fatal error. + String prefix = child.getPrefix(); + if (prefix != null + && fNSBinder.getURI(prefix) == null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + new Object[] { + node.getNodeName(), + child.getNodeName(), + prefix }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + null, + null, + null)); + } + } + + NamedNodeMap attrs = child.getAttributes(); + + for (int i = 0; i < attrs.getLength(); i++) { + String attrPrefix = attrs.item(i).getPrefix(); + if (attrPrefix != null + && fNSBinder.getURI(attrPrefix) == null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + new Object[] { + node.getNodeName(), + child.getNodeName(), + attrs.item(i)}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + null, + null, + null)); + } + } + } + } + + if (child.hasChildNodes()) { + checkUnboundPrefixInEntRef(child); + } + } + } + + // *********************************************************************** + // Namespace normalization + // *********************************************************************** + /** + * Records local namespace declarations, to be used for normalization later + * + * @param Node, The element node, whose namespace declarations are to be recorded + */ + protected void recordLocalNSDecl(Node node) { + NamedNodeMap atts = ((Element) node).getAttributes(); + int length = atts.getLength(); + + for (int i = 0; i < length; i++) { + Node attr = atts.item(i); + + String localName = attr.getLocalName(); + String attrPrefix = attr.getPrefix(); + String attrValue = attr.getNodeValue(); + String attrNS = attr.getNamespaceURI(); + + localName = + localName == null + || XMLNS_PREFIX.equals(localName) ? "" : localName; + attrPrefix = attrPrefix == null ? "" : attrPrefix; + attrValue = attrValue == null ? "" : attrValue; + attrNS = attrNS == null ? "" : attrNS; + + // check if attribute is a namespace decl + if (XMLNS_URI.equals(attrNS)) { + + // No prefix may be bound to http://www.w3.org/2000/xmlns/. + if (XMLNS_URI.equals(attrValue)) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + new Object[] { attrPrefix, XMLNS_URI }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_ERROR, + msg, + MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + null, + null, + null)); + } + } else { + // store the namespace-declaration + if (XMLNS_PREFIX.equals(attrPrefix) ) { + // record valid decl + if (attrValue.length() != 0) { + fNSBinder.declarePrefix(localName, attrValue); + } else { + // Error; xmlns:prefix="" + } + } else { // xmlns + // empty prefix is always bound ("" or some string) + fNSBinder.declarePrefix("", attrValue); + } + } + + } + } + } + + /** + * Fixes an element's namespace + * + * @param Node, The element node, whose namespace is to be fixed + */ + protected void fixupElementNS(Node node) throws SAXException { + String namespaceURI = ((Element) node).getNamespaceURI(); + String prefix = ((Element) node).getPrefix(); + String localName = ((Element) node).getLocalName(); + + if (namespaceURI != null) { + //if ( Element's prefix/namespace pair (or default namespace, + // if no prefix) are within the scope of a binding ) + prefix = prefix == null ? "" : prefix; + String inScopeNamespaceURI = fNSBinder.getURI(prefix); + + if ((inScopeNamespaceURI != null + && inScopeNamespaceURI.equals(namespaceURI))) { + // do nothing, declaration in scope is inherited + + } else { + // Create a local namespace declaration attr for this namespace, + // with Element's current prefix (or a default namespace, if + // no prefix). If there's a conflicting local declaration + // already present, change its value to use this namespace. + + // Add the xmlns declaration attribute + //fNSBinder.pushNamespace(prefix, namespaceURI, fElementDepth); + if ((fFeatures & NAMESPACEDECLS) != 0) { + if ("".equals(prefix) || "".equals(namespaceURI)) { + ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceURI); + } else { + ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX + ":" + prefix, namespaceURI); + } + } + fLocalNSBinder.declarePrefix(prefix, namespaceURI); + fNSBinder.declarePrefix(prefix, namespaceURI); + + } + } else { + // Element has no namespace + // DOM Level 1 + if (localName == null || "".equals(localName)) { + // DOM Level 1 node! + String msg = + Utils.messages.createMessage( + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + new Object[] { node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_ERROR, + msg, + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + null, + null, + null)); + } + } else { + namespaceURI = fNSBinder.getURI(""); + if (namespaceURI !=null && namespaceURI.length() > 0) { + ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, ""); + fLocalNSBinder.declarePrefix("", ""); + fNSBinder.declarePrefix("", ""); + } + } + } + } + /** + * This table is a quick lookup of a property key (String) to the integer that + * is the bit to flip in the fFeatures field, so the integers should have + * values 1,2,4,8,16... + * + */ + private static final Hashtable s_propKeys = new Hashtable(); + static { + + // Initialize the mappings of property keys to bit values (Integer objects) + // or mappings to a String object "", which indicates we are interested + // in the property, but it does not have a simple bit value to flip + + // cdata-sections + int i = CDATA; + Integer val = new Integer(i); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, + val); + + // comments + int i1 = COMMENTS; + val = new Integer(i1); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, + val); + + // element-content-whitespace + int i2 = ELEM_CONTENT_WHITESPACE; + val = new Integer(i2); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + val); + int i3 = ENTITIES; + + // entities + val = new Integer(i3); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, + val); + + // namespaces + int i4 = NAMESPACES; + val = new Integer(i4); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, + val); + + // namespace-declarations + int i5 = NAMESPACEDECLS; + val = new Integer(i5); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + val); + + // split-cdata-sections + int i6 = SPLITCDATA; + val = new Integer(i6); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, + val); + + // discard-default-content + int i7 = WELLFORMED; + val = new Integer(i7); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, + val); + + // discard-default-content + int i8 = DISCARDDEFAULT; + val = new Integer(i8); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, + val); + + // We are interested in these properties, but they don't have a simple + // bit value to deal with. + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_FORMAT_PRETTY_PRINT, + ""); + s_propKeys.put(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, ""); + s_propKeys.put( + DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, + ""); + s_propKeys.put(DOMConstants.S_XSL_OUTPUT_ENCODING, ""); + s_propKeys.put(OutputPropertiesFactory.S_KEY_ENTITIES, ""); + } + + /** + * Initializes fFeatures based on the DOMConfiguration Parameters set. + * + * @param properties DOMConfiguraiton properties that were set and which are + * to be used while serializing the DOM. + */ + protected void initProperties(Properties properties) { + + for (Enumeration keys = properties.keys(); keys.hasMoreElements();) { + + final String key = (String) keys.nextElement(); + + // caonical-form + // Other features will be enabled or disabled when this is set to true or false. + + // error-handler; set via the constructor + + // infoset + // Other features will be enabled or disabled when this is set to true + + // A quick lookup for the given set of properties (cdata-sections ...) + final Object iobj = s_propKeys.get(key); + if (iobj != null) { + if (iobj instanceof Integer) { + // Dealing with a property that has a simple bit value that + // we need to set + + // cdata-sections + // comments + // element-content-whitespace + // entities + // namespaces + // namespace-declarations + // split-cdata-sections + // well-formed + // discard-default-content + final int BITFLAG = ((Integer) iobj).intValue(); + if ((properties.getProperty(key).endsWith("yes"))) { + fFeatures = fFeatures | BITFLAG; + } else { + fFeatures = fFeatures & ~BITFLAG; + } + } else { + // We are interested in the property, but it is not + // a simple bit that we need to set. + + if ((DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_FORMAT_PRETTY_PRINT) + .equals(key)) { + // format-pretty-print; set internally on the serializers via xsl:output properties in LSSerializer + if ((properties.getProperty(key).endsWith("yes"))) { + fSerializer.setIndent(true); + fSerializer.setIndentAmount(4); + } else { + fSerializer.setIndent(false); + } + } else if ( + (DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL).equals( + key)) { + // omit-xml-declaration; set internally on the serializers via xsl:output properties in LSSerializer + if ((properties.getProperty(key).endsWith("yes"))) { + fSerializer.setOmitXMLDeclaration(true); + } else { + fSerializer.setOmitXMLDeclaration(false); + } + } else if ( + ( + DOMConstants.S_XERCES_PROPERTIES_NS + + DOMConstants.S_XML_VERSION).equals( + key)) { + // Retreive the value of the XML Version attribute via the xml-version + String version = properties.getProperty(key); + if ("1.1".equals(version)) { + fIsXMLVersion11 = true; + fSerializer.setVersion(version); + } else { + fSerializer.setVersion("1.0"); + } + } else if ( + (DOMConstants.S_XSL_OUTPUT_ENCODING).equals(key)) { + // Retreive the value of the XML Encoding attribute + String encoding = properties.getProperty(key); + if (encoding != null) { + fSerializer.setEncoding(encoding); + } + } else if ((OutputPropertiesFactory.S_KEY_ENTITIES).equals(key)) { + // Retreive the value of the XML Encoding attribute + String entities = properties.getProperty(key); + if (DOMConstants.S_XSL_VALUE_ENTITIES.equals(entities)) { + fSerializer.setDTDEntityExpansion(false); + } + } else { + // We shouldn't get here, ever, now what? + } + } + } + } + // Set the newLine character to use + if (fNewLine != null) { + fSerializer.setOutputProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR, fNewLine); + } + } + +} //TreeWalker diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java new file mode 100644 index 00000000000..07f19b29d1f --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +/** + * DOM Constants used by the DOM Level 3 LSSerializer implementation. + * + * @xsl.usage internal + */ +final class DOMConstants { + // + // Constants: DOM Level 3 feature ids + // + public static final String DOM3_REC_URL = "http://www.w3.org/TR/DOM-Level-3-LS"; + + public static final String XERCES_URL = "http://xml.apache.org/xerces-2j"; + + // The namespace used to qualified DOM Level 3 DOMConfiguration parameters + public static final String S_DOM3_PROPERTIES_NS = "{" + + DOMConstants.DOM3_REC_URL + "}"; + + public static final String S_XERCES_PROPERTIES_NS = "{" + + DOMConstants.XERCES_URL + "}"; + + // xmlns namespaces + private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; + + // namespace prefix + private static final String XMLNS_PREFIX = "xmlns"; + + // ************************************************************************ + // DOM Level 3 DOM Configuration parameter names + // ************************************************************************ + // DOM Level 3 parameters defined in Core + public static final String DOM_CANONICAL_FORM = "canonical-form"; // Unsupported, we only appear to support this + + public static final String DOM_CDATA_SECTIONS = "cdata-sections"; + + public static final String DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization"; // Unsupported + + public static final String DOM_COMMENTS = "comments"; + + public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization"; // Unsupported + + public static final String DOM_ELEMENT_CONTENT_WHITESPACE = "element-content-whitespace"; + + public static final String DOM_ENTITIES = "entities"; + + public static final String DOM_INFOSET = "infoset"; + + public static final String DOM_NAMESPACES = "namespaces"; + + public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations"; + + public static final String DOM_NORMALIZE_CHARACTERS = "normalize-characters"; // Unsupported + + public static final String DOM_SPLIT_CDATA = "split-cdata-sections"; + + public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema"; // Unsopported + + public static final String DOM_VALIDATE = "validate"; // Unsopported + + public static final String DOM_WELLFORMED = "well-formed"; + + // DOM Level 3 Save + public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content"; + + public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print"; + + public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations"; // Unsupported + + public static final String DOM_XMLDECL = "xml-declaration"; + + // DOM Properties + public static final String DOM_ERROR_HANDLER = "error-handler"; + + public static final String DOM_SCHEMA_TYPE = "schema-type"; // Unsupported + + public static final String DOM_SCHEMA_LOCATION = "schema-location"; // Unsupported + + // ************************************************************************ + + // XSL Output properties + // The xsl:output 'indent' property used in LSSerializer + public static final String S_XSL_OUTPUT_INDENT = "indent"; + + // The xsl:output 'indent' property used in LSSerializer + public static final String S_XSL_OUTPUT_ENCODING = "encoding"; + + // The xsl:output 'omit-xml-declaration' property used in LSSerializer + public static final String S_XSL_OUTPUT_OMIT_XML_DECL = "omit-xml-declaration"; + + // The xerces serializer specific 'omit-xml-declaration' property used in LSSerializer + public static final String S_XML_VERSION = "xml-version"; + + // + public static final String S_XSL_VALUE_ENTITIES = "com/sun/org/apache/xml/internal/serializer/XMLEntities"; + + // Parameter values + public static final String DOM3_EXPLICIT_TRUE = "explicit:yes"; + + public static final String DOM3_DEFAULT_TRUE = "default:yes"; + + public static final String DOM3_EXPLICIT_FALSE = "explicit:no"; + + public static final String DOM3_DEFAULT_FALSE = "default:no"; + + // DOM Exceptions + public static final String DOM_EXCEPTION_FEATURE_NOT_FOUND = "FEATURE_NOT_FOUND"; + + public static final String DOM_EXCEPTION_FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED"; + + public static final String DOM_LSEXCEPTION_SERIALIZER_ERR = "SERIALIZER_ERROR"; + +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java new file mode 100644 index 00000000000..e1b577ffaa9 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; + +/** + * This is the default implementation of the ErrorHandler interface and is + * used if one is not provided. The default implementation simply reports + * DOMErrors to System.err. + * + * @xsl.usage internal + */ +final class DOMErrorHandlerImpl implements DOMErrorHandler { + + /** + * Default Constructor + */ + DOMErrorHandlerImpl() { + } + + /** + * Implementation of DOMErrorHandler.handleError that + * adds copy of error to list for later retrieval. + * + */ + public boolean handleError(DOMError error) { + boolean fail = true; + String severity = null; + if (error.getSeverity() == DOMError.SEVERITY_WARNING) { + fail = false; + severity = "[Warning]"; + } else if (error.getSeverity() == DOMError.SEVERITY_ERROR) { + severity = "[Error]"; + } else if (error.getSeverity() == DOMError.SEVERITY_FATAL_ERROR) { + severity = "[Fatal Error]"; + } + + System.err.println(severity + ": " + error.getMessage() + "\t"); + System.err.println("Type : " + error.getType() + "\t" + "Related Data: " + + error.getRelatedData() + "\t" + "Related Exception: " + + error.getRelatedException() ); + + return fail; + } +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java new file mode 100644 index 00000000000..a143f65491e --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java @@ -0,0 +1,176 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMLocator; + +/** + * Implementation of the DOM Level 3 DOMError interface. + * + *

    See also the DOMError Interface definition from Document Object Model (DOM) Level 3 Core Specification. + * + * @xsl.usage internal + */ + +final class DOMErrorImpl implements DOMError { + + /** private data members */ + + // The DOMError Severity + private short fSeverity = DOMError.SEVERITY_WARNING; + + // The Error message + private String fMessage = null; + + // A String indicating which related data is expected in relatedData. + private String fType; + + // The platform related exception + private Exception fException = null; + + // + private Object fRelatedData; + + // The location of the exception + private DOMLocatorImpl fLocation = new DOMLocatorImpl(); + + + // + // Constructors + // + + /** + * Default constructor. + */ + DOMErrorImpl () { + } + + /** + * @param severity + * @param message + * @param type + */ + DOMErrorImpl(short severity, String message, String type) { + fSeverity = severity; + fMessage = message; + fType = type; + } + + /** + * @param severity + * @param message + * @param type + * @param exception + */ + DOMErrorImpl(short severity, String message, String type, + Exception exception) { + fSeverity = severity; + fMessage = message; + fType = type; + fException = exception; + } + + /** + * @param severity + * @param message + * @param type + * @param exception + * @param relatedData + * @param location + */ + DOMErrorImpl(short severity, String message, String type, + Exception exception, Object relatedData, DOMLocatorImpl location) { + fSeverity = severity; + fMessage = message; + fType = type; + fException = exception; + fRelatedData = relatedData; + fLocation = location; + } + + + /** + * The severity of the error, either SEVERITY_WARNING, + * SEVERITY_ERROR, or SEVERITY_FATAL_ERROR. + * + * @return A short containing the DOMError severity + */ + public short getSeverity() { + return fSeverity; + } + + /** + * The DOMError message string. + * + * @return String + */ + public String getMessage() { + return fMessage; + } + + /** + * The location of the DOMError. + * + * @return A DOMLocator object containing the DOMError location. + */ + public DOMLocator getLocation() { + return fLocation; + } + + /** + * The related platform dependent exception if any. + * + * @return A java.lang.Exception + */ + public Object getRelatedException(){ + return fException; + } + + /** + * Returns a String indicating which related data is expected in relatedData. + * + * @return A String + */ + public String getType(){ + return fType; + } + + /** + * The related DOMError.type dependent data if any. + * + * @return java.lang.Object + */ + public Object getRelatedData(){ + return fRelatedData; + } + + public void reset(){ + fSeverity = DOMError.SEVERITY_WARNING; + fException = null; + fMessage = null; + fType = null; + fRelatedData = null; + fLocation = null; + } + +}// class DOMErrorImpl diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java new file mode 100644 index 00000000000..f0e87c340f4 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java @@ -0,0 +1,180 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.DOMLocator; +import org.w3c.dom.Node; + + +/** + * DOMLocatorImpl is an implementaion that describes a location (e.g. + * where an error occured). + *

    See also the Document Object Model (DOM) Level 3 Core Specification. + * This class is a copy of the Xerces-2J class org.apache.xerces.dom.DOMLocatorImpl.java v 1.10 + * + * @author Gopal Sharma, SUN Microsystems Inc. + * @version $Id: + * + * @xsl.usage internal + */ +final class DOMLocatorImpl implements DOMLocator { + + // + // Data + // + + /** + * The column number where the error occured, + * or -1 if there is no column number available. + */ + private final int fColumnNumber; + + /** + * The line number where the error occured, + * or -1 if there is no line number available. + */ + private final int fLineNumber; + + /** related data node*/ + private final Node fRelatedNode; + + /** + * The URI where the error occured, + * or null if there is no URI available. + */ + private final String fUri; + + /** + * The byte offset into the input source this locator is pointing to or -1 + * if there is no byte offset available + */ + private final int fByteOffset; + + /** + * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], + * offset into the input source this locator is pointing to or -1 if there + * is no UTF-16 offset available. + */ + private final int fUtf16Offset; + + // + // Constructors + // + + DOMLocatorImpl(){ + fColumnNumber = -1; + fLineNumber = -1; + fRelatedNode = null; + fUri = null; + fByteOffset = -1; + fUtf16Offset = -1; + } + + DOMLocatorImpl (int lineNumber, int columnNumber, String uri ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fUri = uri; + + fRelatedNode = null; + fByteOffset = -1; + fUtf16Offset = -1; + } // DOMLocatorImpl (int lineNumber, int columnNumber, String uri ) + + DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fUri = uri; + fUtf16Offset = utf16Offset; + + + fRelatedNode = null; + fByteOffset = -1; + } // DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ) + + DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fByteOffset = byteoffset ; + fRelatedNode = relatedData ; + fUri = uri; + + fUtf16Offset = -1; + } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri ) + + DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri, int utf16Offset ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fByteOffset = byteoffset ; + fRelatedNode = relatedData ; + fUri = uri; + fUtf16Offset = utf16Offset; + } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri ) + + + /** + * The line number where the error occured, or -1 if there is no line + * number available. + */ + public int getLineNumber(){ + return fLineNumber; + } + + /** + * The column number where the error occured, or -1 if there is no column + * number available. + */ + public int getColumnNumber(){ + return fColumnNumber; + } + + + /** + * The URI where the error occured, or null if there is no URI available. + */ + public String getUri(){ + return fUri; + } + + + public Node getRelatedNode(){ + return fRelatedNode; + } + + + /** + * The byte offset into the input source this locator is pointing to or -1 + * if there is no byte offset available + */ + public int getByteOffset(){ + return fByteOffset; + } + + /** + * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], + * offset into the input source this locator is pointing to or -1 if there + * is no UTF-16 offset available. + */ + public int getUtf16Offset(){ + return fUtf16Offset; + } + +}// class DOMLocatorImpl diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java new file mode 100644 index 00000000000..d684acb2902 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java @@ -0,0 +1,177 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package org.apache.xml.serializer.dom3; + +import org.w3c.dom.ls.LSOutput; + +import java.io.Writer; +import java.io.OutputStream; + +/** + * This is a copy of the Xerces-2J class org.apache.xerces.dom.DOMOutputImpl.java + * + * This class represents an output destination for data. + * This interface allows an application to encapsulate information about an + * output destination in a single object, which may include a URI, a byte stream + * (possibly with a specifiedencoding), a base URI, and/or a character stream. + * The exact definitions of a byte stream and a character stream are binding + * dependent. + * The application is expected to provide objects that implement this interface + * whenever such objects are needed. The application can either provide its + * own objects that implement this interface, or it can use the generic factory + * method DOMImplementationLS.createLSOutput() to create objects that + * implement this interface. + * The DOMSerializer will use the LSOutput object to determine where to + * serialize the output to. The DOMSerializer will look at the different + * outputs specified in the LSOutput in the following order to know which one + * to output to, the first one that data can be output to will be used: + * 1.LSOutput.characterStream + * 2.LSOutput.byteStream + * 3.LSOutput.systemId + * LSOutput objects belong to the application. The DOM implementation will + * never modify them (though it may make copies and modify the copies, + * if necessary). + * + * + * @author Arun Yadav, Sun Microsytems + * @author Gopal Sharma, Sun Microsystems + * @version $Id : + * @xsl.usage internal + */ + +final class DOMOutputImpl implements LSOutput { + + private Writer fCharStream = null; + private OutputStream fByteStream = null; + private String fSystemId = null; + private String fEncoding = null; + + /** + * Default Constructor + */ + DOMOutputImpl() {} + + /** + * An attribute of a language and binding dependent type that represents a + * writable stream of bytes. If the application knows the character encoding + * of the byte stream, it should set the encoding attribute. Setting the + * encoding in this way will override any encoding specified in an XML + * declaration in the data. + */ + + public Writer getCharacterStream(){ + return fCharStream; + }; + + /** + * An attribute of a language and binding dependent type that represents a + * writable stream of bytes. If the application knows the character encoding + * of the byte stream, it should set the encoding attribute. Setting the + * encoding in this way will override any encoding specified in an XML + * declaration in the data. + */ + + public void setCharacterStream(Writer characterStream){ + fCharStream = characterStream; + }; + + /** + * Depending on the language binding in use, this attribute may not be + * available. An attribute of a language and binding dependent type that + * represents a writable stream to which 16-bit units can be output. The + * application must encode the stream using UTF-16 (defined in [Unicode] and + * Amendment 1 of [ISO/IEC 10646]). + */ + + public OutputStream getByteStream(){ + return fByteStream; + }; + + /** + * Depending on the language binding in use, this attribute may not be + * available. An attribute of a language and binding dependent type that + * represents a writable stream to which 16-bit units can be output. The + * application must encode the stream using UTF-16 (defined in [Unicode] and + * Amendment 1 of [ISO/IEC 10646]). + */ + + public void setByteStream(OutputStream byteStream){ + fByteStream = byteStream; + }; + + /** + * The system identifier, a URI reference [IETF RFC 2396], for this output + * destination. If the application knows the character encoding of the + * object pointed to by the system identifier, it can set the encoding + * using the encoding attribute. If the system ID is a relative URI + * reference (see section 5 in [IETF RFC 2396]), the behavior is + * implementation dependent. + */ + + public String getSystemId(){ + return fSystemId; + }; + + /** + * The system identifier, a URI reference [IETF RFC 2396], for this output + * destination. If the application knows the character encoding of the + * object pointed to by the system identifier, it can set the encoding + * using the encoding attribute. If the system ID is a relative URI + * reference (see section 5 in [IETF RFC 2396]), the behavior is + * implementation dependent. + */ + + public void setSystemId(String systemId){ + fSystemId = systemId; + }; + + /** + * The character encoding, if known. The encoding must be a string + * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 + * "Character Encoding in Entities"). This attribute has no effect when the + * application provides a character stream or string data. For other sources + * of input, an encoding specified by means of this attribute will override + * any encoding specified in the XML declaration or the Text declaration, or + * an encoding obtained from a higher level protocol, such as HTTP + * [IETF RFC 2616]. + */ + + public String getEncoding(){ + return fEncoding; + }; + + /** + * The character encoding, if known. The encoding must be a string + * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 + * "Character Encoding in Entities"). This attribute has no effect when the + * application provides a character stream or string data. For other sources + * of input, an encoding specified by means of this attribute will override + * any encoding specified in the XML declaration or the Text declaration, or + * an encoding obtained from a higher level protocol, such as HTTP + * [IETF RFC 2616]. + */ + + public void setEncoding(String encoding){ + fEncoding = encoding; + }; + +}//DOMOutputImpl diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java new file mode 100644 index 00000000000..11eac2aa2e8 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.util.Vector; + +//import org.apache.xerces.dom3.DOMStringList; +import org.w3c.dom.DOMStringList; + +/** + * This class implemets the DOM Level 3 Core interface DOMStringList. + * + * @xsl.usage internal + */ +final class DOMStringListImpl implements DOMStringList { + + //A collection of DOMString values + private Vector fStrings; + + /** + * Construct an empty list of DOMStringListImpl + */ + DOMStringListImpl() { + fStrings = new Vector(); + } + + /** + * Construct an empty list of DOMStringListImpl + */ + DOMStringListImpl(Vector params) { + fStrings = params; + } + + /** + * Construct an empty list of DOMStringListImpl + */ + DOMStringListImpl(String[] params ) { + fStrings = new Vector(); + if (params != null) { + for (int i=0; i < params.length; i++) { + fStrings.add(params[i]); + } + } + } + + /** + * @see org.apache.xerces.dom3.DOMStringList#item(int) + */ + public String item(int index) { + try { + return (String) fStrings.elementAt(index); + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } + + /** + * @see org.apache.xerces.dom3.DOMStringList#getLength() + */ + public int getLength() { + return fStrings.size(); + } + + /** + * @see org.apache.xerces.dom3.DOMStringList#contains(String) + */ + public boolean contains(String param) { + return fStrings.contains(param) ; + } + + /** + * DOM Internal: + * Add a DOMString to the list. + * + * @param domString A string to add to the list + */ + public void add(String param) { + fStrings.add(param); + } + +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java new file mode 100644 index 00000000000..5ab43abad0e --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java @@ -0,0 +1,1405 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.util.Properties; + +import com.sun.org.apache.xml.internal.serializer.DOM3Serializer; +import com.sun.org.apache.xml.internal.serializer.Encodings; +import com.sun.org.apache.xml.internal.serializer.Serializer; +import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory; +import com.sun.org.apache.xml.internal.serializer.SerializerFactory; +import com.sun.org.apache.xml.internal.serializer.utils.MsgKey; +import com.sun.org.apache.xml.internal.serializer.utils.Utils; +import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMStringList; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.ls.LSException; +import org.w3c.dom.ls.LSOutput; +import org.w3c.dom.ls.LSSerializer; +import org.w3c.dom.ls.LSSerializerFilter; + + +/** + * Implemenatation of DOM Level 3 org.w3c.ls.LSSerializer and + * org.w3c.dom.ls.DOMConfiguration. Serialization is achieved by delegating + * serialization calls to org.apache.xml.serializer.ToStream or + * one of its derived classes depending on the serialization method, while walking + * the DOM in DOM3TreeWalker. + * @see org.w3c.dom.ls.LSSerializer + * @see org.w3c.dom.DOMConfiguration + * + * @version $Id: + * + * @xsl.usage internal + */ +final public class LSSerializerImpl implements DOMConfiguration, LSSerializer { + + /** private data members */ + private Serializer fXMLSerializer = null; + + // Tracks DOMConfiguration features. + protected int fFeatures = 0; + + // Common DOM serializer + private DOM3Serializer fDOMSerializer = null; + + // A filter set on the LSSerializer + private LSSerializerFilter fSerializerFilter = null; + + // Stores the nodeArg parameter to speed up multiple writes of the same node. + private Node fVisitedNode = null; + + // The end-of-line character sequence used in serialization. "\n" is whats used on the web. + private String fEndOfLine = "\n"; + + // The DOMErrorhandler. + private DOMErrorHandler fDOMErrorHandler = null; + + // The Configuration parameter to pass to the Underlying serilaizer. + private Properties fDOMConfigProperties = null; + + // The encoding to use during serialization. + private String fEncoding; + + // ************************************************************************ + // DOM Level 3 DOM Configuration parameter names + // ************************************************************************ + // Parameter canonical-form, true [optional] - NOT SUPPORTED + private final static int CANONICAL = 0x1 << 0; + + // Parameter cdata-sections, true [required] (default) + private final static int CDATA = 0x1 << 1; + + // Parameter check-character-normalization, true [optional] - NOT SUPPORTED + private final static int CHARNORMALIZE = 0x1 << 2; + + // Parameter comments, true [required] (default) + private final static int COMMENTS = 0x1 << 3; + + // Parameter datatype-normalization, true [optional] - NOT SUPPORTED + private final static int DTNORMALIZE = 0x1 << 4; + + // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED + private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5; + + // Parameter entities, true [required] (default) + private final static int ENTITIES = 0x1 << 6; + + // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer + private final static int INFOSET = 0x1 << 7; + + // Parameter namespaces, true [required] (default) + private final static int NAMESPACES = 0x1 << 8; + + // Parameter namespace-declarations, true [required] (default) + private final static int NAMESPACEDECLS = 0x1 << 9; + + // Parameter normalize-characters, true [optional] - NOT SUPPORTED + private final static int NORMALIZECHARS = 0x1 << 10; + + // Parameter split-cdata-sections, true [required] (default) + private final static int SPLITCDATA = 0x1 << 11; + + // Parameter validate, true [optional] - NOT SUPPORTED + private final static int VALIDATE = 0x1 << 12; + + // Parameter validate-if-schema, true [optional] - NOT SUPPORTED + private final static int SCHEMAVALIDATE = 0x1 << 13; + + // Parameter split-cdata-sections, true [required] (default) + private final static int WELLFORMED = 0x1 << 14; + + // Parameter discard-default-content, true [required] (default) + // Not sure how this will be used in level 2 Documents + private final static int DISCARDDEFAULT = 0x1 << 15; + + // Parameter format-pretty-print, true [optional] + private final static int PRETTY_PRINT = 0x1 << 16; + + // Parameter ignore-unknown-character-denormalizations, true [required] (default) + // We currently do not support XML 1.1 character normalization + private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17; + + // Parameter discard-default-content, true [required] (default) + private final static int XMLDECL = 0x1 << 18; + // ************************************************************************ + + // Recognized parameters for which atleast one value can be set + private String fRecognizedParameters [] = { + DOMConstants.DOM_CANONICAL_FORM, + DOMConstants.DOM_CDATA_SECTIONS, + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, + DOMConstants.DOM_COMMENTS, + DOMConstants.DOM_DATATYPE_NORMALIZATION, + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + DOMConstants.DOM_ENTITIES, + DOMConstants.DOM_INFOSET, + DOMConstants.DOM_NAMESPACES, + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + //DOMConstants.DOM_NORMALIZE_CHARACTERS, + DOMConstants.DOM_SPLIT_CDATA, + DOMConstants.DOM_VALIDATE, + DOMConstants.DOM_VALIDATE_IF_SCHEMA, + DOMConstants.DOM_WELLFORMED, + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, + DOMConstants.DOM_FORMAT_PRETTY_PRINT, + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, + DOMConstants.DOM_XMLDECL, + DOMConstants.DOM_ERROR_HANDLER + }; + + + /** + * Constructor: Creates a LSSerializerImpl object. The underlying + * XML 1.0 or XML 1.1 org.apache.xml.serializer.Serializer object is + * created and initialized the first time any of the write methods are + * invoked to serialize the Node. Subsequent write methods on the same + * LSSerializerImpl object will use the previously created Serializer object. + */ + public LSSerializerImpl () { + // set default parameters + fFeatures |= CDATA; + fFeatures |= COMMENTS; + fFeatures |= ELEM_CONTENT_WHITESPACE; + fFeatures |= ENTITIES; + fFeatures |= NAMESPACES; + fFeatures |= NAMESPACEDECLS; + fFeatures |= SPLITCDATA; + fFeatures |= WELLFORMED; + fFeatures |= DISCARDDEFAULT; + fFeatures |= XMLDECL; + + // New OutputFormat properties + fDOMConfigProperties = new Properties(); + + // Initialize properties to be passed on the underlying serializer + initializeSerializerProps(); + + // Read output_xml.properties and System Properties to initialize properties + Properties configProps = OutputPropertiesFactory.getDefaultMethodProperties("xml"); + + // change xml version from 1.0 to 1.1 + //configProps.setProperty("version", "1.1"); + + // Get a serializer that seriailizes according to the properties, + // which in this case is to xml + fXMLSerializer = SerializerFactory.getSerializer(configProps); + + // Initialize Serializer + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + } + + /** + * Initializes the underlying serializer's configuration depending on the + * default DOMConfiguration parameters. This method must be called before a + * node is to be serialized. + * + * @xsl.usage internal + */ + public void initializeSerializerProps () { + // canonical-form + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_DEFAULT_FALSE); + + // cdata-sections + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_DEFAULT_TRUE); + + // "check-character-normalization" + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, + DOMConstants.DOM3_DEFAULT_FALSE); + + // comments + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE); + + // datatype-normalization + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, + DOMConstants.DOM3_DEFAULT_FALSE); + + // element-content-whitespace + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + DOMConstants.DOM3_DEFAULT_TRUE); + + // entities + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_TRUE); + // preserve entities + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES); + + // error-handler + // Should we set our default ErrorHandler + /* + * if (fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER) != null) { + * fDOMErrorHandler = + * (DOMErrorHandler)fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER); } + */ + + // infoset + if ((fFeatures & INFOSET) != 0) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_FALSE); + // preserve entities + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, ""); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, + DOMConstants.DOM3_DEFAULT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, + DOMConstants.DOM3_DEFAULT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + // namespaces + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE); + + // namespace-declarations + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + DOMConstants.DOM3_DEFAULT_TRUE); + + // normalize-characters + /* + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NORMALIZE_CHARACTERS, + DOMConstants.DOM3_DEFAULT_FALSE); + */ + + // split-cdata-sections + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_DEFAULT_TRUE); + + // validate + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_DEFAULT_FALSE); + + // validate-if-schema + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, + DOMConstants.DOM3_DEFAULT_FALSE); + + // well-formed + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE); + + // pretty-print + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_INDENT, + DOMConstants.DOM3_DEFAULT_FALSE); + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(4)); + + // + + // discard-default-content + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, + DOMConstants.DOM3_DEFAULT_TRUE); + + // xml-declaration + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); + + } + + // ************************************************************************ + // DOMConfiguraiton implementation + // ************************************************************************ + + /** + * Checks if setting a parameter to a specific value is supported. + * + * @see org.w3c.dom.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object) + * @since DOM Level 3 + * @param name A String containing the DOMConfiguration parameter name. + * @param value An Object specifying the value of the corresponding parameter. + */ + public boolean canSetParameter(String name, Object value) { + if (value instanceof Boolean){ + if ( name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS) + || name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS) + || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES) + || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET) + || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE) + || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES) + || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS) + || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA) + || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED) + || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT) + || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT) + || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)){ + // both values supported + return true; + } + else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) + || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) + // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + ) { + // true is not supported + return !((Boolean)value).booleanValue(); + } + else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { + // false is not supported + return ((Boolean)value).booleanValue(); + } + } + else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) && + value == null || value instanceof DOMErrorHandler){ + return true; + } + return false; + } + /** + * This method returns the value of a parameter if known. + * + * @see org.w3c.dom.DOMConfiguration#getParameter(java.lang.String) + * + * @param name A String containing the DOMConfiguration parameter name + * whose value is to be returned. + * @return Object The value of the parameter if known. + */ + public Object getParameter(String name) throws DOMException { + + if(name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)){ + return null; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { + return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { + return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { + return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { + return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { + return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { + return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { + return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { + return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { + return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { + return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { + return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { + return Boolean.TRUE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) + || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) + // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { + return Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){ + if ((fFeatures & ENTITIES) == 0 && + (fFeatures & CDATA) == 0 && + (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 && + (fFeatures & NAMESPACES) != 0 && + (fFeatures & NAMESPACEDECLS) != 0 && + (fFeatures & WELLFORMED) != 0 && + (fFeatures & COMMENTS) != 0) { + return Boolean.TRUE; + } + return Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { + return fDOMErrorHandler; + } else if ( + name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) + || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { + return null; + } else { + // Here we have to add the Xalan specific DOM Message Formatter + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_FOUND, + new Object[] { name }); + throw new DOMException(DOMException.NOT_FOUND_ERR, msg); + } + } + + /** + * This method returns a of the parameters supported by this DOMConfiguration object + * and for which at least one value can be set by the application + * + * @see org.w3c.dom.DOMConfiguration#getParameterNames() + * + * @return DOMStringList A list of DOMConfiguration parameters recognized + * by the serializer + */ + public DOMStringList getParameterNames() { + return new DOMStringListImpl(fRecognizedParameters); + } + + /** + * This method sets the value of the named parameter. + * + * @see org.w3c.dom.DOMConfiguration#setParameter(java.lang.String, java.lang.Object) + * + * @param name A String containing the DOMConfiguration parameter name. + * @param value An Object contaiing the parameters value to set. + */ + public void setParameter(String name, Object value) throws DOMException { + // If the value is a boolean + if (value instanceof Boolean) { + boolean state = ((Boolean) value).booleanValue(); + + if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { + fFeatures = state ? fFeatures | COMMENTS : fFeatures + & ~COMMENTS; + // comments + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { + fFeatures = state ? fFeatures | CDATA : fFeatures + & ~CDATA; + // cdata-sections + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { + fFeatures = state ? fFeatures | ENTITIES : fFeatures + & ~ENTITIES; + // entities + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { + fFeatures = state ? fFeatures | NAMESPACES : fFeatures + & ~NAMESPACES; + // namespaces + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name + .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { + fFeatures = state ? fFeatures | NAMESPACEDECLS + : fFeatures & ~NAMESPACEDECLS; + // namespace-declarations + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { + fFeatures = state ? fFeatures | SPLITCDATA : fFeatures + & ~SPLITCDATA; + // split-cdata-sections + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { + fFeatures = state ? fFeatures | WELLFORMED : fFeatures + & ~WELLFORMED; + // well-formed + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name + .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { + fFeatures = state ? fFeatures | DISCARDDEFAULT + : fFeatures & ~DISCARDDEFAULT; + // discard-default-content + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { + fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures + & ~PRETTY_PRINT; + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(4)); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { + fFeatures = state ? fFeatures | XMLDECL : fFeatures + & ~XMLDECL; + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { + fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures + & ~ELEM_CONTENT_WHITESPACE; + // element-content-whitespace + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { + // false is not supported + if (!state) { + // Here we have to add the Xalan specific DOM Message Formatter + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) + || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) + // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + ) { + // true is not supported + if (state) { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { + fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION + + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); + } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE); + } */ + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { + if (state) { + fFeatures &= ~ENTITIES; + fFeatures &= ~CDATA; + fFeatures &= ~SCHEMAVALIDATE; + fFeatures &= ~DTNORMALIZE; + fFeatures |= NAMESPACES; + fFeatures |= NAMESPACEDECLS; + fFeatures |= WELLFORMED; + fFeatures |= ELEM_CONTENT_WHITESPACE; + fFeatures |= COMMENTS; + } + + // infoset + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); + + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, ""); + + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + // Setting this to false has no effect + } + } // If the parameter value is not a boolean + else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { + if (value == null || value instanceof DOMErrorHandler) { + fDOMErrorHandler = (DOMErrorHandler)value; + } else { + String msg = Utils.messages.createMessage( + MsgKey.ER_TYPE_MISMATCH_ERR, + new Object[] { name }); + throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); + } + } else if ( + name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) + || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE) + || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + && value != null) { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_FOUND, + new Object[] { name }); + throw new DOMException(DOMException.NOT_FOUND_ERR, msg); + } + } + // ************************************************************************ + + + // ************************************************************************ + // DOMConfiguraiton implementation + // ************************************************************************ + + /** + * Returns the DOMConfiguration of the LSSerializer. + * + * @see org.w3c.dom.ls.LSSerializer#getDomConfig() + * @since DOM Level 3 + * @return A DOMConfiguration object. + */ + public DOMConfiguration getDomConfig() { + return (DOMConfiguration)this; + } + + /** + * Returns the DOMConfiguration of the LSSerializer. + * + * @see org.w3c.dom.ls.LSSerializer#getFilter() + * @since DOM Level 3 + * @return A LSSerializerFilter object. + */ + public LSSerializerFilter getFilter() { + return fSerializerFilter; + } + + /** + * Returns the End-Of-Line sequence of characters to be used in the XML + * being serialized. If none is set a default "\n" is returned. + * + * @see org.w3c.dom.ls.LSSerializer#getNewLine() + * @since DOM Level 3 + * @return A String containing the end-of-line character sequence used in + * serialization. + */ + public String getNewLine() { + return fEndOfLine; + } + + /** + * Set a LSSerilizerFilter on the LSSerializer. When set, the filter is + * called before each node is serialized which depending on its implemention + * determines if the node is to be serialized or not. + * + * @see org.w3c.dom.ls.LSSerializer#setFilter + * @since DOM Level 3 + * @param filter A LSSerializerFilter to be applied to the stream to serialize. + */ + public void setFilter(LSSerializerFilter filter) { + fSerializerFilter = filter; + } + + /** + * Sets the End-Of-Line sequence of characters to be used in the XML + * being serialized. Setting this attribute to null will reset its + * value to the default value i.e. "\n". + * + * @see org.w3c.dom.ls.LSSerializer#setNewLine + * @since DOM Level 3 + * @param newLine a String that is the end-of-line character sequence to be used in + * serialization. + */ + public void setNewLine(String newLine) { + fEndOfLine = newLine !=null? newLine: fEndOfLine; + } + + /** + * Serializes the specified node to the specified LSOutput and returns true if the Node + * was successfully serialized. + * + * @see org.w3c.dom.ls.LSSerializer#write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput) + * @since DOM Level 3 + * @param nodeArg The Node to serialize. + * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the + * LSSerializer was unable to serialize the node. + * + */ + public boolean write(Node nodeArg, LSOutput destination) throws LSException { + // If the destination is null + if (destination == null) { + String msg = Utils.messages + .createMessage( + MsgKey.ER_NO_OUTPUT_SPECIFIED, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_NO_OUTPUT_SPECIFIED)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + } + + // If nodeArg is null, return false. Should we throw and LSException instead? + if (nodeArg == null ) { + return false; + } + + // Obtain a reference to the serializer to use + // Serializer serializer = getXMLSerializer(xmlVersion); + Serializer serializer = fXMLSerializer; + serializer.reset(); + + // If the node has not been seen + if ( nodeArg != fVisitedNode) { + // Determine the XML Document version of the Node + String xmlVersion = getXMLVersion(nodeArg); + + // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. + fEncoding = destination.getEncoding(); + if (fEncoding == null ) { + fEncoding = getInputEncoding(nodeArg); + fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); + } + + // If the encoding is not recognized throw an exception. + // Note: The serializer defaults to UTF-8 when created + if (!Encodings.isRecognizedEncoding(fEncoding)) { + String msg = Utils.messages + .createMessage( + MsgKey.ER_UNSUPPORTED_ENCODING, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_UNSUPPORTED_ENCODING)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + } + + serializer.getOutputFormat().setProperty("version", xmlVersion); + + // Set the output encoding and xml version properties + fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); + + // If the node to be serialized is not a Document, Element, or Entity + // node + // then the XML declaration, or text declaration, should be never be + // serialized. + if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE + || nodeArg.getNodeType() != Node.ELEMENT_NODE + || nodeArg.getNodeType() != Node.ENTITY_NODE) + && ((fFeatures & XMLDECL) != 0)) { + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + fVisitedNode = nodeArg; + } + + // Update the serializer properties + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + + // + try { + + // The LSSerializer will use the LSOutput object to determine + // where to serialize the output to in the following order the + // first one that is not null and not an empty string will be + // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream, + // 3. LSOutput.systemId + // 1.LSOutput.characterStream + Writer writer = destination.getCharacterStream(); + if (writer == null ) { + + // 2.LSOutput.byteStream + OutputStream outputStream = destination.getByteStream(); + if ( outputStream == null) { + + // 3. LSOutput.systemId + String uri = destination.getSystemId(); + if (uri == null) { + String msg = Utils.messages + .createMessage( + MsgKey.ER_NO_OUTPUT_SPECIFIED, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_NO_OUTPUT_SPECIFIED)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + + } else { + // Expand the System Id and obtain an absolute URI for it. + String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); + + URL url = new URL(absoluteURI); + OutputStream urlOutStream = null; + String protocol = url.getProtocol(); + String host = url.getHost(); + + // For file protocols, there is no need to use a URL to get its + // corresponding OutputStream + + // Scheme names consist of a sequence of characters. The lower case + // letters "a"--"z", digits, and the characters plus ("+"), period + // ("."), and hyphen ("-") are allowed. For resiliency, programs + // interpreting URLs should treat upper case letters as equivalent to + // lower case in scheme names (e.g., allow "HTTP" as well as "http"). + if (protocol.equalsIgnoreCase("file") + && (host == null || host.length() == 0 || host.equals("localhost"))) { + // do we also need to check for host.equals(hostname) + urlOutStream = new FileOutputStream(new File(url.getPath())); + + } else { + // This should support URL's whose schemes are mentioned in + // RFC1738 other than file + + URLConnection urlCon = url.openConnection(); + urlCon.setDoInput(false); + urlCon.setDoOutput(true); + urlCon.setUseCaches(false); + urlCon.setAllowUserInteraction(false); + + // When writing to a HTTP URI, a HTTP PUT is performed. + if (urlCon instanceof HttpURLConnection) { + HttpURLConnection httpCon = (HttpURLConnection) urlCon; + httpCon.setRequestMethod("PUT"); + } + urlOutStream = urlCon.getOutputStream(); + } + // set the OutputStream to that obtained from the systemId + serializer.setWriter(new OutputStreamWriter(urlOutStream)); + } + } else { + // 2.LSOutput.byteStream + serializer.setWriter(new OutputStreamWriter(outputStream, fEncoding)); + } + } else { + // 1.LSOutput.characterStream + serializer.setWriter(writer); + } + + // The associated media type by default is set to text/xml on + // org.apache.xml.serializer.SerializerBase. + + // Get a reference to the serializer then lets you serilize a DOM + // Use this hack till Xalan support JAXP1.3 + if (fDOMSerializer == null) { + fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); + } + + // Set the error handler on the DOM3Serializer interface implementation + if (fDOMErrorHandler != null) { + fDOMSerializer.setErrorHandler(fDOMErrorHandler); + } + + // Set the filter on the DOM3Serializer interface implementation + if (fSerializerFilter != null) { + fDOMSerializer.setNodeFilter(fSerializerFilter); + } + + // Set the NewLine character to be used + fDOMSerializer.setNewLine(fEndOfLine); + + // Serializer your DOM, where node is an org.w3c.dom.Node + // Assuming that Xalan's serializer can serialize any type of DOM node + fDOMSerializer.serializeDOM3(nodeArg); + + } catch( UnsupportedEncodingException ue) { + + String msg = Utils.messages + .createMessage( + MsgKey.ER_UNSUPPORTED_ENCODING, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_UNSUPPORTED_ENCODING, ue)); + } + throw new LSException(LSException.SERIALIZE_ERR, ue.getMessage()); + } catch (LSException lse) { + // Rethrow LSException. + throw lse; + } catch (RuntimeException e) { + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e!=null?e.getMessage():"NULL Exception") ; + } catch (Exception e) { + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), + null, e)); + } + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } + return true; + } + + /** + * Serializes the specified node and returns a String with the serialized + * data to the caller. + * + * @see org.w3c.dom.ls.LSSerializer#writeToString(org.w3c.dom.Node) + * @since DOM Level 3 + * @param nodeArg The Node to serialize. + * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the + * LSSerializer was unable to serialize the node. + * + */ + public String writeToString(Node nodeArg) throws DOMException, LSException { + // return null is nodeArg is null. Should an Exception be thrown instead? + if (nodeArg == null) { + return null; + } + + // Should we reset the serializer configuration before each write operation? + // Obtain a reference to the serializer to use + Serializer serializer = fXMLSerializer; + serializer.reset(); + + if (nodeArg != fVisitedNode){ + // Determine the XML Document version of the Node + String xmlVersion = getXMLVersion(nodeArg); + + serializer.getOutputFormat().setProperty("version", xmlVersion); + + // Set the output encoding and xml version properties + fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16"); + + // If the node to be serialized is not a Document, Element, or Entity + // node + // then the XML declaration, or text declaration, should be never be + // serialized. + if ((nodeArg.getNodeType() != Node.DOCUMENT_NODE + || nodeArg.getNodeType() != Node.ELEMENT_NODE + || nodeArg.getNodeType() != Node.ENTITY_NODE) + && ((fFeatures & XMLDECL) != 0)) { + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + fVisitedNode = nodeArg; + } + // Update the serializer properties + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + + // StringWriter to Output to + StringWriter output = new StringWriter(); + + // + try { + + // Set the Serializer's Writer to a StringWriter + serializer.setWriter(output); + + // Get a reference to the serializer then lets you serilize a DOM + // Use this hack till Xalan support JAXP1.3 + if (fDOMSerializer == null) { + fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); + } + + // Set the error handler on the DOM3Serializer interface implementation + if (fDOMErrorHandler != null) { + fDOMSerializer.setErrorHandler(fDOMErrorHandler); + } + + // Set the filter on the DOM3Serializer interface implementation + if (fSerializerFilter != null) { + fDOMSerializer.setNodeFilter(fSerializerFilter); + } + + // Set the NewLine character to be used + fDOMSerializer.setNewLine(fEndOfLine); + + // Serializer your DOM, where node is an org.w3c.dom.Node + fDOMSerializer.serializeDOM3(nodeArg); + } catch (LSException lse) { + // Rethrow LSException. + throw lse; + } catch (RuntimeException e) { + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } catch (Exception e) { + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), + null, e)); + } + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } + + // return the serialized string + return output.toString(); + } + + /** + * Serializes the specified node to the specified URI and returns true if the Node + * was successfully serialized. + * + * @see org.w3c.dom.ls.LSSerializer#writeToURI(org.w3c.dom.Node, String) + * @since DOM Level 3 + * @param nodeArg The Node to serialize. + * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the + * LSSerializer was unable to serialize the node. + * + */ + public boolean writeToURI(Node nodeArg, String uri) throws LSException { + // If nodeArg is null, return false. Should we throw and LSException instead? + if (nodeArg == null ) { + return false; + } + + // Obtain a reference to the serializer to use + Serializer serializer = fXMLSerializer; + serializer.reset(); + + if (nodeArg != fVisitedNode) { + // Determine the XML Document version of the Node + String xmlVersion = getXMLVersion(nodeArg); + + // Determine the encoding: 1.LSOutput.encoding, + // 2.Document.inputEncoding, 3.Document.xmlEncoding. + fEncoding = getInputEncoding(nodeArg); + if (fEncoding == null ) { + fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); + } + + serializer.getOutputFormat().setProperty("version", xmlVersion); + + // Set the output encoding and xml version properties + fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); + + // If the node to be serialized is not a Document, Element, or Entity + // node + // then the XML declaration, or text declaration, should be never be + // serialized. + if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE + || nodeArg.getNodeType() != Node.ELEMENT_NODE + || nodeArg.getNodeType() != Node.ENTITY_NODE) + && ((fFeatures & XMLDECL) != 0)) { + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + fVisitedNode = nodeArg; + } + + // Update the serializer properties + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + + // + try { + // If the specified encoding is not supported an + // "unsupported-encoding" fatal error is raised. ?? + if (uri == null) { + String msg = Utils.messages.createMessage( + MsgKey.ER_NO_OUTPUT_SPECIFIED, null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_NO_OUTPUT_SPECIFIED)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + + } else { + // REVISIT: Can this be used to get an absolute expanded URI + String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); + + URL url = new URL(absoluteURI); + OutputStream urlOutStream = null; + String protocol = url.getProtocol(); + String host = url.getHost(); + + // For file protocols, there is no need to use a URL to get its + // corresponding OutputStream + + // Scheme names consist of a sequence of characters. The lower + // case letters "a"--"z", digits, and the characters plus ("+"), + // period ("."), and hyphen ("-") are allowed. For resiliency, + // programs interpreting URLs should treat upper case letters as + // equivalent to lower case in scheme names + // (e.g., allow "HTTP" as well as "http"). + if (protocol.equalsIgnoreCase("file") + && (host == null || host.length() == 0 || host + .equals("localhost"))) { + // do we also need to check for host.equals(hostname) + urlOutStream = new FileOutputStream(new File(url.getPath())); + + } else { + // This should support URL's whose schemes are mentioned in + // RFC1738 other than file + + URLConnection urlCon = url.openConnection(); + urlCon.setDoInput(false); + urlCon.setDoOutput(true); + urlCon.setUseCaches(false); + urlCon.setAllowUserInteraction(false); + + // When writing to a HTTP URI, a HTTP PUT is performed. + if (urlCon instanceof HttpURLConnection) { + HttpURLConnection httpCon = (HttpURLConnection) urlCon; + httpCon.setRequestMethod("PUT"); + } + urlOutStream = urlCon.getOutputStream(); + } + // set the OutputStream to that obtained from the systemId + serializer.setWriter(new OutputStreamWriter(urlOutStream, fEncoding)); + } + + // Get a reference to the serializer then lets you serilize a DOM + // Use this hack till Xalan support JAXP1.3 + if (fDOMSerializer == null) { + fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); + } + + // Set the error handler on the DOM3Serializer interface implementation + if (fDOMErrorHandler != null) { + fDOMSerializer.setErrorHandler(fDOMErrorHandler); + } + + // Set the filter on the DOM3Serializer interface implementation + if (fSerializerFilter != null) { + fDOMSerializer.setNodeFilter(fSerializerFilter); + } + + // Set the NewLine character to be used + fDOMSerializer.setNewLine(fEndOfLine); + + // Serializer your DOM, where node is an org.w3c.dom.Node + // Assuming that Xalan's serializer can serialize any type of DOM + // node + fDOMSerializer.serializeDOM3(nodeArg); + + } catch (LSException lse) { + // Rethrow LSException. + throw lse; + } catch (RuntimeException e) { + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } catch (Exception e) { + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), + null, e)); + } + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } + + return true; + } + // ************************************************************************ + + + // ************************************************************************ + // Implementaion methods + // ************************************************************************ + + /** + * Determines the XML Version of the Document Node to serialize. If the Document Node + * is not a DOM Level 3 Node, then the default version returned is 1.0. + * + * @param nodeArg The Node to serialize + * @return A String containing the version pseudo-attribute of the XMLDecl. + * @throws Throwable if the DOM implementation does not implement Document.getXmlVersion() + */ + //protected String getXMLVersion(Node nodeArg) throws Throwable { + protected String getXMLVersion(Node nodeArg) { + Document doc = null; + + // Determine the XML Version of the document + if (nodeArg != null) { + if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) { + // The Document node is the Node argument + doc = (Document)nodeArg; + } else { + // The Document node is the Node argument's ownerDocument + doc = nodeArg.getOwnerDocument(); + } + + // Determine the DOM Version. + if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) { + try { + return doc.getXmlVersion(); + } catch (AbstractMethodError e) { + //ignore, impl does not support the method + } + } + } + // The version will be treated as "1.0" which may result in + // an ill-formed document being serialized. + // If nodeArg does not have an ownerDocument, treat this as XML 1.0 + return "1.0"; + } + + /** + * Determines the XML Encoding of the Document Node to serialize. If the Document Node + * is not a DOM Level 3 Node, then the default encoding "UTF-8" is returned. + * + * @param nodeArg The Node to serialize + * @return A String containing the encoding pseudo-attribute of the XMLDecl. + * @throws Throwable if the DOM implementation does not implement Document.getXmlEncoding() + */ + protected String getXMLEncoding(Node nodeArg) { + Document doc = null; + + // Determine the XML Encoding of the document + if (nodeArg != null) { + if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) { + // The Document node is the Node argument + doc = (Document)nodeArg; + } else { + // The Document node is the Node argument's ownerDocument + doc = nodeArg.getOwnerDocument(); + } + + // Determine the XML Version. + if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) { + return doc.getXmlEncoding(); + } + } + // The default encoding is UTF-8 except for the writeToString method + return "UTF-8"; + } + + /** + * Determines the Input Encoding of the Document Node to serialize. If the Document Node + * is not a DOM Level 3 Node, then null is returned. + * + * @param nodeArg The Node to serialize + * @return A String containing the input encoding. + */ + protected String getInputEncoding(Node nodeArg) { + Document doc = null; + + // Determine the Input Encoding of the document + if (nodeArg != null) { + if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) { + // The Document node is the Node argument + doc = (Document)nodeArg; + } else { + // The Document node is the Node argument's ownerDocument + doc = nodeArg.getOwnerDocument(); + } + + // Determine the DOM Version. + if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) { + return doc.getInputEncoding(); + } + } + // The default encoding returned is null + return null; + } + + /** + * This method returns the LSSerializer's error handler. + * + * @return Returns the fDOMErrorHandler. + */ + public DOMErrorHandler getErrorHandler() { + return fDOMErrorHandler; + } + +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java new file mode 100644 index 00000000000..611b984f05a --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java @@ -0,0 +1,315 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.util.Enumeration; +import java.util.NoSuchElementException; + +/** + * Namespace support for XML document handlers. This class doesn't + * perform any error checking and assumes that all strings passed + * as arguments to methods are unique symbols. The SymbolTable class + * can be used for this purpose. + * + * Derived from org.apache.xerces.util.NamespaceSupport + * + * @author Andy Clark, IBM + * + * @version $Id: Exp $ + */ +public class NamespaceSupport { + + static final String PREFIX_XML = "xml".intern(); + + static final String PREFIX_XMLNS = "xmlns".intern(); + + /** + * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is + * the Namespace URI that is automatically mapped to the "xml" prefix. + */ + public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern(); + + /** + * XML Information Set REC + * all namespace attributes (including those named xmlns, + * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/ + */ + public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern(); + + // + // Data + // + + /** + * Namespace binding information. This array is composed of a + * series of tuples containing the namespace binding information: + * <prefix, uri>. The default size can be set to anything + * as long as it is a power of 2 greater than 1. + * + * @see #fNamespaceSize + * @see #fContext + */ + protected String[] fNamespace = new String[16 * 2]; + + /** The top of the namespace information array. */ + protected int fNamespaceSize; + + // NOTE: The constructor depends on the initial context size + // being at least 1. -Ac + + /** + * Context indexes. This array contains indexes into the namespace + * information array. The index at the current context is the start + * index of declared namespace bindings and runs to the size of the + * namespace information array. + * + * @see #fNamespaceSize + */ + protected int[] fContext = new int[8]; + + /** The current context. */ + protected int fCurrentContext; + + protected String[] fPrefixes = new String[16]; + + // + // Constructors + // + + /** Default constructor. */ + public NamespaceSupport() { + } // () + + // + // Public methods + // + + /** + * @see org.apache.xerces.xni.NamespaceContext#reset() + */ + public void reset() { + + // reset namespace and context info + fNamespaceSize = 0; + fCurrentContext = 0; + fContext[fCurrentContext] = fNamespaceSize; + + // bind "xml" prefix to the XML uri + fNamespace[fNamespaceSize++] = PREFIX_XML; + fNamespace[fNamespaceSize++] = XML_URI; + // bind "xmlns" prefix to the XMLNS uri + fNamespace[fNamespaceSize++] = PREFIX_XMLNS; + fNamespace[fNamespaceSize++] = XMLNS_URI; + ++fCurrentContext; + + } // reset(SymbolTable) + + + /** + * @see org.apache.xerces.xni.NamespaceContext#pushContext() + */ + public void pushContext() { + + // extend the array, if necessary + if (fCurrentContext + 1 == fContext.length) { + int[] contextarray = new int[fContext.length * 2]; + System.arraycopy(fContext, 0, contextarray, 0, fContext.length); + fContext = contextarray; + } + + // push context + fContext[++fCurrentContext] = fNamespaceSize; + + } // pushContext() + + + /** + * @see org.apache.xerces.xni.NamespaceContext#popContext() + */ + public void popContext() { + fNamespaceSize = fContext[fCurrentContext--]; + } // popContext() + + /** + * @see org.apache.xerces.xni.NamespaceContext#declarePrefix(String, String) + */ + public boolean declarePrefix(String prefix, String uri) { + // ignore "xml" and "xmlns" prefixes + if (prefix == PREFIX_XML || prefix == PREFIX_XMLNS) { + return false; + } + + // see if prefix already exists in current context + for (int i = fNamespaceSize; i > fContext[fCurrentContext]; i -= 2) { + //if (fNamespace[i - 2] == prefix) { + if (fNamespace[i - 2].equals(prefix) ) { + // REVISIT: [Q] Should the new binding override the + // previously declared binding or should it + // it be ignored? -Ac + // NOTE: The SAX2 "NamespaceSupport" helper allows + // re-bindings with the new binding overwriting + // the previous binding. -Ac + fNamespace[i - 1] = uri; + return true; + } + } + + // resize array, if needed + if (fNamespaceSize == fNamespace.length) { + String[] namespacearray = new String[fNamespaceSize * 2]; + System.arraycopy(fNamespace, 0, namespacearray, 0, fNamespaceSize); + fNamespace = namespacearray; + } + + // bind prefix to uri in current context + fNamespace[fNamespaceSize++] = prefix; + fNamespace[fNamespaceSize++] = uri; + + return true; + + } // declarePrefix(String,String):boolean + + /** + * @see org.apache.xerces.xni.NamespaceContext#getURI(String) + */ + public String getURI(String prefix) { + + // find prefix in current context + for (int i = fNamespaceSize; i > 0; i -= 2) { + //if (fNamespace[i - 2] == prefix) { + if (fNamespace[i - 2].equals(prefix) ) { + return fNamespace[i - 1]; + } + } + + // prefix not found + return null; + + } // getURI(String):String + + + /** + * @see org.apache.xerces.xni.NamespaceContext#getPrefix(String) + */ + public String getPrefix(String uri) { + + // find uri in current context + for (int i = fNamespaceSize; i > 0; i -= 2) { + //if (fNamespace[i - 1] == uri) { + if (fNamespace[i - 1].equals(uri) ) { + //if (getURI(fNamespace[i - 2]) == uri) + if (getURI(fNamespace[i - 2]).equals(uri) ) + return fNamespace[i - 2]; + } + } + + // uri not found + return null; + + } // getPrefix(String):String + + + /** + * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount() + */ + public int getDeclaredPrefixCount() { + return (fNamespaceSize - fContext[fCurrentContext]) / 2; + } // getDeclaredPrefixCount():int + + /** + * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int) + */ + public String getDeclaredPrefixAt(int index) { + return fNamespace[fContext[fCurrentContext] + index * 2]; + } // getDeclaredPrefixAt(int):String + + /** + * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes() + */ + public Enumeration getAllPrefixes() { + int count = 0; + if (fPrefixes.length < (fNamespace.length/2)) { + // resize prefix array + String[] prefixes = new String[fNamespaceSize]; + fPrefixes = prefixes; + } + String prefix = null; + boolean unique = true; + for (int i = 2; i < (fNamespaceSize-2); i += 2) { + prefix = fNamespace[i + 2]; + for (int k=0;k'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "An instance of the Well-Formedness checker could not be created. The well-formed parameter was set to true but well-formedness checking can not be performed." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "The node ''{0}'' contains invalid XML characters." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "An invalid XML character (Unicode: 0x{0}) was found in the comment." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "An invalid XML character (Unicode: 0x{0}) was found in the processing instructiondata." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "An invalid XML character (Unicode: 0x{0}) was found in the contents of the CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "An invalid XML character (Unicode: 0x{0}) was found in the node''s character data content." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "An invalid XML character(s) was found in the {0} node named ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "The string \"--\" is not permitted within comments." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "The value of attribute \"{1}\" associated with an element type \"{0}\" must not contain the ''<'' character." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "The unparsed entity reference \"&{0};\" is not permitted." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "The external entity reference \"&{0};\" is not permitted in an attribute value." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "The prefix \"{0}\" can not be bound to namespace \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "The local name of element \"{0}\" is null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "The local name of attr \"{0}\" is null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "The replacement text of the entity node \"{0}\" contains an element node \"{1}\" with an unbound prefix \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "The replacement text of the entity node \"{0}\" contains an attribute node \"{1}\" with an unbound prefix \"{2}\"." + }, + + { MsgKey.ER_WRITING_INTERNAL_SUBSET, + "An error occured while writing the internal subset." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java index 55337933552..5dd866b8bbb 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -122,7 +124,106 @@ public class SerializerMessages_ca extends ListResourceBundle { "Userinfo may not be specified if host is not specified"}, { MsgKey.ER_SCHEME_REQUIRED, - "Scheme is required!"} + "Scheme is required!"}, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "L''objecte de propietats passat a SerializerFactory no t\u00e9 cap propietat ''{0}''." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Av\u00eds: el temps d''execuci\u00f3 de Java no d\u00f3na suport a la codificaci\u00f3 ''{0}''." }, + + {MsgKey.ER_FEATURE_NOT_FOUND, + "El par\u00e0metre ''{0}'' no es reconeix."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "El par\u00e0metre ''{0}'' es reconeix per\u00f2 el valor sol\u00b7licitat no es pot establir."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La cadena resultant \u00e9s massa llarga per cabre en una DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "El tipus de valor per a aquest nom de par\u00e0metre \u00e9s incompatible amb el tipus de valor esperat."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "La destinaci\u00f3 de sortida per a les dades que s'ha d'escriure era nul\u00b7la."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "S'ha trobat una codificaci\u00f3 no suportada."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "El node no s'ha pogut serialitzat."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La secci\u00f3 CDATA cont\u00e9 un o m\u00e9s marcadors d'acabament ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "No s'ha pogut crear cap inst\u00e0ncia per comprovar si t\u00e9 un format correcte o no. El par\u00e0metre del tipus ben format es va establir en cert, per\u00f2 la comprovaci\u00f3 de format no s'ha pogut realitzar." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "El node ''{0}'' cont\u00e9 car\u00e0cters XML no v\u00e0lids." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en el comentari." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en les dades d''instrucci\u00f3 de proc\u00e9s." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en els continguts de la CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en el contingut de dades de car\u00e0cter del node." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "S''han trobat car\u00e0cters XML no v\u00e0lids al node {0} anomenat ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "La cadena \"--\" no est\u00e0 permesa dins dels comentaris." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "El valor d''atribut \"{1}\" associat amb un tipus d''element \"{0}\" no pot contenir el car\u00e0cter ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "La refer\u00e8ncia de l''entitat no analitzada \"&{0};\" no est\u00e0 permesa." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "La refer\u00e8ncia externa de l''entitat \"&{0};\" no est\u00e0 permesa en un valor d''atribut." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "El prefix \"{0}\" no es pot vincular a l''espai de noms \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "El nom local de l''element \"{0}\" \u00e9s nul." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "El nom local d''atr \"{0}\" \u00e9s nul." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''element \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''atribut \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"." + }, }; return contents; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java index 5c6977c79dd..ef7c3236b1c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -114,7 +116,106 @@ public class SerializerMessages_cs extends ListResourceBundle { "Nen\u00ed-li ur\u010den hostitel, nelze zadat \u00fadaje o u\u017eivateli."}, { MsgKey.ER_SCHEME_REQUIRED, - "Je vy\u017eadov\u00e1no sch\u00e9ma!"} + "Je vy\u017eadov\u00e1no sch\u00e9ma!"}, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "Objekt vlastnost\u00ed p\u0159edan\u00fd faktorii SerializerFactory neobsahuje vlastnost ''{0}''. " }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Varov\u00e1n\u00ed: K\u00f3dov\u00e1n\u00ed ''{0}'' nen\u00ed v b\u011bhov\u00e9m prost\u0159ed\u00ed Java podporov\u00e1no." }, + + {MsgKey.ER_FEATURE_NOT_FOUND, + "Parametr ''{0}'' nebyl rozpozn\u00e1n."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Parametr ''{0}'' byl rozpozn\u00e1n, ale nelze nastavit po\u017eadovanou hodnotu."}, + + {MsgKey.ER_STRING_TOO_LONG, + "V\u00fdsledn\u00fd \u0159et\u011bzec je p\u0159\u00edli\u0161 dlouh\u00fd pro \u0159et\u011bzec DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Typ hodnoty pro tento n\u00e1zev parametru nen\u00ed kompatibiln\u00ed s o\u010dek\u00e1van\u00fdm typem hodnoty."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "C\u00edlov\u00e9 um\u00edst\u011bn\u00ed v\u00fdstupu pro data ur\u010den\u00e1 k z\u00e1pisu je rovno hodnot\u011b Null. "}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Bylo nalezeno nepodporovan\u00e9 k\u00f3dov\u00e1n\u00ed."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Nelze prov\u00e9st serializaci uzlu. "}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "Sekce CDATA obsahuje jednu nebo v\u00edce ukon\u010dovac\u00edch zna\u010dek ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Nelze vytvo\u0159it instanci modulu pro kontrolu spr\u00e1vn\u00e9ho utvo\u0159en\u00ed. Parametr spr\u00e1vn\u00e9ho utvo\u0159en\u00ed byl nastaven na hodnotu true, nepoda\u0159ilo se v\u0161ak zkontrolovat spr\u00e1vnost utvo\u0159en\u00ed. " + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Uzel ''{0}'' obsahuje neplatn\u00e9 znaky XML. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "V pozn\u00e1mce byl zji\u0161t\u011bn neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "V datech instrukce zpracov\u00e1n\u00ed byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "V odd\u00edlu CDATASection byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "V obsahu znakov\u00fdch dat uzlu byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "V objektu {0} s n\u00e1zvem ''{1}'' byl nalezen neplatn\u00fd znak XML. " + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "V pozn\u00e1mk\u00e1ch nen\u00ed povolen \u0159et\u011bzec \"--\"." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "Hodnota atributu \"{1}\" souvisej\u00edc\u00edho s typem prvku \"{0}\" nesm\u00ed obsahovat znak ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "Odkaz na neanalyzovanou entitu \"&{0};\" nen\u00ed povolen." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "Extern\u00ed odkaz na entitu \"&{0};\" nen\u00ed v hodnot\u011b atributu povolen." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "P\u0159edpona \"{0}\" nesm\u00ed b\u00fdt v\u00e1zan\u00e1 k oboru n\u00e1zv\u016f \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Lok\u00e1ln\u00ed n\u00e1zev prvku \"{0}\" m\u00e1 hodnotu Null. " + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Lok\u00e1ln\u00ed n\u00e1zev atributu \"{0}\" m\u00e1 hodnotu Null. " + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel prvku \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel atributu \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\". " + }, }; return contents; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java index 20e8a4de7b8..6d3fea66a20 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_de extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Warnung: Die Codierung \"{0}\" wird nicht von der Java-Laufzeit unterst\u00FCtzt." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "Der Parameter ''{0}'' wird nicht erkannt."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Der Parameter ''{0}'' wird erkannt, der angeforderte Wert kann jedoch nicht festgelegt werden."}, + + {MsgKey.ER_STRING_TOO_LONG, + "Die Ergebniszeichenfolge ist zu lang f\u00fcr eine DOM-Zeichenfolge: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Der Werttyp f\u00fcr diesen Parameternamen ist nicht kompatibel mit dem erwarteten Werttyp."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "Das Ausgabeziel f\u00fcr die zu schreibenden Daten war leer."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Eine nicht unterst\u00fctzte Codierung wurde festgestellt."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Der Knoten konnte nicht serialisiert werden."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "Der Abschnitt CDATA enth\u00e4lt mindestens eine Beendigungsmarkierung ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Eine Instanz des Pr\u00fcfprogramms f\u00fcr korrekte Formatierung konnte nicht erstellt werden. F\u00fcr den korrekt formatierten Parameter wurde der Wert 'True' festgelegt, die Pr\u00fcfung auf korrekte Formatierung kann jedoch nicht durchgef\u00fchrt werden." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Der Knoten ''{0}'' enth\u00e4lt ung\u00fcltige XML-Zeichen." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Im Kommentar wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "In der Verarbeitungsanweisung wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Im Inhalt von CDATASection wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) wurde im Inhalt der Zeichendaten des Knotens gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Ung\u00fcltige XML-Zeichen wurden gefunden in {0} im Knoten ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "Die Zeichenfolge \"--\" ist innerhalb von Kommentaren nicht zul\u00e4ssig." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "Der Wert des Attributs \"{1}\" mit einem Elementtyp \"{0}\" darf nicht das Zeichen ''<'' enthalten." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "Der syntaktisch nicht analysierte Entit\u00e4tenverweis \"&{0};\" ist nicht zul\u00e4ssig." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "Der externe Entit\u00e4tenverweis \"&{0};\" ist in einem Attributwert nicht zul\u00e4ssig." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "Das Pr\u00e4fix \"{0}\" kann nicht an den Namensbereich \"{1}\" gebunden werden." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Der lokale Name von Element \"{0}\" ist nicht angegeben." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Der lokale Name des Attributs \"{0}\" ist nicht angegeben." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Elementknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Attributknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java index 4628321c2a0..c942361102b 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -198,8 +200,95 @@ public class SerializerMessages_es extends ListResourceBundle { "El objeto de propiedades transferido a SerializerFactory no tiene una propiedad ''{0}''." }, { MsgKey.ER_ENCODING_NOT_SUPPORTED, - "Advertencia: el tiempo de ejecuci\u00F3n de Java no soporta la codificaci\u00F3n ''{0}''." }, + "Aviso: La codificaci\u00f3n ''{0}'' no est\u00e1 soportada por Java Runtime." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "El par\u00e1metro ''{0}'' no se reconoce."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Se reconoce el par\u00e1metro ''{0}'' pero no puede establecerse el valor solicitado."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La serie producida es demasiado larga para ajustarse a DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "El tipo de valor para este nombre de par\u00e1metro es incompatible con el tipo de valor esperado."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "El destino de salida de escritura de los datos es nulo."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Se ha encontrado una codificaci\u00f3n no soportada."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "No se ha podido serializar el nodo."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La secci\u00f3n CDATA contiene uno o m\u00e1s marcadores ']]>' de terminaci\u00f3n."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "No se ha podido crear una instancia del comprobador de gram\u00e1tica correcta. El par\u00e1metro well-formed se ha establecido en true pero no se puede realizar la comprobaci\u00f3n de gram\u00e1tica correcta." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "El nodo ''{0}'' contiene caracteres XML no v\u00e1lidos." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el comentario." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en los datos de la instrucci\u00f3n de proceso." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de datos de caracteres del nodo." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Se ha encontrado un car\u00e1cter o caracteres XML no v\u00e1lidos en el nodo {0} denominado ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "No se permite la serie \"--\" dentro de los comentarios." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "El valor del atributo \"{1}\" asociado a un tipo de elemento \"{0}\" no debe contener el car\u00e1cter ''''<''''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "No se permite la referencia de entidad no analizada \"&{0};\"." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "La referencia de entidad externa \"&{0};\" no est\u00e1 permitida en un valor de atributo." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "No se puede encontrar el prefijo \"{0}\" en el espacio de nombres \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "El nombre local del elemento \"{0}\" es null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "El nombre local del atributo \"{0}\" es null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de elemento \"{1}\" con un prefijo no enlazado \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de atributo \"{1}\" con un prefijo no enlazado \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java index 97fb91fea96..0998038064e 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_fr extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Avertissement : l''encodage ''{0}'' n''est pas pris en charge par l''ex\u00E9cution Java." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "Le param\u00e8tre ''{0}'' n''est pas reconnu."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Le param\u00e8tre ''{0}'' est reconnu mas la valeur demand\u00e9e ne peut pas \u00eatre d\u00e9finie."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La cha\u00eene obtenue est trop longue pour un DOMString : ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Le type de valeur de ce param\u00e8tre est incompatible avec le type de valeur attendu."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "La sortie de destination des donn\u00e9es \u00e0 \u00e9crire \u00e9tait vide."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Codage non pris en charge."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Le noeud ne peut pas \u00eatre s\u00e9rialis\u00e9."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La section CDATA contient un ou plusieurs marqueurs de fin ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Aucune instance du programme de v\u00e9rification de la formation n'a pu \u00eatre cr\u00e9\u00e9e. La valeur true a \u00e9t\u00e9 attribu\u00e9e au param\u00e8tre well-formed mais la v\u00e9rification de la formation n'a pas pu \u00eatre effectu\u00e9e." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Le noeud ''{0}'' contient des caract\u00e8res XML non valides." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le commentaire." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans les donn\u00e9es de l''instruction de traitement." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Un caract\u00e8re XML non valide (Unicode: 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu de la CDATASection" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu des donn\u00e9es de type caract\u00e8res du noeud." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Un ou plusieurs caract\u00e8res non valides ont \u00e9t\u00e9 trouv\u00e9s dans le noeud {0} nomm\u00e9 ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "La cha\u00eene \"--\" est interdite dans des commentaires." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "La valeur de l''attribut \"{1}\" associ\u00e9 \u00e0 un type d''\u00e9l\u00e9ment \"{0}\" ne doit pas contenir le caract\u00e8re ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "La r\u00e9f\u00e9rence d''entit\u00e9 non analys\u00e9e \"&{0};\" n''est pas admise." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "La r\u00e9f\u00e9rence d''entit\u00e9 externe \"&{0};\" n''est pas admise dans une valeur d''attribut." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "Le pr\u00e9fixe \"{0}\" ne peut pas \u00eatre li\u00e9 \u00e0 l''espace de noms \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Le nom local de l''\u00e9l\u00e9ment \"{0}\" a une valeur null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Le nom local de l''attribut \"{0}\" a une valeur null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contaient un noeud d''\u00e9l\u00e9ment \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contient un noeud d''attribut \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java index 6d3977af38c..37556dfccfd 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_it extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Avvertenza: la codifica ''{0}'' non \u00E8 supportata da Java Runtime." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "Il parametro ''{0}'' non \u00e8 riconosciuto."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Il parametro ''{0}'' \u00e8 riconosciuto ma non \u00e8 possibile impostare il valore richiesto."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La stringa risultante \u00e8 troppo lunga per essere inserita in DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Il tipo di valore per questo nome di parametro non \u00e8 compatibile con il tipo di valore previsto."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "La destinazione di output in cui scrivere i dati era nulla."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\u00c8 stata rilevata una codifica non supportata."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Impossibile serializzare il nodo."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La Sezione CDATA contiene uno o pi\u00f9 markers di termine ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Impossibile creare un'istanza del controllore Well-Formedness. Il parametro well-formed \u00e8 stato impostato su true ma non \u00e8 possibile eseguire i controlli well-formedness." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Il nodo ''{0}'' contiene caratteri XML non validi." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Trovato un carattere XML non valido (Unicode: 0x{0}) nel commento." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Carattere XML non valido (Unicode: 0x{0}) rilevato nell''elaborazione di instructiondata." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto di CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto dati di caratteri del nodo. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Carattere XML non valido rilevato nel nodo {0} denominato ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "La stringa \"--\" non \u00e8 consentita nei commenti." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "Il valore dell''''attributo \"{1}\" associato con un tipo di elemento \"{0}\" non deve contenere il carattere ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "Il riferimento entit\u00e0 non analizzata \"&{0};\" non \u00e8 permesso." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "Il riferimento all''''entit\u00e0 esterna \"&{0};\" non \u00e8 permesso in un valore attributo." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "Il prefisso \"{0}\" non pu\u00f2 essere associato allo spazio nome \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Il nome locale dell''''elemento \"{0}\" \u00e8 null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Il nome locale dell''''attributo \"{0}\" \u00e8 null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di elemento \"{1}\" con un prefisso non associato \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di attributo \"{1}\" con un prefisso non associato \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java index 069c9f8b2d7..0c3612f820a 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_ja extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "\u8B66\u544A: \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0''{0}''\u306F\u3001Java\u30E9\u30F3\u30BF\u30A4\u30E0\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u305b\u3093\u3002"}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u3059\u304c\u3001\u8981\u6c42\u3055\u308c\u305f\u5024\u306f\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002"}, + + {MsgKey.ER_STRING_TOO_LONG, + "\u7d50\u679c\u306e\u30b9\u30c8\u30ea\u30f3\u30b0\u304c\u9577\u3059\u304e\u308b\u305f\u3081\u3001DOMString \u5185\u306b\u53ce\u307e\u308a\u307e\u305b\u3093: ''{0}''\u3002"}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u540d\u306e\u5024\u306e\u578b\u306f\u3001\u671f\u5f85\u3055\u308c\u308b\u5024\u306e\u578b\u3068\u4e0d\u9069\u5408\u3067\u3059\u3002"}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "\u66f8\u304d\u8fbc\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306e\u51fa\u529b\u5b9b\u5148\u304c\u30cc\u30eb\u3067\u3059\u3002"}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u3044\u30a8\u30f3\u30b3\u30fc\u30c9\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002"}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "\u30ce\u30fc\u30c9\u3092\u76f4\u5217\u5316\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002"}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306b 1 \u3064\u4ee5\u4e0a\u306e\u7d42\u4e86\u30de\u30fc\u30ab\u30fc ']]>' \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "\u6574\u5f62\u5f0f\u6027\u30c1\u30a7\u30c3\u30ab\u30fc\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 well-formed \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8a2d\u5b9a\u306f true \u3067\u3057\u305f\u304c\u3001\u6574\u5f62\u5f0f\u6027\u306e\u691c\u67fb\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "\u30ce\u30fc\u30c9 ''{0}'' \u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u3042\u308a\u307e\u3059\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "\u30b3\u30e1\u30f3\u30c8\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "\u51e6\u7406\u547d\u4ee4\u30c7\u30fc\u30bf\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "\u30ce\u30fc\u30c9\u306e\u6587\u5b57\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "''{1}'' \u3068\u3044\u3046\u540d\u524d\u306e {0} \u30ce\u30fc\u30c9\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "\u30b9\u30c8\u30ea\u30f3\u30b0 \"--\" \u306f\u30b3\u30e1\u30f3\u30c8\u5185\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "\u8981\u7d20\u578b \"{0}\" \u306b\u95a2\u9023\u3057\u305f\u5c5e\u6027 \"{1}\" \u306e\u5024\u306b\u306f ''<'' \u6587\u5b57\u3092\u542b\u3081\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "\u89e3\u6790\u5bfe\u8c61\u5916\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "\u5c5e\u6027\u5024\u3067\u306e\u5916\u90e8\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "\u63a5\u982d\u90e8 \"{0}\" \u306f\u540d\u524d\u7a7a\u9593 \"{1}\" \u306b\u7d50\u5408\u3067\u304d\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "\u8981\u7d20 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "\u5c5e\u6027 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002" + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u8981\u7d20\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002" + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u5c5e\u6027\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002" + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java index 90750d5245e..410dcadf72c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_ko extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "\uACBD\uACE0: \uC778\uCF54\uB529 ''{0}''\uC740(\uB294) Java \uB7F0\uD0C0\uC784\uC5D0 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub97c \uc778\uc2dd\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub294 \uc778\uc2dd\ud560 \uc218 \uc788\uc73c\ub098 \uc694\uccad\ub41c \uac12\uc744 \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_STRING_TOO_LONG, + "\uacb0\uacfc \ubb38\uc790\uc5f4\uc774 \ub108\ubb34 \uae38\uc5b4 DOMString\uc5d0 \ub9de\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4: ''{0}'' "}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "\uc774 \ub9e4\uac1c\ubcc0\uc218 \uc774\ub984\uc5d0 \ub300\ud55c \uac12 \uc720\ud615\uc774 \uc608\uc0c1 \uac12 \uc720\ud615\uacfc \ud638\ud658\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "\ub370\uc774\ud130\ub97c \uae30\ub85d\ud560 \ucd9c\ub825 \ub300\uc0c1\uc774 \ub110(null)\uc785\ub2c8\ub2e4."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\uc9c0\uc6d0\ub418\uc9c0 \uc54a\ub294 \uc778\ucf54\ub529\uc774 \ubc1c\uacac\ub418\uc5c8\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "\ub178\ub4dc\ub97c \uc9c1\ub82c\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "CDATA \uc139\uc158\uc5d0 \uc885\ub8cc \ud45c\uc2dc \ubb38\uc790\uc778 ']]>'\uac00 \ud558\ub098 \uc774\uc0c1 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Well-Formedness \uac80\uc0ac\uae30\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc791\uc131\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. Well-Formed \ub9e4\uac1c\ubcc0\uc218\uac00 true\ub85c \uc124\uc815\ub418\uc5c8\uc9c0\ub9cc Well-Formedness \uac80\uc0ac\ub97c \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "''{0}'' \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "\uc124\uba85\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "\ucc98\ub9ac \uba85\ub839\uc5b4 \ub370\uc774\ud130\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4 " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "CDATASection\uc758 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "\ub178\ub4dc\uc758 \ubb38\uc790 \ub370\uc774\ud130 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "\uc774\ub984\uc774 ''{1}''\uc778 {0} \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "\uc124\uba85 \ub0b4\uc5d0\uc11c\ub294 \"--\" \ubb38\uc790\uc5f4\uc774 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "\"{0}\" \uc694\uc18c \uc720\ud615\uacfc \uc5f0\uad00\ub41c \"{1}\" \uc18d\uc131\uac12\uc5d0 ''<'' \ubb38\uc790\uac00 \ud3ec\ud568\ub418\uba74 \uc548\ub429\ub2c8\ub2e4." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "\"&{0};\"\uc758 \uad6c\ubd84 \ubd84\uc11d\ub418\uc9c0 \uc54a\uc740 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\ub294 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. " + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "\uc18d\uc131\uac12\uc5d0\ub294 \"&{0};\" \uc678\ubd80 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\uac00 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. " + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "\"{0}\" \uc811\ub450\ubd80\ub97c \"{1}\" \uc774\ub984 \uacf5\uac04\uc5d0 \ubc14\uc778\ub4dc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "\"{0}\" \uc694\uc18c\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "\"{0}\" \uc18d\uc131\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc694\uc18c \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc18d\uc131 \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java index 41949ddbf55..a65026f3d51 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_pt_BR extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Advert\u00EAncia: a codifica\u00E7\u00E3o ''{0}'' n\u00E3o \u00E9 suportada pelo Java runtime." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "O par\u00e2metro ''{0}'' n\u00e3o \u00e9 reconhecido."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "O par\u00e2metro ''{0}'' \u00e9 reconhecido, mas o valor pedido n\u00e3o pode ser definido. "}, + + {MsgKey.ER_STRING_TOO_LONG, + "A cadeia resultante \u00e9 muito longa para caber em uma DOMString: ''{0}''. "}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "O tipo de valor para este nome de par\u00e2metro \u00e9 incompat\u00edvel com o tipo de valor esperado. "}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "O destino de sa\u00edda para os dados a serem gravados era nulo. "}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Uma codifica\u00e7\u00e3o n\u00e3o suportada foi encontrada. "}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "O n\u00f3 n\u00e3o p\u00f4de ser serializado."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "A Se\u00e7\u00e3o CDATA cont\u00e9m um ou mais marcadores de t\u00e9rmino ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Uma inst\u00e2ncia do verificador Well-Formedness n\u00e3o p\u00f4de ser criada. O par\u00e2metro well-formed foi definido como true, mas a verifica\u00e7\u00e3o well-formedness n\u00e3o pode ser executada." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "O n\u00f3 ''{0}'' cont\u00e9m caracteres XML inv\u00e1lidos. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no coment\u00e1rio. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no processo instructiondata." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado nos conte\u00fados do CDATASection. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no conte\u00fado dos dados de caractere dos n\u00f3s. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Um caractere inv\u00e1lido foi encontrado no {0} do n\u00f3 denominado ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "A cadeia \"--\" n\u00e3o \u00e9 permitida dentro dos coment\u00e1rios. " + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00e3o deve conter o caractere ''<''. " + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "A refer\u00eancia de entidade n\u00e3o analisada \"&{0};\" n\u00e3o \u00e9 permitida. " + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "A refer\u00eancia de entidade externa \"&{0};\" n\u00e3o \u00e9 permitida em um valor de atributo. " + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "O prefixo \"{0}\" n\u00e3o pode ser vinculado ao espa\u00e7o de nomes \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "O nome local do elemento \"{0}\" \u00e9 nulo." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "O nome local do atributo \"{0}\" \u00e9 nulo." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de elemento \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de atributo \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java index f1f64f1acb4..9d3e4996846 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_zh_TW extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "\u8B66\u544A: Java Runtime \u4E0D\u652F\u63F4\u7DE8\u78BC ''{0}''\u3002" }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "\u7121\u6cd5\u8fa8\u8b58\u53c3\u6578 ''{0}''\u3002"}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "\u53ef\u8fa8\u8b58 ''{0}'' \u53c3\u6578\uff0c\u4f46\u6240\u8981\u6c42\u7684\u503c\u7121\u6cd5\u8a2d\u5b9a\u3002"}, + + {MsgKey.ER_STRING_TOO_LONG, + "\u7d50\u679c\u5b57\u4e32\u904e\u9577\uff0c\u7121\u6cd5\u7f6e\u5165 DOMString: ''{0}'' \u4e2d\u3002"}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "\u9019\u500b\u53c3\u6578\u540d\u7a31\u7684\u503c\u985e\u578b\u8207\u671f\u671b\u503c\u985e\u578b\u4e0d\u76f8\u5bb9\u3002"}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "\u8cc7\u6599\u8981\u5beb\u5165\u7684\u8f38\u51fa\u76ee\u7684\u5730\u70ba\u7a7a\u503c\u3002"}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\u767c\u73fe\u4e0d\u652f\u63f4\u7684\u7de8\u78bc\u3002"}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "\u7bc0\u9ede\u7121\u6cd5\u5e8f\u5217\u5316\u3002"}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "CDATA \u5340\u6bb5\u5305\u542b\u4e00\u6216\u591a\u500b\u7d42\u6b62\u6a19\u8a18 ']]>'\u3002"}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "\u7121\u6cd5\u5efa\u7acb\u300c\u5f62\u5f0f\u5b8c\u6574\u300d\u6aa2\u67e5\u7a0b\u5f0f\u7684\u5be6\u4f8b\u3002Well-formed \u53c3\u6578\u96d6\u8a2d\u70ba true\uff0c\u4f46\u7121\u6cd5\u57f7\u884c\u5f62\u5f0f\u5b8c\u6574\u6aa2\u67e5\u3002" + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "\u7bc0\u9ede ''{0}'' \u5305\u542b\u7121\u6548\u7684 XML \u5b57\u5143\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "\u5728\u8a3b\u89e3\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "\u5728\u8655\u7406\u7a0b\u5e8f instructiondata \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "\u5728 CDATASection \u7684\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "\u5728\u7bc0\u9ede\u7684\u5b57\u5143\u8cc7\u6599\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "\u5728\u540d\u70ba ''{1}'' \u7684 ''{0}'' \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143\u3002" + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "\u8a3b\u89e3\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5b57\u4e32 \"--\"\u3002" + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "\u8207\u5143\u7d20\u985e\u578b \"{0}\" \u76f8\u95dc\u806f\u7684\u5c6c\u6027 \"{1}\" \u503c\u4e0d\u53ef\u5305\u542b ''<'' \u5b57\u5143\u3002" + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "\u4e0d\u5141\u8a31\u4f7f\u7528\u672a\u5256\u6790\u7684\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002" + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "\u5c6c\u6027\u503c\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5916\u90e8\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002" + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "\u5b57\u9996 \"{0}\" \u7121\u6cd5\u9023\u7d50\u5230\u540d\u7a31\u7a7a\u9593 \"{1}\"\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "\u5143\u7d20 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "\u5c6c\u6027 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002" + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5143\u7d20\u7bc0\u9ede \"{1}\"\u3002" + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5c6c\u6027\u7bc0\u9ede \"{1}\"\u3002" + }, }; From c5d6fb26786867a40b9f6fca6e0e804647a84ec3 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 30 Jul 2014 15:28:09 +0800 Subject: [PATCH 075/111] 8052999: ProblemList update for Unreachable.java Reviewed-by: xuelei --- jdk/test/ProblemList.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 0ff8e1a1bce..77d3b2b7748 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -204,7 +204,8 @@ sun/rmi/transport/proxy/EagerHttpFallback.java generic-all sun/security/pkcs11/ec/TestKeyFactory.java generic-all # 7164518: no PortUnreachableException on Mac -sun/security/krb5/auto/Unreachable.java macosx-all +# 8051952: Unreachable.java test failing on Windows +sun/security/krb5/auto/Unreachable.java windows-all, macosx-all # 7147060 com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java generic-all @@ -219,9 +220,6 @@ sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java solaris-all java/security/KeyPairGenerator/SolarisShortDSA.java solaris-all sun/security/tools/keytool/standard.sh solaris-all -# 8051952: Unreachable.java test failing on Windows -sun/security/krb5/auto/Unreachable.java windows-all - ############################################################################ # jdk_sound From ce3b922118a85ab78f629a66e806bf6da714e8f1 Mon Sep 17 00:00:00 2001 From: Sergey Lugovoy Date: Wed, 30 Jul 2014 16:49:02 +0400 Subject: [PATCH 076/111] 8049318: Test hideLocationProperties.js fails on Window due to backslash in path Reviewed-by: lagergren, sundar --- nashorn/test/script/basic/hideLocationProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nashorn/test/script/basic/hideLocationProperties.js b/nashorn/test/script/basic/hideLocationProperties.js index 66041dccfaa..62c1ec06322 100644 --- a/nashorn/test/script/basic/hideLocationProperties.js +++ b/nashorn/test/script/basic/hideLocationProperties.js @@ -46,7 +46,7 @@ function z(__FILE__) { (function() { print(__FILE__) })() } -print(__FILE__) +print(__FILE__.replace(/\\/g, "/")) var o = { __FILE__: "woot" } with(o) { print(__FILE__) } From 343fd87ea896d8892fd15368b0702cef19263168 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Wed, 30 Jul 2014 17:42:18 +0100 Subject: [PATCH 077/111] 8053938: Collections.checkedList(empty list).replaceAll((UnaryOperator)null) doesn't throw NPE after JDK-8047795 Reviewed-by: rriggs, mduigou --- jdk/src/share/classes/java/util/Collections.java | 1 + .../util/Collections/CheckedListReplaceAll.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index 7a8404b40f1..ce4ae7d1b97 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -3486,6 +3486,7 @@ public class Collections { */ @Override public void replaceAll(UnaryOperator operator) { + Objects.requireNonNull(operator); list.replaceAll(e -> typeCheck(operator.apply(e))); } diff --git a/jdk/test/java/util/Collections/CheckedListReplaceAll.java b/jdk/test/java/util/Collections/CheckedListReplaceAll.java index 8ac05d095f2..19042db24d6 100644 --- a/jdk/test/java/util/Collections/CheckedListReplaceAll.java +++ b/jdk/test/java/util/Collections/CheckedListReplaceAll.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8047795 + * @bug 8047795 8053938 * @summary Ensure that replaceAll operator cannot add bad elements * @author Mike Duigou */ @@ -46,5 +46,16 @@ public class CheckedListReplaceAll { thwarted.printStackTrace(System.out); System.out.println("Curses! Foiled again!"); } + + unwrapped = Arrays.asList(new Object[]{}); // Empty list + wrapped = Collections.checkedList(unwrapped, Integer.class); + try { + wrapped.replaceAll((UnaryOperator)null); + System.out.printf("Bwahaha! I have defeated you! %s\n", wrapped); + throw new RuntimeException("NPE not thrown when passed a null operator"); + } catch (NullPointerException thwarted) { + thwarted.printStackTrace(System.out); + System.out.println("Curses! Foiled again!"); + } } } From d8c8841e2a7f5c4fba1d48336c69e6369177cccc Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 30 Jul 2014 10:06:42 -0700 Subject: [PATCH 078/111] 8051839: GuardedInvocation needs to clone an argument Reviewed-by: hannesw, sundar --- nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java b/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java index 34dcdc03d76..00ee9dc77cb 100644 --- a/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java +++ b/nashorn/src/jdk/internal/dynalink/linker/GuardedInvocation.java @@ -193,7 +193,7 @@ public class GuardedInvocation { invocation.getClass(); // NPE check this.invocation = invocation; this.guard = guard; - this.switchPoints = switchPoints; + this.switchPoints = switchPoints == null ? null : switchPoints.clone(); this.exception = exception; } From 0bd7232f50c5359757d7a5eb699f84f3f7fae44c Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Wed, 30 Jul 2014 10:09:11 -0700 Subject: [PATCH 079/111] 8053965: Xerces update breaks profile build Reviewed-by: lancea, alanb --- .../org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java index d684acb2902..d6c0a5d59a8 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java @@ -19,7 +19,7 @@ * $Id: $ */ -package org.apache.xml.serializer.dom3; +package com.sun.org.apache.xml.internal.serializer.dom3; import org.w3c.dom.ls.LSOutput; From 5be9b5e8ecb4884f0d0b8f933134510ab9b3771c Mon Sep 17 00:00:00 2001 From: Aleksei Efimov Date: Thu, 31 Jul 2014 11:31:57 +0400 Subject: [PATCH 080/111] 8032908: getTextContent doesn't return string in JAXP Reviewed-by: joehw --- .../xml/jaxp/common/8032908/TestFunc.java | 33 +++++++++++ .../javax/xml/jaxp/common/8032908/XSLT.java | 55 +++++++++++++++++++ jdk/test/javax/xml/jaxp/common/8032908/in.xml | 2 + .../javax/xml/jaxp/common/8032908/test.xsl | 8 +++ 4 files changed, 98 insertions(+) create mode 100644 jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java create mode 100644 jdk/test/javax/xml/jaxp/common/8032908/XSLT.java create mode 100644 jdk/test/javax/xml/jaxp/common/8032908/in.xml create mode 100644 jdk/test/javax/xml/jaxp/common/8032908/test.xsl diff --git a/jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java b/jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java new file mode 100644 index 00000000000..20eb23fa513 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/common/8032908/TestFunc.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import org.w3c.dom.Node; + +public class TestFunc { + + public static String test(Node node) { + String s = node.getTextContent(); + return s; + } + +} diff --git a/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java b/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java new file mode 100644 index 00000000000..77ddcbcfaea --- /dev/null +++ b/jdk/test/javax/xml/jaxp/common/8032908/XSLT.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8032908 + * @summary Test if Node.getTextContent() function correctly returns children + * content + * @compile TestFunc.java XSLT.java + * @run main/othervm XSLT + */ +import java.io.ByteArrayOutputStream; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +public class XSLT { + + static final String XMLTOTRANSFORM = "/in.xml"; + static final String XSLTRANSFORMER = "/test.xsl"; + static final String EXPECTEDRESULT = "ABCDEFG"; + + public static void main(String[] args) throws TransformerException { + ByteArrayOutputStream resStream = new ByteArrayOutputStream(); + TransformerFactory trf = TransformerFactory.newInstance(); + Transformer tr = trf.newTransformer(new StreamSource(System.getProperty("test.src", ".") + XSLTRANSFORMER)); + tr.transform(new StreamSource(System.getProperty("test.src", ".") + XMLTOTRANSFORM), new StreamResult(resStream)); + System.out.println("Transformation completed. Result:" + resStream.toString()); + if (!resStream.toString().equals(EXPECTEDRESULT)) { + throw new RuntimeException("Incorrect transformation result"); + } + } +} diff --git a/jdk/test/javax/xml/jaxp/common/8032908/in.xml b/jdk/test/javax/xml/jaxp/common/8032908/in.xml new file mode 100644 index 00000000000..00585856370 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/common/8032908/in.xml @@ -0,0 +1,2 @@ + +ABCDEFG diff --git a/jdk/test/javax/xml/jaxp/common/8032908/test.xsl b/jdk/test/javax/xml/jaxp/common/8032908/test.xsl new file mode 100644 index 00000000000..268be0a01a8 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/common/8032908/test.xsl @@ -0,0 +1,8 @@ + + + + + + From c77c24b62dda44f897b980f2eebc4f55adf21d68 Mon Sep 17 00:00:00 2001 From: Aleksei Efimov Date: Thu, 31 Jul 2014 11:34:34 +0400 Subject: [PATCH 081/111] 8032908: getTextContent doesn't return string in JAXP Reviewed-by: joehw --- .../org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java index 526f5e1b5f0..ea0e9b7a9a4 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java @@ -3145,7 +3145,11 @@ public class SAX2DTM2 extends SAX2DTM m_data.elementAt(-dataIndex+1)); } } - else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type + else if (DTM.ELEMENT_NODE == type) + { + return getStringValueX(nodeHandle); + } + else if (DTM.DOCUMENT_FRAGMENT_NODE == type || DTM.DOCUMENT_NODE == type) { return null; From a55d1b4b75c6475eaae3aefd3880fbf6b0e4a787 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Thu, 31 Jul 2014 18:14:46 +0530 Subject: [PATCH 082/111] 8053908: jdeps is not PATH on Mac, results in ant clean test failure on Mac Reviewed-by: hannesw, jlaskey --- nashorn/test/script/nosecurity/JDK-8050964.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nashorn/test/script/nosecurity/JDK-8050964.js b/nashorn/test/script/nosecurity/JDK-8050964.js index 35b001f6d84..186d627030d 100644 --- a/nashorn/test/script/nosecurity/JDK-8050964.js +++ b/nashorn/test/script/nosecurity/JDK-8050964.js @@ -46,8 +46,11 @@ if (! nashornJar.isAbsolute()) { nashornJar = new File(".", nashornJar); } +var javahome = System.getProperty("java.home"); +var jdepsPath = javahome + "/../bin/jdeps".replaceAll(/\//g, File.separater); + // run jdep on nashorn.jar - only summary but print profile info -`jdeps -s -P ${nashornJar.absolutePath}` +`${jdepsPath} -s -P ${nashornJar.absolutePath}` // check for "(compact1)" in output from jdep tool if (! /(compact1)/.test($OUT)) { From da88be408e29b168afdee79c33dac5dcbd9890a8 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Thu, 31 Jul 2014 11:14:26 -0700 Subject: [PATCH 083/111] 8054009: Support SKIP_BOOT_CYCLE=false when invoked from JPRT Reviewed-by: dholmes, erikj --- make/Jprt.gmk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/make/Jprt.gmk b/make/Jprt.gmk index a7f9226d99f..59b76cdf4eb 100644 --- a/make/Jprt.gmk +++ b/make/Jprt.gmk @@ -46,6 +46,10 @@ ifndef JPRT_ARCHIVE_INSTALL_BUNDLE JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip endif +ifeq ($(SKIP_BOOT_CYCLE), false) + jprt_bundle: bootcycle-images +endif + # This target must be called in the context of a SPEC file jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) @$(call CheckIfMakeAtEnd) From e03cc0d3c2839dda63f3c7eaaa2d7d401ac3233d Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 31 Jul 2014 11:48:39 -0700 Subject: [PATCH 084/111] 8054050: Fix stay raw and unchecked lint warnings in core libs Reviewed-by: lancea, alanb --- .../classes/com/sun/management/GcInfo.java | 4 ++-- .../example/debug/expr/ExpressionParser.java | 16 ++++++++-------- .../tools/hat/internal/model/JavaClass.java | 6 +++--- .../hat/internal/model/JavaHeapObject.java | 8 ++++---- .../internal/model/ReachableExcludesImpl.java | 4 ++-- .../hat/internal/model/ReachableObjects.java | 6 +++--- .../sun/tools/hat/internal/model/Snapshot.java | 14 +++++++------- .../sun/tools/hat/internal/oql/OQLEngine.java | 18 +++++++++--------- .../hat/internal/server/AllClassesQuery.java | 6 +++--- .../tools/hat/internal/server/ClassQuery.java | 4 ++-- .../internal/server/FinalizerObjectsQuery.java | 4 ++-- .../internal/server/FinalizerSummaryQuery.java | 6 +++--- .../internal/server/InstancesCountQuery.java | 6 +++--- .../hat/internal/server/InstancesQuery.java | 6 +++--- .../hat/internal/server/RefsByTypeQuery.java | 10 +++++----- .../internal/util/CompositeEnumeration.java | 13 +++++++------ .../sun/tools/jdi/EventRequestManagerImpl.java | 4 ++-- .../jdk/nio/zipfs/ZipFileAttributeView.java | 1 + .../jdk/nio/zipfs/ZipFileSystemProvider.java | 1 + .../classes/sun/nio/ch/InheritedChannel.java | 4 ++-- 20 files changed, 72 insertions(+), 69 deletions(-) diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java index 0a7eda76a51..7257b6c6f62 100644 --- a/jdk/src/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/share/classes/com/sun/management/GcInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -267,7 +267,7 @@ public class GcInfo implements CompositeData, CompositeDataView { return cdata.toString(); } - public Collection values() { + public Collection values() { return cdata.values(); } diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java index 5f0c12086d6..4005adc4262 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java @@ -33,18 +33,18 @@ import java.util.ArrayList; public class ExpressionParser implements ExpressionParserConstants { - Stack stack = new Stack(); + Stack stack = new Stack<>(); VirtualMachine vm = null; GetFrame frameGetter = null; private static GetFrame lastFrameGetter; private static LValue lastLValue; LValue peek() { - return (LValue)stack.peek(); + return stack.peek(); } LValue pop() { - return (LValue)stack.pop(); + return stack.pop(); } void push(LValue lval) { @@ -915,7 +915,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void PrimarySuffix() throws ParseException { - List argList; + List argList; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); @@ -993,8 +993,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(NULL); } - final public List Arguments() throws ParseException { - List argList = new ArrayList(); + final public List Arguments() throws ParseException { + List argList = new ArrayList<>(); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: @@ -1026,7 +1026,7 @@ public class ExpressionParser implements ExpressionParserConstants { throw new Error("Missing return statement in function"); } - final public void ArgumentList(List argList) throws ParseException { + final public void ArgumentList(List argList) throws ParseException { Expression(); argList.add(pop().interiorGetValue()); label_17: @@ -1046,7 +1046,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void AllocationExpression() throws ParseException { - List argList; String className; + List argList; String className; if (jj_2_7(2)) { jj_consume_token(NEW); PrimitiveType(); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java index e7a59b3a4d6..3ad56be2d2c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -229,9 +229,9 @@ public class JavaClass extends JavaHeapObject { return name.indexOf('[') != -1; } - public Enumeration getInstances(boolean includeSubclasses) { + public Enumeration getInstances(boolean includeSubclasses) { if (includeSubclasses) { - Enumeration res = instances.elements(); + Enumeration res = instances.elements(); for (int i = 0; i < subclasses.length; i++) { res = new CompositeEnumeration(res, subclasses[i].getInstances(true)); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java index 508e0c0d4a3..471a77b595b 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,11 +166,11 @@ public abstract class JavaHeapObject extends JavaThing { * * @return an Enumeration of JavaHeapObject instances */ - public Enumeration getReferers() { + public Enumeration getReferers() { if (referersLen != -1) { throw new RuntimeException("not resolved: " + getIdString()); } - return new Enumeration() { + return new Enumeration() { private int num = 0; @@ -178,7 +178,7 @@ public abstract class JavaHeapObject extends JavaThing { return referers != null && num < referers.length; } - public Object nextElement() { + public JavaThing nextElement() { return referers[num++]; } }; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java index 46978cfaf90..c20d54b7392 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ public class ReachableExcludesImpl implements ReachableExcludes { private File excludesFile; private long lastModified; - private Hashtable methods; // Hashtable, used as a bag + private Hashtable methods; // Used as a bag /** * Create a new ReachableExcludesImpl over the given file. The file will be diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java index 831e8245873..43f4c03aa91 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ public class ReachableObjects { // Now grab the elements into a vector, and sort it in decreasing size JavaThing[] things = new JavaThing[bag.size()]; int i = 0; - for (Enumeration e = bag.elements(); e.hasMoreElements(); ) { + for (Enumeration e = bag.elements(); e.hasMoreElements(); ) { things[i++] = (JavaThing) e.nextElement(); } ArraySorter.sort(things, new Comparer() { @@ -131,7 +131,7 @@ public class ReachableObjects { return usedFields; } - private String[] getElements(Hashtable ht) { + private String[] getElements(Hashtable ht) { Object[] keys = ht.keySet().toArray(); int len = keys.length; String[] res = new String[len]; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java index 9c00ce05e18..77613c08e41 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ public class Snapshot { new HashMap(); // soft cache of finalizeable objects - lazily initialized - private SoftReference finalizablesCache; + private SoftReference> finalizablesCache; // represents null reference private JavaThing nullThing; @@ -383,7 +383,7 @@ public class Snapshot { /** * Return an Iterator of all of the classes in this snapshot. **/ - public Iterator getClasses() { + public Iterator getClasses() { // note that because classes is a TreeMap // classes are already sorted by name return classes.values().iterator(); @@ -395,8 +395,8 @@ public class Snapshot { return res; } - public synchronized Enumeration getFinalizerObjects() { - Vector obj; + public synchronized Enumeration getFinalizerObjects() { + Vector obj; if (finalizablesCache != null && (obj = finalizablesCache.get()) != null) { return obj.elements(); @@ -418,7 +418,7 @@ public class Snapshot { finalizables.add(referent); } } - finalizablesCache = new SoftReference(finalizables); + finalizablesCache = new SoftReference>(finalizables); return finalizables.elements(); } @@ -455,7 +455,7 @@ public class Snapshot { // Even though curr is in the rootset, we want to explore its // referers, because they might be more interesting. } - Enumeration referers = curr.getReferers(); + Enumeration referers = curr.getReferers(); while (referers.hasMoreElements()) { JavaHeapObject t = (JavaHeapObject) referers.nextElement(); if (t != null && !visited.containsKey(t)) { diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java index c69335d9798..c393b445ec6 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ public class OQLEngine { // create JavaScript engine Method getEngineMethod = managerClass.getMethod("getEngineByName", - new Class[] { String.class }); + new Class[] { String.class }); Object jse = getEngineMethod.invoke(manager, new Object[] {"js"}); oqlSupported = (jse != null); } catch (Exception exp) { @@ -205,9 +205,9 @@ public class OQLEngine { } if (q.className != null) { - Enumeration objects = clazz.getInstances(q.isInstanceOf); + Enumeration objects = clazz.getInstances(q.isInstanceOf); while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); Object[] args = new Object[] { wrapJavaObject(obj) }; boolean b = (whereCode == null); if (!b) { @@ -265,14 +265,14 @@ public class OQLEngine { // create JavaScript engine Method getEngineMethod = managerClass.getMethod("getEngineByName", - new Class[] { String.class }); + new Class[] { String.class }); engine = getEngineMethod.invoke(manager, new Object[] {"js"}); // initialize engine with init file (hat.js) InputStream strm = getInitStream(); Class engineClass = Class.forName("javax.script.ScriptEngine"); evalMethod = engineClass.getMethod("eval", - new Class[] { Reader.class }); + new Class[] { Reader.class }); evalMethod.invoke(engine, new Object[] {new InputStreamReader(strm)}); // initialize ScriptEngine.eval(String) and @@ -280,13 +280,13 @@ public class OQLEngine { Class invocableClass = Class.forName("javax.script.Invocable"); evalMethod = engineClass.getMethod("eval", - new Class[] { String.class }); + new Class[] { String.class }); invokeMethod = invocableClass.getMethod("invokeFunction", - new Class[] { String.class, Object[].class }); + new Class[] { String.class, Object[].class }); // initialize ScriptEngine.put(String, Object) method Method putMethod = engineClass.getMethod("put", - new Class[] { String.class, Object.class }); + new Class[] { String.class, Object.class }); // call ScriptEngine.put to initialize built-in heap object putMethod.invoke(engine, new Object[] { diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java index d453d82c38c..cd08b1bf0da 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,10 +58,10 @@ class AllClassesQuery extends QueryHandler { startHtml("All Classes (including platform)"); } - Iterator classes = snapshot.getClasses(); + Iterator classes = snapshot.getClasses(); String lastPackage = null; while (classes.hasNext()) { - JavaClass clazz = (JavaClass) classes.next(); + JavaClass clazz = classes.next(); if (excludePlatform && PlatformClasses.isPlatformClass(clazz)) { // skip this.. continue; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java index dde9640b4a7..824501381f7 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,7 +151,7 @@ class ClassQuery extends QueryHandler { } out.println("

    References to this object:

    "); out.flush(); - Enumeration referers = obj.getReferers(); + Enumeration referers = obj.getReferers(); while (referers.hasMoreElements()) { JavaHeapObject ref = (JavaHeapObject) referers.nextElement(); printThing(ref); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java index 91f7017ebf2..a717c7aa38c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; public class FinalizerObjectsQuery extends QueryHandler { public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); + Enumeration objs = snapshot.getFinalizerObjects(); startHtml("Objects pending finalization"); out.println("Finalizer summary"); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java index 916cda738a4..c1aa35bce55 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; public class FinalizerSummaryQuery extends QueryHandler { public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); + Enumeration objs = snapshot.getFinalizerObjects(); startHtml("Finalizer Summary"); out.println("

    "); @@ -74,7 +74,7 @@ public class FinalizerSummaryQuery extends QueryHandler { private long count; } - private void printFinalizerSummary(Enumeration objs) { + private void printFinalizerSummary(Enumeration objs) { int count = 0; Map map = new HashMap(); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java index 1b466a49a4f..311df7bbb26 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,10 +111,10 @@ class InstancesCountQuery extends QueryHandler { } out.print(" "); if (snapshot.getHasNewSet()) { - Enumeration objects = clazz.getInstances(false); + Enumeration objects = clazz.getInstances(false); int newInst = 0; while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject)objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); if (obj.isNew()) { newInst++; } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java index ff1f60f7be5..7532b0b2e62 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,11 +73,11 @@ class InstancesQuery extends QueryHandler { out.print(""); printClass(clazz); out.print("

    "); - Enumeration objects = clazz.getInstances(includeSubclasses); + Enumeration objects = clazz.getInstances(includeSubclasses); long totalSize = 0; long instances = 0; while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); if (newObjects && !obj.isNew()) continue; printThing(obj); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java index 73755c2e523..15f7ae8b492 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,15 +47,15 @@ public class RefsByTypeQuery extends QueryHandler { } else { Map referrersStat = new HashMap(); final Map refereesStat = new HashMap(); - Enumeration instances = clazz.getInstances(false); + Enumeration instances = clazz.getInstances(false); while (instances.hasMoreElements()) { - JavaHeapObject instance = (JavaHeapObject) instances.nextElement(); + JavaHeapObject instance = instances.nextElement(); if (instance.getId() == -1) { continue; } - Enumeration e = instance.getReferers(); + Enumeration e = instance.getReferers(); while (e.hasMoreElements()) { - JavaHeapObject ref = (JavaHeapObject) e.nextElement(); + JavaHeapObject ref = (JavaHeapObject)e.nextElement(); JavaClass cl = ref.getClazz(); if (cl == null) { System.out.println("null class for " + ref); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java index 6663d8ff894..c20afb22339 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,12 +34,13 @@ package com.sun.tools.hat.internal.util; import java.util.Enumeration; import java.util.NoSuchElementException; +import com.sun.tools.hat.internal.model.JavaHeapObject; -public class CompositeEnumeration implements Enumeration { - Enumeration e1; - Enumeration e2; +public class CompositeEnumeration implements Enumeration { + Enumeration e1; + Enumeration e2; - public CompositeEnumeration(Enumeration e1, Enumeration e2) { + public CompositeEnumeration(Enumeration e1, Enumeration e2) { this.e1 = e1; this.e2 = e2; } @@ -48,7 +49,7 @@ public class CompositeEnumeration implements Enumeration { return e1.hasMoreElements() || e2.hasMoreElements(); } - public Object nextElement() { + public JavaHeapObject nextElement() { if (e1.hasMoreElements()) { return e1.nextElement(); } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java index 11572160825..93c10f0b00f 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import java.util.*; // Warnings from List filters and List[] requestLists is hard to fix. // Remove SuppressWarning when we fix the warnings from List filters // and List[] requestLists. The generic array is not supported. -@SuppressWarnings("unchecked") +@SuppressWarnings({"unchecked", "rawtypes"}) class EventRequestManagerImpl extends MirrorImpl implements EventRequestManager { diff --git a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java index ef446d96cd4..6d479f02a0e 100644 --- a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java +++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileAttributeView.java @@ -59,6 +59,7 @@ class ZipFileAttributeView implements BasicFileAttributeView this.isZipView = isZipView; } + @SuppressWarnings("unchecked") // Cast to V static V get(ZipPath path, Class type) { if (type == null) throw new NullPointerException(); diff --git a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java index bd3bd411820..2961bc90129 100644 --- a/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java +++ b/jdk/src/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java @@ -271,6 +271,7 @@ public class ZipFileSystemProvider extends FileSystemProvider { } @Override + @SuppressWarnings("unchecked") // Cast to A public A readAttributes(Path path, Class type, LinkOption... options) throws IOException diff --git a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java index e7e485006fb..e696d3eba07 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java +++ b/jdk/src/solaris/classes/sun/nio/ch/InheritedChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -165,7 +165,7 @@ class InheritedChannel { // Have to use reflection and also make assumption on how FD // is implemented. - Class paramTypes[] = { int.class }; + Class paramTypes[] = { int.class }; Constructor ctr = Reflect.lookupConstructor("java.io.FileDescriptor", paramTypes); Object args[] = { new Integer(fdVal) }; From 8c6d88b327e6ecd7cc0172f1f0181d89839886ed Mon Sep 17 00:00:00 2001 From: Neil Toda Date: Thu, 31 Jul 2014 17:01:24 -0700 Subject: [PATCH 085/111] 8044867: Fix raw and unchecked lint warnings in sun.tools.* Reviewed-by: darcy --- .../classes/sun/tools/asm/Assembler.java | 8 +-- .../classes/sun/tools/asm/ConstantPool.java | 2 +- .../classes/sun/tools/asm/SwitchData.java | 10 ++-- .../classes/sun/tools/java/BinaryClass.java | 8 +-- .../sun/tools/java/BinaryConstantPool.java | 21 ++++---- .../classes/sun/tools/java/BinaryMember.java | 4 +- .../sun/tools/java/ClassDefinition.java | 51 +++++++++---------- .../classes/sun/tools/java/ClassPath.java | 10 ++-- .../classes/sun/tools/java/Identifier.java | 4 +- .../share/classes/sun/tools/java/Imports.java | 32 ++++++------ .../sun/tools/java/MemberDefinition.java | 10 ++-- .../classes/sun/tools/java/MethodSet.java | 39 +++++++------- .../share/classes/sun/tools/java/Package.java | 4 +- .../share/classes/sun/tools/java/Parser.java | 20 ++++---- .../share/classes/sun/tools/java/Type.java | 10 ++-- .../sun/tools/javac/BatchEnvironment.java | 50 ++++++++++-------- .../classes/sun/tools/javac/BatchParser.java | 4 +- .../sun/tools/javac/CompilerMember.java | 2 +- .../share/classes/sun/tools/javac/Main.java | 14 ++--- .../classes/sun/tools/javac/SourceClass.java | 51 +++++++++---------- .../classes/sun/tools/javac/SourceMember.java | 28 +++++----- .../classes/sun/tools/tree/AndExpression.java | 2 +- .../sun/tools/tree/ArrayAccessExpression.java | 8 +-- .../sun/tools/tree/ArrayExpression.java | 4 +- .../sun/tools/tree/AssignExpression.java | 2 +- .../sun/tools/tree/AssignOpExpression.java | 2 +- .../tools/tree/BinaryAssignExpression.java | 2 +- .../sun/tools/tree/BinaryExpression.java | 2 +- .../tools/tree/BinaryLogicalExpression.java | 4 +- .../sun/tools/tree/BooleanExpression.java | 2 +- .../sun/tools/tree/BreakStatement.java | 2 +- .../classes/sun/tools/tree/CaseStatement.java | 2 +- .../sun/tools/tree/CastExpression.java | 2 +- .../sun/tools/tree/CatchStatement.java | 2 +- .../sun/tools/tree/CommaExpression.java | 2 +- .../sun/tools/tree/CompoundStatement.java | 2 +- .../sun/tools/tree/ConditionalExpression.java | 4 +- .../sun/tools/tree/ContinueStatement.java | 2 +- .../sun/tools/tree/ConvertExpression.java | 2 +- .../sun/tools/tree/DeclarationStatement.java | 4 +- .../classes/sun/tools/tree/DoStatement.java | 2 +- .../sun/tools/tree/ExprExpression.java | 6 +-- .../classes/sun/tools/tree/Expression.java | 16 +++--- .../sun/tools/tree/ExpressionStatement.java | 2 +- .../sun/tools/tree/FieldExpression.java | 12 ++--- .../sun/tools/tree/FinallyStatement.java | 6 +-- .../classes/sun/tools/tree/ForStatement.java | 2 +- .../sun/tools/tree/IdentifierExpression.java | 10 ++-- .../classes/sun/tools/tree/IfStatement.java | 2 +- .../sun/tools/tree/IncDecExpression.java | 4 +- .../sun/tools/tree/InstanceOfExpression.java | 2 +- .../sun/tools/tree/LengthExpression.java | 2 +- .../classes/sun/tools/tree/LocalMember.java | 2 +- .../sun/tools/tree/MethodExpression.java | 4 +- .../sun/tools/tree/NewArrayExpression.java | 2 +- .../sun/tools/tree/NewInstanceExpression.java | 4 +- .../classes/sun/tools/tree/NotExpression.java | 2 +- .../classes/sun/tools/tree/OrExpression.java | 2 +- .../sun/tools/tree/ReturnStatement.java | 2 +- .../classes/sun/tools/tree/Statement.java | 8 +-- .../sun/tools/tree/SuperExpression.java | 6 +-- .../sun/tools/tree/SwitchStatement.java | 4 +- .../sun/tools/tree/SynchronizedStatement.java | 2 +- .../sun/tools/tree/ThisExpression.java | 2 +- .../sun/tools/tree/ThrowStatement.java | 2 +- .../classes/sun/tools/tree/TryStatement.java | 8 +-- .../sun/tools/tree/TypeExpression.java | 4 +- .../sun/tools/tree/UnaryExpression.java | 2 +- .../tools/tree/VarDeclarationStatement.java | 2 +- .../sun/tools/tree/WhileStatement.java | 2 +- .../classes/sun/tools/util/CommandLine.java | 6 +-- 71 files changed, 286 insertions(+), 280 deletions(-) diff --git a/jdk/src/share/classes/sun/tools/asm/Assembler.java b/jdk/src/share/classes/sun/tools/asm/Assembler.java index af169b20054..7a9fdda2c73 100644 --- a/jdk/src/share/classes/sun/tools/asm/Assembler.java +++ b/jdk/src/share/classes/sun/tools/asm/Assembler.java @@ -238,7 +238,7 @@ class Assembler implements Constants { // if a local variable table is generated if ((field != null) && env.debug_vars()) { @SuppressWarnings("unchecked") - Vector v = (Vector)field.getArguments(); + Vector v = field.getArguments(); if (v != null) { for (Enumeration e = v.elements() ; e.hasMoreElements() ;) { MemberDefinition f = e.nextElement(); @@ -386,7 +386,7 @@ class Assembler implements Constants { if ((field != null) && field.getArguments() != null) { int sum = 0; @SuppressWarnings("unchecked") - Vector v = (Vector)field.getArguments(); + Vector v = field.getArguments(); for (Enumeration e = v.elements(); e.hasMoreElements(); ) { MemberDefinition f = e.nextElement(); sum += f.getType().stackSize(); @@ -858,7 +858,7 @@ public void GenJCov(Environment env) { if ((field != null) && (field.getArguments() != null)) { int reg = 0; @SuppressWarnings("unchecked") - Vector v = (Vector)field.getArguments(); + Vector v = field.getArguments(); for (Enumeration e = v.elements(); e.hasMoreElements(); ) { MemberDefinition f = e.nextElement(); locals[reg] = f; @@ -875,7 +875,7 @@ public void GenJCov(Environment env) { if ((field != null) && (field.getArguments() != null)) { int reg = 0; @SuppressWarnings("unchecked") - Vector v = (Vector)field.getArguments(); + Vector v = field.getArguments(); for (Enumeration e = v.elements(); e.hasMoreElements(); ) { MemberDefinition f = e.nextElement(); locals[reg] = f; diff --git a/jdk/src/share/classes/sun/tools/asm/ConstantPool.java b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java index cb0aaac51be..2292c2cd64b 100644 --- a/jdk/src/share/classes/sun/tools/asm/ConstantPool.java +++ b/jdk/src/share/classes/sun/tools/asm/ConstantPool.java @@ -42,7 +42,7 @@ import java.io.DataOutputStream; */ public final class ConstantPool implements RuntimeConstants { - Hashtable hash = new Hashtable<>(101); + Hashtable hash = new Hashtable<>(101); /** * Find an entry, may return 0 diff --git a/jdk/src/share/classes/sun/tools/asm/SwitchData.java b/jdk/src/share/classes/sun/tools/asm/SwitchData.java index 0e6387c8899..e7cd0f966ea 100644 --- a/jdk/src/share/classes/sun/tools/asm/SwitchData.java +++ b/jdk/src/share/classes/sun/tools/asm/SwitchData.java @@ -39,9 +39,9 @@ public final class SwitchData { int minValue, maxValue; Label defaultLabel = new Label(); - Hashtable tab = new Hashtable<>(); + Hashtable tab = new Hashtable<>(); // JCOV - Hashtable whereCaseTab = null; + Hashtable whereCaseTab = null; // end JCOV /** @@ -92,13 +92,13 @@ class SwitchData { // JCOV public void initTableCase() { - whereCaseTab = new Hashtable(); + whereCaseTab = new Hashtable(); } public void addTableCase(int index, long where) { if (whereCaseTab != null) whereCaseTab.put(Integer.valueOf(index), Long.valueOf(where)); } - // this puts String key into Hashtable + // this puts String key into Hashtable @SuppressWarnings("unchecked") public void addTableDefault(long where) { if (whereCaseTab != null) @@ -123,7 +123,7 @@ class SwitchDataEnumeration implements Enumeration { * hash table will be an Integer, with the value being a label. The * enumeration returns the keys in sorted order. */ - SwitchDataEnumeration(Hashtable tab) { + SwitchDataEnumeration(Hashtable tab) { table = new Integer[tab.size()]; int i = 0; for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) { diff --git a/jdk/src/share/classes/sun/tools/java/BinaryClass.java b/jdk/src/share/classes/sun/tools/java/BinaryClass.java index 580d9e420a1..b7d75e44799 100644 --- a/jdk/src/share/classes/sun/tools/java/BinaryClass.java +++ b/jdk/src/share/classes/sun/tools/java/BinaryClass.java @@ -43,7 +43,7 @@ public final class BinaryClass extends ClassDefinition implements Constants { BinaryConstantPool cpool; BinaryAttribute atts; - Vector dependencies; + Vector dependencies; private boolean haveLoadedNested = false; /** @@ -51,7 +51,7 @@ class BinaryClass extends ClassDefinition implements Constants { */ public BinaryClass(Object source, ClassDeclaration declaration, int modifiers, ClassDeclaration superClass, ClassDeclaration interfaces[], - Vector dependencies) { + Vector dependencies) { super(source, 0, declaration, modifiers, null, null); this.dependencies = dependencies; this.superClass = superClass; @@ -134,7 +134,7 @@ class BinaryClass extends ClassDefinition implements Constants { BinaryConstantPool cpool = new BinaryConstantPool(in); // The dependencies of this class - Vector dependencies = cpool.getDependencies(env); + Vector dependencies = cpool.getDependencies(env); // Read modifiers int classMod = in.readUnsignedShort() & ACCM_CLASS; // JVM 4.1 ClassFile.access_flags @@ -500,7 +500,7 @@ class BinaryClass extends ClassDefinition implements Constants { /** * Get the dependencies */ - public Enumeration getDependencies() { + public Enumeration getDependencies() { return dependencies.elements(); } diff --git a/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java index 56082348f19..9507a19362a 100644 --- a/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java +++ b/jdk/src/share/classes/sun/tools/java/BinaryConstantPool.java @@ -222,8 +222,8 @@ class BinaryConstantPool implements Constants { * Get a list of dependencies, ie: all the classes referenced in this * constant pool. */ - public Vector getDependencies(Environment env) { - Vector v = new Vector(); + public Vector getDependencies(Environment env) { + Vector v = new Vector<>(); for (int i = 1 ; i < cpool.length ; i++) { switch(types[i]) { case CONSTANT_CLASS: @@ -234,8 +234,9 @@ class BinaryConstantPool implements Constants { return v; } - Hashtable indexHashObject, indexHashAscii; - Vector MoreStuff; + Hashtable indexHashObject; + Hashtable indexHashAscii; + Vector MoreStuff; /** * Find the index of an Object in the constant pool @@ -243,7 +244,7 @@ class BinaryConstantPool implements Constants { public int indexObject(Object obj, Environment env) { if (indexHashObject == null) createIndexHash(env); - Integer result = (Integer)indexHashObject.get(obj); + Integer result = indexHashObject.get(obj); if (result == null) throw new IndexOutOfBoundsException("Cannot find object " + obj + " of type " + obj.getClass() + " in constant pool"); @@ -257,9 +258,9 @@ class BinaryConstantPool implements Constants { public int indexString(String string, Environment env) { if (indexHashObject == null) createIndexHash(env); - Integer result = (Integer)indexHashAscii.get(string); + Integer result = indexHashAscii.get(string); if (result == null) { - if (MoreStuff == null) MoreStuff = new Vector(); + if (MoreStuff == null) MoreStuff = new Vector<>(); result = cpool.length + MoreStuff.size(); MoreStuff.addElement(string); indexHashAscii.put(string, result); @@ -273,8 +274,8 @@ class BinaryConstantPool implements Constants { */ public void createIndexHash(Environment env) { - indexHashObject = new Hashtable(); - indexHashAscii = new Hashtable(); + indexHashObject = new Hashtable<>(); + indexHashAscii = new Hashtable<>(); for (int i = 1; i < cpool.length; i++) { if (types[i] == CONSTANT_UTF8) { indexHashAscii.put(cpool[i], i); @@ -342,7 +343,7 @@ class BinaryConstantPool implements Constants { } } for (int i = cpool.length; i < length; i++) { - String string = (String)(MoreStuff.elementAt(i - cpool.length)); + String string = MoreStuff.elementAt(i - cpool.length); out.writeByte(CONSTANT_UTF8); out.writeUTF(string); } diff --git a/jdk/src/share/classes/sun/tools/java/BinaryMember.java b/jdk/src/share/classes/sun/tools/java/BinaryMember.java index a66b48dacd9..0b0b75a6772 100644 --- a/jdk/src/share/classes/sun/tools/java/BinaryMember.java +++ b/jdk/src/share/classes/sun/tools/java/BinaryMember.java @@ -82,9 +82,9 @@ class BinaryMember extends MemberDefinition { /** * Get arguments */ - public Vector getArguments() { + public Vector getArguments() { if (isConstructor() && (getClassDefinition().getSuperClass() == null)) { - Vector v = new Vector(); + Vector v = new Vector<>(); v.addElement(new LocalMember(0, getClassDefinition(), 0, getClassDefinition().getType(), idThis)); return v; diff --git a/jdk/src/share/classes/sun/tools/java/ClassDefinition.java b/jdk/src/share/classes/sun/tools/java/ClassDefinition.java index 76e3b7b99fd..47a163235d5 100644 --- a/jdk/src/share/classes/sun/tools/java/ClassDefinition.java +++ b/jdk/src/share/classes/sun/tools/java/ClassDefinition.java @@ -64,14 +64,14 @@ class ClassDefinition implements Constants { protected boolean nestError; protected UplevelReference references; protected boolean referencesFrozen; - private Hashtable fieldHash = new Hashtable(31); + private Hashtable fieldHash = new Hashtable<>(31); private int abstr; // Table of local and anonymous classes whose internal names are constructed // using the current class as a prefix. This is part of a fix for // bugid 4054523 and 4030421. See also 'Environment.getClassDefinition' // and 'BatchEnvironment.makeClassDefinition'. Allocated on demand. - private Hashtable localClasses = null; + private Hashtable localClasses = null; private final int LOCAL_CLASSES_SIZE = 31; // The immediately surrounding context in which the class appears. @@ -378,7 +378,7 @@ class ClassDefinition implements Constants { return firstMember; } public final MemberDefinition getFirstMatch(Identifier name) { - return (MemberDefinition)fieldHash.get(name); + return fieldHash.get(name); } /** @@ -519,9 +519,9 @@ class ClassDefinition implements Constants { // We check for any abstract methods inherited or declared // by this class. - Iterator methods = getMethods(); + Iterator methods = getMethods(); while (methods.hasNext()) { - MemberDefinition method = (MemberDefinition) methods.next(); + MemberDefinition method = methods.next(); if (method.isAbstract()) { return true; @@ -623,12 +623,11 @@ class ClassDefinition implements Constants { // general can return methods which are not visible to the // current package. We need to make sure that these do not // prevent this class from being implemented. - Iterator otherMethods = intDef.getMethods(); + Iterator otherMethods = intDef.getMethods(); while (otherMethods.hasNext()) { // Get one of the methods from intDef... - MemberDefinition method = - (MemberDefinition) otherMethods.next(); + MemberDefinition method = otherMethods.next(); Identifier name = method.getName(); Type type = method.getType(); @@ -996,14 +995,14 @@ class ClassDefinition implements Constants { MemberDefinition tentative = null; // A list of other methods which may be maximally specific too. - List candidateList = null; + List candidateList = null; // Get all the methods inherited by this class which // have the name `methodName'. - Iterator methods = allMethods.lookupName(methodName); + Iterator methods = allMethods.lookupName(methodName); while (methods.hasNext()) { - MemberDefinition method = (MemberDefinition)methods.next(); + MemberDefinition method = methods.next(); // See if this method is applicable. if (!env.isApplicable(method, argumentTypes)) { @@ -1046,7 +1045,7 @@ class ClassDefinition implements Constants { // list of other candidates. if (!env.isMoreSpecific(tentative,method)) { if (candidateList == null) { - candidateList = new ArrayList(); + candidateList = new ArrayList<>(); } candidateList.add(method); } @@ -1057,9 +1056,9 @@ class ClassDefinition implements Constants { if (tentative != null && candidateList != null) { // Find out if our `tentative' match is a uniquely // maximally specific. - Iterator candidates = candidateList.iterator(); + Iterator candidates = candidateList.iterator(); while (candidates.hasNext()) { - MemberDefinition method = (MemberDefinition)candidates.next(); + MemberDefinition method = candidates.next(); if (!env.isMoreSpecific(tentative, method)) { throw new AmbiguousMember(tentative, method); } @@ -1186,13 +1185,13 @@ class ClassDefinition implements Constants { // methods so that we can correctly detect that this class is // indeed abstract and so that we can give somewhat comprehensible // error messages. - private List permanentlyAbstractMethods = new ArrayList(); + private List permanentlyAbstractMethods = new ArrayList<>(); /** * This method returns an Iterator of all abstract methods * in our superclasses which we are unable to implement. */ - protected Iterator getPermanentlyAbstractMethods() { + protected Iterator getPermanentlyAbstractMethods() { // This method can only be called after collectInheritedMethods. if (allMethods == null) { throw new CompilerError("isPermanentlyAbstract() called early"); @@ -1239,10 +1238,10 @@ class ClassDefinition implements Constants { try { ClassDefinition pClass = parent.getClassDefinition(env); - Iterator methods = pClass.getMethods(env); + Iterator methods = pClass.getMethods(env); while (methods.hasNext()) { MemberDefinition method = - (MemberDefinition) methods.next(); + methods.next(); // Private methods are not inherited. // @@ -1522,7 +1521,7 @@ class ClassDefinition implements Constants { // Make sure that we add all unimplementable methods from our // superclass to our list of unimplementable methods. ClassDefinition sc = scDecl.getClassDefinition(); - Iterator supIter = sc.getPermanentlyAbstractMethods(); + Iterator supIter = sc.getPermanentlyAbstractMethods(); while (supIter.hasNext()) { permanentlyAbstractMethods.add(supIter.next()); } @@ -1587,7 +1586,7 @@ class ClassDefinition implements Constants { * Get an Iterator of all methods which could be accessed in an * instance of this class. */ - public Iterator getMethods(Environment env) { + public Iterator getMethods(Environment env) { if (allMethods == null) { collectInheritedMethods(env); } @@ -1599,7 +1598,7 @@ class ClassDefinition implements Constants { * instance of this class. Throw a compiler error if we haven't * generated this information yet. */ - public Iterator getMethods() { + public Iterator getMethods() { if (allMethods == null) { throw new CompilerError("getMethods: too early"); } @@ -1636,7 +1635,7 @@ class ClassDefinition implements Constants { * affect our compilation. */ protected void addMirandaMethods(Environment env, - Iterator mirandas) { + Iterator mirandas) { // do nothing. } @@ -1921,11 +1920,11 @@ class ClassDefinition implements Constants { // insert this at the front, because of initialization order field.nextMember = firstMember; firstMember = field; - field.nextMatch = (MemberDefinition)fieldHash.get(field.name); + field.nextMatch = fieldHash.get(field.name); } else { lastMember.nextMember = field; lastMember = field; - field.nextMatch = (MemberDefinition)fieldHash.get(field.name); + field.nextMatch = fieldHash.get(field.name); } fieldHash.put(field.name, field); } @@ -2013,13 +2012,13 @@ class ClassDefinition implements Constants { if (localClasses == null) { return null; } else { - return (ClassDefinition)localClasses.get(name); + return localClasses.get(name); } } public void addLocalClass(ClassDefinition c, String name) { if (localClasses == null) { - localClasses = new Hashtable(LOCAL_CLASSES_SIZE); + localClasses = new Hashtable<>(LOCAL_CLASSES_SIZE); } localClasses.put(name, c); } diff --git a/jdk/src/share/classes/sun/tools/java/ClassPath.java b/jdk/src/share/classes/sun/tools/java/ClassPath.java index 5f8aa01e6b8..ae917d0553e 100644 --- a/jdk/src/share/classes/sun/tools/java/ClassPath.java +++ b/jdk/src/share/classes/sun/tools/java/ClassPath.java @@ -233,11 +233,11 @@ class ClassPath { /** * Returns list of files given a package name and extension. */ - public Enumeration getFiles(String pkg, String ext) { - Hashtable files = new Hashtable(); + public Enumeration getFiles(String pkg, String ext) { + Hashtable files = new Hashtable<>(); for (int i = path.length; --i >= 0; ) { if (path[i].zip != null) { - Enumeration e = path[i].zip.entries(); + Enumeration e = path[i].zip.entries(); while (e.hasMoreElements()) { ZipEntry entry = (ZipEntry)e.nextElement(); String name = entry.getName(); @@ -287,9 +287,9 @@ class ClassPathEntry { File dir; ZipFile zip; - Hashtable subdirs = new Hashtable(29); // cache of sub-directory listings + Hashtable subdirs = new Hashtable<>(29); // cache of sub-directory listings: String[] getFiles(String subdir) { - String files[] = (String[]) subdirs.get(subdir); + String files[] = subdirs.get(subdir); if (files == null) { // search the directory, exactly once File sd = new File(dir.getPath(), subdir); diff --git a/jdk/src/share/classes/sun/tools/java/Identifier.java b/jdk/src/share/classes/sun/tools/java/Identifier.java index 22cd413b55d..5869d680724 100644 --- a/jdk/src/share/classes/sun/tools/java/Identifier.java +++ b/jdk/src/share/classes/sun/tools/java/Identifier.java @@ -58,7 +58,7 @@ class Identifier implements Constants { /** * The hashtable of identifiers */ - static Hashtable hash = new Hashtable(3001, 0.5f); + static Hashtable hash = new Hashtable<>(3001, 0.5f); /** * The name of the identifier @@ -115,7 +115,7 @@ class Identifier implements Constants { */ public static synchronized Identifier lookup(String s) { //System.out.println("lookup(" + s + ")"); - Identifier id = (Identifier)hash.get(s); + Identifier id = hash.get(s); if (id == null) { hash.put(s, id = new Identifier(s)); } diff --git a/jdk/src/share/classes/sun/tools/java/Imports.java b/jdk/src/share/classes/sun/tools/java/Imports.java index bc551645449..e2b038bdb58 100644 --- a/jdk/src/share/classes/sun/tools/java/Imports.java +++ b/jdk/src/share/classes/sun/tools/java/Imports.java @@ -67,20 +67,20 @@ class Imports implements Constants { /** * The imported classes, including memoized imports from packages. */ - Hashtable classes = new Hashtable(); + Hashtable classes = new Hashtable<>(); /** * The imported package identifiers. This will not contain duplicate * imports for the same package. It will also not contain the * current package. */ - Vector packages = new Vector(); + Vector packages = new Vector<>(); /** * The (originally) imported classes. * A vector of IdentifierToken. */ - Vector singles = new Vector(); + Vector singles = new Vector<>(); /** * Are the import names checked yet? @@ -134,9 +134,9 @@ class Imports implements Constants { // } // } - Vector resolvedPackages = new Vector(); - for (Enumeration e = packages.elements() ; e.hasMoreElements() ;) { - IdentifierToken t = (IdentifierToken)e.nextElement(); + Vector resolvedPackages = new Vector<>(); + for (Enumeration e = packages.elements() ; e.hasMoreElements() ;) { + IdentifierToken t = e.nextElement(); Identifier nm = t.getName(); long where = t.getWhere(); @@ -175,8 +175,8 @@ class Imports implements Constants { } packages = resolvedPackages; - for (Enumeration e = singles.elements() ; e.hasMoreElements() ;) { - IdentifierToken t = (IdentifierToken)e.nextElement(); + for (Enumeration e = singles.elements() ; e.hasMoreElements() ;) { + IdentifierToken t = e.nextElement(); Identifier nm = t.getName(); long where = t.getWhere(); Identifier pkg = nm.getQualifier(); @@ -191,7 +191,7 @@ class Imports implements Constants { Identifier snm = nm.getFlatName().getName(); // make sure it isn't already imported explicitly - Identifier className = (Identifier)classes.get(snm); + Identifier className = classes.get(snm); if (className != null) { Identifier f1 = Identifier.lookup(className.getQualifier(), className.getFlatName()); @@ -280,7 +280,7 @@ class Imports implements Constants { } // Check if it was imported before - Identifier className = (Identifier)classes.get(nm); + Identifier className = classes.get(nm); if (className != null) { if (tracing) env.dtExit("Imports.resolve: PREVIOUSLY IMPORTED " + nm); return className; @@ -303,9 +303,9 @@ class Imports implements Constants { } else { // If it isn't in the current package, try to find it in // our import-on-demands. - Enumeration e = packages.elements(); + Enumeration e = packages.elements(); while (e.hasMoreElements()) { - IdentifierToken t = (IdentifierToken)e.nextElement(); + IdentifierToken t = e.nextElement(); id = Identifier.lookup(t.getName(), nm); if (importable(id, env)) { @@ -386,7 +386,7 @@ class Imports implements Constants { if (nm.isQualified()) return nm; - Identifier className = (Identifier)classes.get(nm); + Identifier className = classes.get(nm); if (className != null) { return className; } @@ -425,7 +425,7 @@ class Imports implements Constants { // added to the list, ignore it. final int size = packages.size(); for (int i = 0; i < size; i++) { - if (name == ((IdentifierToken)packages.elementAt(i)).getName()) { + if (name == (packages.elementAt(i)).getName()) { return; } } @@ -464,7 +464,7 @@ class Imports implements Constants { * Return an unmodifiable list of IdentifierToken representing * packages specified as imports. */ - public List getImportedPackages() { + public List getImportedPackages() { return Collections.unmodifiableList(packages); } @@ -472,7 +472,7 @@ class Imports implements Constants { * Return an unmodifiable list of IdentifierToken representing * classes specified as imports. */ - public List getImportedClasses() { + public List getImportedClasses() { return Collections.unmodifiableList(singles); } diff --git a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java index 5dde1624cd1..c7060e729d0 100644 --- a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java +++ b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java @@ -103,7 +103,7 @@ class MemberDefinition implements Constants { * uniqueness of proxy objects. See the makeProxyMember method * defined below. */ - static private Map proxyCache; + static private Map proxyCache; /** * Create a member which is externally the same as `field' but @@ -126,12 +126,12 @@ class MemberDefinition implements Constants { Environment env) { if (proxyCache == null) { - proxyCache = new HashMap(); + proxyCache = new HashMap<>(); } String key = field.toString() + "@" + classDef.toString(); // System.out.println("Key is : " + key); - MemberDefinition proxy = (MemberDefinition)proxyCache.get(key); + MemberDefinition proxy = proxyCache.get(key); if (proxy != null) return proxy; @@ -217,8 +217,8 @@ class MemberDefinition implements Constants { /** * Get arguments (a vector of LocalMember) */ - public Vector getArguments() { - return isMethod() ? new Vector() : null; + public Vector getArguments() { + return isMethod() ? new Vector<>() : null; } /** diff --git a/jdk/src/share/classes/sun/tools/java/MethodSet.java b/jdk/src/share/classes/sun/tools/java/MethodSet.java index ecaf0236bfe..c62eb00d167 100644 --- a/jdk/src/share/classes/sun/tools/java/MethodSet.java +++ b/jdk/src/share/classes/sun/tools/java/MethodSet.java @@ -46,7 +46,7 @@ class MethodSet { * A Map containing Lists of MemberDefinitions. The Lists * contain methods which share the same name. */ - private final Map lookupMap; + private final Map> lookupMap; /** * The number of methods stored in the MethodSet. @@ -63,7 +63,7 @@ class MethodSet { */ public MethodSet() { frozen = false; - lookupMap = new HashMap(); + lookupMap = new HashMap<>(); count = 0; } @@ -89,12 +89,12 @@ class MethodSet { Identifier name = method.getName(); // Get a List containing all methods of this name. - List methodList = (List) lookupMap.get(name); + List methodList = lookupMap.get(name); if (methodList == null) { // There is no method with this name already. // Create a List, and insert it into the hash. - methodList = new ArrayList(); + methodList = new ArrayList<>(); lookupMap.put(name, methodList); } @@ -102,7 +102,7 @@ class MethodSet { // been added to the MethodSet. int size = methodList.size(); for (int i = 0; i < size; i++) { - if (((MemberDefinition) methodList.get(i)) + if ((methodList.get(i)) .getType().equalArguments(method.getType())) { throw new CompilerError("duplicate addition"); } @@ -128,12 +128,12 @@ class MethodSet { Identifier name = method.getName(); // Get a List containing all methods of this name. - List methodList = (List) lookupMap.get(name); + List methodList = lookupMap.get(name); if (methodList == null) { // There is no method with this name already. // Create a List, and insert it into the hash. - methodList = new ArrayList(); + methodList = new ArrayList<>(); lookupMap.put(name, methodList); } @@ -141,7 +141,7 @@ class MethodSet { // `method'. int size = methodList.size(); for (int i = 0; i < size; i++) { - if (((MemberDefinition) methodList.get(i)) + if ((methodList.get(i)) .getType().equalArguments(method.getType())) { methodList.set(i, method); return; @@ -160,11 +160,11 @@ class MethodSet { public MemberDefinition lookupSig(Identifier name, Type type) { // Go through all methods of the same name and see if any // have the right signature. - Iterator matches = lookupName(name); + Iterator matches = lookupName(name); MemberDefinition candidate; while (matches.hasNext()) { - candidate = (MemberDefinition) matches.next(); + candidate = matches.next(); if (candidate.getType().equalArguments(type)) { return candidate; } @@ -178,10 +178,10 @@ class MethodSet { * Returns an Iterator of all methods contained in the * MethodSet which have a given name. */ - public Iterator lookupName(Identifier name) { + public Iterator lookupName(Identifier name) { // Find the List containing all methods of this name, and // return that List's Iterator. - List methodList = (List) lookupMap.get(name); + List methodList = lookupMap.get(name); if (methodList == null) { // If there is no method of this name, return a bogus, empty // Iterator. @@ -193,22 +193,21 @@ class MethodSet { /** * Returns an Iterator of all methods in the MethodSet */ - public Iterator iterator() { + public Iterator iterator() { //---------------------------------------------------------- // The inner class MethodIterator is used to create our // Iterator of all methods in the MethodSet. - class MethodIterator implements Iterator { - Iterator hashIter = lookupMap.values().iterator(); - Iterator listIter = Collections.emptyIterator(); + class MethodIterator implements Iterator { + Iterator> hashIter = lookupMap.values().iterator(); + Iterator listIter = Collections.emptyIterator(); public boolean hasNext() { if (listIter.hasNext()) { return true; } else { if (hashIter.hasNext()) { - listIter = ((List) hashIter.next()) - .iterator(); + listIter = hashIter.next().iterator(); // The following should be always true. if (listIter.hasNext()) { @@ -224,7 +223,7 @@ class MethodSet { return false; } - public Object next() { + public MemberDefinition next() { return listIter.next(); } @@ -262,7 +261,7 @@ class MethodSet { public String toString() { int len = size(); StringBuilder sb = new StringBuilder(); - Iterator all = iterator(); + Iterator all = iterator(); sb.append("{"); while (all.hasNext()) { diff --git a/jdk/src/share/classes/sun/tools/java/Package.java b/jdk/src/share/classes/sun/tools/java/Package.java index ef62af0114f..9d45d1c44d4 100644 --- a/jdk/src/share/classes/sun/tools/java/Package.java +++ b/jdk/src/share/classes/sun/tools/java/Package.java @@ -144,11 +144,11 @@ class Package { return null; } - public Enumeration getSourceFiles() { + public Enumeration getSourceFiles() { return sourcePath.getFiles(pkg, ".java"); } - public Enumeration getBinaryFiles() { + public Enumeration getBinaryFiles() { return binaryPath.getFiles(pkg, ".class"); } diff --git a/jdk/src/share/classes/sun/tools/java/Parser.java b/jdk/src/share/classes/sun/tools/java/Parser.java index f8e4f10028c..8c97f3b1906 100644 --- a/jdk/src/share/classes/sun/tools/java/Parser.java +++ b/jdk/src/share/classes/sun/tools/java/Parser.java @@ -392,8 +392,8 @@ class Parser extends Scanner implements ParserActions, Constants { if (superName == null) { env.error(type.getWhere(), "type.expected"); } - Vector ext = new Vector(1); - Vector impl = new Vector(0); + Vector ext = new Vector<>(1); + Vector impl = new Vector<>(0); ext.addElement(new IdentifierToken(idNull)); if (token == IMPLEMENTS || token == EXTENDS) { env.error(pos, "anonymous.extends"); @@ -1682,7 +1682,7 @@ class Parser extends Scanner implements ParserActions, Constants { // Parse and ignore throws clause IdentifierToken exp[] = null; if (token == THROWS) { - Vector v = new Vector(); + Vector v = new Vector<>(); scan(); v.addElement(parseName(false)); while (token == COMMA) { @@ -1890,8 +1890,8 @@ class Parser extends Scanner implements ParserActions, Constants { long p = pos; expect(IDENT); - Vector ext = new Vector(); - Vector impl = new Vector(); + Vector ext = new Vector<>(); + Vector impl = new Vector<>(); parseInheritance(ext, impl); ClassDefinition tmp = parseClassBody(nm, mod, ctx, doc, ext, impl, p); @@ -1901,7 +1901,7 @@ class Parser extends Scanner implements ParserActions, Constants { return tmp; } - protected void parseInheritance(Vector ext, Vector impl) throws SyntaxError, IOException { + protected void parseInheritance(Vector ext, Vector impl) throws SyntaxError, IOException { // Parse extends clause if (token == EXTENDS) { scan(); @@ -1929,23 +1929,23 @@ class Parser extends Scanner implements ParserActions, Constants { */ protected ClassDefinition parseClassBody(IdentifierToken nm, int mod, int ctx, String doc, - Vector ext, Vector impl, long p + Vector ext, Vector impl, long p ) throws SyntaxError, IOException { // Decide which is the super class IdentifierToken sup = null; if ((mod & M_INTERFACE) != 0) { if (impl.size() > 0) { - env.error(((IdentifierToken)impl.elementAt(0)).getWhere(), + env.error(impl.elementAt(0).getWhere(), "intf.impl.intf"); } impl = ext; } else { if (ext.size() > 0) { if (ext.size() > 1) { - env.error(((IdentifierToken)ext.elementAt(1)).getWhere(), + env.error(ext.elementAt(1).getWhere(), "multiple.inherit"); } - sup = (IdentifierToken)ext.elementAt(0); + sup = ext.elementAt(0); } } diff --git a/jdk/src/share/classes/sun/tools/java/Type.java b/jdk/src/share/classes/sun/tools/java/Type.java index a84ae56be88..77348b4df76 100644 --- a/jdk/src/share/classes/sun/tools/java/Type.java +++ b/jdk/src/share/classes/sun/tools/java/Type.java @@ -57,7 +57,7 @@ class Type implements Constants { /** * This hashtable is used to cache types */ - private static final Hashtable typeHash = new Hashtable(231); + private static final Hashtable typeHash = new Hashtable<>(231); /** * The TypeCode of this type. The value of this field is one @@ -169,7 +169,7 @@ class Type implements Constants { */ public static synchronized Type tArray(Type elem) { String sig = new String(SIG_ARRAY + elem.getTypeSignature()); - Type t = (Type)typeHash.get(sig); + Type t = typeHash.get(sig); if (t == null) { t = new ArrayType(sig, elem); } @@ -213,7 +213,7 @@ class Type implements Constants { new String(SIG_CLASS + className.toString().replace('.', SIGC_PACKAGE) + SIG_ENDCLASS); - Type t = (Type)typeHash.get(sig); + Type t = typeHash.get(sig); if (t == null) { t = new ClassType(sig, className); } @@ -283,7 +283,7 @@ class Type implements Constants { sb.append(returnType.getTypeSignature()); String sig = sb.toString(); - Type t = (Type)typeHash.get(sig); + Type t = typeHash.get(sig); if (t == null) { t = new MethodType(sig, returnType, argTypes); } @@ -309,7 +309,7 @@ class Type implements Constants { * @exception CompilerError invalid type signature. */ public static synchronized Type tType(String sig) { - Type t = (Type)typeHash.get(sig); + Type t = typeHash.get(sig); if (t != null) { return t; } diff --git a/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java b/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java index 01141c8155d..e20b386d325 100644 --- a/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java +++ b/jdk/src/share/classes/sun/tools/javac/BatchEnvironment.java @@ -61,17 +61,17 @@ class BatchEnvironment extends Environment implements ErrorConsumer { /** * A hashtable of resource contexts. */ - Hashtable packages = new Hashtable(31); + Hashtable packages = new Hashtable<>(31); /** * The classes, in order of appearance. */ - Vector classesOrdered = new Vector(); + Vector classesOrdered = new Vector<>(); /** * The classes, keyed by ClassDeclaration. */ - Hashtable classes = new Hashtable(351); + Hashtable classes = new Hashtable<>(351); /** * flags @@ -106,7 +106,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { /** * A list of files containing deprecation warnings. */ - Vector deprecationFiles = new Vector(); + Vector deprecationFiles = new Vector<>(); /** * writes out error messages @@ -271,7 +271,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { * Return an enumeration of all the currently defined classes * in order of appearance to getClassDeclaration(). */ - public Enumeration getClasses() { + public Enumeration getClasses() { return classesOrdered.elements(); } @@ -280,7 +280,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { * check in Imports#resolve(). These are the current packages for * all classes being compiled as of the first call to isExemptPackage. */ - private Set exemptPackages; + private Set exemptPackages; /** * Tells whether an Identifier refers to a package which should be @@ -317,11 +317,11 @@ class BatchEnvironment extends Environment implements ErrorConsumer { // will be exempt from the "exists" check in // sun.tools.java.Imports#resolve(). - exemptPackages = new HashSet(101); + exemptPackages = new HashSet<>(101); // Add all of the current packages and their prefixes to our set. - for (Enumeration e = getClasses(); e.hasMoreElements(); ) { - ClassDeclaration c = (ClassDeclaration) e.nextElement(); + for (Enumeration e = getClasses(); e.hasMoreElements(); ) { + ClassDeclaration c = e.nextElement(); if (c.getStatus() == CS_PARSED) { SourceClass def = (SourceClass) c.getClassDefinition(); if (def.isLocal()) @@ -389,7 +389,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { } public ClassDeclaration getClassDeclaration(Type t) { - ClassDeclaration c = (ClassDeclaration)classes.get(t); + ClassDeclaration c = classes.get(t); if (c == null) { classes.put(t, c = new ClassDeclaration(t.getClassName())); classesOrdered.addElement(c); @@ -407,7 +407,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { } Type t = Type.tClass(nm); try { - ClassDeclaration c = (ClassDeclaration)classes.get(t); + ClassDeclaration c = classes.get(t); return (c != null) ? c.getName().equals(nm) : getPackage(nm.getQualifier()).classExists(nm.getName()); } catch (IOException e) { @@ -448,7 +448,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { * Get the package path for a package */ public Package getPackage(Identifier pkg) throws IOException { - Package p = (Package)packages.get(pkg); + Package p = packages.get(pkg); if (p == null) { packages.put(pkg, p = new Package(sourcePath, binaryPath, pkg)); } @@ -527,10 +527,10 @@ class BatchEnvironment extends Environment implements ErrorConsumer { // (Fix for 4107960). // // The dependency code was previously in BatchParser.java. - Enumeration e = p.classes.elements(); + Enumeration e = p.classes.elements(); // first will not be an inner class. - ClassDefinition first = (ClassDefinition) e.nextElement(); + ClassDefinition first = e.nextElement(); if (first.isInnerClass()) { throw new CompilerError("BatchEnvironment, first is inner"); } @@ -538,7 +538,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { ClassDefinition current = first; ClassDefinition next; while (e.hasMoreElements()) { - next = (ClassDefinition) e.nextElement(); + next = e.nextElement(); // Don't chain in inner classes. if (next.isInnerClass()) { continue; @@ -607,7 +607,7 @@ class BatchEnvironment extends Environment implements ErrorConsumer { /** * Load a binary class */ - boolean needsCompilation(Hashtable check, ClassDeclaration c) { + boolean needsCompilation(Hashtable check, ClassDeclaration c) { switch (c.getStatus()) { case CS_UNDEFINED: @@ -621,8 +621,8 @@ class BatchEnvironment extends Environment implements ErrorConsumer { check.put(c, c); BinaryClass bin = (BinaryClass)c.getClassDefinition(); - for (Enumeration e = bin.getDependencies() ; e.hasMoreElements() ;) { - ClassDeclaration dep = (ClassDeclaration)e.nextElement(); + for (Enumeration e = bin.getDependencies() ; e.hasMoreElements() ;) { + ClassDeclaration dep = e.nextElement(); if (needsCompilation(check, dep)) { // It must be source, dependencies need compilation c.setDefinition(bin, CS_SOURCE); @@ -829,11 +829,11 @@ class BatchEnvironment extends Environment implements ErrorConsumer { case CS_UNDECIDED: { if (tracing) dtEvent("loadDefinition: STATUS IS UNDECIDED"); - Hashtable tab = new Hashtable(); + Hashtable tab = new Hashtable<>(); if (!needsCompilation(tab, c)) { // All undecided classes that this class depends on must be binary - for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) { - ClassDeclaration dep = (ClassDeclaration)e.nextElement(); + for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) { + ClassDeclaration dep = e.nextElement(); if (dep.getStatus() == CS_UNDECIDED) { // must be binary, dependencies need compilation dep.setDefinition(dep.getClassDefinition(), CS_BINARY); @@ -1015,9 +1015,17 @@ class BatchEnvironment extends Environment implements ErrorConsumer { return sourceClass; } + /* + * makeMemberDefinition method is left with rawtypes and with lint messages suppressed. + * The addition of Generics to com.sun.tools.* has uncovered an inconsistency + * in usage though tools still work correctly as long as this function is allowed to + * function as is. + */ + /** * Create a new field. */ + @SuppressWarnings({"rawtypes","unchecked"}) public MemberDefinition makeMemberDefinition(Environment origEnv, long where, ClassDefinition clazz, String doc, int modifiers, diff --git a/jdk/src/share/classes/sun/tools/javac/BatchParser.java b/jdk/src/share/classes/sun/tools/javac/BatchParser.java index ab764ce5992..03fc237da99 100644 --- a/jdk/src/share/classes/sun/tools/javac/BatchParser.java +++ b/jdk/src/share/classes/sun/tools/javac/BatchParser.java @@ -56,7 +56,7 @@ class BatchParser extends Parser { /** * The classes defined in this file */ - protected Vector classes; + protected Vector classes; /** @@ -76,7 +76,7 @@ class BatchParser extends Parser { super(env, in); imports = new Imports(env); - classes = new Vector(); + classes = new Vector<>(); toplevelEnv = imports.newEnvironment(env); } diff --git a/jdk/src/share/classes/sun/tools/javac/CompilerMember.java b/jdk/src/share/classes/sun/tools/javac/CompilerMember.java index b3442fd7763..c62eee3b055 100644 --- a/jdk/src/share/classes/sun/tools/javac/CompilerMember.java +++ b/jdk/src/share/classes/sun/tools/javac/CompilerMember.java @@ -38,7 +38,7 @@ import sun.tools.asm.Assembler; */ @Deprecated final -class CompilerMember implements Comparable { +class CompilerMember implements Comparable { MemberDefinition field; Assembler asm; Object value; diff --git a/jdk/src/share/classes/sun/tools/javac/Main.java b/jdk/src/share/classes/sun/tools/javac/Main.java index 0d02cffe698..f7015dbd36e 100644 --- a/jdk/src/share/classes/sun/tools/javac/Main.java +++ b/jdk/src/share/classes/sun/tools/javac/Main.java @@ -212,7 +212,7 @@ class Main implements Constants { //end JCOV int flags = F_WARNINGS | F_DEBUG_LINES | F_DEBUG_SOURCE; long tm = System.currentTimeMillis(); - Vector v = new Vector(); + Vector v = new Vector<>(); boolean nowrite = false; String props = null; String encoding = null; @@ -500,8 +500,8 @@ class Main implements Constants { try { // Parse all input files - for (Enumeration e = v.elements() ; e.hasMoreElements() ;) { - File file = new File((String)e.nextElement()); + for (Enumeration e = v.elements() ; e.hasMoreElements() ;) { + File file = new File(e.nextElement()); try { env.parseFile(new ClassFile(file)); } catch (FileNotFoundException ee) { @@ -512,8 +512,8 @@ class Main implements Constants { // Do a post-read check on all newly-parsed classes, // after they have all been read. - for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) { - ClassDeclaration c = (ClassDeclaration)e.nextElement(); + for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) { + ClassDeclaration c = e.nextElement(); if (c.getStatus() == CS_PARSED) { if (c.getClassDefinition().isLocal()) continue; @@ -531,8 +531,8 @@ class Main implements Constants { do { done = true; env.flushErrors(); - for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) { - ClassDeclaration c = (ClassDeclaration)e.nextElement(); + for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) { + ClassDeclaration c = e.nextElement(); SourceClass src; switch (c.getStatus()) { diff --git a/jdk/src/share/classes/sun/tools/javac/SourceClass.java b/jdk/src/share/classes/sun/tools/javac/SourceClass.java index d1744baf3c6..f5458453260 100644 --- a/jdk/src/share/classes/sun/tools/javac/SourceClass.java +++ b/jdk/src/share/classes/sun/tools/javac/SourceClass.java @@ -70,7 +70,7 @@ class SourceClass extends ClassDefinition { /** * The list of class dependencies */ - Hashtable deps = new Hashtable(11); + Hashtable deps = new Hashtable<>(11); /** * The field used to represent "this" in all of my code. @@ -357,7 +357,7 @@ class SourceClass extends ClassDefinition { f.addModifiers(M_ABSTRACT); } } - Vector arguments = f.getArguments(); + Vector arguments = f.getArguments(); if (arguments != null) { // arguments can be null if this is an implicit abstract method int argumentLength = arguments.size(); @@ -921,9 +921,9 @@ class SourceClass extends ClassDefinition { // Tell the user which methods force this class to be abstract. // First list all of the "unimplementable" abstract methods. - Iterator iter = getPermanentlyAbstractMethods(); + Iterator iter = getPermanentlyAbstractMethods(); while (iter.hasNext()) { - MemberDefinition method = (MemberDefinition) iter.next(); + MemberDefinition method = iter.next(); // We couldn't override this method even if we // wanted to. Try to make the error message // as non-confusing as possible. @@ -937,7 +937,7 @@ class SourceClass extends ClassDefinition { while (iter.hasNext()) { // For each method, check if it is abstract. If it is, // output an appropriate error message. - MemberDefinition method = (MemberDefinition) iter.next(); + MemberDefinition method = iter.next(); if (method.isAbstract()) { env.error(where, "abstract.class", getClassDeclaration(), method, @@ -1163,11 +1163,10 @@ class SourceClass extends ClassDefinition { * sun/tools/java/ClassDeclaration.java */ protected void addMirandaMethods(Environment env, - Iterator mirandas) { + Iterator mirandas) { while(mirandas.hasNext()) { - MemberDefinition method = - (MemberDefinition)mirandas.next(); + MemberDefinition method = mirandas.next(); addMember(method); @@ -2040,7 +2039,7 @@ class SourceClass extends ClassDefinition { * is used to stop two compilations from saving the * same class. */ - private static Vector active = new Vector(); + private static Vector active = new Vector<>(); /** * Compile this class @@ -2082,9 +2081,9 @@ class SourceClass extends ClassDefinition { protected void compileClass(Environment env, OutputStream out) throws IOException, ClassNotFound { - Vector variables = new Vector(); - Vector methods = new Vector(); - Vector innerClasses = new Vector(); + Vector variables = new Vector<>(); + Vector methods = new Vector<>(); + Vector innerClasses = new Vector<>(); CompilerMember init = new CompilerMember(new MemberDefinition(getWhere(), this, M_STATIC, Type.tMethod(Type.tVoid), idClassInit, null, null), new Assembler()); Context ctx = new Context((Context)null, init.field); @@ -2243,8 +2242,8 @@ class SourceClass extends ClassDefinition { methods.setElementAt(ordered_methods[i], i); // Optimize Code and Collect method constants - for (Enumeration e = methods.elements() ; e.hasMoreElements() ; ) { - CompilerMember f = (CompilerMember)e.nextElement(); + for (Enumeration e = methods.elements() ; e.hasMoreElements() ; ) { + CompilerMember f = e.nextElement(); try { f.asm.optimize(env); f.asm.collect(env, f.field, tab); @@ -2262,8 +2261,8 @@ class SourceClass extends ClassDefinition { } // Collect field constants - for (Enumeration e = variables.elements() ; e.hasMoreElements() ; ) { - CompilerMember f = (CompilerMember)e.nextElement(); + for (Enumeration e = variables.elements() ; e.hasMoreElements() ; ) { + CompilerMember f = e.nextElement(); tab.put(f.name); tab.put(f.sig); @@ -2274,9 +2273,9 @@ class SourceClass extends ClassDefinition { } // Collect inner class constants - for (Enumeration e = innerClasses.elements(); + for (Enumeration e = innerClasses.elements(); e.hasMoreElements() ; ) { - ClassDefinition inner = (ClassDefinition)e.nextElement(); + ClassDefinition inner = e.nextElement(); tab.put(inner.getClassDeclaration()); // If the inner class is local, we do not need to add its @@ -2368,8 +2367,8 @@ class SourceClass extends ClassDefinition { DataOutputStream databuf = new DataOutputStream(buf); data.writeShort(variables.size()); - for (Enumeration e = variables.elements() ; e.hasMoreElements() ; ) { - CompilerMember f = (CompilerMember)e.nextElement(); + for (Enumeration e = variables.elements() ; e.hasMoreElements() ; ) { + CompilerMember f = e.nextElement(); Object val = f.field.getInitialValue(); data.writeShort(f.field.getModifiers() & MM_FIELD); @@ -2400,8 +2399,8 @@ class SourceClass extends ClassDefinition { // write methods data.writeShort(methods.size()); - for (Enumeration e = methods.elements() ; e.hasMoreElements() ; ) { - CompilerMember f = (CompilerMember)e.nextElement(); + for (Enumeration e = methods.elements() ; e.hasMoreElements() ; ) { + CompilerMember f = e.nextElement(); int xmods = f.field.getModifiers() & MM_METHOD; // Transform floating point modifiers. M_STRICTFP @@ -2530,7 +2529,7 @@ class SourceClass extends ClassDefinition { data.writeShort(tab.index("InnerClasses")); data.writeInt(2 + 2*4*innerClasses.size()); data.writeShort(innerClasses.size()); - for (Enumeration e = innerClasses.elements() ; + for (Enumeration e = innerClasses.elements() ; e.hasMoreElements() ; ) { // For each inner class name transformation, we have a record // with the following fields: @@ -2549,7 +2548,7 @@ class SourceClass extends ClassDefinition { // See also the initInnerClasses() method in BinaryClass.java. // Generate inner_class_info_index. - ClassDefinition inner = (ClassDefinition)e.nextElement(); + ClassDefinition inner = e.nextElement(); data.writeShort(tab.index(inner.getClassDeclaration())); // Generate outer_class_info_index. @@ -2662,8 +2661,8 @@ class SourceClass extends ClassDefinition { // where className1 is the name of the class we are in, and // classname2 is the name of the class className1 // is dependent on. - for(Enumeration e = deps.elements(); e.hasMoreElements(); ) { - ClassDeclaration data = (ClassDeclaration) e.nextElement(); + for(Enumeration e = deps.elements(); e.hasMoreElements(); ) { + ClassDeclaration data = e.nextElement(); // Mangle name of class dependend on. String depName = Type.mangleInnerType(data.getName()).toString(); diff --git a/jdk/src/share/classes/sun/tools/javac/SourceMember.java b/jdk/src/share/classes/sun/tools/javac/SourceMember.java index 8ba23ce07a0..4c6c0d328c3 100644 --- a/jdk/src/share/classes/sun/tools/javac/SourceMember.java +++ b/jdk/src/share/classes/sun/tools/javac/SourceMember.java @@ -46,7 +46,7 @@ class SourceMember extends MemberDefinition implements Constants { /** * The argument names (if it is a method) */ - Vector args; + Vector args; // set to the MemberDefinition in the interface if we have this field because // it has been forced on us @@ -64,7 +64,7 @@ class SourceMember extends MemberDefinition implements Constants { static final int INLINED = 4; static final int ERROR = 5; - public Vector getArguments() { + public Vector getArguments() { return args; } @@ -74,7 +74,7 @@ class SourceMember extends MemberDefinition implements Constants { */ public SourceMember(long where, ClassDefinition clazz, String doc, int modifiers, Type type, - Identifier name, Vector argNames, + Identifier name, Vector argNames, IdentifierToken exp[], Node value) { super(where, clazz, modifiers, type, name, exp, value); this.documentation = doc; @@ -86,17 +86,17 @@ class SourceMember extends MemberDefinition implements Constants { } } - void createArgumentFields(Vector argNames) { + void createArgumentFields(Vector argNames) { // Create a list of arguments if (isMethod()) { - args = new Vector(); + args = new Vector<>(); if (isConstructor() || !(isStatic() || isInitializer())) { args.addElement(((SourceClass)clazz).getThisArgument()); } if (argNames != null) { - Enumeration e = argNames.elements(); + Enumeration e = argNames.elements(); Type argTypes[] = getType().getArgumentTypes(); for (int i = 0 ; i < argTypes.length ; i++) { Object x = e.nextElement(); @@ -359,7 +359,7 @@ class SourceMember extends MemberDefinition implements Constants { getExceptions(env); if (isMethod()) { - Vector argNames = args; args = null; + Vector argNames = args; args = null; createArgumentFields(argNames); // Add outer instance argument for constructors. if (isConstructor()) { @@ -523,7 +523,7 @@ class SourceMember extends MemberDefinition implements Constants { // initialize vset, indication that each of the arguments // to the function has a value - for (Enumeration e = args.elements(); e.hasMoreElements();){ + for (Enumeration e = args.elements(); e.hasMoreElements();){ LocalMember f = (LocalMember)e.nextElement(); vset.addVar(ctx.declare(env, f)); } @@ -549,7 +549,7 @@ class SourceMember extends MemberDefinition implements Constants { //System.out.println("VSET = " + vset); ClassDeclaration exp[] = getExceptions(env); int htsize = (exp.length > 3) ? 17 : 7; - Hashtable thrown = new Hashtable(htsize); + Hashtable thrown = new Hashtable<>(htsize); vset = s.checkMethod(env, ctx, vset, thrown); @@ -558,7 +558,7 @@ class SourceMember extends MemberDefinition implements Constants { ClassDeclaration ignore2 = env.getClassDeclaration(idJavaLangRuntimeException); - for (Enumeration e = thrown.keys(); e.hasMoreElements();) { + for (Enumeration e = thrown.keys(); e.hasMoreElements();) { ClassDeclaration c = (ClassDeclaration)e.nextElement(); ClassDefinition def = c.getClassDefinition(env); if (def.subClassOf(env, ignore1) @@ -606,7 +606,7 @@ class SourceMember extends MemberDefinition implements Constants { } } } else { - Hashtable thrown = new Hashtable(3); // small & throw-away + Hashtable thrown = new Hashtable<>(3); // small & throw-away Expression val = (Expression)getValue(); vset = val.checkInitializer(env, ctx, vset, @@ -636,7 +636,7 @@ class SourceMember extends MemberDefinition implements Constants { ClassDeclaration ignore2 = env.getClassDeclaration(idJavaLangRuntimeException); - for (Enumeration e = thrown.keys(); e.hasMoreElements(); ) { + for (Enumeration e = thrown.keys(); e.hasMoreElements(); ) { ClassDeclaration c = (ClassDeclaration)e.nextElement(); ClassDefinition def = c.getClassDefinition(env); @@ -707,7 +707,7 @@ class SourceMember extends MemberDefinition implements Constants { if ((!isNative()) && (!isAbstract())) { Statement s = (Statement)getValue(); Context ctx = new Context((Context)null, this); - for (Enumeration e = args.elements() ; e.hasMoreElements() ;) { + for (Enumeration e = args.elements() ; e.hasMoreElements() ;) { LocalMember local = (LocalMember)e.nextElement(); ctx.declare(env, local); } @@ -812,7 +812,7 @@ class SourceMember extends MemberDefinition implements Constants { Context ctx = new Context((Context)null, this); Statement s = (Statement)getValue(); - for (Enumeration e = args.elements() ; e.hasMoreElements() ; ) { + for (Enumeration e = args.elements() ; e.hasMoreElements() ; ) { LocalMember f = (LocalMember)e.nextElement(); ctx.declare(env, f); //ctx.declare(env, (LocalMember)e.nextElement()); diff --git a/jdk/src/share/classes/sun/tools/tree/AndExpression.java b/jdk/src/share/classes/sun/tools/tree/AndExpression.java index 18082007153..84eaa01b141 100644 --- a/jdk/src/share/classes/sun/tools/tree/AndExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/AndExpression.java @@ -54,7 +54,7 @@ class AndExpression extends BinaryLogicalExpression { * either the left or right hand side is false */ public void checkCondition(Environment env, Context ctx, Vset vset, - Hashtable exp, ConditionVars cvars) { + Hashtable exp, ConditionVars cvars) { // Find out when the left side is true/false left.checkCondition(env, ctx, vset, exp, cvars); left = convert(env, ctx, Type.tBoolean, left); diff --git a/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java b/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java index 3997b33e07c..d720df67e04 100644 --- a/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/ArrayAccessExpression.java @@ -62,7 +62,7 @@ class ArrayAccessExpression extends UnaryExpression { /** * Check expression type */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = right.checkValue(env, ctx, vset, exp); if (index == null) { env.error(where, "array.index.required"); @@ -83,7 +83,7 @@ class ArrayAccessExpression extends UnaryExpression { } public Vset checkAmbigName(Environment env, Context ctx, - Vset vset, Hashtable exp, + Vset vset, Hashtable exp, UnaryExpression loc) { if (index == null) { vset = right.checkAmbigName(env, ctx, vset, exp, this); @@ -109,7 +109,7 @@ class ArrayAccessExpression extends UnaryExpression { * Check the array if it appears on the LHS of an assignment */ public Vset checkLHS(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { return checkValue(env, ctx, vset, exp); } @@ -117,7 +117,7 @@ class ArrayAccessExpression extends UnaryExpression { * Check the array if it appears on the LHS of an op= expression */ public Vset checkAssignOp(Environment env, Context ctx, - Vset vset, Hashtable exp, Expression outside) { + Vset vset, Hashtable exp, Expression outside) { return checkValue(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java b/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java index b784a263ce4..a431159af34 100644 --- a/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/ArrayExpression.java @@ -47,11 +47,11 @@ class ArrayExpression extends NaryExpression { /** * Check expression type */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { env.error(where, "invalid.array.expr"); return vset; } - public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp) { + public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp) { if (!t.isType(TC_ARRAY)) { if (!t.isType(TC_ERROR)) { env.error(where, "invalid.array.init", t); diff --git a/jdk/src/share/classes/sun/tools/tree/AssignExpression.java b/jdk/src/share/classes/sun/tools/tree/AssignExpression.java index 3a9b1d23239..929335fc553 100644 --- a/jdk/src/share/classes/sun/tools/tree/AssignExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/AssignExpression.java @@ -50,7 +50,7 @@ class AssignExpression extends BinaryAssignExpression { /** * Check an assignment expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { if (left instanceof IdentifierExpression) { // we don't want to mark an identifier as having a value // until having evaluated the right-hand side diff --git a/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java index b3493bc7d9a..b8185925c3c 100644 --- a/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/AssignOpExpression.java @@ -149,7 +149,7 @@ class AssignOpExpression extends BinaryAssignExpression { /** * Check an assignment expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = left.checkAssignOp(env, ctx, vset, exp, this); vset = right.checkValue(env, ctx, vset, exp); int tm = left.type.getTypeMask() | right.type.getTypeMask(); diff --git a/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java b/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java index f5f9f21c337..5a45fe69d93 100644 --- a/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/BinaryAssignExpression.java @@ -67,7 +67,7 @@ class BinaryAssignExpression extends BinaryExpression { /** * Check void expression */ - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { return checkValue(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java b/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java index 9fd7fa33b55..d54f8250995 100644 --- a/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/BinaryExpression.java @@ -64,7 +64,7 @@ class BinaryExpression extends UnaryExpression { /** * Check a binary expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = left.checkValue(env, ctx, vset, exp); vset = right.checkValue(env, ctx, vset, exp); diff --git a/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java b/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java index 9b2eed093e7..e86f178d5db 100644 --- a/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/BinaryLogicalExpression.java @@ -46,7 +46,7 @@ class BinaryLogicalExpression extends BinaryExpression { * Check a binary expression */ public Vset checkValue(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { ConditionVars cvars = new ConditionVars(); // evaluate the logical expression, determining which variables are // set if the resulting value is true or false @@ -61,7 +61,7 @@ class BinaryLogicalExpression extends BinaryExpression { */ abstract public void checkCondition(Environment env, Context ctx, Vset vset, - Hashtable exp, ConditionVars cvars); + Hashtable exp, ConditionVars cvars); /** diff --git a/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java b/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java index af5f0891401..c82deb4d0c2 100644 --- a/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/BooleanExpression.java @@ -86,7 +86,7 @@ class BooleanExpression extends ConstantExpression { */ public void checkCondition(Environment env, Context ctx, - Vset vset, Hashtable exp, ConditionVars cvars) { + Vset vset, Hashtable exp, ConditionVars cvars) { if (value) { cvars.vsFalse = Vset.DEAD_END; cvars.vsTrue = vset; diff --git a/jdk/src/share/classes/sun/tools/tree/BreakStatement.java b/jdk/src/share/classes/sun/tools/tree/BreakStatement.java index f1801e32c55..3847f180d40 100644 --- a/jdk/src/share/classes/sun/tools/tree/BreakStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/BreakStatement.java @@ -51,7 +51,7 @@ class BreakStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { reach(env, vset); checkLabel(env, ctx); CheckContext destctx = (CheckContext)new CheckContext(ctx, this).getBreakContext(lbl); diff --git a/jdk/src/share/classes/sun/tools/tree/CaseStatement.java b/jdk/src/share/classes/sun/tools/tree/CaseStatement.java index 0fa27556dac..cd8c33cb45b 100644 --- a/jdk/src/share/classes/sun/tools/tree/CaseStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/CaseStatement.java @@ -49,7 +49,7 @@ class CaseStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { if (expr != null) { expr.checkValue(env, ctx, vset, exp); expr = convert(env, ctx, Type.tInt, expr); diff --git a/jdk/src/share/classes/sun/tools/tree/CastExpression.java b/jdk/src/share/classes/sun/tools/tree/CastExpression.java index 0a53c2b926e..6826b173bb6 100644 --- a/jdk/src/share/classes/sun/tools/tree/CastExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/CastExpression.java @@ -48,7 +48,7 @@ class CastExpression extends BinaryExpression { /** * Check the expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { type = left.toType(env, ctx); vset = right.checkValue(env, ctx, vset, exp); diff --git a/jdk/src/share/classes/sun/tools/tree/CatchStatement.java b/jdk/src/share/classes/sun/tools/tree/CatchStatement.java index 593699804a8..543396ee881 100644 --- a/jdk/src/share/classes/sun/tools/tree/CatchStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/CatchStatement.java @@ -67,7 +67,7 @@ class CatchStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = reach(env, vset); ctx = new Context(ctx, this); Type type = texpr.toType(env, ctx); diff --git a/jdk/src/share/classes/sun/tools/tree/CommaExpression.java b/jdk/src/share/classes/sun/tools/tree/CommaExpression.java index 2cbfa845442..1dcde645441 100644 --- a/jdk/src/share/classes/sun/tools/tree/CommaExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/CommaExpression.java @@ -46,7 +46,7 @@ class CommaExpression extends BinaryExpression { /** * Check void expression */ - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = left.check(env, ctx, vset, exp); vset = right.check(env, ctx, vset, exp); return vset; diff --git a/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java b/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java index 4fef3c5772f..b130bbbc651 100644 --- a/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/CompoundStatement.java @@ -70,7 +70,7 @@ class CompoundStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); if (args.length > 0) { vset = reach(env, vset); diff --git a/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java b/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java index bdd201598d0..7fb3bace37a 100644 --- a/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/ConditionalExpression.java @@ -64,7 +64,7 @@ class ConditionalExpression extends BinaryExpression { /** * Check the expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { ConditionVars cvars = cond.checkCondition(env, ctx, vset, exp); vset = left.checkValue(env, ctx, cvars.vsTrue, exp).join( right.checkValue(env, ctx, cvars.vsFalse, exp) ); @@ -107,7 +107,7 @@ class ConditionalExpression extends BinaryExpression { return vset; } - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = cond.checkValue(env, ctx, vset, exp); cond = convert(env, ctx, Type.tBoolean, cond); return left.check(env, ctx, vset.copy(), exp).join(right.check(env, ctx, vset, exp)); diff --git a/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java b/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java index 13eaf61aced..6cd22017fee 100644 --- a/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/ContinueStatement.java @@ -52,7 +52,7 @@ class ContinueStatement extends Statement { * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); reach(env, vset); // A new context is established here because the 'continue' statement diff --git a/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java b/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java index 13fdb2f89bb..eb2d25e3b77 100644 --- a/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/ConvertExpression.java @@ -47,7 +47,7 @@ class ConvertExpression extends UnaryExpression { /** * Check the value */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { return right.checkValue(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java b/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java index 1ee52de6c7e..82bbea39b4b 100644 --- a/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/DeclarationStatement.java @@ -55,11 +55,11 @@ class DeclarationStatement extends Statement { * Check statement * Report an error unless the call is checkBlockStatement. */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { env.error(where, "invalid.decl"); return checkBlockStatement(env, ctx, vset, exp); } - Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable exp) { if (labels != null) { env.error(where, "declaration.with.label", labels[0]); } diff --git a/jdk/src/share/classes/sun/tools/tree/DoStatement.java b/jdk/src/share/classes/sun/tools/tree/DoStatement.java index 87a6b9e40d3..974ae99400b 100644 --- a/jdk/src/share/classes/sun/tools/tree/DoStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/DoStatement.java @@ -53,7 +53,7 @@ class DoStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env,ctx); CheckContext newctx = new CheckContext(ctx, this); // remember what was unassigned on entry diff --git a/jdk/src/share/classes/sun/tools/tree/ExprExpression.java b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java index 796f559e877..0e40b801aba 100644 --- a/jdk/src/share/classes/sun/tools/tree/ExprExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/ExprExpression.java @@ -49,7 +49,7 @@ class ExprExpression extends UnaryExpression { * Check a condition. We must pass it on to our unparenthesised form. */ public void checkCondition(Environment env, Context ctx, Vset vset, - Hashtable exp, ConditionVars cvars) { + Hashtable exp, ConditionVars cvars) { right.checkCondition(env, ctx, vset, exp, cvars); type = right.type; } @@ -60,7 +60,7 @@ class ExprExpression extends UnaryExpression { * (Part of fix for 4090372) */ public Vset checkAssignOp(Environment env, Context ctx, - Vset vset, Hashtable exp, Expression outside) { + Vset vset, Hashtable exp, Expression outside) { vset = right.checkAssignOp(env, ctx, vset, exp, outside); type = right.type; return vset; @@ -80,7 +80,7 @@ class ExprExpression extends UnaryExpression { // going to clammer for this one. // // public Vset checkLHS(Environment env, Context ctx, - // Vset vset, Hashtable exp) { + // Vset vset, Hashtable exp) { // vset = right.check(env, ctx, vset, exp); // type = right.type; // return vset; diff --git a/jdk/src/share/classes/sun/tools/tree/Expression.java b/jdk/src/share/classes/sun/tools/tree/Expression.java index 5eca24e26e7..2a77971900d 100644 --- a/jdk/src/share/classes/sun/tools/tree/Expression.java +++ b/jdk/src/share/classes/sun/tools/tree/Expression.java @@ -192,18 +192,18 @@ class Expression extends Node { /** * Check an expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { return vset; } - public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp) { + public Vset checkInitializer(Environment env, Context ctx, Vset vset, Type t, Hashtable exp) { return checkValue(env, ctx, vset, exp); } - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { throw new CompilerError("check failed"); } public Vset checkLHS(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { env.error(where, "invalid.lhs.assignment"); type = Type.tError; return vset; @@ -243,7 +243,7 @@ class Expression extends Node { } public Vset checkAssignOp(Environment env, Context ctx, - Vset vset, Hashtable exp, Expression outside) { + Vset vset, Hashtable exp, Expression outside) { if (outside instanceof IncDecExpression) env.error(where, "invalid.arg", opNames[outside.op]); else @@ -266,7 +266,7 @@ class Expression extends Node { * and act appropriately to verify the full package name. * @arg loc the expression containing the ambiguous expression */ - public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, + public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, UnaryExpression loc) { return checkValue(env, ctx, vset, exp); } @@ -277,7 +277,7 @@ class Expression extends Node { * the condition is false. */ public ConditionVars checkCondition(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { ConditionVars cvars = new ConditionVars(); checkCondition(env, ctx, vset, exp, cvars); return cvars; @@ -295,7 +295,7 @@ class Expression extends Node { */ public void checkCondition(Environment env, Context ctx, - Vset vset, Hashtable exp, ConditionVars cvars) { + Vset vset, Hashtable exp, ConditionVars cvars) { cvars.vsTrue = cvars.vsFalse = checkValue(env, ctx, vset, exp); // unshare side effects: cvars.vsFalse = cvars.vsFalse.copy(); diff --git a/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java b/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java index ee83fca196c..265311275ec 100644 --- a/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/ExpressionStatement.java @@ -50,7 +50,7 @@ class ExpressionStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); return expr.check(env, ctx, reach(env, vset), exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java index 4dc02f71b1a..c21551931aa 100644 --- a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java @@ -219,7 +219,7 @@ class FieldExpression extends UnaryExpression { */ public Vset checkAmbigName(Environment env, Context ctx, - Vset vset, Hashtable exp, + Vset vset, Hashtable exp, UnaryExpression loc) { if (id == idThis || id == idClass) { loc = null; // this cannot be a type or package @@ -232,7 +232,7 @@ class FieldExpression extends UnaryExpression { */ public Vset checkValue(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { vset = checkCommon(env, ctx, vset, exp, null, false); if (id == idSuper && type != Type.tError) { // "super" is not allowed in this context. @@ -416,7 +416,7 @@ class FieldExpression extends UnaryExpression { */ private Vset checkCommon(Environment env, Context ctx, - Vset vset, Hashtable exp, + Vset vset, Hashtable exp, UnaryExpression loc, boolean isLHS) { // Handle class literal, e.g., 'x.class'. @@ -850,7 +850,7 @@ class FieldExpression extends UnaryExpression { * Finish checking it. */ private Vset checkInnerClass(Environment env, Context ctx, - Vset vset, Hashtable exp, + Vset vset, Hashtable exp, UnaryExpression loc) { ClassDefinition inner = field.getInnerClass(); type = inner.getType(); @@ -903,7 +903,7 @@ class FieldExpression extends UnaryExpression { * Check the expression if it appears on the LHS of an assignment */ public Vset checkLHS(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { boolean hadField = (field != null); //checkValue(env, ctx, vset, exp); @@ -945,7 +945,7 @@ class FieldExpression extends UnaryExpression { * Check the expression if it appears on the LHS of an op= expression */ public Vset checkAssignOp(Environment env, Context ctx, - Vset vset, Hashtable exp, Expression outside) { + Vset vset, Hashtable exp, Expression outside) { //checkValue(env, ctx, vset, exp); checkCommon(env, ctx, vset, exp, null, true); diff --git a/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java b/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java index f56dfe63e61..710f03b94b8 100644 --- a/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/FinallyStatement.java @@ -68,9 +68,9 @@ class FinallyStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = reach(env, vset); - Hashtable newexp = new Hashtable(); + Hashtable newexp = new Hashtable<>(); // Handle the proposed 'try (init) { stmts } finally { stmts }' syntax. // This feature has not been adopted, and support is presently disabled. @@ -182,7 +182,7 @@ class FinallyStatement extends Statement { // generated by the body into exp. if (finallyCanFinish) { // Add newexp's back into exp; cf. ThrowStatement.check(). - for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) { + for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) { Object def = e.nextElement(); exp.put(def, newexp.get(def)); } diff --git a/jdk/src/share/classes/sun/tools/tree/ForStatement.java b/jdk/src/share/classes/sun/tools/tree/ForStatement.java index c6cb38dc6f1..639126f4beb 100644 --- a/jdk/src/share/classes/sun/tools/tree/ForStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/ForStatement.java @@ -57,7 +57,7 @@ class ForStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); vset = reach(env, vset); Context initctx = new Context(ctx, this); diff --git a/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java b/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java index 53594276400..1cbdb1a4317 100644 --- a/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/IdentifierExpression.java @@ -231,7 +231,7 @@ class IdentifierExpression extends Expression { /** * Check expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { if (field != null) { // An internally pre-set field, such as an argument copying // an uplevel value. Do not re-check it. @@ -250,7 +250,7 @@ class IdentifierExpression extends Expression { * Check the expression if it appears on the LHS of an assignment */ public Vset checkLHS(Environment env, Context ctx, - Vset vset, Hashtable exp) { + Vset vset, Hashtable exp) { if (!bind(env, ctx)) return vset; vset = assign(env, ctx, vset); @@ -263,7 +263,7 @@ class IdentifierExpression extends Expression { * Check the expression if it appears on the LHS of an op= expression */ public Vset checkAssignOp(Environment env, Context ctx, - Vset vset, Hashtable exp, Expression outside) { + Vset vset, Hashtable exp, Expression outside) { if (!bind(env, ctx)) return vset; vset = assign(env, ctx, get(env, ctx, vset)); @@ -293,7 +293,7 @@ class IdentifierExpression extends Expression { /** * Check if the present name is part of a scoping prefix. */ - public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, + public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, UnaryExpression loc) { try { if (ctx.getField(env, id) != null) { @@ -474,4 +474,4 @@ class IdentifierExpression extends Expression { implementation.print(out); } } -} \ No newline at end of file +} diff --git a/jdk/src/share/classes/sun/tools/tree/IfStatement.java b/jdk/src/share/classes/sun/tools/tree/IfStatement.java index 479ff7e18df..c3235514c8b 100644 --- a/jdk/src/share/classes/sun/tools/tree/IfStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/IfStatement.java @@ -55,7 +55,7 @@ class IfStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); CheckContext newctx = new CheckContext(ctx, this); // Vset vsExtra = vset.copy(); // See comment below. diff --git a/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java index cc85e6473c1..591881cbce1 100644 --- a/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/IncDecExpression.java @@ -49,7 +49,7 @@ class IncDecExpression extends UnaryExpression { /** * Check an increment or decrement expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = right.checkAssignOp(env, ctx, vset, exp, this); if (right.type.inMask(TM_NUMBER)) { type = right.type; @@ -66,7 +66,7 @@ class IncDecExpression extends UnaryExpression { /** * Check void expression */ - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { return checkValue(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java b/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java index 114328955bb..c6a2e684f40 100644 --- a/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/InstanceOfExpression.java @@ -48,7 +48,7 @@ class InstanceOfExpression extends BinaryExpression { /** * Check the expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = left.checkValue(env, ctx, vset, exp); right = new TypeExpression(right.where, right.toType(env, ctx)); diff --git a/jdk/src/share/classes/sun/tools/tree/LengthExpression.java b/jdk/src/share/classes/sun/tools/tree/LengthExpression.java index 31f97ebc443..f9dfe706ed8 100644 --- a/jdk/src/share/classes/sun/tools/tree/LengthExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/LengthExpression.java @@ -46,7 +46,7 @@ class LengthExpression extends UnaryExpression { /** * Select the type of the expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = right.checkValue(env, ctx, vset, exp); if (!right.type.isType(TC_ARRAY)) { env.error(where, "invalid.length", right.type); diff --git a/jdk/src/share/classes/sun/tools/tree/LocalMember.java b/jdk/src/share/classes/sun/tools/tree/LocalMember.java index 9890e073bb6..b7067cf0f0e 100644 --- a/jdk/src/share/classes/sun/tools/tree/LocalMember.java +++ b/jdk/src/share/classes/sun/tools/tree/LocalMember.java @@ -163,7 +163,7 @@ class LocalMember extends MemberDefinition { * May inline copies of all the arguments of the given method. */ static public LocalMember[] copyArguments(Context ctx, MemberDefinition field) { - Vector v = field.getArguments(); + Vector v = field.getArguments(); LocalMember res[] = new LocalMember[v.size()]; v.copyInto(res); for (int i = 0; i < res.length; i++) { diff --git a/jdk/src/share/classes/sun/tools/tree/MethodExpression.java b/jdk/src/share/classes/sun/tools/tree/MethodExpression.java index b1f7fc2d518..ef5c8ea0fa3 100644 --- a/jdk/src/share/classes/sun/tools/tree/MethodExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/MethodExpression.java @@ -78,7 +78,7 @@ class MethodExpression extends NaryExpression { /** * Check expression type */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { ClassDeclaration c = null; boolean isArray = false; boolean staticRef = false; @@ -587,7 +587,7 @@ class MethodExpression extends NaryExpression { /** * Check void expression */ - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { return checkValue(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java b/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java index ffa85bafd46..4925e6b5792 100644 --- a/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/NewArrayExpression.java @@ -55,7 +55,7 @@ class NewArrayExpression extends NaryExpression { /** * Check */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { type = right.toType(env, ctx); boolean flag = (init != null); // flag says that dims are forbidden diff --git a/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java index 0347c41efbf..408aa159614 100644 --- a/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/NewInstanceExpression.java @@ -83,7 +83,7 @@ class NewInstanceExpression extends NaryExpression { /** * Check expression type */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { // What type? ClassDefinition def = null; @@ -366,7 +366,7 @@ class NewInstanceExpression extends NaryExpression { /** * Check void expression */ - public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { return checkValue(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/NotExpression.java b/jdk/src/share/classes/sun/tools/tree/NotExpression.java index 66b47819fe4..2bc42e8775c 100644 --- a/jdk/src/share/classes/sun/tools/tree/NotExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/NotExpression.java @@ -65,7 +65,7 @@ class NotExpression extends UnaryExpression { */ public void checkCondition(Environment env, Context ctx, Vset vset, - Hashtable exp, ConditionVars cvars) { + Hashtable exp, ConditionVars cvars) { right.checkCondition(env, ctx, vset, exp, cvars); right = convert(env, ctx, Type.tBoolean, right); // swap true and false diff --git a/jdk/src/share/classes/sun/tools/tree/OrExpression.java b/jdk/src/share/classes/sun/tools/tree/OrExpression.java index e1bd6ec6215..c1edd1cec02 100644 --- a/jdk/src/share/classes/sun/tools/tree/OrExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/OrExpression.java @@ -54,7 +54,7 @@ class OrExpression extends BinaryLogicalExpression { * both the left or right hand side are false */ public void checkCondition(Environment env, Context ctx, Vset vset, - Hashtable exp, ConditionVars cvars) { + Hashtable exp, ConditionVars cvars) { // Find out when the left side is true/false left.checkCondition(env, ctx, vset, exp, cvars); left = convert(env, ctx, Type.tBoolean, left); diff --git a/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java b/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java index 6cfc043bbe8..7e2f6bfacec 100644 --- a/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/ReturnStatement.java @@ -51,7 +51,7 @@ class ReturnStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); vset = reach(env, vset); if (expr != null) { diff --git a/jdk/src/share/classes/sun/tools/tree/Statement.java b/jdk/src/share/classes/sun/tools/tree/Statement.java index 1cbdc80e1bd..70d25db2724 100644 --- a/jdk/src/share/classes/sun/tools/tree/Statement.java +++ b/jdk/src/share/classes/sun/tools/tree/Statement.java @@ -100,7 +100,7 @@ class Statement extends Node { /** * Check a statement */ - public Vset checkMethod(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkMethod(Environment env, Context ctx, Vset vset, Hashtable exp) { // Set up ctx.getReturnContext() for the sake of ReturnStatement.check(). CheckContext mctx = new CheckContext(ctx, new Statement(METHOD, 0)); ctx = mctx; @@ -130,7 +130,7 @@ class Statement extends Node { return vset; } - Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable exp) { + Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable exp) { throw new CompilerError("checkDeclaration"); } @@ -164,12 +164,12 @@ class Statement extends Node { } } - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { throw new CompilerError("check"); } /** This is called in contexts where declarations are valid. */ - Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset checkBlockStatement(Environment env, Context ctx, Vset vset, Hashtable exp) { return check(env, ctx, vset, exp); } diff --git a/jdk/src/share/classes/sun/tools/tree/SuperExpression.java b/jdk/src/share/classes/sun/tools/tree/SuperExpression.java index e9975ac60e6..dcce41058c7 100644 --- a/jdk/src/share/classes/sun/tools/tree/SuperExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/SuperExpression.java @@ -61,7 +61,7 @@ class SuperExpression extends ThisExpression { /** * Check expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = checkCommon(env, ctx, vset, exp); if (type != Type.tError) { // "super" is not allowed in this context: @@ -74,13 +74,13 @@ class SuperExpression extends ThisExpression { * Check if the present name is part of a scoping prefix. */ public Vset checkAmbigName(Environment env, Context ctx, - Vset vset, Hashtable exp, + Vset vset, Hashtable exp, UnaryExpression loc) { return checkCommon(env, ctx, vset, exp); } /** Common code for checkValue and checkAmbigName */ - private Vset checkCommon(Environment env, Context ctx, Vset vset, Hashtable exp) { + private Vset checkCommon(Environment env, Context ctx, Vset vset, Hashtable exp) { ClassDeclaration superClass = ctx.field.getClassDefinition().getSuperClass(); if (superClass == null) { env.error(where, "undef.var", idSuper); diff --git a/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java b/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java index d8899f2c3ba..5eae83e825b 100644 --- a/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/SwitchStatement.java @@ -54,7 +54,7 @@ class SwitchStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); CheckContext newctx = new CheckContext(ctx, this); vset = expr.checkValue(env, newctx, reach(env, vset), exp); @@ -62,7 +62,7 @@ class SwitchStatement extends Statement { expr = convert(env, newctx, Type.tInt, expr); - Hashtable tab = new Hashtable(); + Hashtable tab = new Hashtable<>(); boolean hasDefault = false; // Note that vs is reset to vset.copy() on every case label. // If the first substatement is not a case label, it is unreached. diff --git a/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java b/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java index 88ffbad81e4..945d539f732 100644 --- a/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/SynchronizedStatement.java @@ -56,7 +56,7 @@ class SynchronizedStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); CheckContext newctx = new CheckContext(ctx, this); vset = reach(env, vset); diff --git a/jdk/src/share/classes/sun/tools/tree/ThisExpression.java b/jdk/src/share/classes/sun/tools/tree/ThisExpression.java index e4328f5a908..59330e0d85a 100644 --- a/jdk/src/share/classes/sun/tools/tree/ThisExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/ThisExpression.java @@ -87,7 +87,7 @@ class ThisExpression extends Expression { /** * Check expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { if (ctx.field.isStatic()) { env.error(where, "undef.var", opNames[op]); type = Type.tError; diff --git a/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java b/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java index 2b4571ce916..53710843bda 100644 --- a/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/ThrowStatement.java @@ -50,7 +50,7 @@ class ThrowStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); try { vset = reach(env, vset); diff --git a/jdk/src/share/classes/sun/tools/tree/TryStatement.java b/jdk/src/share/classes/sun/tools/tree/TryStatement.java index 5e5dbe3b07c..61cd11b6b30 100644 --- a/jdk/src/share/classes/sun/tools/tree/TryStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/TryStatement.java @@ -57,11 +57,11 @@ class TryStatement extends Statement { /** * Check statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); try { vset = reach(env, vset); - Hashtable newexp = new Hashtable(); + Hashtable newexp = new Hashtable<>(); CheckContext newctx = new CheckContext(ctx, this); // Check 'try' block. A variable is DA (DU) before the try @@ -131,7 +131,7 @@ class TryStatement extends Statement { // Make sure the exception is actually throw in that part of the code boolean ok = false; - for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) { + for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) { ClassDeclaration c = (ClassDeclaration)e.nextElement(); if (def.superClassOf(env, c) || def.subClassOf(env, c)) { ok = true; @@ -149,7 +149,7 @@ class TryStatement extends Statement { } // Only carry over exceptions that are not caught - for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) { + for (Enumeration e = newexp.keys() ; e.hasMoreElements() ; ) { ClassDeclaration c = (ClassDeclaration)e.nextElement(); ClassDefinition def = c.getClassDefinition(env); boolean add = true; diff --git a/jdk/src/share/classes/sun/tools/tree/TypeExpression.java b/jdk/src/share/classes/sun/tools/tree/TypeExpression.java index ea31f272a3d..419fab06a7f 100644 --- a/jdk/src/share/classes/sun/tools/tree/TypeExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/TypeExpression.java @@ -53,13 +53,13 @@ class TypeExpression extends Expression { /** * Check an expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { env.error(where, "invalid.term"); type = Type.tError; return vset; } - public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, + public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable exp, UnaryExpression loc) { return vset; } diff --git a/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java b/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java index ec54654f81b..1db5157a7cb 100644 --- a/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java +++ b/jdk/src/share/classes/sun/tools/tree/UnaryExpression.java @@ -69,7 +69,7 @@ class UnaryExpression extends Expression { /** * Check a unary expression */ - public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { + public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = right.checkValue(env, ctx, vset, exp); int tm = right.type.getTypeMask(); diff --git a/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java b/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java index 744aa761c50..5a2e2c8a5a6 100644 --- a/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/VarDeclarationStatement.java @@ -57,7 +57,7 @@ class VarDeclarationStatement extends Statement { /** * Check statement */ - Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable exp) { + Vset checkDeclaration(Environment env, Context ctx, Vset vset, int mod, Type t, Hashtable exp) { if (labels != null) { env.error(where, "declaration.with.label", labels[0]); } diff --git a/jdk/src/share/classes/sun/tools/tree/WhileStatement.java b/jdk/src/share/classes/sun/tools/tree/WhileStatement.java index 4ddd5e666f7..71bd4418cdd 100644 --- a/jdk/src/share/classes/sun/tools/tree/WhileStatement.java +++ b/jdk/src/share/classes/sun/tools/tree/WhileStatement.java @@ -53,7 +53,7 @@ class WhileStatement extends Statement { /** * Check a while statement */ - Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { + Vset check(Environment env, Context ctx, Vset vset, Hashtable exp) { checkLabel(env, ctx); CheckContext newctx = new CheckContext(ctx, this); // remember what was unassigned on entry diff --git a/jdk/src/share/classes/sun/tools/util/CommandLine.java b/jdk/src/share/classes/sun/tools/util/CommandLine.java index 4bf9582583c..da45f6a8284 100644 --- a/jdk/src/share/classes/sun/tools/util/CommandLine.java +++ b/jdk/src/share/classes/sun/tools/util/CommandLine.java @@ -54,7 +54,7 @@ public class CommandLine { public static String[] parse(String[] args) throws IOException { - ArrayList newArgs = new ArrayList(args.length); + ArrayList newArgs = new ArrayList<>(args.length); for (int i = 0; i < args.length; i++) { String arg = args[i]; if (arg.length() > 1 && arg.charAt(0) == '@') { @@ -68,10 +68,10 @@ public class CommandLine { newArgs.add(arg); } } - return (String[])newArgs.toArray(new String[newArgs.size()]); + return newArgs.toArray(new String[newArgs.size()]); } - private static void loadCmdFile(String name, List args) + private static void loadCmdFile(String name, List args) throws IOException { Reader r = new BufferedReader(new FileReader(name)); From 8bfd74fd09f15fcd60c1317915c4ad5dc658a09a Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 31 Jul 2014 17:20:40 -0700 Subject: [PATCH 086/111] 8039102: Add raw and unchecked lint warnings to build of jdk repository Reviewed-by: tbell --- jdk/make/Setup.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/make/Setup.gmk b/jdk/make/Setup.gmk index 485c3b72b13..c4f204cf6af 100644 --- a/jdk/make/Setup.gmk +++ b/jdk/make/Setup.gmk @@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,- # To build with all warnings enabled, do the following: # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS := -Xlint:all,-deprecation,-rawtypes,-unchecked -Werror +JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror # Any java code executed during a JDK build to build other parts of the JDK must be # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this From ef6f1e0e2e4a8e9486825b04e9350245ccd34f81 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 1 Aug 2014 12:05:05 +0000 Subject: [PATCH 087/111] 8052406: SSLv2Hello protocol may be filter out unexpectedly Reviewed-by: weijun --- .../classes/sun/security/ssl/Handshaker.java | 12 + .../javax/net/ssl/TLSv12/ProtocolFilter.java | 315 ++++++++++++++++++ 2 files changed, 327 insertions(+) create mode 100644 jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java diff --git a/jdk/src/share/classes/sun/security/ssl/Handshaker.java b/jdk/src/share/classes/sun/security/ssl/Handshaker.java index 9fea3fada98..bea8608e6ff 100644 --- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java +++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java @@ -656,8 +656,15 @@ abstract class Handshaker { */ ProtocolList getActiveProtocols() { if (activeProtocols == null) { + boolean enabledSSL20Hello = false; ArrayList protocols = new ArrayList<>(4); for (ProtocolVersion protocol : enabledProtocols.collection()) { + // Need not to check the SSL20Hello protocol. + if (protocol.v == ProtocolVersion.SSL20Hello.v) { + enabledSSL20Hello = true; + continue; + } + boolean found = false; for (CipherSuite suite : enabledCipherSuites.collection()) { if (suite.isAvailable() && suite.obsoleted > protocol.v && @@ -684,6 +691,11 @@ abstract class Handshaker { "No available cipher suite for " + protocol); } } + + if (!protocols.isEmpty() && enabledSSL20Hello) { + protocols.add(ProtocolVersion.SSL20Hello); + } + activeProtocols = new ProtocolList(protocols); } diff --git a/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java b/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java new file mode 100644 index 00000000000..ec58bc74d0c --- /dev/null +++ b/jdk/test/javax/net/ssl/TLSv12/ProtocolFilter.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @bug 8052406 + * @summary SSLv2Hello protocol may be filter out unexpectedly + * @run main/othervm ProtocolFilter + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class ProtocolFilter { + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + // Only enable cipher suites for TLS v1.2. + sslServerSocket.setEnabledCipherSuites( + new String[]{"TLS_RSA_WITH_AES_128_CBC_SHA256"}); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + + sslSocket.close(); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + // Enable all supported protocols, including SSLv2Hello. + sslSocket.setEnabledProtocols(sslSocket.getSupportedProtocols()); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + + sslSocket.close(); + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", ".") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new ProtocolFilter(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + ProtocolFilter() throws Exception { + Exception startException = null; + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + startException = e; + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + if (serverThread != null) { + serverThread.join(); + } + } else { + if (clientThread != null) { + clientThread.join(); + } + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + } else { + remote = clientException; + local = serverException; + } + + Exception exception = null; + + /* + * Check various exception conditions. + */ + if ((local != null) && (remote != null)) { + // If both failed, return the curthread's exception. + local.initCause(remote); + exception = local; + } else if (local != null) { + exception = local; + } else if (remote != null) { + exception = remote; + } else if (startException != null) { + exception = startException; + } + + /* + * If there was an exception *AND* a startException, + * output it. + */ + if (exception != null) { + if (exception != startException && startException != null) { + exception.addSuppressed(startException); + } + throw exception; + } + + // Fall-through: no exception to throw! + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } +} From 140ff9735f0e3b3979a97e5cc09d3979a7197385 Mon Sep 17 00:00:00 2001 From: Dmeetry Degrave Date: Fri, 1 Aug 2014 16:29:46 +0400 Subject: [PATCH 088/111] 8044671: NPE from JapaneseEra when a new era is defined in calendar.properties Reviewed-by: okutsu --- jdk/src/share/classes/java/time/chrono/JapaneseEra.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java index 0187565869f..0c9e3e81e1d 100644 --- a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java +++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java @@ -127,7 +127,7 @@ public final class JapaneseEra // the number of defined JapaneseEra constants. // There could be an extra era defined in its configuration. - private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET + 1; + private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET; /** * Serialization version. @@ -148,7 +148,7 @@ public final class JapaneseEra for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) { CalendarDate date = ERA_CONFIG[i].getSinceDate(); LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()); - KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET, isoDate); + KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET + 1, isoDate); } }; @@ -195,7 +195,7 @@ public final class JapaneseEra * @throws DateTimeException if the value is invalid */ public static JapaneseEra of(int japaneseEra) { - if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET - 1 >= KNOWN_ERAS.length) { + if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET > KNOWN_ERAS.length) { throw new DateTimeException("Invalid era: " + japaneseEra); } return KNOWN_ERAS[ordinal(japaneseEra)]; From 12b137c7c09689e85b59f6cbb172bb8dae275726 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Fri, 1 Aug 2014 14:57:15 +0100 Subject: [PATCH 089/111] 8051991: Flatten VersionHelper hierarchies Reviewed-by: vinnie --- .../com/sun/jndi/ldap/VersionHelper.java | 65 ++++- .../com/sun/jndi/ldap/VersionHelper12.java | 98 ------- .../sun/naming/internal/VersionHelper.java | 238 +++++++++++++--- .../sun/naming/internal/VersionHelper12.java | 268 ------------------ 4 files changed, 253 insertions(+), 416 deletions(-) delete mode 100644 jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java delete mode 100644 jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java index 0a696bd4ff2..17e7bc13779 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java @@ -25,32 +25,77 @@ package com.sun.jndi.ldap; +import sun.misc.SharedSecrets; + import java.net.MalformedURLException; import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedAction; -abstract class VersionHelper { +public final class VersionHelper { - private static final VersionHelper helper = new VersionHelper12(); + private static final VersionHelper helper = new VersionHelper(); - VersionHelper() {} // Disallow anyone from creating one of these. + /** + * Determines whether classes may be loaded from an arbitrary URL code base. + */ + private static final boolean trustURLCodebase; + + static { + // System property to control whether classes may be loaded from an + // arbitrary URL code base + PrivilegedAction act = + () -> System.getProperty("com.sun.jndi.ldap.object.trustURLCodebase", "false"); + String trust = AccessController.doPrivileged(act); + trustURLCodebase = "true".equalsIgnoreCase(trust); + } + + private VersionHelper() { } static VersionHelper getVersionHelper() { return helper; } - abstract ClassLoader getURLClassLoader(String[] url) - throws MalformedURLException; + ClassLoader getURLClassLoader(String[] url) throws MalformedURLException { + ClassLoader parent = getContextClassLoader(); + /* + * Classes may only be loaded from an arbitrary URL code base when + * the system property com.sun.jndi.ldap.object.trustURLCodebase + * has been set to "true". + */ + if (url != null && trustURLCodebase) { + return URLClassLoader.newInstance(getUrlArray(url), parent); + } else { + return parent; + } + } + Class loadClass(String className) throws ClassNotFoundException { + return Class.forName(className, true, getContextClassLoader()); + } - static protected URL[] getUrlArray(String[] url) throws MalformedURLException { + Thread createThread(Runnable r) { + AccessControlContext acc = AccessController.getContext(); + // 4290486: doPrivileged is needed to create a thread in + // an environment that restricts "modifyThreadGroup". + PrivilegedAction act = + () -> SharedSecrets.getJavaLangAccess().newThreadWithAcc(r, acc); + return AccessController.doPrivileged(act); + } + + private ClassLoader getContextClassLoader() { + PrivilegedAction act = + Thread.currentThread()::getContextClassLoader; + return AccessController.doPrivileged(act); + } + + private static URL[] getUrlArray(String[] url) throws MalformedURLException { URL[] urlArray = new URL[url.length]; for (int i = 0; i < urlArray.length; i++) { urlArray[i] = new URL(url[i]); } return urlArray; } - - abstract Class loadClass(String className) throws ClassNotFoundException; - - abstract Thread createThread(Runnable r); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java deleted file mode 100644 index 468273ede97..00000000000 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jndi.ldap; - -import java.net.URLClassLoader; -import java.net.MalformedURLException; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedAction; -import sun.misc.SharedSecrets; - -final class VersionHelper12 extends VersionHelper { - - // System property to control whether classes may be loaded from an - // arbitrary URL code base. - private static final String TRUST_URL_CODEBASE_PROPERTY = - "com.sun.jndi.ldap.object.trustURLCodebase"; - - // Determine whether classes may be loaded from an arbitrary URL code base. - private static final String trustURLCodebase = - AccessController.doPrivileged( - new PrivilegedAction() { - public String run() { - return System.getProperty(TRUST_URL_CODEBASE_PROPERTY, - "false"); - } - } - ); - - VersionHelper12() {} // Disallow external from creating one of these. - - ClassLoader getURLClassLoader(String[] url) - throws MalformedURLException { - ClassLoader parent = getContextClassLoader(); - /* - * Classes may only be loaded from an arbitrary URL code base when - * the system property com.sun.jndi.ldap.object.trustURLCodebase - * has been set to "true". - */ - if (url != null && "true".equalsIgnoreCase(trustURLCodebase)) { - return URLClassLoader.newInstance(getUrlArray(url), parent); - } else { - return parent; - } - } - - Class loadClass(String className) throws ClassNotFoundException { - ClassLoader cl = getContextClassLoader(); - return Class.forName(className, true, cl); - } - - private ClassLoader getContextClassLoader() { - return AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - return Thread.currentThread().getContextClassLoader(); - } - } - ); - } - - Thread createThread(final Runnable r) { - final AccessControlContext acc = AccessController.getContext(); - // 4290486: doPrivileged is needed to create a thread in - // an environment that restricts "modifyThreadGroup". - return AccessController.doPrivileged( - new PrivilegedAction() { - public Thread run() { - return SharedSecrets.getJavaLangAccess() - .newThreadWithAcc(r, acc); - } - } - ); - } -} diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java index 63590be93aa..2a9db220af0 100644 --- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java +++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,19 @@ package com.sun.naming.internal; -import java.io.InputStream; +import javax.naming.NamingEnumeration; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.util.StringTokenizer; -import java.util.Vector; - -import javax.naming.NamingEnumeration; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.*; /** * VersionHelper was used by JNDI to accommodate differences between @@ -45,10 +50,10 @@ import javax.naming.NamingEnumeration; * @author Scott Seligman */ -public abstract class VersionHelper { - private static VersionHelper helper = null; +public final class VersionHelper { + private static final VersionHelper helper = new VersionHelper(); - final static String[] PROPS = new String[] { + final static String[] PROPS = new String[]{ javax.naming.Context.INITIAL_CONTEXT_FACTORY, javax.naming.Context.OBJECT_FACTORIES, javax.naming.Context.URL_PKG_PREFIXES, @@ -67,31 +72,57 @@ public abstract class VersionHelper { public final static int DNS_URL = 5; public final static int CONTROL_FACTORIES = 6; - VersionHelper() {} // Disallow anyone from creating one of these. - - static { - helper = new VersionHelper12(); - } + private VersionHelper() {} // Disallow anyone from creating one of these. public static VersionHelper getVersionHelper() { return helper; } - public abstract Class loadClass(String className) - throws ClassNotFoundException; + public Class loadClass(String className) throws ClassNotFoundException { + return loadClass(className, getContextClassLoader()); + } - abstract Class loadClass(String className, ClassLoader cl) - throws ClassNotFoundException; + /** + * @param className A non-null fully qualified class name. + * @param codebase A non-null, space-separated list of URL strings. + */ + public Class loadClass(String className, String codebase) + throws ClassNotFoundException, MalformedURLException { - public abstract Class loadClass(String className, String codebase) - throws ClassNotFoundException, MalformedURLException; + ClassLoader parent = getContextClassLoader(); + ClassLoader cl = + URLClassLoader.newInstance(getUrlArray(codebase), parent); + + return loadClass(className, cl); + } + + /** + * Package private. + *

    + * This internal method is used with Thread Context Class Loader (TCCL), + * please don't expose this method as public. + */ + Class loadClass(String className, ClassLoader cl) + throws ClassNotFoundException { + Class cls = Class.forName(className, true, cl); + return cls; + } /* - * Returns a JNDI property from the system properties. Returns + * Returns a JNDI property from the system properties. Returns * null if the property is not set, or if there is no permission * to read it. */ - abstract String getJndiProperty(int i); + String getJndiProperty(int i) { + PrivilegedAction act = () -> { + try { + return System.getProperty(PROPS[i]); + } catch (SecurityException e) { + return null; + } + }; + return AccessController.doPrivileged(act); + } /* * Reads each property in PROPS from the system properties, and @@ -99,13 +130,33 @@ public abstract class VersionHelper { * unset property, the corresponding array element is set to null. * Returns null if there is no permission to call System.getProperties(). */ - abstract String[] getJndiProperties(); + String[] getJndiProperties() { + PrivilegedAction act = () -> { + try { + return System.getProperties(); + } catch (SecurityException e) { + return null; + } + }; + Properties sysProps = AccessController.doPrivileged(act); + if (sysProps == null) { + return null; + } + String[] jProps = new String[PROPS.length]; + for (int i = 0; i < PROPS.length; i++) { + jProps[i] = sysProps.getProperty(PROPS[i]); + } + return jProps; + } /* * Returns the resource of a given name associated with a particular * class (never null), or null if none can be found. */ - abstract InputStream getResourceAsStream(Class c, String name); + InputStream getResourceAsStream(Class c, String name) { + PrivilegedAction act = () -> c.getResourceAsStream(name); + return AccessController.doPrivileged(act); + } /* * Returns an input stream for a file in /lib, @@ -113,7 +164,22 @@ public abstract class VersionHelper { * * @param filename The file name, sans directory. */ - abstract InputStream getJavaHomeLibStream(String filename); + InputStream getJavaHomeLibStream(String filename) { + PrivilegedAction act = () -> { + try { + String javahome = System.getProperty("java.home"); + if (javahome == null) { + return null; + } + String pathname = javahome + File.separator + + "lib" + File.separator + filename; + return new FileInputStream(pathname); + } catch (Exception e) { + return null; + } + }; + return AccessController.doPrivileged(act); + } /* * Returns an enumeration (never null) of InputStreams of the @@ -121,29 +187,55 @@ public abstract class VersionHelper { * loader. Null represents the bootstrap class loader in some * Java implementations. */ - abstract NamingEnumeration getResources( - ClassLoader cl, String name) - throws IOException; + NamingEnumeration getResources(ClassLoader cl, + String name) throws IOException { + Enumeration urls; + PrivilegedExceptionAction> act = () -> + (cl == null) + ? ClassLoader.getSystemResources(name) + : cl.getResources(name); + try { + urls = AccessController.doPrivileged(act); + } catch (PrivilegedActionException e) { + throw (IOException) e.getException(); + } + return new InputStreamEnumeration(urls); + } - /* - * Returns the context class loader associated with the current thread. - * Null indicates the bootstrap class loader in some Java implementations. - * - * @throws SecurityException if the class loader is not accessible. + + /** + * Package private. + *

    + * This internal method returns Thread Context Class Loader (TCCL), + * if null, returns the system Class Loader. + *

    + * Please don't expose this method as public. + * @throws SecurityException if the class loader is not accessible */ - abstract ClassLoader getContextClassLoader(); + ClassLoader getContextClassLoader() { - static protected URL[] getUrlArray(String codebase) - throws MalformedURLException { + PrivilegedAction act = () -> { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) { + // Don't use bootstrap class loader directly! + loader = ClassLoader.getSystemClassLoader(); + } + return loader; + }; + return AccessController.doPrivileged(act); + } + + private static URL[] getUrlArray(String codebase) + throws MalformedURLException { // Parse codebase into separate URLs StringTokenizer parser = new StringTokenizer(codebase); - Vector vec = new Vector<>(10); + List list = new ArrayList<>(); while (parser.hasMoreTokens()) { - vec.addElement(parser.nextToken()); + list.add(parser.nextToken()); } - String[] url = new String[vec.size()]; + String[] url = new String[list.size()]; for (int i = 0; i < url.length; i++) { - url[i] = vec.elementAt(i); + url[i] = list.get(i); } URL[] urlArray = new URL[url.length]; @@ -152,4 +244,70 @@ public abstract class VersionHelper { } return urlArray; } + + /** + * Given an enumeration of URLs, an instance of this class represents + * an enumeration of their InputStreams. Each operation on the URL + * enumeration is performed within a doPrivileged block. + * This is used to enumerate the resources under a foreign codebase. + * This class is not MT-safe. + */ + private class InputStreamEnumeration implements + NamingEnumeration { + + private final Enumeration urls; + + private InputStream nextElement; + + InputStreamEnumeration(Enumeration urls) { + this.urls = urls; + } + + /* + * Returns the next InputStream, or null if there are no more. + * An InputStream that cannot be opened is skipped. + */ + private InputStream getNextElement() { + PrivilegedAction act = () -> { + while (urls.hasMoreElements()) { + try { + return urls.nextElement().openStream(); + } catch (IOException e) { + // skip this URL + } + } + return null; + }; + return AccessController.doPrivileged(act); + } + + public boolean hasMore() { + if (nextElement != null) { + return true; + } + nextElement = getNextElement(); + return (nextElement != null); + } + + public boolean hasMoreElements() { + return hasMore(); + } + + public InputStream next() { + if (hasMore()) { + InputStream res = nextElement; + nextElement = null; + return res; + } else { + throw new NoSuchElementException(); + } + } + + public InputStream nextElement() { + return next(); + } + + public void close() { + } + } } diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java deleted file mode 100644 index bf4586e7ebc..00000000000 --- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.naming.internal; - -import java.io.InputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URLClassLoader; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.Enumeration; -import java.util.NoSuchElementException; -import java.util.Properties; - -import javax.naming.*; - -/** - * VersionHelper was used by JNDI to accommodate differences between - * JDK 1.1.x and the Java 2 platform. As this is no longer necessary - * since JNDI's inclusion in the platform, this class currently - * serves as a set of utilities for performing system-level things, - * such as class-loading and reading system properties. - * - * @author Rosanna Lee - * @author Scott Seligman - */ - -final class VersionHelper12 extends VersionHelper { - - // Disallow external from creating one of these. - VersionHelper12() { - } - - public Class loadClass(String className) throws ClassNotFoundException { - return loadClass(className, getContextClassLoader()); - } - - /** - * Package private. - * - * This internal method is used with Thread Context Class Loader (TCCL), - * please don't expose this method as public. - */ - Class loadClass(String className, ClassLoader cl) - throws ClassNotFoundException { - Class cls = Class.forName(className, true, cl); - return cls; - } - - /** - * @param className A non-null fully qualified class name. - * @param codebase A non-null, space-separated list of URL strings. - */ - public Class loadClass(String className, String codebase) - throws ClassNotFoundException, MalformedURLException { - - ClassLoader parent = getContextClassLoader(); - ClassLoader cl = - URLClassLoader.newInstance(getUrlArray(codebase), parent); - - return loadClass(className, cl); - } - - String getJndiProperty(final int i) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public String run() { - try { - return System.getProperty(PROPS[i]); - } catch (SecurityException e) { - return null; - } - } - } - ); - } - - String[] getJndiProperties() { - Properties sysProps = AccessController.doPrivileged( - new PrivilegedAction() { - public Properties run() { - try { - return System.getProperties(); - } catch (SecurityException e) { - return null; - } - } - } - ); - if (sysProps == null) { - return null; - } - String[] jProps = new String[PROPS.length]; - for (int i = 0; i < PROPS.length; i++) { - jProps[i] = sysProps.getProperty(PROPS[i]); - } - return jProps; - } - - InputStream getResourceAsStream(final Class c, final String name) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - return c.getResourceAsStream(name); - } - } - ); - } - - InputStream getJavaHomeLibStream(final String filename) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - try { - String javahome = System.getProperty("java.home"); - if (javahome == null) { - return null; - } - String pathname = javahome + java.io.File.separator + - "lib" + java.io.File.separator + filename; - return new java.io.FileInputStream(pathname); - } catch (Exception e) { - return null; - } - } - } - ); - } - - NamingEnumeration getResources(final ClassLoader cl, - final String name) throws IOException { - Enumeration urls; - try { - urls = AccessController.doPrivileged( - new PrivilegedExceptionAction>() { - public Enumeration run() throws IOException { - return (cl == null) - ? ClassLoader.getSystemResources(name) - : cl.getResources(name); - } - } - ); - } catch (PrivilegedActionException e) { - throw (IOException)e.getException(); - } - return new InputStreamEnumeration(urls); - } - - /** - * Package private. - * - * This internal method returns Thread Context Class Loader (TCCL), - * if null, returns the system Class Loader. - * - * Please don't expose this method as public. - */ - ClassLoader getContextClassLoader() { - - return AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - ClassLoader loader = - Thread.currentThread().getContextClassLoader(); - if (loader == null) { - // Don't use bootstrap class loader directly! - loader = ClassLoader.getSystemClassLoader(); - } - - return loader; - } - } - ); - } - - /** - * Given an enumeration of URLs, an instance of this class represents - * an enumeration of their InputStreams. Each operation on the URL - * enumeration is performed within a doPrivileged block. - * This is used to enumerate the resources under a foreign codebase. - * This class is not MT-safe. - */ - class InputStreamEnumeration implements NamingEnumeration { - - private final Enumeration urls; - - private InputStream nextElement = null; - - InputStreamEnumeration(Enumeration urls) { - this.urls = urls; - } - - /* - * Returns the next InputStream, or null if there are no more. - * An InputStream that cannot be opened is skipped. - */ - private InputStream getNextElement() { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - while (urls.hasMoreElements()) { - try { - return urls.nextElement().openStream(); - } catch (IOException e) { - // skip this URL - } - } - return null; - } - } - ); - } - - public boolean hasMore() { - if (nextElement != null) { - return true; - } - nextElement = getNextElement(); - return (nextElement != null); - } - - public boolean hasMoreElements() { - return hasMore(); - } - - public InputStream next() { - if (hasMore()) { - InputStream res = nextElement; - nextElement = null; - return res; - } else { - throw new NoSuchElementException(); - } - } - - public InputStream nextElement() { - return next(); - } - - public void close() { - } - } -} From 063b7f5dc98ef14bfe644de6dc69f4544aab6cb2 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Fri, 1 Aug 2014 15:34:55 +0100 Subject: [PATCH 090/111] 8030166: java/lang/ProcessBuilder/Basic.java fails intermittently: waitFor took too long Reviewed-by: rriggs --- jdk/test/java/lang/ProcessBuilder/Basic.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index d59688e9d7d..bb955f2de20 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -2269,9 +2269,9 @@ public class Basic { fail("Test failed: Process exited prematurely"); } long end = System.nanoTime(); - // give waitFor(timeout) a wide berth (100ms) + // give waitFor(timeout) a wide berth (200ms) // Old AIX machines my need a little longer. - if ((end - start) > 100000000L * (AIX.is() ? 4 : 1)) + if ((end - start) > 200000000L * (AIX.is() ? 2 : 1)) fail("Test failed: waitFor took too long (" + (end - start) + "ns)"); p.destroy(); From 96c0091bdeb10fbe6296a0dcee75f82930dded9e Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Fri, 1 Aug 2014 15:36:23 +0100 Subject: [PATCH 091/111] 8031435: Ftp download does not work properly for ftp user without password Reviewed-by: chegar --- .../classes/sun/net/www/protocol/ftp/FtpURLConnection.java | 2 +- jdk/test/sun/net/ftp/FtpURL.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java index ee7684deb9d..d787ab3df1a 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java @@ -301,7 +301,7 @@ public class FtpURLConnection extends URLConnection { throw new IOException(fe); } try { - ftp.login(user, password.toCharArray()); + ftp.login(user, password == null ? null : password.toCharArray()); } catch (sun.net.ftp.FtpProtocolException e) { ftp.close(); // Backward compatibility diff --git a/jdk/test/sun/net/ftp/FtpURL.java b/jdk/test/sun/net/ftp/FtpURL.java index 117913f6a63..64c4e8fc890 100644 --- a/jdk/test/sun/net/ftp/FtpURL.java +++ b/jdk/test/sun/net/ftp/FtpURL.java @@ -483,7 +483,7 @@ public class FtpURL { // Now let's check the URL handler - url = new URL("ftp://user2:@localhost:" + port + "/%2Fusr/bin;type=d"); + url = new URL("ftp://user2@localhost:" + port + "/%2Fusr/bin;type=d"); con = url.openConnection(); in = new BufferedReader(new InputStreamReader(con.getInputStream())); do { From 269f961b6df5b613378d9385887228a9daa4788d Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Fri, 1 Aug 2014 15:50:01 +0100 Subject: [PATCH 092/111] 8053931: (fc) FileDispatcherImpl.lock0 does not handle ERROR_IO_PENDING [win] Reviewed-by: alanb --- jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c index 0fdc2ab51fb..fcf0d04fbf8 100644 --- a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c @@ -406,6 +406,14 @@ Java_sun_nio_ch_FileDispatcherImpl_lock0(JNIEnv *env, jobject this, jobject fdo, result = LockFileEx(h, flags, 0, lowNumBytes, highNumBytes, &o); if (result == 0) { int error = GetLastError(); + if (error == ERROR_IO_PENDING) { + LPDWORD dwBytes; + result = GetOverlappedResult(h, &o, &dwBytes, TRUE); + if (result != 0) { + return sun_nio_ch_FileDispatcherImpl_LOCKED; + } + error = GetLastError(); + } if (error != ERROR_LOCK_VIOLATION) { JNU_ThrowIOExceptionWithLastError(env, "Lock failed"); return sun_nio_ch_FileDispatcherImpl_NO_LOCK; From c4304d447abf52e9857b14aeb6dd8f11193c89f8 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Fri, 1 Aug 2014 19:44:52 +0100 Subject: [PATCH 093/111] 8042982: Unexpected RuntimeExceptions being thrown by SSLEngine Reviewed-by: wetmore, xuelei --- .../share/classes/sun/security/ssl/DHCrypt.java | 7 ++++--- .../classes/sun/security/ssl/ECDHCrypt.java | 17 +++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/jdk/src/share/classes/sun/security/ssl/DHCrypt.java b/jdk/src/share/classes/sun/security/ssl/DHCrypt.java index ae9118f4ba5..6deae7e2657 100644 --- a/jdk/src/share/classes/sun/security/ssl/DHCrypt.java +++ b/jdk/src/share/classes/sun/security/ssl/DHCrypt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -188,7 +188,7 @@ final class DHCrypt { * the same size as the Diffie-Hellman modulus. */ SecretKey getAgreedSecret(BigInteger peerPublicValue, - boolean keyIsValidated) throws IOException { + boolean keyIsValidated) throws SSLHandshakeException { try { KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman"); DHPublicKeySpec spec = @@ -211,7 +211,8 @@ final class DHCrypt { ka.doPhase(publicKey, true); return ka.generateSecret("TlsPremasterSecret"); } catch (GeneralSecurityException e) { - throw new RuntimeException("Could not generate secret", e); + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(e); } } diff --git a/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java b/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java index df52bc5948a..c1ce4e93cee 100644 --- a/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java +++ b/jdk/src/share/classes/sun/security/ssl/ECDHCrypt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import java.security.spec.*; import javax.crypto.SecretKey; import javax.crypto.KeyAgreement; +import javax.net.ssl.SSLHandshakeException; /** * Helper class for the ECDH key exchange. It generates the appropriate @@ -88,19 +89,20 @@ final class ECDHCrypt { } // called by ClientHandshaker with either the server's static or ephemeral public key - SecretKey getAgreedSecret(PublicKey peerPublicKey) { + SecretKey getAgreedSecret(PublicKey peerPublicKey) throws SSLHandshakeException { try { KeyAgreement ka = JsseJce.getKeyAgreement("ECDH"); ka.init(privateKey); ka.doPhase(peerPublicKey, true); return ka.generateSecret("TlsPremasterSecret"); } catch (GeneralSecurityException e) { - throw new RuntimeException("Could not generate secret", e); + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(e); } } // called by ServerHandshaker - SecretKey getAgreedSecret(byte[] encodedPoint) { + SecretKey getAgreedSecret(byte[] encodedPoint) throws SSLHandshakeException { try { ECParameterSpec params = publicKey.getParams(); ECPoint point = JsseJce.decodePoint(encodedPoint, params.getCurve()); @@ -108,10 +110,9 @@ final class ECDHCrypt { ECPublicKeySpec spec = new ECPublicKeySpec(point, params); PublicKey peerPublicKey = kf.generatePublic(spec); return getAgreedSecret(peerPublicKey); - } catch (GeneralSecurityException e) { - throw new RuntimeException("Could not generate secret", e); - } catch (java.io.IOException e) { - throw new RuntimeException("Could not generate secret", e); + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(e); } } From b17398aa78f101ab28617104331c7ff27b278777 Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:05 -0700 Subject: [PATCH 094/111] Added tag jdk9-b25 for changeset 4c599f00e556 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 519f598b86e..fe5540a5d8e 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -267,3 +267,4 @@ ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20 8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22 88567461a2cd9b7fb431fee6440005a694df1f47 jdk9-b23 1d4a293fbec19dc2d5790bbb2c7dd0ed8f265484 jdk9-b24 +aefd8899a8d6615fb34ba99b2e38996a7145baa8 jdk9-b25 From 7566d8b011eba28f3b0e45b911f5981fa4838760 Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:06 -0700 Subject: [PATCH 095/111] Added tag jdk9-b25 for changeset 607831311622 --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 25bbe5d05c0..80f38489230 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -267,3 +267,4 @@ eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19 ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22 57735d66face054440a63ce99789eac5a5ee1dfd jdk9-b23 8a44142bb7fc8118f70f91a1b97c12dfc50563ee jdk9-b24 +da08cca6b97f41b7081a3e176dcb400af6e4bb26 jdk9-b25 From a33df03f5305f79f10bad17eccd93be38b884588 Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:09 -0700 Subject: [PATCH 096/111] Added tag jdk9-b25 for changeset 938af06a9f70 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 63e06453ec9..a39d162f8d8 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -427,3 +427,4 @@ c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20 518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22 dd472cdacc32e3afc7c5bfa7ef16ea0e0befb7fa jdk9-b23 dde2d03b0ea46a27650839e3a1d212c7c1f7b4c8 jdk9-b24 +6de94e8693240cec8aae11f6b42f43433456a733 jdk9-b25 From a4229e08b855e6a0c16b9a9bb9782627ec8c66b8 Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:14 -0700 Subject: [PATCH 097/111] Added tag jdk9-b25 for changeset d553e7400295 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 70e4a78662f..63f10acd85e 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -267,3 +267,4 @@ f9c82769a6bc2b219a8f01c24afe5c91039267d7 jdk9-b19 82b94ff002c6e007a03bf0f364ca94b381e09135 jdk9-b22 2e5b63006187bfc64d8eace374dbc2806267a160 jdk9-b23 345af113f57206711f75089c3ebf84a36a789122 jdk9-b24 +73757f4b8aa353ca8937abc07e79e7ece4c011a1 jdk9-b25 From cfd81866b2963b1f03f35ece1688eb9ecd0447bf Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:18 -0700 Subject: [PATCH 098/111] Added tag jdk9-b25 for changeset 3dad8878772d --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index fce4d5f7307..26347e69cbf 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -270,3 +270,4 @@ e9780330017a6b464a385356d77e5136f9de8d09 jdk9-b15 7f5e5902cde75fd9335c52f469491f061fe0239e jdk9-b22 ce19e0403ec8a80223cc47320c905b2a4d45881d jdk9-b23 0b35542d6bf32af23a9fc59a37c52aa091fee388 jdk9-b24 +ab8726a0fcde897e4cfd1ea581ed90b0d8a7cbb7 jdk9-b25 From 65ce4d424fe64e57de00ee86dd8a48dbd7544855 Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:19 -0700 Subject: [PATCH 099/111] Added tag jdk9-b25 for changeset 48b43b7b9e0c --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 0718a4f34ab..d5928939618 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -267,3 +267,4 @@ f87c5be90e01a7ffb47947108eb3e0b0b1920880 jdk9-b20 85bcf0f99edc08873614afbe5a5563e13ce13c83 jdk9-b22 9febf9dbc0a4b15323f2dbd29931cfbf086332b4 jdk9-b23 875450e7ef8dde8f59db662ec1351ea30b8cb35d jdk9-b24 +a31efe49556a7c12f9ea2c9ee8b4fae8aa67723a jdk9-b25 From 48710812cbc4ccbeb2b602386ac04e45915f07ee Mon Sep 17 00:00:00 2001 From: Tim Bell Date: Fri, 1 Aug 2014 14:09:25 -0700 Subject: [PATCH 100/111] Added tag jdk9-b25 for changeset 064db4f56d0d --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index b59b5a487f0..f529a5ef4ec 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -258,3 +258,4 @@ d703c59c556f9fcd9604272806ef7acf55c92363 jdk9-b20 a9d39bcfeb1bb3f7de929c56a2ecbea10a554ca1 jdk9-b22 aa3fda2d2967847dbd264aa962d624c07fc6c29f jdk9-b23 49d7a2a66ae6b70fee367e2ceb29d0c20f8be01b jdk9-b24 +b33633fc10c5bffd39d3492ed2602dadd8d44642 jdk9-b25 From 5731d09e61714b71026a78ec37cc51444c665826 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Fri, 1 Aug 2014 22:32:51 +0100 Subject: [PATCH 101/111] 8054158: Fix typos in JNDI-related packages Reviewed-by: rriggs, vinnie --- .../share/classes/com/sun/jndi/cosnaming/CNCtx.java | 2 +- .../share/classes/com/sun/jndi/dns/DnsClient.java | 2 +- .../sun/jndi/ldap/AbstractLdapNamingEnumeration.java | 2 +- .../share/classes/com/sun/jndi/ldap/ClientId.java | 2 +- .../share/classes/com/sun/jndi/ldap/EventQueue.java | 4 ++-- .../classes/com/sun/jndi/ldap/EventSupport.java | 2 +- .../classes/com/sun/jndi/ldap/LdapAttribute.java | 4 ++-- jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java | 8 ++++---- .../share/classes/com/sun/jndi/ldap/LdapName.java | 10 +++++----- .../com/sun/jndi/ldap/LdapReferralContext.java | 4 ++-- .../share/classes/com/sun/jndi/ldap/LdapRequest.java | 2 +- .../classes/com/sun/jndi/ldap/LdapSchemaParser.java | 12 ++++++------ .../com/sun/jndi/ldap/LdapSearchEnumeration.java | 4 +--- jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java | 2 +- .../classes/com/sun/jndi/ldap/ServiceLocator.java | 2 +- .../classes/com/sun/jndi/ldap/pool/Connections.java | 2 +- .../share/classes/com/sun/jndi/ldap/pool/Pool.java | 4 ++-- .../com/sun/jndi/toolkit/ctx/AtomicContext.java | 4 ++-- .../com/sun/jndi/toolkit/ctx/ComponentContext.java | 2 +- .../com/sun/jndi/toolkit/ctx/Continuation.java | 4 ++-- .../com/sun/jndi/toolkit/dir/ContextEnumerator.java | 6 +++--- .../com/sun/jndi/toolkit/dir/HierMemDirCtx.java | 4 ++-- .../jndi/toolkit/dir/LazySearchEnumerationImpl.java | 2 +- .../com/sun/jndi/toolkit/dir/SearchFilter.java | 6 +++--- .../com/sun/jndi/toolkit/url/GenericURLContext.java | 2 +- .../com/sun/jndi/url/ldap/ldapURLContext.java | 2 +- .../classes/javax/naming/directory/DirContext.java | 2 +- jdk/src/share/classes/javax/naming/ldap/Rdn.java | 6 +++--- .../share/classes/javax/naming/ldap/SortControl.java | 2 +- 29 files changed, 54 insertions(+), 56 deletions(-) diff --git a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java index 800c0a53643..6a4d3dea7da 100644 --- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java @@ -1145,7 +1145,7 @@ public class CNCtx implements javax.naming.Context { // Never destroy an orb in CNCtx. // The orb we have is either the shared/default orb, or one passed in to a constructor - // from elsewhere, so that orb is somebody else's reponsibility. + // from elsewhere, so that orb is somebody else's responsibility. } protected void finalize() { diff --git a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java index 18654c87808..db1f907182a 100644 --- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java +++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java @@ -376,7 +376,7 @@ public class DnsClient { /** - * Tries to retreive an UDP packet matching the given xid + * Tries to retrieve a UDP packet matching the given xid * received within the timeout. * If a packet with different xid is received, the received packet * is enqueued with the corresponding xid in 'resps'. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java index 241105bf1ce..be3315674fa 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java @@ -137,7 +137,7 @@ abstract class AbstractLdapNamingEnumeration limit = (entries == null) ? 0 : entries.size(); // handle empty set posn = 0; // reset - // mimimize the number of calls to processReturnCode() + // minimize the number of calls to processReturnCode() // (expensive when batchSize is small and there are many results) if ((res.status != LdapClient.LDAP_SUCCESS) || ((res.status == LdapClient.LDAP_SUCCESS) && diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java index 5095823dc23..aa535a2b995 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java @@ -196,7 +196,7 @@ class ClientId { System.out.println("ClientId received an exception"); e.printStackTrace(); } - // Failed to invoke the comparator; flag unequality + // Failed to invoke the comparator; flag inequality return false; } if (((Integer) ret) == 0) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java index db335f7acc9..85bc38076f5 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java @@ -75,7 +75,7 @@ final class EventQueue implements Runnable { * Enqueue an event. * @param event Either a NamingExceptionEvent or a subclass * of NamingEvent or - * UnsolicitedNotificatoniEvent. + * UnsolicitedNotificationEvent. * If it is a subclass of NamingEvent, all listeners must implement * the corresponding subinterface of NamingListener. * For example, for a ObjectAddedEvent, all listeners must @@ -141,7 +141,7 @@ final class EventQueue implements Runnable { // it is interested in. (No need to check mask or // instanceof subinterfaces.) // It is the responsibility of the enqueuer to - // only enqueue events with listseners of the correct type. + // only enqueue events with listeners of the correct type. if (e instanceof NamingEvent) { ((NamingEvent)e).dispatch(v.elementAt(i)); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java index a9d45a23c17..86006ff714b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java @@ -83,7 +83,7 @@ import javax.naming.ldap.UnsolicitedNotification; *a new notifier is created for the listener. * *

    Deregistration

    - *When a deregistration request is made, this class attemps to find its + *When a deregistration request is made, this class attempts to find its *corresponding notifier. If the notifier is found, the listener is removed *from the notifier's list. If the listener is the last listener on the list, *the notifier's thread is terminated and removed from this class's hashtable. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java index 50f6ac69f5f..36c7dad4611 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java @@ -34,7 +34,7 @@ import javax.naming.directory.*; /** * This subclass is used by LDAP to implement the schema calls. * Basically, it keeps track of which context it is an attribute of - * so it can get the schema for that cotnext. + * so it can get the schema for that context. * * @author Jon Ruiz */ @@ -134,7 +134,7 @@ final class LdapAttribute extends BasicAttribute { // setup internal state this.setBaseCtxInfo(); - // let the ObjectOutpurStream do the real work of serialization + // let the ObjectOutputStream do the real work of serialization out.defaultWriteObject(); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java index e5821adea6e..c163dce796a 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -1651,7 +1651,7 @@ final public class LdapCtx extends ComponentDirContext * * This function is called regardless of the server's version, since * an administrator may have setup the server to support client schema - * queries. If this function trys a serarch on a v2 server that + * queries. If this function tries a search on a v2 server that * doesn't support schema, one of these two things will happen: * 1) It will get an exception when querying the root DSE * 2) It will not find a subschemasubentry on the root DSE @@ -2016,7 +2016,7 @@ final public class LdapCtx extends ComponentDirContext * - the returning attributes list is present but empty */ - // returns true if a search can be caried out as a compare, and sets + // returns true if a search can be carried out as a compare, and sets // tokens[0] and tokens[1] to the type and value respectively. // e.g. filter "cn=Jon Ruiz" becomes, type "cn" and value "Jon Ruiz" // This function uses the documents JNDI Compare example as a model @@ -2083,7 +2083,7 @@ final public class LdapCtx extends ComponentDirContext return false; // unbalanced } - // make sure the left and right half are not expresions themselves + // make sure the left and right half are not expressions themselves StringTokenizer illegalCharsTokenizer = new StringTokenizer(tokens[0], "()&|!=~><*", true); @@ -2443,7 +2443,7 @@ final public class LdapCtx extends ComponentDirContext } /** - * Set whether aliases are derefereced during resolution and searches. + * Set whether aliases are dereferenced during resolution and searches. */ private void setDerefAliases(String deref) { if (deref != null) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java index d29e408cdec..b3f76d9ab0b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java @@ -346,8 +346,8 @@ public final class LdapName implements Name { } /** - * Given an attribute value formated according to RFC 2253, - * returns the unformated value. Returns a string value as + * Given an attribute value formatted according to RFC 2253, + * returns the unformatted value. Returns a string value as * a string, and a binary value as a byte array. */ public static Object unescapeAttributeValue(String val) { @@ -687,7 +687,7 @@ public final class LdapName implements Name { private final boolean binary; private final boolean valueCaseSensitive; - // If non-null, a canonical represention of the value suitable + // If non-null, a canonical representation of the value suitable // for comparison using String.compareTo(). private String comparable = null; @@ -842,8 +842,8 @@ public final class LdapName implements Name { } /* - * Given an attribute value formated according to RFC 2253, - * returns the unformated value. Escapes and quotes are + * Given an attribute value formatted according to RFC 2253, + * returns the unformatted value. Escapes and quotes are * stripped away, and hex-encoded UTF-8 is converted to 16-bit * Unicode chars. Returns a string value as a String, and a * binary value as a byte array. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java index 0a09e0fda69..b810187c649 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java @@ -679,7 +679,7 @@ final class LdapReferralContext implements DirContext, LdapContext { } catch (LdapReferralException e) { - // %%% VR - setNameResolved(true); + // %%% setNameResolved(true); // append (referrals from) the exception that generated this // context to the new exception, so that referral processing @@ -897,7 +897,7 @@ final class LdapReferralContext implements DirContext, LdapContext { /* * Use the attributes and scope components from the LDAP URL (if present) - * to override the corrpesonding components supplied in SearchControls. + * to override the corresponding components supplied in SearchControls. */ private SearchControls overrideAttributesAndScope(SearchControls cons) { SearchControls urlCons; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java index 23347ac5dc8..6e7e3e6544b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java @@ -62,7 +62,7 @@ final class LdapRequest { cancelled = true; // Unblock reader of pending request - // Should only ever have atmost one waiter + // Should only ever have at most one waiter notify(); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java index 7fddd7799f5..ae3d2bd4881 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java @@ -84,7 +84,7 @@ final class LdapSchemaParser { // Object Class specific IDs private static final String ABSTRACT_ID = "ABSTRACT"; private static final String STRUCTURAL_ID = "STRUCTURAL"; - private static final String AUXILARY_ID = "AUXILIARY"; + private static final String AUXILIARY_ID = "AUXILIARY"; private static final String MUST_ID = "MUST"; private static final String MAY_ID = "MAY"; @@ -300,8 +300,8 @@ final class LdapSchemaParser { return new Object[] {currentName, attrs}; } - // returns the index of the first whitespace char of a linear whitspace - // sequince ending at the given position. + // returns the index of the first whitespace char of a linear whitespace + // sequence ending at the given position. final private static int findTrailingWhitespace(String string, int pos) { for(int i = pos; i > 0; i--) { if(string.charAt(i) != WHSP) { @@ -423,7 +423,7 @@ final class LdapSchemaParser { if (tag.equals(OBSOLETE_ID) || tag.equals(ABSTRACT_ID) || tag.equals(STRUCTURAL_ID) || - tag.equals(AUXILARY_ID) || + tag.equals(AUXILIARY_ID) || tag.equals(SINGLE_VAL_ID) || tag.equals(COLLECTIVE_ID) || tag.equals(NO_USER_MOD_ID)) { @@ -819,7 +819,7 @@ final class LdapSchemaParser { count++; } - attr = attrs.get(AUXILARY_ID); + attr = attrs.get(AUXILIARY_ID); if (attr != null) { objectDesc.append(writeBoolean(attr)); count++; @@ -856,7 +856,7 @@ final class LdapSchemaParser { attrId.equals(MUST_ID) || attrId.equals(STRUCTURAL_ID) || attrId.equals(DESC_ID) || - attrId.equals(AUXILARY_ID) || + attrId.equals(AUXILIARY_ID) || attrId.equals(ABSTRACT_ID) || attrId.equals(OBSOLETE_ID)) { continue; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java index 329b1d249af..4af58a8b0dd 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java @@ -156,7 +156,7 @@ final class LdapSearchEnumeration String[] reqAttrs; if ((reqAttrs = searchArgs.reqAttrs) != null) { // create an attribute set for those requested - Attributes rattrs = new BasicAttributes(true); // caseignore + Attributes rattrs = new BasicAttributes(true); // ignore case for (int i = 0; i < reqAttrs.length; i++) { rattrs.put(reqAttrs[i], null); } @@ -213,8 +213,6 @@ final class LdapSearchEnumeration // Update search-specific variables LdapSearchEnumeration se = (LdapSearchEnumeration)ne; startName = se.startName; -//VR - keep original args, don't overwite with current args -// searchArgs = se.searchArgs; } void setStartName(Name nm) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java index ada02f6f3bc..40b2b56cf42 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java @@ -162,7 +162,7 @@ final public class LdapURL extends Uri { } /** - * Derermines whether an LDAP URL has query components. + * Determines whether an LDAP URL has query components. */ public static boolean hasQueryComponents(String url) { return (url.lastIndexOf('?') != -1); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java index 05df1bbd6b7..a7bf61d9494 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java @@ -62,7 +62,7 @@ class ServiceLocator { * * @param dn A string distinguished name (RFC 2253). * @return A domain name or null if none can be derived. - * @throw InvalidNameException If the distinugished name is invalid. + * @throw InvalidNameException If the distinguished name is invalid. */ static String mapDnToDomainName(String dn) throws InvalidNameException { if (dn == null) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java index 2df13459570..0e3e1094d67 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java @@ -254,7 +254,7 @@ final class Connections implements PoolCallback { /** * Removes PooledConnection from list of connections. * The closing of the connection is separate from this method. - * This method is called usually when the caller encouters an error + * This method is called usually when the caller encounters an error * when using the connection and wants it removed from the pool. * * @return true if conn removed; false if it was not in pool diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java index f9786cad213..723f11a8783 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java @@ -68,8 +68,8 @@ import javax.naming.NamingException; * whenever a pooled connection is requested or a call to remove the expired * connections is made. The monitoring is done regularly when idle connection * timeout is set as the PoolCleaner removes expired connections periodically. - * As determined by the experiements, cleanup of resources using the - * ReferenceQueue mechanism is reliable and has immidiate effect than the + * As determined by experimentation, cleanup of resources using the + * ReferenceQueue mechanism is reliable and has more immediate effect than the * finalizer approach. * * @author Rosanna Lee diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java index f8f41d598f9..606f38005cf 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java @@ -96,7 +96,7 @@ public abstract class AtomicContext extends ComponentContext { * Resolves the nns for 'name' when the named context is acting * as an intermediate context. * - * For a system that supports junctions, this would be equilvalent to + * For a system that supports junctions, this would be equivalent to * a_lookup(name, cont); * because for junctions, an intermediate slash simply signifies * a syntactic separator. @@ -487,7 +487,7 @@ public abstract class AtomicContext extends ComponentContext { resolve_to_nns_and_continue(name, cont); return null; } else { - // use COmponentContext + // use ComponentContext return super.c_getNameParser_nns(name, cont); } } diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java index 351d6d7d0f7..24e65fa104a 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java @@ -137,7 +137,7 @@ public abstract class ComponentContext extends PartialCompositeContext { * as an intermediate context. * * For a system that supports only junctions, this would be - * equilvalent to + * equivalent to * c_lookup(name, cont); * because for junctions, an intermediate slash simply signifies * a syntactic separator. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java index 6c09f935f97..44bc245bad4 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java @@ -172,7 +172,7 @@ public class Continuation extends ResolveResult { * * This method is typically called by _nns methods that have been * given a name to process. It might process part of that name but - * encountered some error. Consequenetly, it would call setErrorNNS() + * encountered some error. Consequently, it would call setErrorNNS() * with the remaining name. Since the _nns method was expected to * operate upon the "nns" of the original name, the remaining name * must include the "nns". That's why this method adds a trailing "/". @@ -219,7 +219,7 @@ public class Continuation extends ResolveResult { * * This method is typically called by methods that have been * given a name to process. It might process part of that name but - * encountered some error. Consequenetly, it would call setError() + * encountered some error. Consequently, it would call setError() * with the resolved object and the remaining name. *

    * After this method is called, isContinuing() returns false. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java index cafd047b144..176e3392b02 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java @@ -182,14 +182,14 @@ public class ContextEnumerator implements NamingEnumeration { if (!currentReturned) { // returning parent - if(debug) {System.out.println("getNextDescedant: simple case");} + if(debug) {System.out.println("getNextDescendant: simple case");} currentReturned = true; return currentChild; } else if (currentChildExpanded && currentChildEnum.hasMore()) { - if(debug) {System.out.println("getNextDescedant: expanded case");} + if(debug) {System.out.println("getNextDescendant: expanded case");} // if the current child is expanded, use it's enumerator return currentChildEnum.next(); @@ -197,7 +197,7 @@ public class ContextEnumerator implements NamingEnumeration { } else { // Ready to go onto next child - if(debug) {System.out.println("getNextDescedant: next case");} + if(debug) {System.out.println("getNextDescendant: next case");} prepNextChild(); return getNextDescendant(); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java index e10ee2aec41..35895db2395 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java @@ -881,8 +881,8 @@ public class HierMemDirCtx implements DirContext { } } - // CompundNames's HashCode() method isn't good enough for many string. - // The only prupose of this subclass is to have a more discerning + // CompoundNames's HashCode() method isn't good enough for many strings. + // The only purpose of this subclass is to have a more discerning // hash function. We'll make up for the performance hit by caching // the hash value. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java index b6efbedfa4b..8871e0f051c 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java @@ -152,7 +152,7 @@ final public class LazySearchEnumerationImpl } else if (useFactory) { try { // Give name only if context non-null, - // otherewise, name will be interpreted relative + // otherwise, name will be interpreted relative // to initial context (not what we want) Name nm = (context != null ? new CompositeName(next.getName()) : null); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java index cf23c3dd2e4..695238309f3 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java @@ -256,7 +256,7 @@ public class SearchFilter implements AttrFilter { static final int LESS_MATCH = 4; /** - * A class for dealing wtih atomic filters + * A class for dealing with atomic filters */ final class AtomicFilter implements StringFilter { private String attrID; @@ -369,7 +369,7 @@ public class SearchFilter implements AttrFilter { } break; default: - if (debug) {System.out.println("AtomicFilter: unkown " + + if (debug) {System.out.println("AtomicFilter: unknown " + "matchType");} } } @@ -434,7 +434,7 @@ public class SearchFilter implements AttrFilter { /** - * Creates an LDAP filter as a conjuction of the attributes supplied. + * Creates an LDAP filter as a conjunction of the attributes supplied. */ public static String format(Attributes attrs) throws NamingException { if (attrs == null || attrs.size() == 0) { diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java index cb5255d0a7b..8493330135b 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java @@ -168,7 +168,7 @@ abstract public class GenericURLContext implements Context { } } - // else 0 or 1 iniitial slashes; start is unchanged + // else 0 or 1 initial slashes; start is unchanged return url.substring(0, start); } diff --git a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java index 6143363284a..af88b606e21 100644 --- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java +++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java @@ -562,7 +562,7 @@ final public class ldapURLContext } // Search using the LDAP URL in name. - // LDAP URL query components override the search argments. + // LDAP URL query components override the search arguments. private NamingEnumeration searchUsingURL(String name) throws NamingException { diff --git a/jdk/src/share/classes/javax/naming/directory/DirContext.java b/jdk/src/share/classes/javax/naming/directory/DirContext.java index 903ccbea421..2b77486673a 100644 --- a/jdk/src/share/classes/javax/naming/directory/DirContext.java +++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java @@ -723,7 +723,7 @@ public interface DirContext extends Context { * specified set of attributes. * This method returns all the attributes of such objects. * It is equivalent to supplying null as - * the atributesToReturn parameter to the method + * the attributesToReturn parameter to the method * search(Name, Attributes, String[]). *
    * See {@link #search(Name, Attributes, String[])} for a full description. diff --git a/jdk/src/share/classes/javax/naming/ldap/Rdn.java b/jdk/src/share/classes/javax/naming/ldap/Rdn.java index d688e11baf8..dc001705bdd 100644 --- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java +++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java @@ -421,7 +421,7 @@ public class Rdn implements Serializable, Comparable { private String type; private Object value; - // If non-null, a cannonical representation of the value suitable + // If non-null, a canonical representation of the value suitable // for comparison using String.compareTo() private String comparable = null; @@ -571,10 +571,10 @@ public class Rdn implements Serializable, Comparable { } /** - * Given an attribute value string formated according to the rules + * Given an attribute value string formatted according to the rules * specified in * RFC 2253, - * returns the unformated value. Escapes and quotes are + * returns the unformatted value. Escapes and quotes are * stripped away, and hex-encoded UTF-8 is converted to equivalent * UTF-16 characters. Returns a string value as a String, and a * binary value as a byte array. diff --git a/jdk/src/share/classes/javax/naming/ldap/SortControl.java b/jdk/src/share/classes/javax/naming/ldap/SortControl.java index b7420b987ec..aaeb7a17ad9 100644 --- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java @@ -188,7 +188,7 @@ final public class SortControl extends BasicControl { /* * Encodes the sort control's value using ASN.1 BER. * The result includes the BER tag and length for the control's value but - * does not include the control's object identifer and criticality setting. + * does not include the control's object identifier and criticality setting. * * @param sortKeys A non-null list of keys to sort by. * @return A possibly null byte array representing the ASN.1 BER encoded From 108bef819dce587ce567d0b7ffddc83a02b86818 Mon Sep 17 00:00:00 2001 From: Amy Lu Date: Sun, 3 Aug 2014 20:09:08 +0800 Subject: [PATCH 102/111] 8054095: No space allowed in platforms string in ProblemList.txt Reviewed-by: weijun --- jdk/test/ProblemList.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 77d3b2b7748..41f9001f1e1 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -205,7 +205,7 @@ sun/security/pkcs11/ec/TestKeyFactory.java generic-all # 7164518: no PortUnreachableException on Mac # 8051952: Unreachable.java test failing on Windows -sun/security/krb5/auto/Unreachable.java windows-all, macosx-all +sun/security/krb5/auto/Unreachable.java windows-all,macosx-all # 7147060 com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java generic-all @@ -241,8 +241,8 @@ sun/security/tools/keytool/standard.sh solaris-all # jdk_tools # Tests take too long, on sparcs see 7143279 -tools/pack200/CommandLineTests.java solaris-all, macosx-all -tools/pack200/Pack200Test.java solaris-all, macosx-all +tools/pack200/CommandLineTests.java solaris-all,macosx-all +tools/pack200/Pack200Test.java solaris-all,macosx-all # 8007410 tools/launcher/FXLauncherTest.java linux-all @@ -252,7 +252,7 @@ tools/launcher/FXLauncherTest.java linux-all # jdk_jdi # 6983531 -com/sun/jdi/BadHandshakeTest.java linux-all, windows-all +com/sun/jdi/BadHandshakeTest.java linux-all,windows-all # 8004127 com/sun/jdi/RedefineImplementor.sh generic-all From 578ec9d11e079f0d3367bac232b4c92ceb5ee863 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Mon, 4 Aug 2014 21:37:45 +0530 Subject: [PATCH 103/111] 8054223: Nashorn: AssertionError when use __DIR__ and ScriptEngine.eval() Reviewed-by: lagergren, hannesw --- .../src/jdk/nashorn/internal/codegen/CodeGenerator.java | 2 +- .../src/jdk/nashorn/api/scripting/ScriptEngineTest.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java index 5b5929f9d32..e2cffa5aaf8 100644 --- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java @@ -4742,7 +4742,7 @@ final class CodeGenerator extends NodeOperatorVisitor Date: Tue, 5 Aug 2014 13:59:15 +0100 Subject: [PATCH 104/111] 8051972: sun/security/pkcs11/ec/ReadCertificates.java fails intermittently Reviewed-by: mullan --- .../sun/security/pkcs11/ec/ReadCertificates.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java index 8311b8d1e20..82b7f4abc26 100644 --- a/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java +++ b/jdk/test/sun/security/pkcs11/ec/ReadCertificates.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 6405536 6414980 + * @bug 6405536 6414980 8051972 * @summary Make sure that we can parse certificates using various named curves * and verify their signatures * @author Andreas Sterbenz @@ -153,8 +153,14 @@ public class ReadCertificates extends PKCS11Test { signer = getRandomCert(certList); } while (cert.getIssuerX500Principal().equals(signer.getSubjectX500Principal())); try { - cert.verify(signer.getPublicKey()); - throw new Exception("Verified invalid signature"); + PublicKey signerPublicKey = signer.getPublicKey(); + cert.verify(signerPublicKey); + // Ignore false positives + if (cert.getPublicKey().equals(signerPublicKey)) { + System.out.println("OK: self-signed certificate detected"); + } else { + throw new Exception("Verified invalid signature"); + } } catch (SignatureException e) { System.out.println("OK: " + e); } catch (InvalidKeyException e) { From 73dee84b563df236919353a067d189ff472f5a4f Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Tue, 5 Aug 2014 14:29:47 +0100 Subject: [PATCH 105/111] 8036612: [parfait] JNI exception pending in jdk/src/windows/native/sun/security/mscapi/security.cpp Reviewed-by: valeriep --- .../native/sun/security/mscapi/security.cpp | 129 +++++++++++++----- 1 file changed, 96 insertions(+), 33 deletions(-) diff --git a/jdk/src/windows/native/sun/security/mscapi/security.cpp b/jdk/src/windows/native/sun/security/mscapi/security.cpp index 49cbe81e418..8b5d8aeb8a9 100644 --- a/jdk/src/windows/native/sun/security/mscapi/security.cpp +++ b/jdk/src/windows/native/sun/security/mscapi/security.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,7 +74,10 @@ ALG_ID MapHashAlgorithm(JNIEnv *env, jstring jHashAlgorithm) { const char* pszHashAlgorithm = NULL; ALG_ID algId = 0; - pszHashAlgorithm = env->GetStringUTFChars(jHashAlgorithm, NULL); + if ((pszHashAlgorithm = env->GetStringUTFChars(jHashAlgorithm, NULL)) + == NULL) { + return algId; + } if ((strcmp("SHA", pszHashAlgorithm) == 0) || (strcmp("SHA1", pszHashAlgorithm) == 0) || @@ -179,7 +182,9 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_PRNG_generateSeed */ if (length < 0) { length = env->GetArrayLength(seed); - reseedBytes = env->GetByteArrayElements(seed, 0); + if ((reseedBytes = env->GetByteArrayElements(seed, 0)) == NULL) { + __leave; + } if (::CryptGenRandom( hCryptProv, @@ -211,7 +216,9 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_PRNG_generateSeed } else { // length == 0 length = env->GetArrayLength(seed); - seedBytes = env->GetByteArrayElements(seed, 0); + if ((seedBytes = env->GetByteArrayElements(seed, 0)) == NULL) { + __leave; + } if (::CryptGenRandom( hCryptProv, @@ -275,7 +282,10 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateCh __try { // Open a system certificate store. - pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL); + if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL)) + == NULL) { + __leave; + } if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) { @@ -710,7 +720,10 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSAKeyPairGenerator_generateR __try { - pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL); + if ((pszKeyContainerName = + env->GetStringUTFChars(keyContainerName, NULL)) == NULL) { + __leave; + } // Acquire a CSP context (create a new key container). // Prefer a PROV_RSA_AES CSP, when available, due to its support @@ -847,7 +860,10 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_storeCertificate __try { // Open a system certificate store. - pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL); + if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL)) + == NULL) { + __leave; + } if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) { ThrowException(env, KEYSTORE_EXCEPTION, GetLastError()); __leave; @@ -1086,7 +1102,10 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_removeCertificate __try { // Open a system certificate store. - pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL); + if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL)) + == NULL) { + __leave; + } if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) { ThrowException(env, KEYSTORE_EXCEPTION, GetLastError()); __leave; @@ -1123,7 +1142,10 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_removeCertificate cchNameString); // Compare the certificate's friendly name with supplied alias name - pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL); + if ((pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL)) + == NULL) { + __leave; + } if (strcmp(pszCertAliasName, pszNameString) == 0) { // Only delete the certificate if the alias names matches @@ -1181,7 +1203,10 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_destroyKeyContainer __try { - pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL); + if ((pszKeyContainerName = + env->GetStringUTFChars(keyContainerName, NULL)) == NULL) { + __leave; + } // Destroying the default key container is not permitted // (because it may contain more one keypair). @@ -1234,8 +1259,14 @@ JNIEXPORT jlong JNICALL Java_sun_security_mscapi_RSACipher_findCertificateUsingA __try { - pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL); - pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL); + if ((pszCertStoreName = env->GetStringUTFChars(jCertStoreName, NULL)) + == NULL) { + __leave; + } + if ((pszCertAliasName = env->GetStringUTFChars(jCertAliasName, NULL)) + == NULL) { + __leave; + } // Open a system certificate store. if ((hCertStore = ::CertOpenSystemStore(NULL, pszCertStoreName)) == NULL) { @@ -1530,7 +1561,9 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getExponent __try { jsize length = env->GetArrayLength(jKeyBlob); - keyBlob = env->GetByteArrayElements(jKeyBlob, 0); + if ((keyBlob = env->GetByteArrayElements(jKeyBlob, 0)) == NULL) { + __leave; + } PUBLICKEYSTRUC* pPublicKeyStruc = (PUBLICKEYSTRUC *) keyBlob; @@ -1580,7 +1613,9 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getModulus __try { jsize length = env->GetArrayLength(jKeyBlob); - keyBlob = env->GetByteArrayElements(jKeyBlob, 0); + if ((keyBlob = env->GetByteArrayElements(jKeyBlob, 0)) == NULL) { + __leave; + } PUBLICKEYSTRUC* pPublicKeyStruc = (PUBLICKEYSTRUC *) keyBlob; @@ -1632,6 +1667,9 @@ int convertToLittleEndian(JNIEnv *env, jbyteArray source, jbyte* destination, } jbyte* sourceBytes = env->GetByteArrayElements(source, 0); + if (sourceBytes == NULL) { + return -1; + } // Copy bytes from the end of the source array to the beginning of the // destination array (until the destination array is full). @@ -1740,45 +1778,61 @@ jbyteArray generateKeyBlob( } // The length argument must be the smaller of jPublicExponentLength // and sizeof(pRsaPubKey->pubkey) - convertToLittleEndian(env, jPublicExponent, - (jbyte *) &(pRsaPubKey->pubexp), jPublicExponentLength); + if ((jElementLength = convertToLittleEndian(env, jPublicExponent, + (jbyte *) &(pRsaPubKey->pubexp), jPublicExponentLength)) < 0) { + __leave; + } // Modulus n jBlobElement = (jbyte *) (jBlobBytes + sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY)); - jElementLength = convertToLittleEndian(env, jModulus, jBlobElement, - jKeyByteLength); + if ((jElementLength = convertToLittleEndian(env, jModulus, jBlobElement, + jKeyByteLength)) < 0) { + __leave; + } if (bGeneratePrivateKeyBlob) { // Prime p jBlobElement += jElementLength; - jElementLength = convertToLittleEndian(env, jPrimeP, jBlobElement, - jKeyByteLength / 2); + if ((jElementLength = convertToLittleEndian(env, jPrimeP, + jBlobElement, jKeyByteLength / 2)) < 0) { + __leave; + } // Prime q jBlobElement += jElementLength; - jElementLength = convertToLittleEndian(env, jPrimeQ, jBlobElement, - jKeyByteLength / 2); + if ((jElementLength = convertToLittleEndian(env, jPrimeQ, + jBlobElement, jKeyByteLength / 2)) < 0) { + __leave; + } // Prime exponent p jBlobElement += jElementLength; - jElementLength = convertToLittleEndian(env, jExponentP, - jBlobElement, jKeyByteLength / 2); + if ((jElementLength = convertToLittleEndian(env, jExponentP, + jBlobElement, jKeyByteLength / 2)) < 0) { + __leave; + } // Prime exponent q jBlobElement += jElementLength; - jElementLength = convertToLittleEndian(env, jExponentQ, - jBlobElement, jKeyByteLength / 2); + if ((jElementLength = convertToLittleEndian(env, jExponentQ, + jBlobElement, jKeyByteLength / 2)) < 0) { + __leave; + } // CRT coefficient jBlobElement += jElementLength; - jElementLength = convertToLittleEndian(env, jCrtCoefficient, - jBlobElement, jKeyByteLength / 2); + if ((jElementLength = convertToLittleEndian(env, jCrtCoefficient, + jBlobElement, jKeyByteLength / 2)) < 0) { + __leave; + } // Private exponent jBlobElement += jElementLength; - convertToLittleEndian(env, jPrivateExponent, jBlobElement, - jKeyByteLength); + if ((jElementLength = convertToLittleEndian(env, jPrivateExponent, + jBlobElement, jKeyByteLength)) < 0) { + __leave; + } } jBlob = env->NewByteArray(jBlobLength); @@ -1849,9 +1903,15 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_KeyStore_storePrivateKey __try { - pszKeyContainerName = env->GetStringUTFChars(keyContainerName, NULL); + if ((pszKeyContainerName = + env->GetStringUTFChars(keyContainerName, NULL)) == NULL) { + __leave; + } dwBlobLen = env->GetArrayLength(keyBlob); - pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0); + if ((pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0)) + == NULL) { + __leave; + } // Acquire a CSP context (create a new key container). if (::CryptAcquireContext( @@ -1923,7 +1983,10 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSASignature_importPublicKey __try { dwBlobLen = env->GetArrayLength(keyBlob); - pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0); + if ((pbKeyBlob = (BYTE *) env->GetByteArrayElements(keyBlob, 0)) + == NULL) { + __leave; + } // Acquire a CSP context (create a new key container). // Prefer a PROV_RSA_AES CSP, when available, due to its support From 5b89cb1b70d45148c81223c16006a8ea5b43cf2a Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Tue, 5 Aug 2014 10:00:27 -0400 Subject: [PATCH 106/111] 7147060: com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java doesn't run in agentvm mode Reviewed-by: xuelei --- jdk/test/ProblemList.txt | 3 --- .../xml/internal/security/transforms/ClassLoaderTest.java | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 41f9001f1e1..774b43a811f 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -207,9 +207,6 @@ sun/security/pkcs11/ec/TestKeyFactory.java generic-all # 8051952: Unreachable.java test failing on Windows sun/security/krb5/auto/Unreachable.java windows-all,macosx-all -# 7147060 -com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java generic-all - # 6988842: 4 tests failing on Solaris 5.10 sun/security/pkcs11/Secmod/AddPrivateKey.java solaris-all sun/security/pkcs11/ec/ReadCertificates.java solaris-all diff --git a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java index d0a56b6c7b8..010cdd1004c 100644 --- a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java +++ b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,9 +24,9 @@ /** * @test * @author Sean Mullan - * @bug 6461674 8009217 + * @bug 6461674 8009217 7147060 * @compile -XDignore.symbol.file ClassLoaderTest.java MyTransform.java - * @run main ClassLoaderTest + * @run main/othervm ClassLoaderTest * @summary Ensure Transform.register works with transform implementations * loaded by class loader other than system/boot class loader */ From 6b6a37ee50d90cb8ef5e5850b28ea2740797c2f4 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Wed, 6 Aug 2014 02:11:17 +0400 Subject: [PATCH 107/111] 8051382: Optimize java.lang.reflect.Modifier.toString() Reviewed-by: martin --- .../classes/java/lang/reflect/Modifier.java | 32 +++++++++---------- .../lang/reflect/Modifier/toStringTest.java | 6 ++-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/jdk/src/share/classes/java/lang/reflect/Modifier.java b/jdk/src/share/classes/java/lang/reflect/Modifier.java index 7387bbeaa75..f84a35166a9 100644 --- a/jdk/src/share/classes/java/lang/reflect/Modifier.java +++ b/jdk/src/share/classes/java/lang/reflect/Modifier.java @@ -26,6 +26,7 @@ package java.lang.reflect; import java.security.AccessController; +import java.util.StringJoiner; import sun.reflect.LangReflectAccess; import sun.reflect.ReflectionFactory; @@ -232,27 +233,24 @@ public class Modifier { * represented by {@code mod} */ public static String toString(int mod) { - StringBuilder sb = new StringBuilder(); - int len; + StringJoiner sj = new StringJoiner(" "); - if ((mod & PUBLIC) != 0) sb.append("public "); - if ((mod & PROTECTED) != 0) sb.append("protected "); - if ((mod & PRIVATE) != 0) sb.append("private "); + if ((mod & PUBLIC) != 0) sj.add("public"); + if ((mod & PROTECTED) != 0) sj.add("protected"); + if ((mod & PRIVATE) != 0) sj.add("private"); /* Canonical order */ - if ((mod & ABSTRACT) != 0) sb.append("abstract "); - if ((mod & STATIC) != 0) sb.append("static "); - if ((mod & FINAL) != 0) sb.append("final "); - if ((mod & TRANSIENT) != 0) sb.append("transient "); - if ((mod & VOLATILE) != 0) sb.append("volatile "); - if ((mod & SYNCHRONIZED) != 0) sb.append("synchronized "); - if ((mod & NATIVE) != 0) sb.append("native "); - if ((mod & STRICT) != 0) sb.append("strictfp "); - if ((mod & INTERFACE) != 0) sb.append("interface "); + if ((mod & ABSTRACT) != 0) sj.add("abstract"); + if ((mod & STATIC) != 0) sj.add("static"); + if ((mod & FINAL) != 0) sj.add("final"); + if ((mod & TRANSIENT) != 0) sj.add("transient"); + if ((mod & VOLATILE) != 0) sj.add("volatile"); + if ((mod & SYNCHRONIZED) != 0) sj.add("synchronized"); + if ((mod & NATIVE) != 0) sj.add("native"); + if ((mod & STRICT) != 0) sj.add("strictfp"); + if ((mod & INTERFACE) != 0) sj.add("interface"); - if ((len = sb.length()) > 0) /* trim trailing space */ - return sb.toString().substring(0, len-1); - return ""; + return sj.toString(); } /* diff --git a/jdk/test/java/lang/reflect/Modifier/toStringTest.java b/jdk/test/java/lang/reflect/Modifier/toStringTest.java index 694e8ecc7f9..85bceb48339 100644 --- a/jdk/test/java/lang/reflect/Modifier/toStringTest.java +++ b/jdk/test/java/lang/reflect/Modifier/toStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,11 +23,11 @@ /** * @test - * @bug 4394937 + * @bug 4394937 8051382 * @summary tests the toString method of reflect.Modifier */ -import java.lang.reflect.*; +import java.lang.reflect.Modifier; public class toStringTest { From c14ca481dd6f3600b60bbecb382c46720d86d293 Mon Sep 17 00:00:00 2001 From: Neil Toda Date: Tue, 5 Aug 2014 19:29:00 -0700 Subject: [PATCH 108/111] 8042469: Launcher changes for native memory tracking scalability enhancement Reviewed-by: darcy, ksrini, zgu --- jdk/src/share/bin/java.c | 66 +++++++++ jdk/src/share/bin/jli_util.h | 7 +- jdk/test/tools/launcher/TestSpecialArgs.java | 135 ++++++++++++++++++- 3 files changed, 205 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c index df1f832cef8..c71f4c26fab 100644 --- a/jdk/src/share/bin/java.c +++ b/jdk/src/share/bin/java.c @@ -98,6 +98,7 @@ static int numOptions, maxOptions; */ static void SetClassPath(const char *s); static void SelectVersion(int argc, char **argv, char **main_class); +static void SetJvmEnvironment(int argc, char **argv); static jboolean ParseArguments(int *pargc, char ***pargv, int *pmode, char **pwhat, int *pret, const char *jrepath); @@ -238,6 +239,10 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ jvmpath, sizeof(jvmpath), jvmcfg, sizeof(jvmcfg)); + if (!IsJavaArgs()) { + SetJvmEnvironment(argc,argv); + } + ifn.CreateJavaVM = 0; ifn.GetDefaultJavaVMInitArgs = 0; @@ -640,6 +645,67 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) { return jvmtype; } +/* + * static void SetJvmEnvironment(int argc, char **argv); + * Is called just before the JVM is loaded. We can set env variables + * that are consumed by the JVM. This function is non-destructive, + * leaving the arg list intact. The first use is for the JVM flag + * -XX:NativeMemoryTracking=value. + */ +static void +SetJvmEnvironment(int argc, char **argv) { + + static const char* NMT_Env_Name = "NMT_LEVEL_"; + + int i; + for (i = 0; i < argc; i++) { + /* + * The following case checks for "-XX:NativeMemoryTracking=value". + * If value is non null, an environmental variable set to this value + * will be created to be used by the JVM. + * The argument is passed to the JVM, which will check validity. + * The JVM is responsible for removing the env variable. + */ + char *arg = argv[i]; + if (JLI_StrCCmp(arg, "-XX:NativeMemoryTracking=") == 0) { + int retval; + // get what follows this parameter, include "=" + size_t pnlen = JLI_StrLen("-XX:NativeMemoryTracking="); + if (JLI_StrLen(arg) > pnlen) { + char* value = arg + pnlen; + size_t pbuflen = pnlen + JLI_StrLen(value) + 10; // 10 max pid digits + + /* + * ensures that malloc successful + * DONT JLI_MemFree() pbuf. JLI_PutEnv() uses system call + * that could store the address. + */ + char * pbuf = (char*)JLI_MemAlloc(pbuflen); + + JLI_Snprintf(pbuf, pbuflen, "%s%d=%s", NMT_Env_Name, JLI_GetPid(), value); + retval = JLI_PutEnv(pbuf); + if (JLI_IsTraceLauncher()) { + char* envName; + char* envBuf; + + // ensures that malloc successful + envName = (char*)JLI_MemAlloc(pbuflen); + JLI_Snprintf(envName, pbuflen, "%s%d", NMT_Env_Name, JLI_GetPid()); + + printf("TRACER_MARKER: NativeMemoryTracking: env var is %s\n",envName); + printf("TRACER_MARKER: NativeMemoryTracking: putenv arg %s\n",pbuf); + envBuf = getenv(envName); + printf("TRACER_MARKER: NativeMemoryTracking: got value %s\n",envBuf); + free(envName); + } + + } + + } + + } +} + /* copied from HotSpot function "atomll()" */ static int parse_size(const char *s, jlong *result) { diff --git a/jdk/src/share/bin/jli_util.h b/jdk/src/share/bin/jli_util.h index d3c9f0ff8f2..579972278b3 100644 --- a/jdk/src/share/bin/jli_util.h +++ b/jdk/src/share/bin/jli_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,17 +64,22 @@ int JLI_GetStdArgc(); #ifdef _WIN32 #include #include +#include #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) int JLI_Snprintf(char *buffer, size_t size, const char *format, ...); void JLI_CmdToArgs(char *cmdline); #define JLI_Lseek _lseeki64 +#define JLI_PutEnv _putenv +#define JLI_GetPid _getpid #else /* NIXES */ #include #include #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strncasecmp((p1), (p2), (p3)) #define JLI_Snprintf snprintf +#define JLI_PutEnv putenv +#define JLI_GetPid getpid #ifdef __solaris__ #define JLI_Lseek llseek #endif diff --git a/jdk/test/tools/launcher/TestSpecialArgs.java b/jdk/test/tools/launcher/TestSpecialArgs.java index 344869bfbae..04344e6adfb 100644 --- a/jdk/test/tools/launcher/TestSpecialArgs.java +++ b/jdk/test/tools/launcher/TestSpecialArgs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 7124089 7131021 + * @bug 7124089 7131021 8042469 * @summary Checks for MacOSX specific flags are accepted or rejected, and * MacOSX platforms specific environment is consistent. * @compile -XDignore.symbol.file TestSpecialArgs.java EnvironmentVariables.java @@ -69,6 +69,137 @@ public class TestSpecialArgs extends TestHelper { throw new RuntimeException("Error: argument was accepted ????"); } } + + /* + * test argument : -XX:NativeMemoryTracking=value + * A JVM flag, comsumed by the JVM, but requiring launcher + * to set an environmental variable if and only if value is supplied. + * Test and order: + * 1) execute with valid parameter: -XX:NativeMemoryTracking=MyValue + * a) check for correct env variable name: "NMT_LEVEL_" + pid + * b) check that "MyValue" was found in local env. + * 2) execute with invalid parameter: -XX:NativeMemoryTracking= + * !) Won't find "NativeMemoryTracking:" + * Code to create env variable not executed. + * 3) execute with invalid parameter: -XX:NativeMemoryTracking + * !) Won't find "NativeMemoryTracking:" + * Code to create env variable not executed. + * 4) give and invalid value and check to make sure JVM commented + */ + { // NativeMemoryTracking + String launcherPidString = "launcher.pid="; + String envVarPidString = "TRACER_MARKER: NativeMemoryTracking: env var is NMT_LEVEL_"; + String NMT_Option_Value = "off"; + String myClassName = "helloworld"; + boolean haveLauncherPid = false; + + // === Run the tests === + + // ---Test 1a + tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=" + NMT_Option_Value, + "-version"); + + // get the PID from the env var we set for the JVM + String envVarPid = null; + for (String line : tr.testOutput) { + if (line.contains(envVarPidString)) { + int sindex = envVarPidString.length(); + envVarPid = line.substring(sindex); + break; + } + } + // did we find envVarPid? + if (envVarPid == null) { + System.out.println(tr); + throw new RuntimeException("Error: failed to find env Var Pid in tracking info"); + } + // we think we found the pid string. min test, not "". + if (envVarPid.length() < 1) { + System.out.println(tr); + throw new RuntimeException("Error: env Var Pid in tracking info is empty string"); + } + + /* + * On Linux, Launcher Tracking will print the PID. Use this info + * to validate what we got as the PID in the Launcher itself. + * Linux is the only one that prints this, and trying to get it + * here for win is awful. So let the linux test make sure we get + * the valid pid, and for non-linux, just make sure pid string is + * non-zero. + */ + if (isLinux) { + // get what the test says is the launcher pid + String launcherPid = null; + for (String line : tr.testOutput) { + int index = line.indexOf(launcherPidString); + if (index >= 0) { + int sindex = index + launcherPidString.length(); + int tindex = sindex + line.substring(sindex).indexOf("'"); + System.out.println("DEBUG INFO: sindex = " + sindex); + System.out.println("DEBUG INFO: searching substring: " + line.substring(sindex)); + System.out.println("DEBUG INFO: tindex = " + tindex); + // DEBUG INFO + System.out.println(tr); + launcherPid = line.substring(sindex, tindex); + break; + } + } + if (launcherPid == null) { + System.out.println(tr); + throw new RuntimeException("Error: failed to find launcher Pid in launcher tracking info"); + } + + // did we create the env var with the correct pid? + if (!launcherPid.equals(envVarPid)) { + System.out.println(tr); + System.out.println("Error: wrong pid in creating env var"); + System.out.println("Error Info: launcherPid = " + launcherPid); + System.out.println("Error Info: envVarPid = " + envVarPid); + throw new RuntimeException("Error: wrong pid in creating env var"); + } + } + + + // --- Test 1b + if (!tr.contains("NativeMemoryTracking: got value " + NMT_Option_Value)) { + System.out.println(tr); + throw new RuntimeException("Error: Valid param failed to set env variable"); + } + + // --- Test 2 + tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=", + "-version"); + if (tr.contains("NativeMemoryTracking:")) { + System.out.println(tr); + throw new RuntimeException("Error: invalid param caused env variable to be erroneously created"); + } + if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) { + System.out.println(tr); + throw new RuntimeException("Error: invalid param not checked by JVM"); + } + + // --- Test 3 + tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking", + "-version"); + if (tr.contains("NativeMemoryTracking:")) { + System.out.println(tr); + throw new RuntimeException("Error: invalid param caused env variable to be erroneously created"); + } + if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) { + System.out.println(tr); + throw new RuntimeException("Error: invalid param not checked by JVM"); + } + // --- Test 4 + tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=BADVALUE", + "-version"); + if (!tr.contains("expecting -XX:NativeMemoryTracking")) { + System.out.println(tr); + throw new RuntimeException("Error: invalid param did not get JVM Syntax error message"); + } + + } // NativeMemoryTracking + + // MacOSX specific tests ensue...... if (!isMacOSX) return; From 1eb6e5cb4259c76be5a6e894434632e6dab8925f Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 6 Aug 2014 10:42:46 +0200 Subject: [PATCH 109/111] 8044786: Some tests fail with non-optimistic compilation Reviewed-by: hannesw, jlaskey --- .../internal/objects/NativeUint8ClampedArray.java | 14 +++++++++++--- .../nashorn/internal/runtime/ScriptRuntime.java | 5 ++--- nashorn/test/script/basic/JDK-8030182_2.js | 2 +- .../test/script/basic/JDK-8030182_2.js.EXPECTED | 2 +- .../basic/optimistic_arithmetic_check_type.js | 1 + .../basic/optimistic_assignment_check_type.js | 1 + nashorn/test/script/basic/optimistic_check_type.js | 1 + nashorn/test/script/trusted/event_queue.js | 1 + .../script/trusted/optimistic_recompilation.js | 1 + 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java index 8e81924d3cf..db19ab37a59 100644 --- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java @@ -80,7 +80,8 @@ public final class NativeUint8ClampedArray extends ArrayBufferView { private static final MethodHandle GET_ELEM = specialCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "getElem", int.class, int.class).methodHandle(); private static final MethodHandle SET_ELEM = specialCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "setElem", void.class, int.class, int.class).methodHandle(); - private static final MethodHandle RINT = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", double.class, double.class).methodHandle(); + private static final MethodHandle RINT_D = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", double.class, double.class).methodHandle(); + private static final MethodHandle RINT_O = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "rint", Object.class, Object.class).methodHandle(); private static final MethodHandle CLAMP_LONG = staticCall(MethodHandles.lookup(), Uint8ClampedArrayData.class, "clampLong", long.class, long.class).methodHandle(); private Uint8ClampedArrayData(final ByteBuffer nb, final int start, final int end) { @@ -109,8 +110,10 @@ public final class NativeUint8ClampedArray extends ArrayBufferView { public MethodHandle getElementSetter(final Class elementType) { final MethodHandle setter = super.getElementSetter(elementType); //getContinuousElementSetter(getClass(), setElem(), elementType); if (setter != null) { - if (elementType == double.class) { - return MH.filterArguments(setter, 2, RINT); + if (elementType == Object.class) { + return MH.filterArguments(setter, 2, RINT_O); + } else if (elementType == double.class) { + return MH.filterArguments(setter, 2, RINT_D); } else if (elementType == long.class) { return MH.filterArguments(setter, 2, CLAMP_LONG); } @@ -190,6 +193,11 @@ public final class NativeUint8ClampedArray extends ArrayBufferView { return (int)Math.rint(rint); } + @SuppressWarnings("unused") + private static Object rint(final Object rint) { + return rint(JSType.toNumber(rint)); + } + @SuppressWarnings("unused") private static long clampLong(final long l) { if(l < 0L) { diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java index a2516ba181f..d4350c5998a 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java @@ -818,9 +818,8 @@ public final class ScriptRuntime { /** ECMA 11.9.6 The Strict Equality Comparison Algorithm */ private static boolean strictEquals(final Object x, final Object y) { - if(x == y) { - return true; - } + // NOTE: you might be tempted to do a quick x == y comparison. Remember, though, that any Double object having + // NaN value is not equal to itself by value even though it is referentially. final JSType xType = JSType.ofNoFunction(x); final JSType yType = JSType.ofNoFunction(y); diff --git a/nashorn/test/script/basic/JDK-8030182_2.js b/nashorn/test/script/basic/JDK-8030182_2.js index 4c2f5c429f6..9ad8f31bae5 100644 --- a/nashorn/test/script/basic/JDK-8030182_2.js +++ b/nashorn/test/script/basic/JDK-8030182_2.js @@ -41,6 +41,6 @@ str +="g()"; try { eval(str); } catch (e) { - print(e.stack.replace(/\\/g, '/')); + print(e.stack.replace(/\\/g, '/').replace(/@[0-9]+/, '@')); } diff --git a/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED index 090bd1f1ab2..9fdd913f12d 100644 --- a/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED +++ b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED @@ -1,3 +1,3 @@ ReferenceError: "g" is not defined - at (test/script/basic/JDK-8030182_2.js#42:4@1:-1) + at (test/script/basic/JDK-8030182_2.js#42:4@:-1) at (test/script/basic/JDK-8030182_2.js:42) diff --git a/nashorn/test/script/basic/optimistic_arithmetic_check_type.js b/nashorn/test/script/basic/optimistic_arithmetic_check_type.js index 66b1e361508..62ff301d0f0 100644 --- a/nashorn/test/script/basic/optimistic_arithmetic_check_type.js +++ b/nashorn/test/script/basic/optimistic_arithmetic_check_type.js @@ -25,6 +25,7 @@ * @test * @bug 8036987, 8037572 * @summary Implement tests that checks static types in the compiled code + * @option --optimistic-types=true * @run */ diff --git a/nashorn/test/script/basic/optimistic_assignment_check_type.js b/nashorn/test/script/basic/optimistic_assignment_check_type.js index 2665c18d9ba..7ead00d8448 100644 --- a/nashorn/test/script/basic/optimistic_assignment_check_type.js +++ b/nashorn/test/script/basic/optimistic_assignment_check_type.js @@ -25,6 +25,7 @@ * @test * @bug 8036987, 8037572 * @summary Implement tests that checks static types in the compiled code + * @option --optimistic-types=true * @run */ diff --git a/nashorn/test/script/basic/optimistic_check_type.js b/nashorn/test/script/basic/optimistic_check_type.js index 163244e817b..d2b50a4c3fb 100644 --- a/nashorn/test/script/basic/optimistic_check_type.js +++ b/nashorn/test/script/basic/optimistic_check_type.js @@ -25,6 +25,7 @@ * @test * @bug 8036987, 8037572 * @summary Implement tests that checks static types in the compiled code + * @option --optimistic-types=true * @run */ diff --git a/nashorn/test/script/trusted/event_queue.js b/nashorn/test/script/trusted/event_queue.js index 305240eff45..feecc201da5 100644 --- a/nashorn/test/script/trusted/event_queue.js +++ b/nashorn/test/script/trusted/event_queue.js @@ -29,6 +29,7 @@ * @fork * @option -Dnashorn.debug=true * @option --log=recompile:quiet + * @option --optimistic-types=true */ print(Debug); diff --git a/nashorn/test/script/trusted/optimistic_recompilation.js b/nashorn/test/script/trusted/optimistic_recompilation.js index 2435ed510f9..9c9a9c751b0 100644 --- a/nashorn/test/script/trusted/optimistic_recompilation.js +++ b/nashorn/test/script/trusted/optimistic_recompilation.js @@ -28,6 +28,7 @@ * @fork * @option -Dnashorn.debug=true * @option --log=recompile:quiet + * @option --optimistic-types=true */ var forName = java.lang.Class["forName(String)"]; From 5d2615f1cb359e277dc80e937c7c737a3fa13457 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Wed, 6 Aug 2014 11:02:14 +0200 Subject: [PATCH 110/111] 8051439: Wrong type calculated for ADD operator with undefined operand Reviewed-by: jlaskey, sundar --- .../internal/codegen/CodeGenerator.java | 2 +- .../codegen/LocalVariableTypesCalculator.java | 4 +- .../jdk/nashorn/internal/ir/BinaryNode.java | 52 ++++++++++++++++++- nashorn/test/script/basic/JDK-8051439.js | 52 +++++++++++++++++++ .../test/script/basic/JDK-8051439.js.EXPECTED | 2 + 5 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 nashorn/test/script/basic/JDK-8051439.js create mode 100644 nashorn/test/script/basic/JDK-8051439.js.EXPECTED diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java index e2cffa5aaf8..5b7bf91ab2a 100644 --- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java @@ -314,7 +314,7 @@ final class CodeGenerator extends NodeOperatorVisitor{ } else if(binaryNode.isOptimisticUndecidedType()) { // At this point, we can assign a static type to the optimistic binary ADD operator as now we know // the types of its operands. - final Type type = Type.widest(binaryNode.lhs().getType(), binaryNode.rhs().getType()); - // Use Type.CHARSEQUENCE instead of Type.STRING to avoid conversion of ConsStrings to Strings. - return binaryNode.setType(type.equals(Type.STRING) ? Type.CHARSEQUENCE : type); + return binaryNode.decideType(); } return binaryNode; } diff --git a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java index 8411e263bfa..f32f6325622 100644 --- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java +++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java @@ -183,17 +183,31 @@ public final class BinaryNode extends Expression implements Assignment localVariableTypes) { if(type == OPTIMISTIC_UNDECIDED_TYPE) { - return Type.widest(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes)); + return decideType(lhs.getType(localVariableTypes), rhs.getType(localVariableTypes)); } final Type widest = getWidestOperationType(localVariableTypes); if(type == null) { @@ -536,6 +558,32 @@ public final class BinaryNode extends Expression implements Assignment Date: Wed, 6 Aug 2014 11:54:50 +0200 Subject: [PATCH 111/111] 8054411: Add nashorn.args.prepend system property Reviewed-by: hannesw, jlaskey --- .../internal/runtime/options/Options.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java b/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java index db755cb9a0e..ed39fa95481 100644 --- a/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java +++ b/nashorn/src/jdk/nashorn/internal/runtime/options/Options.java @@ -78,7 +78,10 @@ public final class Options { /** The options map of enabled options */ private final TreeMap> options; - /** System property that can be used for command line option propagation */ + /** System property that can be used to prepend options to the explicitly specified command line. */ + private static final String NASHORN_ARGS_PREPEND_PROPERTY = "nashorn.args.prepend"; + + /** System property that can be used to append options to the explicitly specified command line. */ private static final String NASHORN_ARGS_PROPERTY = "nashorn.args"; /** @@ -419,15 +422,9 @@ public final class Options { */ public void process(final String[] args) { final LinkedList argList = new LinkedList<>(); + addSystemProperties(NASHORN_ARGS_PREPEND_PROPERTY, argList); Collections.addAll(argList, args); - - final String extra = getStringProperty(NASHORN_ARGS_PROPERTY, null); - if (extra != null) { - final StringTokenizer st = new StringTokenizer(extra); - while (st.hasMoreTokens()) { - argList.add(st.nextToken()); - } - } + addSystemProperties(NASHORN_ARGS_PROPERTY, argList); while (!argList.isEmpty()) { final String arg = argList.remove(0); @@ -509,6 +506,16 @@ public final class Options { } } + private static void addSystemProperties(final String sysPropName, final List argList) { + final String sysArgs = getStringProperty(sysPropName, null); + if (sysArgs != null) { + final StringTokenizer st = new StringTokenizer(sysArgs); + while (st.hasMoreTokens()) { + argList.add(st.nextToken()); + } + } + } + private static OptionTemplate getOptionTemplate(final String key) { for (final OptionTemplate t : Options.validOptions) { if (t.matches(key)) {