diff --git a/.hgtags b/.hgtags
index 0b3abeb4247..a9f9153ddaa 100644
--- a/.hgtags
+++ b/.hgtags
@@ -223,3 +223,4 @@ ea73f01b9053e7165e7ba80f242bafecbc6af712 jdk8-b96
2d3875b0d18b3ad1c2bebf385a697e309e4005a4 jdk8-b99
3d34036aae4ea90b2ca59712d5a69db3221f0875 jdk8-b100
edb01c460d4cab21ff0ff13512df7b746efaa0e7 jdk8-b101
+bbe43d712fe08e650808d774861b256ccb34e500 jdk8-b102
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index a5df9845c1e..b53d6e5d657 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -223,3 +223,4 @@ a1c1e8bf71f354f3aec0214cf13d6668811e021d jdk8-b97
59dc9da813794c924a0383c2a6241af94defdfed jdk8-b99
d2dcb110e9dbaf9903c05b211df800e78e4b394e jdk8-b100
9f74a220677dc265a724515d8e2617548cef62f1 jdk8-b101
+5eb3c1dc348f72a7f84f7d9d07834e8bbe09a799 jdk8-b102
diff --git a/corba/.hgtags b/corba/.hgtags
index dde93b19425..83e58a77cfe 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -223,3 +223,4 @@ c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90
3f67804ab61303782df57e54989ef5e0e4629beb jdk8-b99
8d492f1dfd1b131a4c7886ee6b59528609f7e4fe jdk8-b100
a013024b07475782f1fa8e196e950b34b4077663 jdk8-b101
+528c7e76eaeee022817ee085668459bc97cf5665 jdk8-b102
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava b/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava
deleted file mode 100644
index 648ff3f4fb7..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.encoding;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.Principal;
-import org.omg.CORBA.Any;
-
-import com.sun.org.omg.SendingContext.CodeBase;
-
-import com.sun.corba.se.pept.protocol.MessageMediator;
-
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.orb.ORB;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-import com.sun.corba.se.impl.encoding.CodeSetConversion;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-
-/**
- * This is delegates to the real implementation.
- *
- * NOTE:
- *
- * Before using the stream for valuetype unmarshaling, one must call
- * performORBVersionSpecificInit().
- */
-public abstract class CDRInputStream
- extends org.omg.CORBA_2_3.portable.InputStream
- implements com.sun.corba.se.impl.encoding.MarshalInputStream,
- org.omg.CORBA.DataInputStream, org.omg.CORBA.portable.ValueInputStream
-{
- protected CorbaMessageMediator messageMediator;
- private CDRInputStreamBase impl;
-
- // We can move this out somewhere later. For now, it serves its purpose
- // to create a concrete CDR delegate based on the GIOP version.
- private static class InputStreamFactory {
-
- public static CDRInputStreamBase newInputStream(ORB orb, GIOPVersion version)
- {
- switch(version.intValue()) {
- case GIOPVersion.VERSION_1_0:
- return new CDRInputStream_1_0();
- case GIOPVersion.VERSION_1_1:
- return new CDRInputStream_1_1();
- case GIOPVersion.VERSION_1_2:
- return new CDRInputStream_1_2();
- default:
- ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_ENCODING ) ;
- throw wrapper.unsupportedGiopVersion( version ) ;
- }
- }
- }
-
- // Required for the case when a ClientResponseImpl is
- // created with a SystemException due to a dead server/closed
- // connection with no warning. Note that the stream will
- // not be initialized in this case.
- //
- // Probably also required by ServerRequestImpl.
- //
- // REVISIT.
- public CDRInputStream() {
- }
-
- public CDRInputStream(CDRInputStream is) {
- impl = is.impl.dup();
- impl.setParent(this);
- }
-
- public CDRInputStream(org.omg.CORBA.ORB orb,
- ByteBuffer byteBuffer,
- int size,
- boolean littleEndian,
- GIOPVersion version,
- BufferManagerRead bufMgr)
- {
- impl = InputStreamFactory.newInputStream( (ORB)orb, version);
-
- impl.init(orb, byteBuffer, size, littleEndian, bufMgr);
-
- impl.setParent(this);
- }
-
- // org.omg.CORBA.portable.InputStream
- public final boolean read_boolean() {
- return impl.read_boolean();
- }
-
- public final char read_char() {
- return impl.read_char();
- }
-
- public final char read_wchar() {
- return impl.read_wchar();
- }
-
- public final byte read_octet() {
- return impl.read_octet();
- }
-
- public final short read_short() {
- return impl.read_short();
- }
-
- public final short read_ushort() {
- return impl.read_ushort();
- }
-
- public final int read_long() {
- return impl.read_long();
- }
-
- public final int read_ulong() {
- return impl.read_ulong();
- }
-
- public final long read_longlong() {
- return impl.read_longlong();
- }
-
- public final long read_ulonglong() {
- return impl.read_ulonglong();
- }
-
- public final float read_float() {
- return impl.read_float();
- }
-
- public final double read_double() {
- return impl.read_double();
- }
-
- public final String read_string() {
- return impl.read_string();
- }
-
- public final String read_wstring() {
- return impl.read_wstring();
- }
-
- public final void read_boolean_array(boolean[] value, int offset, int length) {
- impl.read_boolean_array(value, offset, length);
- }
-
- public final void read_char_array(char[] value, int offset, int length) {
- impl.read_char_array(value, offset, length);
- }
-
- public final void read_wchar_array(char[] value, int offset, int length) {
- impl.read_wchar_array(value, offset, length);
- }
-
- public final void read_octet_array(byte[] value, int offset, int length) {
- impl.read_octet_array(value, offset, length);
- }
-
- public final void read_short_array(short[] value, int offset, int length) {
- impl.read_short_array(value, offset, length);
- }
-
- public final void read_ushort_array(short[] value, int offset, int length) {
- impl.read_ushort_array(value, offset, length);
- }
-
- public final void read_long_array(int[] value, int offset, int length) {
- impl.read_long_array(value, offset, length);
- }
-
- public final void read_ulong_array(int[] value, int offset, int length) {
- impl.read_ulong_array(value, offset, length);
- }
-
- public final void read_longlong_array(long[] value, int offset, int length) {
- impl.read_longlong_array(value, offset, length);
- }
-
- public final void read_ulonglong_array(long[] value, int offset, int length) {
- impl.read_ulonglong_array(value, offset, length);
- }
-
- public final void read_float_array(float[] value, int offset, int length) {
- impl.read_float_array(value, offset, length);
- }
-
- public final void read_double_array(double[] value, int offset, int length) {
- impl.read_double_array(value, offset, length);
- }
-
- public final org.omg.CORBA.Object read_Object() {
- return impl.read_Object();
- }
-
- public final TypeCode read_TypeCode() {
- return impl.read_TypeCode();
- }
- public final Any read_any() {
- return impl.read_any();
- }
-
- public final Principal read_Principal() {
- return impl.read_Principal();
- }
-
- public final int read() throws java.io.IOException {
- return impl.read();
- }
-
- public final java.math.BigDecimal read_fixed() {
- return impl.read_fixed();
- }
-
- public final org.omg.CORBA.Context read_Context() {
- return impl.read_Context();
- }
-
- public final org.omg.CORBA.Object read_Object(java.lang.Class clz) {
- return impl.read_Object(clz);
- }
-
- public final org.omg.CORBA.ORB orb() {
- return impl.orb();
- }
-
- // org.omg.CORBA_2_3.portable.InputStream
- public final java.io.Serializable read_value() {
- return impl.read_value();
- }
-
- public final java.io.Serializable read_value(java.lang.Class clz) {
- return impl.read_value(clz);
- }
-
- public final java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) {
- return impl.read_value(factory);
- }
-
- public final java.io.Serializable read_value(java.lang.String rep_id) {
- return impl.read_value(rep_id);
- }
-
- public final java.io.Serializable read_value(java.io.Serializable value) {
- return impl.read_value(value);
- }
-
- public final java.lang.Object read_abstract_interface() {
- return impl.read_abstract_interface();
- }
-
- public final java.lang.Object read_abstract_interface(java.lang.Class clz) {
- return impl.read_abstract_interface(clz);
- }
- // com.sun.corba.se.impl.encoding.MarshalInputStream
-
- public final void consumeEndian() {
- impl.consumeEndian();
- }
-
- public final int getPosition() {
- return impl.getPosition();
- }
-
- // org.omg.CORBA.DataInputStream
-
- public final java.lang.Object read_Abstract () {
- return impl.read_Abstract();
- }
-
- public final java.io.Serializable read_Value () {
- return impl.read_Value();
- }
-
- public final void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length) {
- impl.read_any_array(seq, offset, length);
- }
-
- public final void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) {
- impl.read_boolean_array(seq, offset, length);
- }
-
- public final void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length) {
- impl.read_char_array(seq, offset, length);
- }
-
- public final void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length) {
- impl.read_wchar_array(seq, offset, length);
- }
-
- public final void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length) {
- impl.read_octet_array(seq, offset, length);
- }
-
- public final void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length) {
- impl.read_short_array(seq, offset, length);
- }
-
- public final void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length) {
- impl.read_ushort_array(seq, offset, length);
- }
-
- public final void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length) {
- impl.read_long_array(seq, offset, length);
- }
-
- public final void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length) {
- impl.read_ulong_array(seq, offset, length);
- }
-
- public final void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) {
- impl.read_ulonglong_array(seq, offset, length);
- }
-
- public final void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) {
- impl.read_longlong_array(seq, offset, length);
- }
-
- public final void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length) {
- impl.read_float_array(seq, offset, length);
- }
-
- public final void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) {
- impl.read_double_array(seq, offset, length);
- }
-
- // org.omg.CORBA.portable.ValueBase
- public final String[] _truncatable_ids() {
- return impl._truncatable_ids();
- }
-
- // java.io.InputStream
- public final int read(byte b[]) throws IOException {
- return impl.read(b);
- }
-
- public final int read(byte b[], int off, int len) throws IOException {
- return impl.read(b, off, len);
- }
-
- public final long skip(long n) throws IOException {
- return impl.skip(n);
- }
-
- public final int available() throws IOException {
- return impl.available();
- }
-
- public final void close() throws IOException {
- impl.close();
- }
-
- public final void mark(int readlimit) {
- impl.mark(readlimit);
- }
-
- public final void reset() {
- impl.reset();
- }
-
- public final boolean markSupported() {
- return impl.markSupported();
- }
-
- public abstract CDRInputStream dup();
-
- // Needed by TCUtility
- public final java.math.BigDecimal read_fixed(short digits, short scale) {
- return impl.read_fixed(digits, scale);
- }
-
- public final boolean isLittleEndian() {
- return impl.isLittleEndian();
- }
-
- protected final ByteBuffer getByteBuffer() {
- return impl.getByteBuffer();
- }
-
- protected final void setByteBuffer(ByteBuffer byteBuffer) {
- impl.setByteBuffer(byteBuffer);
- }
-
- protected final void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
- impl.setByteBufferWithInfo(bbwi);
- }
-
- public final int getBufferLength() {
- return impl.getBufferLength();
- }
-
- protected final void setBufferLength(int value) {
- impl.setBufferLength(value);
- }
-
- protected final int getIndex() {
- return impl.getIndex();
- }
-
- protected final void setIndex(int value) {
- impl.setIndex(value);
- }
-
- public final void orb(org.omg.CORBA.ORB orb) {
- impl.orb(orb);
- }
-
- public final GIOPVersion getGIOPVersion() {
- return impl.getGIOPVersion();
- }
-
- public final BufferManagerRead getBufferManager() {
- return impl.getBufferManager();
- }
-
- // This should be overridden by any stream (ex: IIOPInputStream)
- // which wants to read values. Thus, TypeCodeInputStream doesn't
- // have to do this.
- public CodeBase getCodeBase() {
- return null;
- }
-
- // Use Latin-1 for GIOP 1.0 or when code set negotiation was not
- // performed.
- protected CodeSetConversion.BTCConverter createCharBTCConverter() {
- return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.ISO_8859_1,
- impl.isLittleEndian());
- }
-
- // Subclasses must decide what to do here. It's inconvenient to
- // make the class and this method abstract because of dup().
- protected abstract CodeSetConversion.BTCConverter createWCharBTCConverter();
-
- // Prints the current buffer in a human readable form
- void printBuffer() {
- impl.printBuffer();
- }
-
- /**
- * Aligns the current position on the given octet boundary
- * if there are enough bytes available to do so. Otherwise,
- * it just returns. This is used for some (but not all)
- * GIOP 1.2 message headers.
- */
- public void alignOnBoundary(int octetBoundary) {
- impl.alignOnBoundary(octetBoundary);
- }
-
- // Needed by request and reply messages for GIOP versions >= 1.2 only.
- public void setHeaderPadding(boolean headerPadding) {
- impl.setHeaderPadding(headerPadding);
- }
-
- /**
- * This must be called after determining the proper ORB version,
- * and setting it on the stream's ORB instance. It can be called
- * after reading the service contexts, since that is the only place
- * we can get the ORB version info.
- *
- * Trying to unmarshal things requiring repository IDs before calling
- * this will result in NullPtrExceptions.
- */
- public void performORBVersionSpecificInit() {
- // In the case of SystemExceptions, a stream is created
- // with its default constructor (and thus no impl is set).
- if (impl != null)
- impl.performORBVersionSpecificInit();
- }
-
- /**
- * Resets any internal references to code set converters.
- * This is useful for forcing the CDR stream to reacquire
- * converters (probably from its subclasses) when state
- * has changed.
- */
- public void resetCodeSetConverters() {
- impl.resetCodeSetConverters();
- }
-
- public void setMessageMediator(MessageMediator messageMediator)
- {
- this.messageMediator = (CorbaMessageMediator) messageMediator;
- }
-
- public MessageMediator getMessageMediator()
- {
- return messageMediator;
- }
-
- // ValueInputStream -----------------------------
-
- public void start_value() {
- impl.start_value();
- }
-
- public void end_value() {
- impl.end_value();
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava b/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava
deleted file mode 100644
index 240a28067da..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.encoding;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.Principal;
-import org.omg.CORBA.Any;
-
-import com.sun.corba.se.pept.protocol.MessageMediator;
-
-import com.sun.corba.se.spi.orb.ORB;
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-
-import com.sun.corba.se.impl.encoding.CodeSetConversion;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-
-/**
- * This is delegates to the real implementation.
- */
-public abstract class CDROutputStream
- extends org.omg.CORBA_2_3.portable.OutputStream
- implements com.sun.corba.se.impl.encoding.MarshalOutputStream,
- org.omg.CORBA.DataOutputStream, org.omg.CORBA.portable.ValueOutputStream
-{
-/*
- private CDROutputStreamBase impl;
- protected ORB orb ;
- protected ORBUtilSystemException wrapper ;
- protected CorbaMessageMediator corbaMessageMediator;
-
-
- // We can move this out somewhere later. For now, it serves its purpose
- // to create a concrete CDR delegate based on the GIOP version.
- private static class OutputStreamFactory {
-
- public static CDROutputStreamBase newOutputStream(ORB orb, GIOPVersion version)
- {
- switch(version.intValue()) {
- case GIOPVersion.VERSION_1_0:
- return new CDROutputStream_1_0();
- case GIOPVersion.VERSION_1_1:
- return new CDROutputStream_1_1();
- case GIOPVersion.VERSION_1_2:
- return new CDROutputStream_1_2();
- default:
- ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_ENCODING ) ;
- // REVISIT - what is appropriate? INTERNAL exceptions
- // are really hard to track later.
- throw wrapper.unsupportedGiopVersion( version ) ;
- }
- }
- }
-
- // REVISIT - These two constructors should be re-factored to better hide
- // the fact that someone extending this class 'can' construct a CDROutputStream
- // that does not use pooled ByteBuffers. Right now, only EncapsOutputStream
- // does _not_ use pooled ByteBuffers, see EncapsOutputStream.
-
- // NOTE: When a stream is constructed for non-channel-backed sockets
- // it notifies the constructor not to use pooled (i.e, direct)
- // ByteBuffers.
-
- public CDROutputStream(ORB orb,
- GIOPVersion version,
- boolean littleEndian,
- BufferManagerWrite bufferManager,
- byte streamFormatVersion,
- boolean usePooledByteBuffers)
- {
- impl = OutputStreamFactory.newOutputStream(orb, version);
- impl.init(orb, littleEndian, bufferManager, streamFormatVersion, usePooledByteBuffers);
-
- impl.setParent(this);
- this.orb = orb ;
- this.wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_ENCODING ) ;
- }
-
- public CDROutputStream(ORB orb,
- GIOPVersion version,
- boolean littleEndian,
- BufferManagerWrite bufferManager,
- byte streamFormatVersion)
- {
- this(orb, version, littleEndian, bufferManager, streamFormatVersion, true);
- }
-*/
-
- private ByteArrayOutputStream bos ;
- private ObjectOutputStream oos ;
-
- public JavaOutputStream()
- {
- bos = new ByteArrayOutputStream() ;
- oos = new ObjectOutputStream( bos ) ;
- }
-
- // Provided by IIOPOutputStream and EncapsOutputStream
- public org.omg.CORBA.portable.InputStream create_input_stream()
- {
- ObjectInputStream ois = new ByteArrayInputStream( bos.toByteArray() ) ;
-
- return new JavaInputStream( ois ) ;
- }
-
- public final void write_boolean(boolean value) {
- impl.write_boolean(value);
- }
- public final void write_char(char value) {
- impl.write_char(value);
- }
- public final void write_wchar(char value) {
- impl.write_wchar(value);
- }
- public final void write_octet(byte value) {
- impl.write_octet(value);
- }
- public final void write_short(short value) {
- impl.write_short(value);
- }
- public final void write_ushort(short value) {
- impl.write_ushort(value);
- }
- public final void write_long(int value) {
- impl.write_long(value);
- }
- public final void write_ulong(int value) {
- impl.write_ulong(value);
- }
- public final void write_longlong(long value) {
- impl.write_longlong(value);
- }
- public final void write_ulonglong(long value) {
- impl.write_ulonglong(value);
- }
- public final void write_float(float value) {
- impl.write_float(value);
- }
- public final void write_double(double value) {
- impl.write_double(value);
- }
- public final void write_string(String value) {
- impl.write_string(value);
- }
- public final void write_wstring(String value) {
- impl.write_wstring(value);
- }
-
- public final void write_boolean_array(boolean[] value, int offset, int length) {
- impl.write_boolean_array(value, offset, length);
- }
- public final void write_char_array(char[] value, int offset, int length) {
- impl.write_char_array(value, offset, length);
- }
- public final void write_wchar_array(char[] value, int offset, int length) {
- impl.write_wchar_array(value, offset, length);
- }
- public final void write_octet_array(byte[] value, int offset, int length) {
- impl.write_octet_array(value, offset, length);
- }
- public final void write_short_array(short[] value, int offset, int length) {
- impl.write_short_array(value, offset, length);
- }
- public final void write_ushort_array(short[] value, int offset, int length){
- impl.write_ushort_array(value, offset, length);
- }
- public final void write_long_array(int[] value, int offset, int length) {
- impl.write_long_array(value, offset, length);
- }
- public final void write_ulong_array(int[] value, int offset, int length) {
- impl.write_ulong_array(value, offset, length);
- }
- public final void write_longlong_array(long[] value, int offset, int length) {
- impl.write_longlong_array(value, offset, length);
- }
- public final void write_ulonglong_array(long[] value, int offset,int length) {
- impl.write_ulonglong_array(value, offset, length);
- }
- public final void write_float_array(float[] value, int offset, int length) {
- impl.write_float_array(value, offset, length);
- }
- public final void write_double_array(double[] value, int offset, int length) {
- impl.write_double_array(value, offset, length);
- }
- public final void write_Object(org.omg.CORBA.Object value) {
- impl.write_Object(value);
- }
- public final void write_TypeCode(TypeCode value) {
- impl.write_TypeCode(value);
- }
- public final void write_any(Any value) {
- impl.write_any(value);
- }
-
- public final void write_Principal(Principal value) {
- impl.write_Principal(value);
- }
-
- public final void write(int b) throws java.io.IOException {
- impl.write(b);
- }
-
- public final void write_fixed(java.math.BigDecimal value) {
- impl.write_fixed(value);
- }
-
- public final void write_Context(org.omg.CORBA.Context ctx,
- org.omg.CORBA.ContextList contexts) {
- impl.write_Context(ctx, contexts);
- }
-
- public final org.omg.CORBA.ORB orb() {
- return impl.orb();
- }
-
- // org.omg.CORBA_2_3.portable.OutputStream
- public final void write_value(java.io.Serializable value) {
- impl.write_value(value);
- }
-
- public final void write_value(java.io.Serializable value, java.lang.Class clz) {
- impl.write_value(value, clz);
- }
-
- public final void write_value(java.io.Serializable value, String repository_id) {
- impl.write_value(value, repository_id);
- }
-
- public final void write_value(java.io.Serializable value,
- org.omg.CORBA.portable.BoxedValueHelper factory) {
- impl.write_value(value, factory);
- }
-
- public final void write_abstract_interface(java.lang.Object obj) {
- impl.write_abstract_interface(obj);
- }
-
- // java.io.OutputStream
- public final void write(byte b[]) throws IOException {
- impl.write(b);
- }
-
- public final void write(byte b[], int off, int len) throws IOException {
- impl.write(b, off, len);
- }
-
- public final void flush() throws IOException {
- impl.flush();
- }
-
- public final void close() throws IOException {
- impl.close();
- }
-
- // com.sun.corba.se.impl.encoding.MarshalOutputStream
- public final void start_block() {
- impl.start_block();
- }
-
- public final void end_block() {
- impl.end_block();
- }
-
- public final void putEndian() {
- impl.putEndian();
- }
-
- public void writeTo(java.io.OutputStream s)
- throws IOException
- {
- impl.writeTo(s);
- }
-
- public final byte[] toByteArray() {
- return impl.toByteArray();
- }
-
- // org.omg.CORBA.DataOutputStream
- public final void write_Abstract (java.lang.Object value) {
- impl.write_Abstract(value);
- }
-
- public final void write_Value (java.io.Serializable value) {
- impl.write_Value(value);
- }
-
- public final void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length) {
- impl.write_any_array(seq, offset, length);
- }
-
- public void setMessageMediator(MessageMediator messageMediator)
- {
- this.corbaMessageMediator = (CorbaMessageMediator) messageMediator;
- }
-
- public MessageMediator getMessageMediator()
- {
- return corbaMessageMediator;
- }
-
- // org.omg.CORBA.portable.ValueBase
- public final String[] _truncatable_ids() {
- return impl._truncatable_ids();
- }
-
- // Other
- protected final int getSize() {
- return impl.getSize();
- }
-
- protected final int getIndex() {
- return impl.getIndex();
- }
-
- protected int getRealIndex(int index) {
- // Used in indirections. Overridden by TypeCodeOutputStream.
- return index;
- }
-
- protected final void setIndex(int value) {
- impl.setIndex(value);
- }
-
- protected final ByteBuffer getByteBuffer() {
- return impl.getByteBuffer();
- }
-
- protected final void setByteBuffer(ByteBuffer byteBuffer) {
- impl.setByteBuffer(byteBuffer);
- }
-
- public final boolean isLittleEndian() {
- return impl.isLittleEndian();
- }
-
- // XREVISIT - return to final if possible
- // REVISIT - was protected - need access from msgtypes test.
- public ByteBufferWithInfo getByteBufferWithInfo() {
- return impl.getByteBufferWithInfo();
- }
-
- protected void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
- impl.setByteBufferWithInfo(bbwi);
- }
-
- // REVISIT: was protected - but need to access from xgiop.
- public final BufferManagerWrite getBufferManager() {
- return impl.getBufferManager();
- }
-
- public final void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale) {
- impl.write_fixed(bigDecimal, digits, scale);
- }
-
- public final void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) {
- impl.writeOctetSequenceTo(s);
- }
-
- public final GIOPVersion getGIOPVersion() {
- return impl.getGIOPVersion();
- }
-
- public final void writeIndirection(int tag, int posIndirectedTo) {
- impl.writeIndirection(tag, posIndirectedTo);
- }
-
- // Use Latin-1 for GIOP 1.0 or when code set negotiation was not
- // performed.
- protected CodeSetConversion.CTBConverter createCharCTBConverter() {
- return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.ISO_8859_1);
- }
-
- // Subclasses must decide what to do here. It's inconvenient to
- // make the class and this method abstract because of dup().
- protected abstract CodeSetConversion.CTBConverter createWCharCTBConverter();
-
- protected final void freeInternalCaches() {
- impl.freeInternalCaches();
- }
-
- void printBuffer() {
- impl.printBuffer();
- }
-
- public void alignOnBoundary(int octetBoundary) {
- impl.alignOnBoundary(octetBoundary);
- }
-
- // Needed by request and reply messages for GIOP versions >= 1.2 only.
- public void setHeaderPadding(boolean headerPadding) {
- impl.setHeaderPadding(headerPadding);
- }
-
- // ValueOutputStream -----------------------------
-
- public void start_value(String rep_id) {
- impl.start_value(rep_id);
- }
-
- public void end_value() {
- impl.end_value();
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava
deleted file mode 100644
index 016a902825a..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.interceptors;
-
-import com.sun.corba.se.impl.corba.AnyImpl;
-import org.omg.PortableInterceptor.Current;
-import org.omg.PortableInterceptor.InvalidSlot;
-
-import com.sun.corba.se.impl.util.MinorCodes;
-import com.sun.corba.se.impl.core.ORB;
-
-/**
- * ThreadCurrentStack is the container of PICurrent instances for each thread
- */
-public class ThreadCurrentStack
-{
- // PICurrentPool is the container for reusable PICurrents
- private class PICurrentPool {
-
- // Contains a list of reusable PICurrents
- private java.util.ArrayList pool;
-
- // High water mark for the pool
- // If the pool size reaches this limit then putPICurrent will
- // not put PICurrent to the pool.
- private static final int HIGH_WATER_MARK = 5;
-
- // currentIndex points to the last PICurrent in the list
- private int currentIndex;
-
- PICurrentPool( ) {
- pool = new java.util.ArrayList( HIGH_WATER_MARK );
- currentIndex = 0;
- }
-
- /**
- * Puts PICurrent to the re-usable pool.
- */
- void putPICurrent( PICurrent current ) {
- // If there are enough PICurrents in the pool, then don't add
- // this current to the pool.
- if( currentIndex >= HIGH_WATER_MARK ) {
- return;
- }
- pool.add(currentIndex , current);
- currentIndex++;
- }
-
- /**
- * Gets PICurrent from the re-usable pool.
- */
- PICurrent getPICurrent( ) {
- // If there are no entries in the pool then return null
- if( currentIndex == 0 ) {
- return null;
- }
- // Works like a stack, Gets the last one added first
- currentIndex--;
- return (PICurrent) pool.get(currentIndex);
- }
- }
-
- // Contains all the active PICurrents for each thread.
- // The ArrayList is made to behave like a stack.
- private java.util.ArrayList currentContainer;
-
- // Keeps track of number of PICurrents in the stack.
- private int currentIndex;
-
- // For Every Thread there will be a pool of re-usable ThreadCurrent's
- // stored in PICurrentPool
- private PICurrentPool currentPool;
-
- // The orb associated with this ThreadCurrentStack
- private ORB piOrb;
-
- /**
- * Constructs the stack and and PICurrentPool
- */
- ThreadCurrentStack( ORB piOrb, PICurrent current ) {
- this.piOrb = piOrb;
- currentIndex = 0;
- currentContainer = new java.util.ArrayList( );
- currentPool = new PICurrentPool( );
- currentContainer.add( currentIndex, current );
- currentIndex++;
- }
-
-
- /**
- * pushPICurrent goes through the following steps
- * 1: Checks to see if there is any PICurrent in PICurrentPool
- * If present then use that instance to push into the ThreadCurrentStack
- *
- * 2:If there is no PICurrent in the pool, then creates a new one and pushes
- * that into the ThreadCurrentStack
- */
- void pushPICurrent( ) {
- PICurrent current = currentPool.getPICurrent( );
- if( current == null ) {
- // get an existing PICurrent to get the slotSize
- PICurrent currentTemp = peekPICurrent();
- current = new PICurrent( piOrb, currentTemp.getSlotSize( ));
- }
- currentContainer.add( currentIndex, current );
- currentIndex++;
- }
-
- /**
- * popPICurrent does the following
- * 1: pops the top PICurrent in the ThreadCurrentStack
- *
- * 2: resets the slots in the PICurrent which resets the slotvalues to
- * null if there are any previous sets.
- *
- * 3: pushes the reset PICurrent into the PICurrentPool to reuse
- */
- void popPICurrent( ) {
- // Do not pop the PICurrent, If there is only one.
- // This should not happen, But an extra check for safety.
- if( currentIndex <= 1 ) {
- throw new org.omg.CORBA.INTERNAL(
- "Cannot pop the only PICurrent in the stack",
- MinorCodes.CANT_POP_ONLY_CURRENT_2,
- CompletionStatus.COMPLETED_NO );
- }
- currentIndex--;
- PICurrent current = (PICurrent)currentContainer.get( currentIndex );
- current.resetSlots( );
- currentPool.putPICurrent( current );
- }
-
- /**
- * peekPICurrent gets the top PICurrent in the ThreadCurrentStack without
- * popping.
- */
- PICurrent peekPICurrent( ) {
- return (PICurrent) currentContainer.get( currentIndex - 1);
- }
-
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava
deleted file mode 100644
index 0179dfa0bd1..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.orbutil ;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-/** This class provides just a main method. Its purpose is to allow -D arguments to
-* set up the system properties when starting programs with tools like OptimizeIt that
-* make this difficult or impossible.
-*
-* Invocation: {java launcher of some kind} DefineClass -Dxxx=yyy -Dxxx=yyy ... {class name} arg0, arg1, ...
-* Result: updates system properties with -D args, then uses reflection to invoke {class name}.main with the args
-*/
-
-class DefineWrapper {
- public static void main( String[] args )
- {
- int numberDefines = args.length ;
- String className = null ;
-
- for (int ctr=0; ctr and get methods.
-
-
- //
- // Perform case sensitivity test first. This applies to all
- // method names AND attributes. Compare each method name and
- // attribute to all other method names and attributes. If names
- // differ only in case, apply mangling as defined in section 1.3.2.7
- // of Java2IDL spec. Note that we compare using the original names.
- //
- for(Iterator outerIter=allMethodInfo.values().iterator();
- outerIter.hasNext();) {
- IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
- for(Iterator innerIter = allMethodInfo.values().iterator();
- innerIter.hasNext();) {
- IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-
- if( (outer != inner) &&
- (!outer.originalName.equals(inner.originalName)) &&
- outer.originalName.equalsIgnoreCase(inner.originalName) ) {
- outer.mangledName =
- mangleCaseSensitiveCollision(outer.originalName);
- break;
- }
-
- }
- }
-
- for(Iterator iter = allMethodInfo.values().iterator();
- iter.hasNext();) {
- IDLMethodInfo next = (IDLMethodcurrentInfo) iter.next();
- next.mangledName =
- mangleIdentifier(next.mangledName,
- next.propertyType != null);
- }
-
- //
- // Now check for overloaded method names and apply 1.3.2.6.
- //
- for(Iterator outerIter=allMethodInfo.values().iterator();
- outerIter.hasNext();) {
- IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
- if (outer.propertyType != null) {
- continue;
- }
- for(Iterator innerIter = allMethodInfo.values().iterator();
- innerIter.hasNext();) {
- IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-
- if( (outer != inner) &&
- (inner.propertyType == null) &&
- outer.originalName.equals(inner.originalName) ) {
- outer.mangledName = mangleOverloadedMethod
- (outer.mangledName, outer.method);
- break;
- }
- }
- }
-
- //
- // Now mangle any properties that clash with method names.
- //
- for(Iterator outerIter=allMethodInfo.values().iterator();
- outerIter.hasNext();) {
- IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
- if(outer.propertyType == null) {
- continue;
- }
- for(Iterator innerIter = allMethodInfo.values().iterator();
- innerIter.hasNext();) {
- IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
- if( (outer != inner) &&
- (inner.propertyType == null) &&
- outer.mangledName.equals(inner.mangledName) ) {
- outer.mangledName = outer.mangledName +
- ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS;
- break;
- }
- }
- }
-
- //
- // Ensure that no mapped method names clash with mapped name
- // of container(1.3.2.9). This is a case insensitive comparison.
- //
- for (int ctr=0; ctr and get,
- // map only is to an attribute, and leave the
- // get method alone.
- if( IDLNameToMethodMap_.containsKey(idlName) ) {
- // @@@ I18N
- Method clash = (Method) IDLNameToMethodMap_.get(idlName);
- MethodInfo clashMethodInfo =
- (MethodInfo)allMethodInfo.get( clash ) ;
- if (clashMethodInfo.isBooleanProperty() &&
- next.isReadProperty()) {
- // fix idlName
- } else if (clashMethodInfo.isReadProperty() &&
- next.isBooleanProperty()) {
- // Remove entry under idlName
- // put entry into table under correct name
- } else {
- throw new IllegalStateException("Error : methods " +
- clash + " and " + next.method +
- " both result in IDL name '" + idlName + "'");
- }
- }
-
- IDLNameToMethodMap_.put(idlName, next.method);
- }
-
- return;
-
- }
-
-
- /**
- * Perform all necessary stand-alone identifier mangling operations
- * on a java identifier that is being transformed into an IDL name.
- * That is, mangling operations that don't require looking at anything
- * else but the identifier itself. This covers sections 1.3.2.2, 1.3.2.3,
- * and 1.3.2.4 of the Java2IDL spec. Method overloading and
- * case-sensitivity checks are handled elsewhere.
- */
-
- private static String mangleIdentifier(String identifier) {
- return mangleIdentifier(identifier, false);
- }
-
- private static String mangleIdentifier(String identifier, boolean attribute) {
-
- String mangledName = identifier;
-
- //
- // Apply leading underscore test (1.3.2.3)
- // This should be done before IDL Keyword clash test, since clashing
- // IDL keywords are mangled by adding a leading underscore.
- //
- if( hasLeadingUnderscore(mangledName) ) {
- mangledName = mangleLeadingUnderscore(mangledName);
- }
-
- //
- // Apply IDL keyword clash test (1.3.2.2).
- // This is not needed for attributes since when the full property
- // name is composed it cannot clash with an IDL keyword.
- // (Also, rmic doesn't do it.)
- //
-
- if( !attribute && isIDLKeyword(mangledName) ) {
- mangledName = mangleIDLKeywordClash(mangledName);
- }
-
- //
- // Replace illegal IDL identifier characters (1.3.2.4)
- // for all method names and attributes.
- //
- if( !isIDLIdentifier(mangledName) ) {
- mangledName = mangleUnicodeChars(mangledName);
- }
-
- return mangledName;
- }
-
- /**
- * Checks whether a java identifier clashes with an
- * IDL keyword. Note that this is a case-insensitive
- * comparison.
- *
- * Used to implement section 1.3.2.2 of Java2IDL spec.
- */
- private static boolean isIDLKeyword(String identifier) {
-
- String identifierAllCaps = identifier.toUpperCase();
-
- return idlKeywords_.contains(identifierAllCaps);
- }
-
- private static String mangleIDLKeywordClash(String identifier) {
- return UNDERSCORE + identifier;
- }
-
- private static String mangleLeadingUnderscore(String identifier) {
- return LEADING_UNDERSCORE_CHAR + identifier;
- }
-
- /**
- * Checks whether a java identifier starts with an underscore.
- * Used to implement section 1.3.2.3 of Java2IDL spec.
- */
- private static boolean hasLeadingUnderscore(String identifier) {
- return identifier.startsWith(UNDERSCORE);
- }
-
- /**
- * Implements Section 1.3.2.4 of Java2IDL Mapping.
- * All non-IDL identifier characters must be replaced
- * with their Unicode representation.
- */
- static String mangleUnicodeChars(String identifier) {
- StringBuffer mangledIdentifier = new StringBuffer();
-
- for(int i = 0; i < identifier.length(); i++) {
- char nextChar = identifier.charAt(i);
- if( isIDLIdentifierChar(nextChar) ) {
- mangledIdentifier.append(nextChar);
- } else {
- String unicode = charToUnicodeRepresentation(nextChar);
- mangledIdentifier.append(unicode);
- }
- }
-
- return mangledIdentifier.toString();
- }
-
- /**
- * Implements mangling portion of Section 1.3.2.7 of Java2IDL spec.
- * This method only deals with the actual mangling. Decision about
- * whether case-sensitive collision mangling is required is made
- * elsewhere.
- *
- *
- * "...a mangled name is generated consisting of the original name
- * followed by an underscore separated list of decimal indices
- * into the string, where the indices identify all the upper case
- * characters in the original string. Indices are zero based."
- *
- */
- String mangleCaseSensitiveCollision(String identifier) {
-
- StringBuffer mangledIdentifier = new StringBuffer(identifier);
-
- // There is always at least one trailing underscore, whether or
- // not the identifier has uppercase letters.
- mangledIdentifier.append(UNDERSCORE);
-
- boolean needUnderscore = false;
- for(int i = 0; i < identifier.length(); i++) {
- char next = identifier.charAt(i);
- if( Character.isUpperCase(next) ) {
- // This bit of logic is needed to ensure that we have
- // an underscore separated list of indices but no
- // trailing underscores. Basically, after we have at least
- // one uppercase letter, we always put an undercore before
- // printing the next one.
- if( needUnderscore ) {
- mangledIdentifier.append(UNDERSCORE);
- }
- mangledIdentifier.append(i);
- needUnderscore = true;
- }
- }
-
- return mangledIdentifier.toString();
- }
-
- private static String mangleContainerClash(String identifier) {
- return identifier + ID_CONTAINER_CLASH_CHAR;
- }
-
- /**
- * Implements Section 1.3.2.9 of Java2IDL Mapping. Container in this
- * context means the name of the java Class(excluding package) in which
- * the identifier is defined. Comparison is case-insensitive.
- */
- private static boolean identifierClashesWithContainer
- (String mappedContainerName, String identifier) {
-
- return identifier.equalsIgnoreCase(mappedContainerName);
- }
-
- /**
- * Returns Unicode mangling as defined in Section 1.3.2.4 of
- * Java2IDL spec.
- *
- * "For Java identifiers that contain illegal OMG IDL identifier
- * characters such as '$' or Unicode characters outside of ISO Latin 1,
- * any such illegal characters are replaced by "U" followed by the
- * 4 hexadecimal characters(in upper case) representing the Unicode
- * value. So, the Java name a$b is mapped to aU0024b and
- * x\u03bCy is mapped to xU03BCy."
- */
- public static String charToUnicodeRepresentation(char c) {
-
- int orig = (int) c;
- StringBuffer hexString = new StringBuffer();
-
- int value = orig;
-
- while( value > 0 ) {
- int div = value / 16;
- int mod = value % 16;
- hexString.insert(0, HEX_DIGITS[mod]);
- value = div;
- }
-
- int numZerosToAdd = 4 - hexString.length();
- for(int i = 0; i < numZerosToAdd; i++) {
- hexString.insert(0, "0");
- }
-
- hexString.insert(0, "U");
- return hexString.toString();
- }
-
- private static boolean isIDLIdentifier(String identifier) {
-
- boolean isIdentifier = true;
-
- for(int i = 0; i < identifier.length(); i++) {
- char nextChar = identifier.charAt(i);
- // 1st char must be alphbetic.
- isIdentifier = (i == 0) ?
- isIDLAlphabeticChar(nextChar) :
- isIDLIdentifierChar(nextChar);
- if( !isIdentifier ) {
- break;
- }
- }
-
- return isIdentifier;
-
- }
-
- private static boolean isIDLIdentifierChar(char c) {
- return (isIDLAlphabeticChar(c) ||
- isIDLDecimalDigit(c) ||
- isUnderscore(c));
- }
-
- /**
- * True if character is one of 114 Alphabetic characters as
- * specified in Table 2 of Chapter 3 in CORBA spec.
- */
- private static boolean isIDLAlphabeticChar(char c) {
-
- // NOTE that we can't use the java.lang.Character
- // isUpperCase, isLowerCase, etc. methods since they
- // include many characters other than the Alphabetic list in
- // the CORBA spec. Instead, we test for inclusion in the
- // Unicode value ranges for the corresponding legal characters.
-
- boolean alphaChar =
- (
- // A - Z
- ((c >= 0x0041) && (c <= 0x005A))
-
- ||
-
- // a - z
- ((c >= 0x0061) && (c <= 0x007A))
-
- ||
-
- // other letter uppercase, other letter lowercase, which is
- // the entire upper half of C1 Controls except X and /
- ((c >= 0x00C0) && (c <= 0x00FF)
- && (c != 0x00D7) && (c != 0x00F7)));
-
- return alphaChar;
- }
-
- /**
- * True if character is one of 10 Decimal Digits
- * specified in Table 3 of Chapter 3 in CORBA spec.
- */
- private static boolean isIDLDecimalDigit(char c) {
- return ( (c >= 0x0030) && (c <= 0x0039) );
- }
-
- private static boolean isUnderscore(char c) {
- return ( c == 0x005F );
- }
-
- /**
- * Mangle an overloaded method name as defined in Section 1.3.2.6 of
- * Java2IDL spec. Current value of method name is passed in as argument.
- * We can't start from original method name since the name might have
- * been partially mangled as a result of the other rules.
- */
- private static String mangleOverloadedMethod(String mangledName, Method m) {
-
- IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-
- // Start by appending the separator string
- String newMangledName = mangledName + OVERLOADED_TYPE_SEPARATOR;
-
- Class[] parameterTypes = m.getParameterTypes();
-
- for(int i = 0; i < parameterTypes.length; i++) {
- Class nextParamType = parameterTypes[i];
-
- if( i > 0 ) {
- newMangledName = newMangledName + OVERLOADED_TYPE_SEPARATOR;
- }
- IDLType idlType = classToIDLType(nextParamType);
-
- String moduleName = idlType.getModuleName();
- String memberName = idlType.getMemberName();
-
- String typeName = (moduleName.length() > 0) ?
- moduleName + UNDERSCORE + memberName : memberName;
-
- if( !idlTypesUtil.isPrimitive(nextParamType) &&
- (idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType)
- == null) &&
- isIDLKeyword(typeName) ) {
- typeName = mangleIDLKeywordClash(typeName);
- }
-
- typeName = mangleUnicodeChars(typeName);
-
- newMangledName = newMangledName + typeName;
- }
-
- return newMangledName;
- }
-
-
- private static IDLType classToIDLType(Class c) {
-
- IDLType idlType = null;
- IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-
- if( idlTypesUtil.isPrimitive(c) ) {
-
- idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c);
-
- } else if( c.isArray() ) {
-
- // Calculate array depth, as well as base element type.
- Class componentType = c.getComponentType();
- int numArrayDimensions = 1;
- while(componentType.isArray()) {
- componentType = componentType.getComponentType();
- numArrayDimensions++;
- }
- IDLType componentIdlType = classToIDLType(componentType);
-
- String[] modules = BASE_IDL_ARRAY_MODULE_TYPE;
- if( componentIdlType.hasModule() ) {
- modules = (String[])ObjectUtility.concatenateArrays( modules,
- componentIdlType.getModules() ) ;
- }
-
- String memberName = BASE_IDL_ARRAY_ELEMENT_TYPE +
- numArrayDimensions + UNDERSCORE +
- componentIdlType.getMemberName();
-
- idlType = new IDLType(c, modules, memberName);
-
- } else {
- idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c);
-
- if (idlType == null) {
- // Section 1.3.2.5 of Java2IDL spec defines mangling rules for
- // inner classes.
- String memberName = getUnmappedContainerName(c);
-
- // replace inner class separator with double underscore
- memberName = memberName.replaceAll("\\$",
- INNER_CLASS_SEPARATOR);
-
- if( hasLeadingUnderscore(memberName) ) {
- memberName = mangleLeadingUnderscore(memberName);
- }
-
- // Get raw package name. If there is a package, it
- // will still have the "." separators and none of the
- // mangling rules will have been applied.
- String packageName = getPackageName(c);
-
- if (packageName == null) {
- idlType = new IDLType( c, memberName ) ;
- } else {
- // If this is a generated IDL Entity Type we need to
- // prepend org_omg_boxedIDL per sections 1.3.5 and 1.3.9
- if (idlTypesUtil.isEntity(c)) {
- packageName = "org.omg.boxedIDL." + packageName ;
- }
-
- // Section 1.3.2.1 and 1.3.2.6 of Java2IDL spec defines
- // rules for mapping java packages to IDL modules and for
- // mangling module name portion of type name. NOTE that
- // of the individual identifier mangling rules,
- // only the leading underscore test is done here.
- // The other two(IDL Keyword, Illegal Unicode chars) are
- // done in mangleOverloadedMethodName.
- StringTokenizer tokenizer =
- new StringTokenizer(packageName, ".");
-
- String[] modules = new String[ tokenizer.countTokens() ] ;
- int index = 0 ;
- while (tokenizer.hasMoreElements()) {
- String next = tokenizer.nextToken();
- String nextMangled = hasLeadingUnderscore(next) ?
- mangleLeadingUnderscore(next) : next;
-
- modules[index++] = nextMangled ;
- }
-
- idlType = new IDLType(c, modules, memberName);
- }
- }
- }
-
- return idlType;
- }
-
- /**
- * Return Class' package name or null if there is no package.
- */
- private static String getPackageName(Class c) {
- Package thePackage = c.getPackage();
- String packageName = null;
-
- // Try to get package name by introspection. Some classloaders might
- // not provide this information, so check for null.
- if( thePackage != null ) {
- packageName = thePackage.getName();
- } else {
- // brute force method
- String fullyQualifiedClassName = c.getName();
- int lastDot = fullyQualifiedClassName.indexOf('.');
- packageName = (lastDot == -1) ? null :
- fullyQualifiedClassName.substring(0, lastDot);
- }
- return packageName;
- }
-
- private static String getMappedContainerName(Class c) {
- String unmappedName = getUnmappedContainerName(c);
-
- return mangleIdentifier(unmappedName);
- }
-
- /**
- * Return portion of class name excluding package name.
- */
- private static String getUnmappedContainerName(Class c) {
-
- String memberName = null;
- String packageName = getPackageName(c);
-
- String fullyQualifiedClassName = c.getName();
-
- if( packageName != null ) {
- int packageLength = packageName.length();
- memberName = fullyQualifiedClassName.substring(packageLength + 1);
- } else {
- memberName = fullyQualifiedClassName;
-
- }
-
- return memberName;
- }
-
- /**
- * Internal helper class for tracking information related to each
- * interface method while we're building the name translation table.
- */
- private static class IDLMethodInfo
- {
- public Method method;
- public String propertyType;
-
- // If this is a property, originalName holds the original
- // attribute name. Otherwise, it holds the original method name.
- public String originalName;
-
- // If this is a property, mangledName holds the mangled attribute
- // name. Otherwise, it holds the mangled method name.
- public String mangledName;
-
- }
-
- public String toString() {
-
- StringBuffer contents = new StringBuffer();
- contents.append("IDLNameTranslator[" );
- for( int ctr=0; ctr 0 ) {
- String className = args[0];
- try {
- remoteInterface = Class.forName(className);
- } catch(Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
- }
-
- System.out.println("Building name translation for " + remoteInterface);
- try {
- IDLNameTranslator nameTranslator =
- IDLNameTranslatorImpl.get(remoteInterface);
- System.out.println(nameTranslator);
- } catch(IllegalStateException ise) {
- ise.printStackTrace();
- }
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava
deleted file mode 100644
index 66bf284375e..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.presentation.rmi ;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Field;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * Utility class for testing RMI/IDL Types as defined in
- * Section 1.2 of The Java Language to IDL Mapping. Note that
- * these are static checks only. Runtime checks, such as those
- * described in Section 1.2.3, #3, are not covered.
- */
-public class IDLTypesUtil {
-
- public static final String JAVA_GET_PROPERTY_PREFIX = "get";
- public static final String JAVA_SET_PROPERTY_PREFIX = "set";
- public static final String JAVA_IS_PROPERTY_PREFIX = "is";
-
- public static final int VALID_TYPE = 0;
- public static final int INVALID_TYPE = 1;
-
- /**
- * Validate a class to ensure it conforms to the rules for a
- * Java RMI/IIOP interface.
- *
- * @throws IDLTypeException if not a valid RMI/IIOP interface.
- */
- public void validateRemoteInterface(Class c) throws IDLTypeException
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( !c.isInterface() ) {
- String msg = "Class " + c + " must be a java interface.";
- throw new IDLTypeException(msg);
- }
-
- if( !java.rmi.Remote.class.isAssignableFrom(c) ) {
- String msg = "Class " + c + " must extend java.rmi.Remote, " +
- "either directly or indirectly.";
- throw new IDLTypeException(msg);
- }
-
- // Get all methods, including super-interface methods.
- Method[] methods = c.getMethods();
-
- for(int i = 0; i < methods.length; i++) {
- Method next = methods[i];
- validateExceptions(next);
- }
-
- // Removed because of bug 4989053
- // validateDirectInterfaces(c);
- validateConstants(c);
-
- return;
- }
-
- public boolean isRemoteInterface(Class c)
- {
- boolean remoteInterface = true;
- try {
- validateRemoteInterface(c);
- } catch(IDLTypeException ite) {
- remoteInterface = false;
- }
-
- return remoteInterface;
- }
-
- /**
- * Section 1.2.2 Primitive Types
- */
- public boolean isPrimitive(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return c.isPrimitive();
- }
-
- /**
- * Section 1.2.4
- */
- public boolean isValue(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return
- (!c.isInterface() &&
- java.io.Serializable.class.isAssignableFrom(c) &&
- !java.rmi.Remote.class.isAssignableFrom(c));
- }
-
- /**
- * Section 1.2.5
- */
- public boolean isArray(Class c)
- {
- boolean arrayType = false;
-
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( c.isArray() ) {
- Class componentType = c.getComponentType();
- arrayType =
- (isPrimitive(componentType) || isRemoteInterface(componentType) ||
- isEntity(componentType) || isException(componentType) ||
- isValue(componentType) || isObjectReference(componentType) );
- }
-
- return arrayType;
- }
-
- /**
- * Section 1.2.6
- */
- public boolean isException(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- // Must be a checked exception, not including RemoteException or
- // its subclasses.
- return isCheckedException(c) && !isRemoteException(c) && isValue(c);
- }
-
- public boolean isRemoteException(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return java.rmi.RemoteException.class.isAssignableFrom(c) ;
- }
-
- public boolean isCheckedException(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return Throwable.class.isAssignableFrom(c) &&
- !RuntimeException.class.isAssignableFrom(c) &&
- !Error.class.isAssignableFrom(c) ;
- }
-
- /**
- * Section 1.2.7
- */
- public boolean isObjectReference(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return (c.isInterface() &&
- org.omg.CORBA.Object.class.isAssignableFrom(c));
- }
-
- /**
- * Section 1.2.8
- */
- public boolean isEntity(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- Class superClass = c.getSuperclass();
- return (!c.isInterface() &&
- (superClass != null) &&
- (org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c)));
- }
-
- public String javaPropertyPrefixToIDL( String javaPrefix )
- {
- return "_" + javaPrefix + "_" ;
- }
-
- /**
- * Return the property type if given method is legal property accessor as defined in
- * Section 1.3.4.3 of Java2IDL spec. Result is one of: JAVA_GET_PROPERTY_PREFIX,
- * JAVA_SET_PROPERTY_PREFIX, JAVA_IS_PROPERTY_PREFIX.
- */
- public String propertyAccessorMethodType(Method m, Class c) {
-
- String methodName = m.getName();
- Class returnType = m.getReturnType();
- Class[] parameters = m.getParameterTypes();
- Class[] exceptionTypes = m.getExceptionTypes();
- String propertyType = null;
-
- if( methodName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
-
- if((parameters.length == 0) && (returnType != Void.TYPE) &&
- !hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX) {
- propertyType = JAVA_GET_PROPERTY_PREFIX;
- }
-
- } else if( methodName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
-
- if((returnType == Void.TYPE) && (parameters.length == 1)) {
- if (hasCorrespondingReadProperty(m, c, JAVA_GET_PROPERTY_PREFIX) ||
- hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX)) {
- propertyType = JAVA_SET_PROPERTY_PREFIX;
- }
- }
-
- } else if( methodName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
- if((parameters.length == 0) && (returnType == Boolean.TYPE)) {
- propertyType = JAVA_IS_PROPERTY_PREFIX;
- }
- }
-
- // Some final checks that apply to all properties.
- if( propertyType != null ) {
- if(!validPropertyExceptions(m) ||
- (methodName.length() <= propertyType.length())) {
- propertyType = null;
- }
- }
-
- return propertyType ;
- }
-
- private boolean hasCorrespondingReadProperty
- (Method writeProperty, Class c, String readPropertyPrefix) {
-
- String writePropertyMethodName = writeProperty.getName();
- Class[] writePropertyParameters = writeProperty.getParameterTypes();
- boolean foundReadProperty = false;
-
- try {
- // Look for a valid corresponding Read property
- String readPropertyMethodName =
- writePropertyMethodName.replaceFirst
- (JAVA_SET_PROPERTY_PREFIX, readPropertyPrefix);
- Method readPropertyMethod = c.getMethod(readPropertyMethodName,
- new Class[] {});
- foundReadProperty =
- ((propertyAccessorMethodType(readPropertyMethod, c) != null) &&
- (readPropertyMethod.getReturnType() ==
- writePropertyParameters[0]));
- } catch(Exception e) {
- // ignore. this means we didn't find a corresponding get property.
- }
-
- return foundReadProperty;
- }
-
- public String getAttributeNameForProperty(String propertyName) {
- String attributeName = null;
- String prefix = null;
-
- if( propertyName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
- prefix = JAVA_GET_PROPERTY_PREFIX;
- } else if( propertyName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
- prefix = JAVA_SET_PROPERTY_PREFIX;
- } else if( propertyName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
- prefix = JAVA_IS_PROPERTY_PREFIX;
- }
-
- if( (prefix != null) && (prefix.length() < propertyName.length()) ) {
- String remainder = propertyName.substring(prefix.length());
- if( (remainder.length() >= 2) &&
- Character.isUpperCase(remainder.charAt(0)) &&
- Character.isUpperCase(remainder.charAt(1)) ) {
- // don't set the first letter to lower-case if the
- // first two are upper-case
- attributeName = remainder;
- } else {
- attributeName = Character.toLowerCase(remainder.charAt(0)) +
- remainder.substring(1);
- }
- }
-
- return attributeName;
- }
-
- /**
- * Return IDL Type name for primitive types as defined in
- * Section 1.3.3 of Java2IDL spec or null if not a primitive type.
- */
- public IDLType getPrimitiveIDLTypeMapping(Class c) {
-
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( c.isPrimitive() ) {
- if( c == Void.TYPE ) {
- return new IDLType( c, "void" ) ;
- } else if( c == Boolean.TYPE ) {
- return new IDLType( c, "boolean" ) ;
- } else if( c == Character.TYPE ) {
- return new IDLType( c, "wchar" ) ;
- } else if( c == Byte.TYPE ) {
- return new IDLType( c, "octet" ) ;
- } else if( c == Short.TYPE ) {
- return new IDLType( c, "short" ) ;
- } else if( c == Integer.TYPE ) {
- return new IDLType( c, "long" ) ;
- } else if( c == Long.TYPE ) {
- return new IDLType( c, "long_long" ) ;
- } else if( c == Float.TYPE ) {
- return new IDLType( c, "float" ) ;
- } else if( c == Double.TYPE ) {
- return new IDLType( c, "double" ) ;
- }
- }
-
- return null;
- }
-
- /**
- * Return IDL Type name for special case type mappings as defined in
- * Table 1-1 of Java2IDL spec or null if given class is not a special
- * type.
- */
- public IDLType getSpecialCaseIDLTypeMapping(Class c) {
-
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( c == java.lang.Object.class ) {
- return new IDLType( c, new String[] { "java", "lang" },
- "Object" ) ;
- } else if( c == java.lang.String.class ) {
- return new IDLType( c, new String[] { "CORBA" },
- "WStringValue" ) ;
- } else if( c == java.lang.Class.class ) {
- return new IDLType( c, new String[] { "javax", "rmi", "CORBA" },
- "ClassDesc" ) ;
- } else if( c == java.io.Serializable.class ) {
- return new IDLType( c, new String[] { "java", "io" },
- "Serializable" ) ;
- } else if( c == java.io.Externalizable.class ) {
- return new IDLType( c, new String[] { "java", "io" },
- "Externalizable" ) ;
- } else if( c == java.rmi.Remote.class ) {
- return new IDLType( c, new String[] { "java", "rmi" },
- "Remote" ) ;
- } else if( c == org.omg.CORBA.Object.class ) {
- return new IDLType( c, "Object" ) ;
- } else {
- return null;
- }
- }
-
- /**
- * Implements 1.2.3 #2 and #4
- */
- private void validateExceptions(Method method) throws IDLTypeException {
-
- Class[] exceptions = method.getExceptionTypes();
-
- boolean declaresRemoteExceptionOrSuperClass = false;
-
- // Section 1.2.3, #2
- for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
- Class exception = exceptions[eIndex];
- if( isRemoteExceptionOrSuperClass(exception) ) {
- declaresRemoteExceptionOrSuperClass = true;
- break;
- }
- }
-
- if( !declaresRemoteExceptionOrSuperClass ) {
- String msg = "Method '" + method + "' must throw at least one " +
- "exception of type java.rmi.RemoteException or one of its " +
- "super-classes";
- throw new IDLTypeException(msg);
- }
-
- // Section 1.2.3, #4
- // See also bug 4972402
- // For all exceptions E in exceptions,
- // (isCheckedException(E) => (isValue(E) || RemoteException.isAssignableFrom( E ) )
- for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
- Class exception = exceptions[eIndex];
-
- if (isCheckedException(exception) && !isValue(exception) &&
- !isRemoteException(exception))
- {
- String msg = "Exception '" + exception + "' on method '" +
- method + "' is not a allowed RMI/IIOP exception type";
- throw new IDLTypeException(msg);
- }
- }
-
- return;
- }
-
- /**
- * Returns true if the method's throw clause conforms to the exception
- * restrictions for properties as defined in Section 1.3.4.3 of
- * Java2IDL spec. This means that for all exceptions E declared on the
- * method, E isChecked => RemoteException.isAssignableFrom( E ).
- */
- private boolean validPropertyExceptions(Method method)
- {
- Class[] exceptions = method.getExceptionTypes();
-
- for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
- Class exception = exceptions[eIndex];
-
- if (isCheckedException(exception) && !isRemoteException(exception))
- return false ;
- }
-
- return true;
- }
-
- /**
- * Implements Section 1.2.3, #2.
- */
- private boolean isRemoteExceptionOrSuperClass(Class c) {
- return
- ((c == java.rmi.RemoteException.class) ||
- (c == java.io.IOException.class) ||
- (c == java.lang.Exception.class) ||
- (c == java.lang.Throwable.class));
- }
-
- /**
- * Implements Section 1.2.3, #5.
- */
- private void validateDirectInterfaces(Class c) throws IDLTypeException {
-
- Class[] directInterfaces = c.getInterfaces();
-
- if( directInterfaces.length < 2 ) {
- return;
- }
-
- Set allMethodNames = new HashSet();
- Set currentMethodNames = new HashSet();
-
- for(int i = 0; i < directInterfaces.length; i++) {
- Class next = directInterfaces[i];
- Method[] methods = next.getMethods();
-
- // Comparison is based on method names only. First collect
- // all methods from current interface, eliminating duplicate
- // names.
- currentMethodNames.clear();
- for(int m = 0; m < methods.length; m++) {
- currentMethodNames.add(methods[m].getName());
- }
-
- // Now check each method against list of all unique method
- // names processed so far.
- for(Iterator iter=currentMethodNames.iterator(); iter.hasNext();) {
- String methodName = (String) iter.next();
- if( allMethodNames.contains(methodName) ) {
- String msg = "Class " + c + " inherits method " +
- methodName + " from multiple direct interfaces.";
- throw new IDLTypeException(msg);
- } else {
- allMethodNames.add(methodName);
- }
- }
- }
-
- return;
- }
-
- /**
- * Implements 1.2.3 #6
- */
- private void validateConstants(final Class c)
- throws IDLTypeException {
-
- Field[] fields = null;
-
- try {
- fields = (Field[])
- java.security.AccessController.doPrivileged
- (new java.security.PrivilegedExceptionAction() {
- public java.lang.Object run() throws Exception {
- return c.getFields();
- }
- });
- } catch(java.security.PrivilegedActionException pae) {
- IDLTypeException ite = new IDLTypeException();
- ite.initCause(pae);
- throw ite;
- }
-
- for(int i = 0; i < fields.length; i++) {
- Field next = fields[i];
- Class fieldType = next.getType();
- if( (fieldType != java.lang.String.class) &&
- !isPrimitive(fieldType) ) {
- String msg = "Constant field '" + next.getName() +
- "' in class '" + next.getDeclaringClass().getName() +
- "' has invalid type' " + next.getType() + "'. Constants" +
- " in RMI/IIOP interfaces can only have primitive" +
- " types and java.lang.String types.";
- throw new IDLTypeException(msg);
- }
- }
-
-
- return;
- }
-
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava
deleted file mode 100644
index 6279ff6acb6..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.iiop;
-
-import com.sun.corba.se.impl.protocol.Request;
-import com.sun.corba.se.impl.core.ClientRequest;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.core.ServerRequest;
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.corba.GIOPVersion;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.core.ORBVersion;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.orbutil.ORBUtility;
-import com.sun.corba.se.impl.ior.ObjectKeyFactory ;
-import com.sun.corba.se.impl.ior.ObjectKey ;
-import com.sun.corba.se.impl.ior.ObjectKeyTemplate ;
-import com.sun.corba.se.impl.ior.IIOPProfile;
-
-public class LocalClientRequestImpl extends IIOPOutputStream
- implements ClientRequest
-{
- public LocalClientRequestImpl( GIOPVersion gv,
- ORB orb, IOR ior, short addrDisposition,
- String operationName, boolean oneway, ServiceContexts svc,
- int requestId, byte streamFormatVersion)
- {
- super(gv,
- orb,
- null,
- BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
- streamFormatVersion);
-
- this.isOneway = oneway;
- boolean responseExpected = !isOneway;
-
- IIOPProfile iop = ior.getProfile();
- ObjectKey okey = iop.getObjectKey();
- ObjectKeyTemplate oktemp = okey.getTemplate() ;
- ORBVersion version = oktemp.getORBVersion() ;
- orb.setORBVersion( version ) ;
-
- this.request = MessageBase.createRequest(orb, gv, requestId,
- responseExpected, ior, addrDisposition, operationName, svc, null);
- setMessage(request);
- request.write(this);
-
- // mark beginning of msg body for possible later use
- bodyBegin = getSize();
- }
-
- public int getRequestId() {
- return request.getRequestId();
- }
-
- public boolean isOneWay() {
- return isOneway;
- }
-
- public ServiceContexts getServiceContexts() {
- return request.getServiceContexts();
- }
-
- public String getOperationName() {
- return request.getOperation();
- }
-
- public ObjectKey getObjectKey() {
- return request.getObjectKey();
- }
-
- public ServerRequest getServerRequest()
- {
- // Set the size of the marshalled data in the message header.
- getMessage().setSize( getByteBuffer(), getSize() ) ;
-
- // Construct a new ServerRequest out of the buffer in this ClientRequest
- LocalServerRequestImpl serverRequest = new LocalServerRequestImpl(
- (ORB)orb(), toByteArray(), request ) ;
-
- // Skip over all of the GIOP header information. This positions
- // the offset in the buffer so that the skeleton can correctly read
- // the marshalled arguments.
- serverRequest.setIndex( bodyBegin ) ;
-
- return serverRequest ;
- }
-
- public ClientResponse invoke()
- {
- ORB myORB = (ORB)orb() ;
-
- ServerResponse serverResponse = myORB.process( getServerRequest() ) ;
-
- LocalServerResponseImpl lsr = (LocalServerResponseImpl)serverResponse ;
-
- return lsr.getClientResponse() ;
- }
-
- /**
- * Check to see if the request is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private RequestMessage request;
- private int bodyBegin;
- private boolean isOneway;
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava
deleted file mode 100644
index 24f40e7249f..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.iiop;
-
-import java.io.IOException;
-
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.CompletionStatus;
-
-import com.sun.corba.se.impl.core.Response;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-import com.sun.corba.se.impl.orbutil.MinorCodes;
-
-class LocalClientResponseImpl extends IIOPInputStream implements ClientResponse
-{
- LocalClientResponseImpl(ORB orb, byte[] buf, ReplyMessage header)
- {
- super(orb, buf, header.getSize(), header.isLittleEndian(), header, null);
-
- this.reply = header;
-
- // NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin)
- // in LocalServerResponse.getClientResponse(), then we do not need
- // to read the headers (done below) anymore.
- // This will be an optimisation which is can be done to speed up the
- // local invocation by avoiding reading the headers in the local cases.
-
- // BUGFIX(Ram Jeyaraman) This has been moved from
- // LocalServerResponse.getClientResponse()
- // Skip over all of the GIOP header information. This positions
- // the offset in the buffer so that the skeleton can correctly read
- // the marshalled arguments.
- this.setIndex(Message.GIOPMessageHeaderLength);
-
- // BUGFIX(Ram Jeyaraman) For local invocations, the reply mesg fields
- // needs to be set, by reading the response buffer contents
- // to correctly set the exception type and other info.
- this.reply.read(this);
- }
-
- LocalClientResponseImpl(SystemException ex)
- {
- this.systemException = ex;
- }
-
- public boolean isSystemException() {
- if ( reply != null )
- return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
- else
- return (systemException != null);
- }
-
- public boolean isUserException() {
- if ( reply != null )
- return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
- else
- return false;
- }
-
- public boolean isLocationForward() {
- if ( reply != null ) {
- return ( (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD) ||
- (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD_PERM) );
- //return reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD;
- } else {
- return false;
- }
- }
-
- public boolean isDifferentAddrDispositionRequested() {
- if (reply != null) {
- return reply.getReplyStatus() == ReplyMessage.NEEDS_ADDRESSING_MODE;
- }
-
- return false;
- }
-
- public short getAddrDisposition() {
- if (reply != null) {
- return reply.getAddrDisposition();
- }
-
- throw new org.omg.CORBA.INTERNAL(
- "Null reply in getAddrDisposition",
- MinorCodes.NULL_REPLY_IN_GET_ADDR_DISPOSITION,
- CompletionStatus.COMPLETED_MAYBE);
- }
-
- public IOR getForwardedIOR() {
- if ( reply != null )
- return reply.getIOR();
- else
- return null;
- }
-
- public int getRequestId() {
- if ( reply != null )
- return reply.getRequestId();
- else
- throw new org.omg.CORBA.INTERNAL("Error in getRequestId");
- }
-
- public ServiceContexts getServiceContexts() {
- if ( reply != null )
- return reply.getServiceContexts();
- else
- return null;
- }
-
- public SystemException getSystemException() {
- if ( reply != null )
- return reply.getSystemException();
- else
- return systemException;
- }
-
- public java.lang.String peekUserExceptionId() {
- mark(Integer.MAX_VALUE);
- String result = read_string();
- reset();
- return result;
- }
-
- /**
- * Check to see if the response is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private ReplyMessage reply;
- private SystemException systemException;
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava
deleted file mode 100644
index ecafbee3947..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.iiop;
-
-import org.omg.CORBA.SystemException;
-
-import com.sun.corba.se.impl.core.ServerRequest;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.DuplicateServiceContext;
-import com.sun.corba.se.impl.core.UEInfoServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.orbutil.ORBUtility; //d11638
-import org.omg.CORBA.portable.UnknownException;
-import org.omg.CORBA.UNKNOWN;
-import org.omg.CORBA.CompletionStatus;
-import com.sun.corba.se.impl.ior.ObjectKey;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
-
-class LocalServerRequestImpl extends IIOPInputStream implements ServerRequest {
- org.omg.CORBA.portable.OutputStream replyStream;
- org.omg.CORBA.portable.OutputStream exceptionReplyStream;
-
- LocalServerRequestImpl(ORB orb, byte[] buf, RequestMessage header)
- {
- super(orb, buf, header.getSize(), header.isLittleEndian(), header, null );
-
- this.request = header;
- }
-
- public int getRequestId() {
- return request.getRequestId();
- }
-
- public boolean isOneWay() {
- return !request.isResponseExpected();
- }
-
- public ServiceContexts getServiceContexts() {
- return request.getServiceContexts();
- }
-
- public String getOperationName() {
- return request.getOperation();
- }
-
- public ObjectKey getObjectKey() {
- return request.getObjectKey();
- }
-
- public ServerResponse createResponse(ServiceContexts svc)
- {
- return new LocalServerResponseImpl(this, svc);
- }
-
- public org.omg.CORBA.portable.OutputStream createReply() {
- if (replyStream == null) {
- replyStream = (org.omg.CORBA.portable.OutputStream)
- createResponse(null);
- }
- return replyStream;
- }
-
- public org.omg.CORBA.portable.OutputStream createExceptionReply() {
- if (exceptionReplyStream == null) {
- exceptionReplyStream = (org.omg.CORBA.portable.OutputStream)
- createUserExceptionResponse(null);
- }
- return exceptionReplyStream;
- }
-
- public ServerResponse createUserExceptionResponse(
- ServiceContexts svc)
- {
- return new LocalServerResponseImpl(this, svc, true);
- }
-
- public ServerResponse createUnknownExceptionResponse(
- UnknownException ex) {
- ServiceContexts contexts = null;
- SystemException sys = new UNKNOWN( 0,
- CompletionStatus.COMPLETED_MAYBE);
-
- try {
- contexts = new ServiceContexts( (ORB)orb() );
- UEInfoServiceContext uei = new UEInfoServiceContext(sys);
- contexts.put(uei) ;
- } catch (DuplicateServiceContext d) {
- // can't happen
- }
-
- return createSystemExceptionResponse(sys,contexts);
- }
-
- public ServerResponse createSystemExceptionResponse(
- SystemException ex, ServiceContexts svc) {
-
- // Only do this if interceptors have been initialized on this request
- // and have not completed their lifecycle (otherwise the info stack
- // may be empty or have a different request's entry on top).
- if (executePIInResponseConstructor()) {
- // Inform Portable Interceptors of the SystemException. This is
- // required to be done here because the ending interception point
- // is called in the ServerResponseImpl constructor called below
- // but we do not currently write the SystemException into the
- // response until after the ending point is called.
- ORB orb = (ORB)orb();
- orb.getPIHandler().setServerPIInfo( ex );
- }
-
- if (orb() != null && ((ORB)orb()).subcontractDebugFlag && ex != null)
- ORBUtility.dprint(this, "Sending SystemException:", ex);
-
- LocalServerResponseImpl response =
- new LocalServerResponseImpl(this, svc, false);
- ORBUtility.writeSystemException(ex, response);
- return response;
- }
-
- public ServerResponse createLocationForward(
- IOR ior, ServiceContexts svc) {
- ReplyMessage reply = MessageBase.createReply( (ORB)orb(),
- request.getGIOPVersion(), request.getRequestId(),
- ReplyMessage.LOCATION_FORWARD, svc, ior);
- LocalServerResponseImpl response =
- new LocalServerResponseImpl(this, reply, ior);
-
- return response;
- }
-
- private RequestMessage request;
-
- /**
- * Check to see if the request is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private boolean _executeReturnServantInResponseConstructor = false;
-
- public boolean executeReturnServantInResponseConstructor()
- {
- return _executeReturnServantInResponseConstructor;
- }
-
- public void setExecuteReturnServantInResponseConstructor(boolean b)
- {
- _executeReturnServantInResponseConstructor = b;
- }
-
-
- private boolean _executeRemoveThreadInfoInResponseConstructor = false;
-
- public boolean executeRemoveThreadInfoInResponseConstructor()
- {
- return _executeRemoveThreadInfoInResponseConstructor;
- }
-
- public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b)
- {
- _executeRemoveThreadInfoInResponseConstructor = b;
- }
-
-
- private boolean _executePIInResponseConstructor = false;
-
- public boolean executePIInResponseConstructor() {
- return _executePIInResponseConstructor;
- }
-
- public void setExecutePIInResponseConstructor( boolean b ) {
- _executePIInResponseConstructor = b;
- }
-
- // We know that we're talking to the same ValueHandler, so
- // use the maximum version it supports.
- public byte getStreamFormatVersionForReply() {
- return ORBUtility.getMaxStreamFormatVersion();
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava
deleted file mode 100644
index 8574ccfadf1..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.iiop;
-
-import org.omg.CORBA.SystemException;
-
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-
-class LocalServerResponseImpl
- extends IIOPOutputStream
- implements ServerResponse
-{
- LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc)
- {
- this(request,
- MessageBase.createReply(
- (ORB)request.orb(),
- request.getGIOPVersion(),
- request.getRequestId(), ReplyMessage.NO_EXCEPTION,
- svc, null),
- null);
- }
-
- LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc,
- boolean user)
- {
- this(request,
- MessageBase.createReply(
- (ORB)request.orb(),
- request.getGIOPVersion(), request.getRequestId(),
- user ? ReplyMessage.USER_EXCEPTION :
- ReplyMessage.SYSTEM_EXCEPTION,
- svc, null),
- null);
- }
-
- LocalServerResponseImpl( LocalServerRequestImpl request, ReplyMessage reply,
- IOR ior)
- {
- super(request.getGIOPVersion(),
- (ORB)request.orb(),
- null,
- BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
- request.getStreamFormatVersionForReply());
-
- setMessage(reply);
-
- ORB orb = (ORB)request.orb();
-
- ServerResponseImpl.runServantPostInvoke(orb, request);
-
- if( request.executePIInResponseConstructor() ) {
- // Invoke server request ending interception points (send_*):
- // Note: this may end up with a SystemException or an internal
- // Runtime ForwardRequest.
- orb.getPIHandler().invokeServerPIEndingPoint( reply );
-
- // Note this will be executed even if a ForwardRequest or
- // SystemException is thrown by a Portable Interceptors ending
- // point since we end up in this constructor again anyway.
- orb.getPIHandler().cleanupServerPIRequest();
-
- // See (Local)ServerRequestImpl.createSystemExceptionResponse
- // for why this is necesary.
- request.setExecutePIInResponseConstructor(false);
- }
-
- // Once you get here then the final reply is available (i.e.,
- // postinvoke and interceptors have completed.
- if (request.executeRemoveThreadInfoInResponseConstructor()) {
- ServerResponseImpl.removeThreadInfo(orb, request);
- }
-
- reply.write(this);
- if (reply.getIOR() != null)
- reply.getIOR().write(this);
-
- this.reply = reply;
- this.ior = reply.getIOR();
- }
-
- public boolean isSystemException() {
- if (reply != null)
- return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
- return false;
- }
-
- public boolean isUserException() {
- if (reply != null)
- return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
- return false;
- }
-
- public boolean isLocationForward() {
- if (ior != null)
- return true;
- return false;
- }
-
- public IOR getForwardedIOR() {
- return ior;
- }
-
- public int getRequestId() {
- if (reply != null)
- return reply.getRequestId();
- return -1;
- }
-
- public ServiceContexts getServiceContexts() {
- if (reply != null)
- return reply.getServiceContexts();
- return null;
- }
-
- public SystemException getSystemException() {
- if (reply != null)
- return reply.getSystemException();
- return null;
- }
-
- public ReplyMessage getReply()
- {
- return reply ;
- }
-
- public ClientResponse getClientResponse()
- {
- // set the size of the marshalled data in the message header
- getMessage().setSize(getByteBuffer(), getSize());
-
- // Construct a new ClientResponse out of the buffer in this ClientRequest
- LocalClientResponseImpl result =
- new LocalClientResponseImpl( (ORB)orb(), toByteArray(), reply);
-
- // NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin) here
- // then the LocalClientResponse does not need to read the headers anymore.
- // This will be an optimisation which is can be done to speed up the
- // local invocation by avoiding reading the headers in the local cases.
-
- // BUGFIX(Ram Jeyaraman) result.setOffset is now done in
- // LocalClientResponseImpl constructor.
- /*
- // Skip over all of the GIOP header information. This positions
- // the offset in the buffer so that the skeleton can correctly read
- // the marshalled arguments.
- result.setOffset( bodyBegin ) ;
- */
-
- return result ;
- }
-
- /**
- * Check to see if the response is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private ReplyMessage reply;
- private IOR ior; // forwarded IOR
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava
deleted file mode 100644
index c54ee9434f1..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * 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.corba.se.impl.transport;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.omg.CORBA.COMM_FAILURE;
-import org.omg.CORBA.CompletionStatus;
-import org.omg.CORBA.DATA_CONVERSION;
-import org.omg.CORBA.INTERNAL;
-import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.OBJECT_NOT_EXIST;
-import org.omg.CORBA.SystemException;
-
-import com.sun.org.omg.SendingContext.CodeBase;
-
-import com.sun.corba.se.pept.broker.Broker;
-import com.sun.corba.se.pept.encoding.InputObject;
-import com.sun.corba.se.pept.encoding.OutputObject;
-import com.sun.corba.se.pept.protocol.MessageMediator;
-import com.sun.corba.se.pept.transport.Acceptor;
-import com.sun.corba.se.pept.transport.Connection;
-import com.sun.corba.se.pept.transport.ConnectionCache;
-import com.sun.corba.se.pept.transport.ContactInfo;
-import com.sun.corba.se.pept.transport.EventHandler;
-import com.sun.corba.se.pept.transport.InboundConnectionCache;
-import com.sun.corba.se.pept.transport.OutboundConnectionCache;
-import com.sun.corba.se.pept.transport.ResponseWaitingRoom;
-import com.sun.corba.se.pept.transport.Selector;
-
-import com.sun.corba.se.spi.ior.IOR;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.orb.ORB ;
-import com.sun.corba.se.spi.orbutil.threadpool.Work;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-import com.sun.corba.se.spi.transport.CorbaContactInfo;
-import com.sun.corba.se.spi.transport.CorbaConnection;
-import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom;
-
-import com.sun.corba.se.impl.encoding.CachedCodeBase;
-import com.sun.corba.se.impl.encoding.CDRInputStream_1_0;
-import com.sun.corba.se.impl.encoding.CDROutputObject;
-import com.sun.corba.se.impl.encoding.CDROutputStream_1_0;
-import com.sun.corba.se.impl.encoding.CodeSetComponentInfo;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.orbutil.ORBUtility;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl;
-
-/**
- * @author Ken Cavanaugh
- */
-public class BufferConnectionImpl
- extends
- EventHandlerBase
- implements
- CorbaConnection,
- Work
-{
- //
- // New transport.
- //
-
- protected long enqueueTime;
-
- public SocketChannel getSocketChannel()
- {
- return null;
- }
-
- // REVISIT:
- // protected for test: genericRPCMSGFramework.IIOPConnection constructor.
-
- //
- // From iiop.Connection.java
- //
-
- protected long timeStamp = 0;
- protected boolean isServer = false;
-
- // Start at some value other than zero since this is a magic
- // value in some protocols.
- protected int requestId = 5;
- protected CorbaResponseWaitingRoom responseWaitingRoom;
- protected int state;
- protected java.lang.Object stateEvent = new java.lang.Object();
- protected java.lang.Object writeEvent = new java.lang.Object();
- protected boolean writeLocked;
- protected int serverRequestCount = 0;
-
- // Server request map: used on the server side of Connection
- // Maps request ID to IIOPInputStream.
- Map serverRequestMap = new HashMap() ;
-
- // This is a flag associated per connection telling us if the
- // initial set of sending contexts were sent to the receiver
- // already...
- protected boolean postInitialContexts = false;
-
- // Remote reference to CodeBase server (supplies
- // FullValueDescription, among other things)
- protected IOR codeBaseServerIOR;
-
- // CodeBase cache for this connection. This will cache remote operations,
- // handle connecting, and ensure we don't do any remote operations until
- // necessary.
- protected CachedCodeBase cachedCodeBase = new CachedCodeBase(this);
-
- protected ORBUtilSystemException wrapper ;
-
- List buffers ;
-
- public BufferConnectionImpl(ORB orb, byte[][] data )
- {
- this.orb = orb;
- wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_TRANSPORT ) ;
- buffers = new ArrayList() ;
- }
-
- ////////////////////////////////////////////////////
- //
- // framework.transport.Connection
- //
-
- public boolean shouldRegisterReadEvent()
- {
- return false;
- }
-
- public boolean shouldRegisterServerReadEvent()
- {
- return false;
- }
-
- public boolean read()
- {
- return true ;
- }
-
- protected CorbaMessageMediator readBits()
- {
- return null ;
- }
-
- protected boolean dispatch(CorbaMessageMediator messageMediator)
- {
- }
-
- public boolean shouldUseDirectByteBuffers()
- {
- return false ;
- }
-
- // Only called from readGIOPMessage with (12, 0, 12) as arguments
- // size is size of buffer to create
- // offset is offset from start of message in buffer
- // length is length to read
- public ByteBuffer read(int size, int offset, int length)
- throws IOException
- {
- byte[] buf = new byte[size];
- readFully( buf, offset, length);
- ByteBuffer byteBuffer = ByteBuffer.wrap(buf);
- byteBuffer.limit(size);
- return byteBuffer;
- }
-
- // Only called as read( buf, 12, msgsize-12 ) in readGIOPMessage
- // We can ignore the byteBuffer parameter
- // offset is the starting position to place data in the result
- // length is the length of the data to read
- public ByteBuffer read(ByteBuffer byteBuffer, int offset, int length)
- throws IOException
- {
- int size = offset + length;
- byte[] buf = new byte[size];
- readFully(buf, offset, length);
- return ByteBuffer.wrap(buf);
- }
-
- // Read size bytes from buffer list and place the data
- // starting at offset in buf.
- public void readFully(byte[] buf, int offset, int size)
- throws IOException
- {
- int remaining = size ;
- int position = offset ;
- while (remaining > 0) {
- ByteBuffer buff = (ByteBuffer)buffers.get(0) ;
- int dataSize = buff.remaining() ;
- int xferSize = dataSize ;
- if (dataSize >= remaining) :
- xferSize = remaining ;
- buffers.remove(0) ;
- }
-
- buff.get( buf, offset, xferSize ) ;
-
- offset += xferSize ;
- remaining -= xferSize ;
- }
- }
-
- public void write(ByteBuffer byteBuffer)
- throws IOException
- {
- buffers.add( byteBuffer ) ;
- }
-
- /**
- * Note:it is possible for this to be called more than once
- */
- public synchronized void close()
- {
- }
-
- public Acceptor getAcceptor()
- {
- return null;
- }
-
- public ContactInfo getContactInfo()
- {
- return null;
- }
-
- public EventHandler getEventHandler()
- {
- return this;
- }
-
- public OutputObject createOutputObject(MessageMediator messageMediator)
- {
- // REVISIT - remove this method from Connection and all it subclasses.
- throw new RuntimeException("*****SocketOrChannelConnectionImpl.createOutputObject - should not be called.");
- }
-
- // This is used by the GIOPOutputObject in order to
- // throw the correct error when handling code sets.
- // Can we determine if we are on the server side by
- // other means? XREVISIT
- public boolean isServer()
- {
- return isServer;
- }
-
- public boolean isBusy()
- {
- return false ;
- }
-
- public long getTimeStamp()
- {
- return timeStamp;
- }
-
- public void setTimeStamp(long time)
- {
- timeStamp = time;
- }
-
- public void setState(String stateString)
- {
- synchronized (stateEvent) {
- if (stateString.equals("ESTABLISHED")) {
- state = ESTABLISHED;
- stateEvent.notifyAll();
- } else {
- // REVISIT: ASSERT
- }
- }
- }
-
- public void writeLock()
- {
- }
-
- public void writeUnlock()
- {
- }
-
- public void sendWithoutLock(OutputObject outputObject)
- {
- }
-
- public void registerWaiter(MessageMediator messageMediator)
- {
- }
-
- public void unregisterWaiter(MessageMediator messageMediator)
- {
- }
-
- public InputObject waitForResponse(MessageMediator messageMediator)
- {
- return null ;
- }
-
- public void setConnectionCache(ConnectionCache connectionCache)
- {
- }
-
- public ConnectionCache getConnectionCache()
- {
- return null;
- }
-
- ////////////////////////////////////////////////////
- //
- // EventHandler methods
- //
-
- public SelectableChannel getChannel()
- {
- return null;
- }
-
- public int getInterestOps()
- {
- return null;
- }
-
- // public Acceptor getAcceptor() - already defined above.
-
- public Connection getConnection()
- {
- return this;
- }
-
- ////////////////////////////////////////////////////
- //
- // Work methods.
- //
-
- public String getName()
- {
- return this.toString();
- }
-
- public void doWork()
- {
- }
-
- public void setEnqueueTime(long timeInMillis)
- {
- enqueueTime = timeInMillis;
- }
-
- public long getEnqueueTime()
- {
- return enqueueTime;
- }
-
- ////////////////////////////////////////////////////
- //
- // spi.transport.CorbaConnection.
- //
-
- public ResponseWaitingRoom getResponseWaitingRoom()
- {
- return null ;
- }
-
- // REVISIT - inteface defines isServer but already defined in
- // higher interface.
-
-
- public void serverRequestMapPut(int requestId,
- CorbaMessageMediator messageMediator)
- {
- serverRequestMap.put(new Integer(requestId), messageMediator);
- }
-
- public CorbaMessageMediator serverRequestMapGet(int requestId)
- {
- return (CorbaMessageMediator)
- serverRequestMap.get(new Integer(requestId));
- }
-
- public void serverRequestMapRemove(int requestId)
- {
- serverRequestMap.remove(new Integer(requestId));
- }
-
-
- // REVISIT: this is also defined in:
- // com.sun.corba.se.spi.legacy.connection.Connection
- public java.net.Socket getSocket()
- {
- return null;
- }
-
- /** It is possible for a Close Connection to have been
- ** sent here, but we will not check for this. A "lazy"
- ** Exception will be thrown in the Worker thread after the
- ** incoming request has been processed even though the connection
- ** is closed before the request is processed. This is o.k because
- ** it is a boundary condition. To prevent it we would have to add
- ** more locks which would reduce performance in the normal case.
- **/
- public synchronized void serverRequestProcessingBegins()
- {
- serverRequestCount++;
- }
-
- public synchronized void serverRequestProcessingEnds()
- {
- serverRequestCount--;
- }
-
- //
- //
- //
-
- public synchronized int getNextRequestId()
- {
- return requestId++;
- }
-
- // Negotiated code sets for char and wchar data
- protected CodeSetComponentInfo.CodeSetContext codeSetContext = null;
-
- public ORB getBroker()
- {
- return orb;
- }
-
- public CodeSetComponentInfo.CodeSetContext getCodeSetContext()
- {
- // Needs to be synchronized for the following case when the client
- // doesn't send the code set context twice, and we have two threads
- // in ServerRequestDispatcher processCodeSetContext.
- //
- // Thread A checks to see if there is a context, there is none, so
- // it calls setCodeSetContext, getting the synch lock.
- // Thread B checks to see if there is a context. If we didn't synch,
- // it might decide to outlaw wchar/wstring.
- if (codeSetContext == null) {
- synchronized(this) {
- return codeSetContext;
- }
- }
-
- return codeSetContext;
- }
-
- public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
- // Double check whether or not we need to do this
- if (codeSetContext == null) {
-
- if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
- OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
- // If the client says it's negotiated a code set that
- // isn't a fallback and we never said we support, then
- // it has a bug.
- throw wrapper.badCodesetsFromClient() ;
- }
-
- codeSetContext = csc;
- }
- }
-
- //
- // from iiop.IIOPConnection.java
- //
-
- // Map request ID to an InputObject.
- // This is so the client thread can start unmarshaling
- // the reply and remove it from the out_calls map while the
- // ReaderThread can still obtain the input stream to give
- // new fragments. Only the ReaderThread touches the clientReplyMap,
- // so it doesn't incur synchronization overhead.
-
- public MessageMediator clientRequestMapGet(int requestId)
- {
- return null ;
- }
-
- protected MessageMediator clientReply_1_1;
-
- public void clientReply_1_1_Put(MessageMediator x)
- {
- clientReply_1_1 = x;
- }
-
- public MessageMediator clientReply_1_1_Get()
- {
- return clientReply_1_1;
- }
-
- public void clientReply_1_1_Remove()
- {
- clientReply_1_1 = null;
- }
-
- protected MessageMediator serverRequest_1_1;
-
- public void serverRequest_1_1_Put(MessageMediator x)
- {
- serverRequest_1_1 = x;
- }
-
- public MessageMediator serverRequest_1_1_Get()
- {
- return serverRequest_1_1;
- }
-
- public void serverRequest_1_1_Remove()
- {
- serverRequest_1_1 = null;
- }
-
- protected String getStateString( int state )
- {
- synchronized ( stateEvent ){
- switch (state) {
- case OPENING : return "OPENING" ;
- case ESTABLISHED : return "ESTABLISHED" ;
- case CLOSE_SENT : return "CLOSE_SENT" ;
- case CLOSE_RECVD : return "CLOSE_RECVD" ;
- case ABORT : return "ABORT" ;
- default : return "???" ;
- }
- }
- }
-
- public synchronized boolean isPostInitialContexts() {
- return postInitialContexts;
- }
-
- // Can never be unset...
- public synchronized void setPostInitialContexts(){
- postInitialContexts = true;
- }
-
- /**
- * Wake up the outstanding requests on the connection, and hand them
- * COMM_FAILURE exception with a given minor code.
- *
- * Also, delete connection from connection table and
- * stop the reader thread.
-
- * Note that this should only ever be called by the Reader thread for
- * this connection.
- *
- * @param minor_code The minor code for the COMM_FAILURE major code.
- * @param die Kill the reader thread (this thread) before exiting.
- */
- public void purgeCalls(SystemException systemException,
- boolean die, boolean lockHeld)
- {
- }
-
- /*************************************************************************
- * The following methods are for dealing with Connection cleaning for
- * better scalability of servers in high network load conditions.
- **************************************************************************/
-
- public void sendCloseConnection(GIOPVersion giopVersion)
- throws IOException
- {
- Message msg = MessageBase.createCloseConnection(giopVersion);
- sendHelper(giopVersion, msg);
- }
-
- public void sendMessageError(GIOPVersion giopVersion)
- throws IOException
- {
- Message msg = MessageBase.createMessageError(giopVersion);
- sendHelper(giopVersion, msg);
- }
-
- /**
- * Send a CancelRequest message. This does not lock the connection, so the
- * caller needs to ensure this method is called appropriately.
- * @exception IOException - could be due to abortive connection closure.
- */
- public void sendCancelRequest(GIOPVersion giopVersion, int requestId)
- throws IOException
- {
-
- Message msg = MessageBase.createCancelRequest(giopVersion, requestId);
- sendHelper(giopVersion, msg);
- }
-
- protected void sendHelper(GIOPVersion giopVersion, Message msg)
- throws IOException
- {
- // REVISIT: See comments in CDROutputObject constructor.
- CDROutputObject outputObject =
- new CDROutputObject((ORB)orb, null, giopVersion, this, msg,
- ORBConstants.STREAM_FORMAT_VERSION_1);
- msg.write(outputObject);
-
- outputObject.writeTo(this);
- }
-
- public void sendCancelRequestWithLock(GIOPVersion giopVersion,
- int requestId)
- throws IOException
- {
- writeLock();
- try {
- sendCancelRequest(giopVersion, requestId);
- } finally {
- writeUnlock();
- }
- }
-
- // Begin Code Base methods ---------------------------------------
- //
- // Set this connection's code base IOR. The IOR comes from the
- // SendingContext. This is an optional service context, but all
- // JavaSoft ORBs send it.
- //
- // The set and get methods don't need to be synchronized since the
- // first possible get would occur during reading a valuetype, and
- // that would be after the set.
-
- // Sets this connection's code base IOR. This is done after
- // getting the IOR out of the SendingContext service context.
- // Our ORBs always send this, but it's optional in CORBA.
-
- public final void setCodeBaseIOR(IOR ior) {
- codeBaseServerIOR = ior;
- }
-
- public final IOR getCodeBaseIOR() {
- return codeBaseServerIOR;
- }
-
- // Get a CodeBase stub to use in unmarshaling. The CachedCodeBase
- // won't connect to the remote codebase unless it's necessary.
- public final CodeBase getCodeBase() {
- return cachedCodeBase;
- }
-
- // End Code Base methods -----------------------------------------
-
- // Can be overridden in subclass for different options.
- protected void setSocketOptions(Socket socket)
- {
- }
-
- public String toString()
- {
- synchronized ( stateEvent ){
- return
- "BufferConnectionImpl[" + " "
- + getStateString( state ) + " "
- + shouldUseSelectThreadToWait() + " "
- + shouldUseWorkerThreadForEvent()
- + "]" ;
- }
- }
-
- // Must be public - used in encoding.
- public void dprint(String msg)
- {
- ORBUtility.dprint("SocketOrChannelConnectionImpl", msg);
- }
-
- protected void dprint(String msg, Throwable t)
- {
- dprint(msg);
- t.printStackTrace(System.out);
- }
-}
-
-// End of file.
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 56f7ea3c416..cdd98f7b367 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -365,3 +365,5 @@ c9dd82da51ed34a28f7c6b3245163ee962e94572 hs25-b40
46487ba40ff225654d0c51787ed3839bafcbd9f3 hs25-b43
f6921c876db192bba389cec062855a66372da01c jdk8-b101
530fe88b3b2c710f42810b3580d86a0d83ad6c1c hs25-b44
+c4697c1c448416108743b59118b4a2498b339d0c jdk8-b102
+7f55137d6aa81efc6eb0035813709f2cb6a26b8b hs25-b45
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
index dd800a49bc4..dbf09b29119 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
@@ -29,11 +29,10 @@ public interface JVMTIThreadState {
public static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
public static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
public static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
- public static final int JVMTI_THREAD_STATE_WAITING = 0x0008;
+ public static final int JVMTI_THREAD_STATE_WAITING = 0x0080;
public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
public static final int JVMTI_THREAD_STATE_SLEEPING = 0x0040;
- public static final int JVMTI_THREAD_STATE_WAITING_FOR_NOTIFICATION = 0x0080;
public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100;
public static final int JVMTI_THREAD_STATE_PARKED = 0x0200;
public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
index fb17c53d329..226a1762570 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
@@ -32,7 +32,7 @@ import sun.jvm.hotspot.types.*;
// to the sys_thread_t structure of the classic JVM implementation.
public class OSThread extends VMObject {
private static JIntField interruptedField;
- private static JIntField threadIdField;
+ private static Field threadIdField;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -44,7 +44,7 @@ public class OSThread extends VMObject {
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("OSThread");
interruptedField = type.getJIntField("_interrupted");
- threadIdField = type.getJIntField("_thread_id");
+ threadIdField = type.getField("_thread_id");
}
public OSThread(Address addr) {
@@ -56,7 +56,7 @@ public class OSThread extends VMObject {
}
public int threadId() {
- return (int)threadIdField.getValue(addr);
+ return threadIdField.getJInt(addr);
}
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java
index 96817b26226..418bef9a086 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -74,23 +74,24 @@ public class ClassDump extends Tool {
public void run() {
// Ready to go with the database...
try {
- // The name of the filter always comes from a System property.
- // If we have a pkgList, pass it, otherwise let the filter read
- // its own System property for the list of classes.
- String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
- "sun.jvm.hotspot.tools.jcore.PackageNameFilter");
- try {
- Class filterClass = Class.forName(filterClassName);
- if (pkgList == null) {
- classFilter = (ClassFilter) filterClass.newInstance();
- } else {
- Constructor con = filterClass.getConstructor(String.class);
- classFilter = (ClassFilter) con.newInstance(pkgList);
+ if (classFilter == null) {
+ // If not already set, the name of the filter comes from a System property.
+ // If we have a pkgList, pass it, otherwise let the filter read
+ // its own System property for the list of classes.
+ String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
+ "sun.jvm.hotspot.tools.jcore.PackageNameFilter");
+ try {
+ Class filterClass = Class.forName(filterClassName);
+ if (pkgList == null) {
+ classFilter = (ClassFilter) filterClass.newInstance();
+ } else {
+ Constructor con = filterClass.getConstructor(String.class);
+ classFilter = (ClassFilter) con.newInstance(pkgList);
+ }
+ } catch(Exception exp) {
+ System.err.println("Warning: Can not create class filter!");
}
- } catch(Exception exp) {
- System.err.println("Warning: Can not create class filter!");
}
-
String outputDirectory = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir", ".");
setOutputDirectory(outputDirectory);
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index 578a0dfd0de..614c5b082cc 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=44
+HS_BUILD_NUMBER=45
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 3af2d23b7d6..dbe3476aad9 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -2295,7 +2295,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) {
if (gen_type_check) {
// We have determined that offset == referent_offset && src != null.
// if (src->_klass->_reference_type == REF_NONE) -> continue
- __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), UseCompressedKlassPointers ? T_OBJECT : T_ADDRESS), src_klass);
+ __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass);
LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE);
LIR_Opr reference_type = new_register(T_INT);
__ move(reference_type_addr, reference_type);
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index 650a299f346..32a4da05bb5 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -878,7 +878,7 @@ objArrayOop ClassLoader::get_system_packages(TRAPS) {
instanceKlassHandle ClassLoader::load_classfile(Symbol* h_name, TRAPS) {
ResourceMark rm(THREAD);
- EventMark m("loading class " INTPTR_FORMAT, (address)h_name);
+ EventMark m("loading class %s", h_name->as_C_string());
ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion);
stringStream st;
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index a507c83a511..0662b6912b9 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -60,6 +60,28 @@
#define DEFAULT_VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/crash.jsp"
#define DEFAULT_JAVA_LAUNCHER "generic"
+// Disable options not supported in this release, with a warning if they
+// were explicitly requested on the command-line
+#define UNSUPPORTED_OPTION(opt, description) \
+do { \
+ if (opt) { \
+ if (FLAG_IS_CMDLINE(opt)) { \
+ warning(description " is disabled in this release."); \
+ } \
+ FLAG_SET_DEFAULT(opt, false); \
+ } \
+} while(0)
+
+#define UNSUPPORTED_GC_OPTION(gc) \
+do { \
+ if (gc) { \
+ if (FLAG_IS_CMDLINE(gc)) { \
+ warning(#gc " is not supported in this VM. Using Serial GC."); \
+ } \
+ FLAG_SET_DEFAULT(gc, false); \
+ } \
+} while(0)
+
char** Arguments::_jvm_flags_array = NULL;
int Arguments::_num_jvm_flags = 0;
char** Arguments::_jvm_args_array = NULL;
@@ -3128,14 +3150,17 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req
FLAG_SET_DEFAULT(UseLargePages, false);
}
- // Tiered compilation is undefined with C1.
- TieredCompilation = false;
#else
if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
}
#endif
+#ifndef TIERED
+ // Tiered compilation is undefined.
+ UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation");
+#endif
+
// If we are running in a headless jre, force java.awt.headless property
// to be true unless the property has already been set.
// Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
@@ -3278,29 +3303,6 @@ void Arguments::set_shared_spaces_flags() {
}
}
-// Disable options not supported in this release, with a warning if they
-// were explicitly requested on the command-line
-#define UNSUPPORTED_OPTION(opt, description) \
-do { \
- if (opt) { \
- if (FLAG_IS_CMDLINE(opt)) { \
- warning(description " is disabled in this release."); \
- } \
- FLAG_SET_DEFAULT(opt, false); \
- } \
-} while(0)
-
-
-#define UNSUPPORTED_GC_OPTION(gc) \
-do { \
- if (gc) { \
- if (FLAG_IS_CMDLINE(gc)) { \
- warning(#gc " is not supported in this VM. Using Serial GC."); \
- } \
- FLAG_SET_DEFAULT(gc, false); \
- } \
-} while(0)
-
#if !INCLUDE_ALL_GCS
static void force_serial_gc() {
FLAG_SET_DEFAULT(UseSerialGC, true);
diff --git a/hotspot/src/share/vm/services/gcNotifier.cpp b/hotspot/src/share/vm/services/gcNotifier.cpp
index e6106e29c7d..7d1fe5d8944 100644
--- a/hotspot/src/share/vm/services/gcNotifier.cpp
+++ b/hotspot/src/share/vm/services/gcNotifier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -211,9 +211,9 @@ void GCNotifier::sendNotificationInternal(TRAPS) {
NotificationMark nm(request);
Handle objGcInfo = createGcInfo(request->gcManager, request->gcStatInfo, THREAD);
- Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK);
- Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK);
- Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK);
+ Handle objName = java_lang_String::create_from_str(request->gcManager->name(), CHECK);
+ Handle objAction = java_lang_String::create_from_str(request->gcAction, CHECK);
+ Handle objCause = java_lang_String::create_from_str(request->gcCause, CHECK);
Klass* k = Management::sun_management_GarbageCollectorImpl_klass(CHECK);
instanceKlassHandle gc_mbean_klass(THREAD, k);
diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp
index 0808ebd0acd..a2c8944ee42 100644
--- a/hotspot/src/share/vm/services/management.cpp
+++ b/hotspot/src/share/vm/services/management.cpp
@@ -1831,13 +1831,13 @@ class ThreadTimesClosure: public ThreadClosure {
private:
objArrayHandle _names_strings;
char **_names_chars;
- typeArrayOop _times;
+ typeArrayHandle _times;
int _names_len;
int _times_len;
int _count;
public:
- ThreadTimesClosure(objArrayHandle names, typeArrayOop times);
+ ThreadTimesClosure(objArrayHandle names, typeArrayHandle times);
~ThreadTimesClosure();
virtual void do_thread(Thread* thread);
void do_unlocked();
@@ -1845,9 +1845,9 @@ class ThreadTimesClosure: public ThreadClosure {
};
ThreadTimesClosure::ThreadTimesClosure(objArrayHandle names,
- typeArrayOop times) {
+ typeArrayHandle times) {
assert(names() != NULL, "names was NULL");
- assert(times != NULL, "times was NULL");
+ assert(times() != NULL, "times was NULL");
_names_strings = names;
_names_len = names->length();
_names_chars = NEW_C_HEAP_ARRAY(char*, _names_len, mtInternal);
@@ -1925,7 +1925,7 @@ JVM_ENTRY(jint, jmm_GetInternalThreadTimes(JNIEnv *env,
typeArrayOop ta = typeArrayOop(JNIHandles::resolve_non_null(times));
typeArrayHandle times_ah(THREAD, ta);
- ThreadTimesClosure ttc(names_ah, times_ah());
+ ThreadTimesClosure ttc(names_ah, times_ah);
{
MutexLockerEx ml(Threads_lock);
Threads::threads_do(&ttc);
diff --git a/hotspot/src/share/vm/utilities/exceptions.cpp b/hotspot/src/share/vm/utilities/exceptions.cpp
index 6083c555cbf..af5f974f126 100644
--- a/hotspot/src/share/vm/utilities/exceptions.cpp
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp
@@ -125,13 +125,13 @@ void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exce
}
void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
+ ResourceMark rm;
assert(h_exception() != NULL, "exception should not be NULL");
// tracing (do this up front - so it works during boot strapping)
if (TraceExceptions) {
ttyLocker ttyl;
- ResourceMark rm;
- tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
+ tty->print_cr("Exception <%s%s%s> (" INTPTR_FORMAT ") \n"
"thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
h_exception->print_value_string(),
message ? ": " : "", message ? message : "",
@@ -141,7 +141,9 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc
NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
// Check for special boot-strapping/vm-thread handling
- if (special_exception(thread, file, line, h_exception)) return;
+ if (special_exception(thread, file, line, h_exception)) {
+ return;
+ }
assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
@@ -149,7 +151,9 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc
thread->set_pending_exception(h_exception(), file, line);
// vm log
- Events::log_exception(thread, "Threw " INTPTR_FORMAT " at %s:%d", (address)h_exception(), file, line);
+ Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
+ h_exception->print_value_string(), message ? ": " : "", message ? message : "",
+ (address)h_exception(), file, line);
}
diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp
index aea96c8581c..d3eafd5de47 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp
@@ -395,7 +395,13 @@ bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) {
template
bool GenericTaskQueue::pop_global(E& t) {
Age oldAge = _age.get();
- uint localBot = _bottom;
+ // Architectures with weak memory model require a barrier here
+ // to guarantee that bottom is not older than age,
+ // which is crucial for the correctness of the algorithm.
+#if !(defined SPARC || defined IA32 || defined AMD64)
+ OrderAccess::fence();
+#endif
+ uint localBot = OrderAccess::load_acquire((volatile juint*)&_bottom);
uint n_elems = size(localBot, oldAge.top());
if (n_elems == 0) {
return false;
@@ -644,7 +650,7 @@ public:
template inline bool
GenericTaskQueue::push(E t) {
uint localBot = _bottom;
- assert((localBot >= 0) && (localBot < N), "_bottom out of range.");
+ assert(localBot < N, "_bottom out of range.");
idx_t top = _age.top();
uint dirty_n_elems = dirty_size(localBot, top);
assert(dirty_n_elems < N, "n_elems out of range.");
diff --git a/hotspot/test/compiler/codecache/CheckUpperLimit.java b/hotspot/test/compiler/codecache/CheckUpperLimit.java
index 5e4803226d5..e2a2705b554 100644
--- a/hotspot/test/compiler/codecache/CheckUpperLimit.java
+++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java
@@ -35,10 +35,6 @@ public class CheckUpperLimit {
ProcessBuilder pb;
OutputAnalyzer out;
- pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2048m", "-version");
- out = new OutputAnalyzer(pb.start());
- out.shouldHaveExitValue(0);
-
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
out = new OutputAnalyzer(pb.start());
out.shouldContain("Invalid ReservedCodeCacheSize=");
diff --git a/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
new file mode 100644
index 00000000000..c3f455274dd
--- /dev/null
+++ b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8016474
+ * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8)
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier
+ */
+
+import java.lang.reflect.Field;
+
+import sun.misc.Unsafe;
+
+public class GetUnsafeObjectG1PreBarrier {
+ private static final Unsafe unsafe;
+ private static final int N = 100_000;
+
+ static {
+ try {
+ Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+ theUnsafe.setAccessible(true);
+ unsafe = (Unsafe) theUnsafe.get(null);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public Object a;
+
+ public static void main(String[] args) throws Throwable {
+ new GetUnsafeObjectG1PreBarrier();
+ }
+
+ public GetUnsafeObjectG1PreBarrier() throws Throwable {
+ doit();
+ }
+
+ private void doit() throws Throwable {
+ Field field = GetUnsafeObjectG1PreBarrier.class.getField("a");
+ long fieldOffset = unsafe.objectFieldOffset(field);
+
+ for (int i = 0; i < N; i++) {
+ readField(this, fieldOffset);
+ }
+ }
+
+ private void readField(Object o, long fieldOffset) {
+ unsafe.getObject(o, fieldOffset);
+ }
+}
diff --git a/hotspot/test/runtime/8000968/Test8000968.sh b/hotspot/test/runtime/8000968/Test8000968.sh
deleted file mode 100644
index cd7183476cf..00000000000
--- a/hotspot/test/runtime/8000968/Test8000968.sh
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Copyright (c) 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.
-#
-# 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 Test8000968.sh
-# @bug 8000968
-# @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
-# @run shell Test8000968.sh
-#
-
-if [ "${TESTJAVA}" = "" ]
-then
- PARENT=`dirname \`which java\``
- TESTJAVA=`dirname ${PARENT}`
- printf "TESTJAVA not set, selecting " ${TESTJAVA}
- printf " If this is incorrect, try setting the variable manually.\n"
-fi
-
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
- Windows_* )
- FS="\\"
- NULL=NUL
- ;;
- * )
- FS="/"
- NULL=/dev/null
- ;;
-esac
-
-JAVA=${TESTJAVA}${FS}bin${FS}java
-
-#
-# See if platform has 64 bit java.
-#
-${JAVA} ${TESTVMOPTS} -d64 -version 2>&1 | grep -i "does not support" > ${NULL}
-if [ "$?" != "1" ]
-then
- printf "Platform is 32 bit, does not support -XX:ObjectAlignmentInBytes= option.\n"
- printf "Passed.\n"
- exit 0
-fi
-
-#
-# Test -XX:ObjectAlignmentInBytes with -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops.
-#
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=16 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=16 option did not work.\n"
- exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=32 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=32 option did not work.\n"
- exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=64 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=64 option did not work.\n"
- exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=128 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=128 option did not work.\n"
- exit 1
-fi
-
-
-printf "Passed.\n"
-exit 0
diff --git a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
new file mode 100644
index 00000000000..dd0c26d9f10
--- /dev/null
+++ b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8000968
+ * @key regression
+ * @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class CompressedKlassPointerAndOops {
+
+ public static void main(String[] args) throws Exception {
+
+ if (!Platform.is64bit()) {
+ // Can't test this on 32 bit, just pass
+ System.out.println("Skipping test on 32bit");
+ return;
+ }
+
+ runWithAlignment(16);
+ runWithAlignment(32);
+ runWithAlignment(64);
+ runWithAlignment(128);
+ }
+
+ private static void runWithAlignment(int alignment) throws Exception {
+ ProcessBuilder pb;
+ OutputAnalyzer output;
+
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+UseCompressedKlassPointers",
+ "-XX:+UseCompressedOops",
+ "-XX:ObjectAlignmentInBytes=" + alignment,
+ "-version");
+
+ output = new OutputAnalyzer(pb.start());
+ output.shouldHaveExitValue(0);
+ }
+}
diff --git a/hotspot/test/runtime/7196045/Test7196045.java b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
similarity index 82%
rename from hotspot/test/runtime/7196045/Test7196045.java
rename to hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
index 4c6fcc8c072..3416ce45fec 100644
--- a/hotspot/test/runtime/7196045/Test7196045.java
+++ b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -25,8 +25,9 @@
/*
* @test
* @bug 7196045
+ * @bug 8014294
* @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
- * @run main/othervm -XX:+UsePerfData Test7196045
+ * @run main/othervm -XX:+UsePerfData -Xmx32m ThreadCpuTimesDeadlock
*/
import java.lang.management.ManagementFactory;
@@ -35,9 +36,10 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-public class Test7196045 {
+public class ThreadCpuTimesDeadlock {
- public static long duration = 1000 * 60 * 2;
+ public static byte[] dummy;
+ public static long duration = 10 * 1000;
private static final String HOTSPOT_INTERNAL = "sun.management:type=HotspotInternal";
public static void main(String[] args) {
@@ -57,6 +59,18 @@ public class Test7196045 {
throw new RuntimeException("Bad object name" + e1);
}
+ // Thread that allocs memory to generate GC's
+ Thread allocThread = new Thread() {
+ public void run() {
+ while (true) {
+ dummy = new byte[4096];
+ }
+ }
+ };
+
+ allocThread.setDaemon(true);
+ allocThread.start();
+
long endTime = System.currentTimeMillis() + duration;
long i = 0;
while (true) {
diff --git a/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java b/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java
new file mode 100644
index 00000000000..068f193efcf
--- /dev/null
+++ b/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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
+ * @summary Test the OutputAnalyzer reporting functionality,
+ * such as printing additional diagnostic info
+ * (exit code, stdout, stderr, command line, etc.)
+ * @library /testlibrary
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+
+public class OutputAnalyzerReportingTest {
+
+ public static void main(String[] args) throws Exception {
+ // Create the output analyzer under test
+ String stdout = "aaaaaa";
+ String stderr = "bbbbbb";
+ OutputAnalyzer output = new OutputAnalyzer(stdout, stderr);
+
+ // Expected summary values should be the same for all cases,
+ // since the outputAnalyzer object is the same
+ String expectedExitValue = "-1";
+ String expectedSummary =
+ " stdout: [" + stdout + "];\n" +
+ " stderr: [" + stderr + "]\n" +
+ " exitValue = " + expectedExitValue + "\n";
+
+
+ DiagnosticSummaryTestRunner testRunner =
+ new DiagnosticSummaryTestRunner();
+
+ // should have exit value
+ testRunner.init(expectedSummary);
+ int unexpectedExitValue = 2;
+ try {
+ output.shouldHaveExitValue(unexpectedExitValue);
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should not contain
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldNotContain(stdout);
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should contain
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldContain("unexpected-stuff");
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should not match
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldNotMatch("[a]");
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should match
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldMatch("[qwerty]");
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ }
+
+ private static class DiagnosticSummaryTestRunner {
+ private ByteArrayOutputStream byteStream =
+ new ByteArrayOutputStream(10000);
+
+ private String expectedSummary = "";
+ private PrintStream errStream;
+
+
+ public void init(String expectedSummary) {
+ this.expectedSummary = expectedSummary;
+ byteStream.reset();
+ errStream = new PrintStream(byteStream);
+ System.setErr(errStream);
+ }
+
+ public void closeAndCheckResults() {
+ // check results
+ errStream.close();
+ String stdErrStr = byteStream.toString();
+ if (!stdErrStr.contains(expectedSummary)) {
+ throw new RuntimeException("The output does not contain "
+ + "the diagnostic message, or the message is incorrect");
+ }
+ }
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
index ede667f8e58..b9e37128d23 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
@@ -76,7 +76,8 @@ public final class OutputAnalyzer {
*/
public void shouldContain(String expectedString) {
if (!stdout.contains(expectedString) && !stderr.contains(expectedString)) {
- throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr: [" + stdout + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr \n");
}
}
@@ -88,7 +89,8 @@ public final class OutputAnalyzer {
*/
public void stdoutShouldContain(String expectedString) {
if (!stdout.contains(expectedString)) {
- throw new RuntimeException("'" + expectedString + "' missing from stdout: [" + stdout + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stdout \n");
}
}
@@ -100,7 +102,8 @@ public final class OutputAnalyzer {
*/
public void stderrShouldContain(String expectedString) {
if (!stderr.contains(expectedString)) {
- throw new RuntimeException("'" + expectedString + "' missing from stderr: [" + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stderr \n");
}
}
@@ -112,10 +115,12 @@ public final class OutputAnalyzer {
*/
public void shouldNotContain(String notExpectedString) {
if (stdout.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stdout: [" + stdout + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
}
if (stderr.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stderr: [" + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
}
}
@@ -127,7 +132,8 @@ public final class OutputAnalyzer {
*/
public void stdoutShouldNotContain(String notExpectedString) {
if (stdout.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stdout: [" + stdout + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
}
}
@@ -139,7 +145,8 @@ public final class OutputAnalyzer {
*/
public void stderrShouldNotContain(String notExpectedString) {
if (stderr.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stderr: [" + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
}
}
@@ -154,9 +161,9 @@ public final class OutputAnalyzer {
Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (!stdoutMatcher.find() && !stderrMatcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' missing from stdout/stderr: [" + stdout + stderr
- + "]\n");
+ + "' missing from stdout/stderr \n");
}
}
@@ -170,8 +177,9 @@ public final class OutputAnalyzer {
public void stdoutShouldMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (!matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' missing from stdout: [" + stdout + "]\n");
+ + "' missing from stdout \n");
}
}
@@ -185,8 +193,9 @@ public final class OutputAnalyzer {
public void stderrShouldMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (!matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' missing from stderr: [" + stderr + "]\n");
+ + "' missing from stderr \n");
}
}
@@ -200,13 +209,15 @@ public final class OutputAnalyzer {
public void shouldNotMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stdout: [" + stdout + "]\n");
+ + "' found in stdout \n");
}
matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stderr: [" + stderr + "]\n");
+ + "' found in stderr \n");
}
}
@@ -220,8 +231,9 @@ public final class OutputAnalyzer {
public void stdoutShouldNotMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stdout: [" + stdout + "]\n");
+ + "' found in stdout \n");
}
}
@@ -235,23 +247,45 @@ public final class OutputAnalyzer {
public void stderrShouldNotMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stderr: [" + stderr + "]\n");
+ + "' found in stderr \n");
}
}
/**
- * Verifiy the exit value of the process
+ * Verify the exit value of the process
*
* @param expectedExitValue Expected exit value from process
* @throws RuntimeException If the exit value from the process did not match the expected value
*/
public void shouldHaveExitValue(int expectedExitValue) {
if (getExitValue() != expectedExitValue) {
- throw new RuntimeException("Exit value " + getExitValue() + " , expected to get " + expectedExitValue);
+ reportDiagnosticSummary();
+ throw new RuntimeException("Expected to get exit value of ["
+ + expectedExitValue + "]\n");
}
}
+
+ /**
+ * Report summary that will help to diagnose the problem
+ * Currently includes:
+ * - standard input produced by the process under test
+ * - standard output
+ * - exit code
+ * Note: the command line is printed by the ProcessTools
+ */
+ private void reportDiagnosticSummary() {
+ String msg =
+ " stdout: [" + stdout + "];\n" +
+ " stderr: [" + stderr + "]\n" +
+ " exitValue = " + getExitValue() + "\n";
+
+ System.err.println(msg);
+ }
+
+
/**
* Get the contents of the output buffer (stdout and stderr)
*
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
index cfc1a271c13..8e5d303317d 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
@@ -27,6 +27,7 @@ public class Platform {
private static final String osName = System.getProperty("os.name");
private static final String dataModel = System.getProperty("sun.arch.data.model");
private static final String vmVersion = System.getProperty("java.vm.version");
+ private static final String osArch = System.getProperty("os.arch");
public static boolean is64bit() {
return dataModel.equals("64");
@@ -59,4 +60,14 @@ public class Platform {
public static String getVMVersion() {
return vmVersion;
}
+
+ // Returns true for sparc and sparcv9.
+ public static boolean isSparc() {
+ return osArch.toLowerCase().startsWith("sparc");
+ }
+
+ public static String getOsArch() {
+ return osArch;
+ }
+
}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
index 6e0fdae6564..56277f046ec 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
@@ -31,6 +31,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.List;
import sun.management.VMManagement;
@@ -106,6 +107,22 @@ public final class ProcessTools {
return pid;
}
+ /**
+ * Get the string containing input arguments passed to the VM
+ *
+ * @return arguments
+ */
+ public static String getVmInputArguments() {
+ RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+
+ List args = runtime.getInputArguments();
+ StringBuilder result = new StringBuilder();
+ for (String arg : args)
+ result.append(arg).append(' ');
+
+ return result.toString();
+ }
+
/**
* Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
*
@@ -132,8 +149,13 @@ public final class ProcessTools {
Collections.addAll(args, getPlatformSpecificVMArgs());
Collections.addAll(args, command);
- return new ProcessBuilder(args.toArray(new String[args.size()]));
+ // Reporting
+ StringBuilder cmdLine = new StringBuilder();
+ for (String cmd : args)
+ cmdLine.append(cmd).append(' ');
+ System.out.println("Command line: [" + cmdLine.toString() + "]");
+ return new ProcessBuilder(args.toArray(new String[args.size()]));
}
}
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index fc49036c257..e0c06d60dc2 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -223,3 +223,4 @@ b8c5f4b6f0fffb44618fc609a584953c4ed67c0b jdk8-b95
adf49c3ef83c160d53ece623049b2cdccaf78fc7 jdk8-b99
5d1974c1d7b9a86431bc253dc5a6a52d4586622e jdk8-b100
0a7432f898e579ea35e8c51e3edab37f949168e4 jdk8-b101
+7cffafa606e9fb865e7b5e6a56e0a681ce5cf617 jdk8-b102
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index b7bd401237e..12637ee84ca 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -223,3 +223,4 @@ b1fb4612a2caea52b5661b87509e560fa044b194 jdk8-b98
8ef83d4b23c933935e28f59b282cea920b1b1f5f jdk8-b99
4fd722afae5c02f00bbd44c3a34425ee474afb1c jdk8-b100
60b623a361642a0f5aef5f06dad9e5f279b9d9a9 jdk8-b101
+988a5f2ac559dcab05698b8a8633aa453e012260 jdk8-b102
diff --git a/jdk/.hgtags b/jdk/.hgtags
index e73ad87229f..f680ba06806 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -223,3 +223,4 @@ c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98
6a099a36589bd933957272ba63e5263bede29971 jdk8-b99
5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100
6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101
+8ed8e2b4b90e0ac9aa5b3efef51cd576a9db96a9 jdk8-b102
diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk
index 1acb78ecb65..f5582fc6a90 100644
--- a/jdk/makefiles/CompileNativeLibraries.gmk
+++ b/jdk/makefiles/CompileNativeLibraries.gmk
@@ -798,6 +798,16 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
endif
+ifeq ($(OPENJDK_TARGET_OS),linux)
+ifndef OPENJDK
+include $(JDK_TOPDIR)/make/closed/xawt.gmk
+endif
+
+ifeq ($(DISABLE_XRENDER),true)
+ LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
+endif
+endif
+
ifeq ($(MILESTONE),internal)
LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
endif
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
index fdad818c4f0..5a1cf0cdeb7 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
@@ -1856,7 +1856,10 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
// If we're not valid that means we will shortly be validated and
// painted, which means we don't have to do anything here.
if (!isRunsDirty && index >= 0 && index < tabPane.getTabCount()) {
- tabPane.repaint(getTabBounds(tabPane, index));
+ Rectangle rect = getTabBounds(tabPane, index);
+ if (rect != null) {
+ tabPane.repaint(rect);
+ }
}
}
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
index 7dbc187296d..39b55762648 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
@@ -701,6 +701,20 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI {
return false;
}
+ /**
+ * Returns the bounds of the specified tab index. The bounds are
+ * with respect to the JTabbedPane's coordinate space. If the tab at this
+ * index is not currently visible in the UI, then returns null.
+ */
+ @Override
+ public Rectangle getTabBounds(final JTabbedPane pane, final int i) {
+ if (visibleTabState.needsScrollTabs()
+ && (visibleTabState.isBefore(i) || visibleTabState.isAfter(i))) {
+ return null;
+ }
+ return super.getTabBounds(pane, i);
+ }
+
/**
* Returns the tab index which intersects the specified point
* in the JTabbedPane's coordinate space.
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index 8aed7e5feaa..d38946d4376 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -830,18 +830,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// UTILITY METHODS
// ----------------------------------------------------------------------
- /*
- * Find image to install into Title or into Application icon.
- * First try icons installed for toplevel. If there is no icon
- * use default Duke image.
- * This method shouldn't return null.
+ /**
+ * Find image to install into Title or into Application icon. First try
+ * icons installed for toplevel. Null is returned, if there is no icon and
+ * default Duke image should be used.
*/
private CImage getImageForTarget() {
- List icons = target.getIconImages();
- if (icons == null || icons.size() == 0) {
- return null;
+ CImage icon = null;
+ try {
+ icon = CImage.getCreator().createFromImages(target.getIconImages());
+ } catch (Exception ignored) {
+ // Perhaps the icon passed into Java is broken. Skipping this icon.
}
- return CImage.getCreator().createFromImages(icons);
+ return icon;
}
/*
diff --git a/jdk/src/share/classes/java/awt/event/ContainerListener.java b/jdk/src/share/classes/java/awt/event/ContainerListener.java
index d5c444ff184..6fb8321589b 100644
--- a/jdk/src/share/classes/java/awt/event/ContainerListener.java
+++ b/jdk/src/share/classes/java/awt/event/ContainerListener.java
@@ -42,7 +42,7 @@ import java.util.EventListener;
* Container events are provided for notification purposes ONLY;
* The AWT will automatically handle add and remove operations
* internally so the program works properly regardless of
- * whether the program registers a ComponentListener or not.
+ * whether the program registers a {@code ContainerListener} or not.
*
* @see ContainerAdapter
* @see ContainerEvent
diff --git a/jdk/src/share/classes/java/awt/image/BufferStrategy.java b/jdk/src/share/classes/java/awt/image/BufferStrategy.java
index 82ad5e07d97..de7877330b9 100644
--- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java
+++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java
@@ -55,7 +55,7 @@ import java.awt.Image;
* Alternatively, the contents of the back buffer can be copied, or
* blitted forward in a chain instead of moving the video pointer.
*
* Here is an example of how buffer strategies can be created and used:
*
diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java
index d510dcc1ba4..b4222b1e740 100644
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java
@@ -602,12 +602,12 @@ public class BufferedImage extends java.awt.Image
* the raster has been premultiplied with alpha.
* @param properties Hashtable of
* String/Object pairs.
- * @exception RasterFormatException if the number and
+ * @exception RasterFormatException if the number and
* types of bands in the SampleModel of the
* Raster do not match the number and types required by
* the ColorModel to represent its color and alpha
* components.
- * @exception IllegalArgumentException if
+ * @exception IllegalArgumentException if
* raster is incompatible with cm
* @see ColorModel
* @see Raster
@@ -927,7 +927,7 @@ public class BufferedImage extends java.awt.Image
* each color component in the returned data when
* using this method. With a specified coordinate (x, y) in the
* image, the ARGB pixel can be accessed in this way:
- *
@@ -1131,7 +1131,7 @@ public class BufferedImage extends java.awt.Image
* @return an {@link Object} that is the property referred to by the
* specified name or null if the
* properties of this image are not yet known.
- * @throws NullPointerException if the property name is null.
+ * @throws NullPointerException if the property name is null.
* @see ImageObserver
* @see java.awt.Image#UndefinedProperty
*/
@@ -1144,7 +1144,7 @@ public class BufferedImage extends java.awt.Image
* @param name the property name
* @return an Object that is the property referred to by
* the specified name.
- * @throws NullPointerException if the property name is null.
+ * @throws NullPointerException if the property name is null.
*/
public Object getProperty(String name) {
if (name == null) {
@@ -1196,7 +1196,7 @@ public class BufferedImage extends java.awt.Image
* @param h the height of the specified rectangular region
* @return a BufferedImage that is the subimage of this
* BufferedImage.
- * @exception RasterFormatException if the specified
+ * @exception RasterFormatException if the specified
* area is not contained within this BufferedImage.
*/
public BufferedImage getSubimage (int x, int y, int w, int h) {
@@ -1388,7 +1388,7 @@ public class BufferedImage extends java.awt.Image
* @param tileY the y index of the requested tile in the tile array
* @return a Raster that is the tile defined by the
* arguments tileX and tileY.
- * @exception ArrayIndexOutOfBoundsException if both
+ * @exception ArrayIndexOutOfBoundsException if both
* tileX and tileY are not
* equal to 0
*/
@@ -1558,7 +1558,7 @@ public class BufferedImage extends java.awt.Image
* @return true if the tile specified by the specified
* indices is checked out for writing; false
* otherwise.
- * @exception ArrayIndexOutOfBoundsException if both
+ * @exception ArrayIndexOutOfBoundsException if both
* tileX and tileY are not equal
* to 0
*/
diff --git a/jdk/src/share/classes/java/awt/image/ByteLookupTable.java b/jdk/src/share/classes/java/awt/image/ByteLookupTable.java
index 6f7e67d7432..35968d62ac8 100644
--- a/jdk/src/share/classes/java/awt/image/ByteLookupTable.java
+++ b/jdk/src/share/classes/java/awt/image/ByteLookupTable.java
@@ -171,7 +171,7 @@ public class ByteLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if src is
* longer than dst or if for any element
* i of src,
- * (src[i]&0xff)-offset is either less than
+ * {@code (src[i]&0xff)-offset} is either less than
* zero or greater than or equal to the length of the
* lookup table for any band.
*/
diff --git a/jdk/src/share/classes/java/awt/image/ColorModel.java b/jdk/src/share/classes/java/awt/image/ColorModel.java
index 5ce313e1bf3..73f5b49fc28 100644
--- a/jdk/src/share/classes/java/awt/image/ColorModel.java
+++ b/jdk/src/share/classes/java/awt/image/ColorModel.java
@@ -692,12 +692,12 @@ public abstract class ColorModel implements Transparency{
* DataBuffer.TYPE_INT.
* @param inData an array of pixel values
* @return the value of the green component of the specified pixel.
- * @throws ClassCastException if inData
+ * @throws ClassCastException if inData
* is not a primitive array of type transferType
- * @throws ArrayIndexOutOfBoundsException if
+ * @throws ArrayIndexOutOfBoundsException if
* inData is not large enough to hold a pixel value
* for this ColorModel
- * @throws UnsupportedOperationException if this
+ * @throws UnsupportedOperationException if this
* tranferType is not supported by this
* ColorModel
*/
diff --git a/jdk/src/share/classes/java/awt/image/DirectColorModel.java b/jdk/src/share/classes/java/awt/image/DirectColorModel.java
index 751d780ba64..2ddd85c1ad1 100644
--- a/jdk/src/share/classes/java/awt/image/DirectColorModel.java
+++ b/jdk/src/share/classes/java/awt/image/DirectColorModel.java
@@ -642,12 +642,12 @@ public class DirectColorModel extends PackedColorModel {
* @param inData the specified pixel
* @return the alpha component of the specified pixel, scaled from
* 0 to 255.
- * @exception ClassCastException if inData
+ * @exception ClassCastException if inData
* is not a primitive array of type transferType
- * @exception ArrayIndexOutOfBoundsException if
+ * @exception ArrayIndexOutOfBoundsException if
* inData is not large enough to hold a pixel value
* for this ColorModel
- * @exception UnsupportedOperationException if this
+ * @exception UnsupportedOperationException if this
* tranferType is not supported by this
* ColorModel
*/
@@ -1055,7 +1055,7 @@ public class DirectColorModel extends PackedColorModel {
* begin retrieving the color and alpha components
* @return an int pixel value in this
* ColorModel corresponding to the specified components.
- * @exception ArrayIndexOutOfBoundsException if
+ * @exception ArrayIndexOutOfBoundsException if
* the components array is not large enough to
* hold all of the color and alpha components starting at
* offset
@@ -1097,9 +1097,9 @@ public class DirectColorModel extends PackedColorModel {
* and alpha components
* @return an Object representing an array of color and
* alpha components.
- * @exception ClassCastException if obj
+ * @exception ClassCastException if obj
* is not a primitive array of type transferType
- * @exception ArrayIndexOutOfBoundsException if
+ * @exception ArrayIndexOutOfBoundsException if
* obj is not large enough to hold a pixel value
* for this ColorModel or the components
* array is not large enough to hold all of the color and alpha
diff --git a/jdk/src/share/classes/java/awt/image/ImageProducer.java b/jdk/src/share/classes/java/awt/image/ImageProducer.java
index 768aad50dd9..a419f8bd644 100644
--- a/jdk/src/share/classes/java/awt/image/ImageProducer.java
+++ b/jdk/src/share/classes/java/awt/image/ImageProducer.java
@@ -100,11 +100,11 @@ public interface ImageProducer {
* ImageProducer should respond by executing
* the following minimum set of ImageConsumer
* method calls:
- *
+ *
{@code
* ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
* ic.setPixels(...); // As many times as needed
* ic.imageComplete();
- *
+ * }
* @param ic the specified ImageConsumer
* @see ImageConsumer#setHints
*/
diff --git a/jdk/src/share/classes/java/awt/image/IndexColorModel.java b/jdk/src/share/classes/java/awt/image/IndexColorModel.java
index fabe8d20432..d26e3d381be 100644
--- a/jdk/src/share/classes/java/awt/image/IndexColorModel.java
+++ b/jdk/src/share/classes/java/awt/image/IndexColorModel.java
@@ -98,6 +98,7 @@ import java.math.BigInteger;
* Index values greater than or equal to the map size, but less than
* 2n, are undefined and return 0 for all color and
* alpha components.
+ *
*
* For those methods that use a primitive array pixel representation of
* type transferType, the array length is always one.
diff --git a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java
index b5fd99b475f..90519ce26e4 100644
--- a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java
+++ b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java
@@ -37,7 +37,7 @@ import java.util.Enumeration;
* uses an array to produce pixel values for an Image. Here is an example
* which calculates a 100x100 image representing a fade from black to blue
* along the X axis and a fade from black to red along the Y axis:
- *
+ *
{@code
*
* int w = 100;
* int h = 100;
@@ -52,12 +52,12 @@ import java.util.Enumeration;
* }
* Image img = createImage(new MemoryImageSource(w, h, pix, 0, w));
*
- *
+ * }
* The MemoryImageSource is also capable of managing a memory image which
* varies over time to allow animation or custom rendering. Here is an
* example showing how to set up the animation source and signal changes
* in the data (adapted from the MemoryAnimationSourceDemo by Garth Dickie):
- *
*
* @see ImageProducer
*
diff --git a/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java b/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
index 43d3a8080ba..8095dad2fc5 100644
--- a/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
+++ b/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
@@ -52,14 +52,14 @@ package java.awt.image;
* x, y from DataBufferdata
* and storing the pixel data in data elements of type
* dataType:
- *
+ *
{@code
* int dataElementSize = DataBuffer.getDataTypeSize(dataType);
* int bitnum = dataBitOffset + x*pixelBitStride;
* int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
* int shift = dataElementSize - (bitnum & (dataElementSize-1))
* - pixelBitStride;
* int pixel = (element >> shift) & ((1 << pixelBitStride) - 1);
- *
+ * }
*/
public class MultiPixelPackedSampleModel extends SampleModel
diff --git a/jdk/src/share/classes/java/awt/image/PixelGrabber.java b/jdk/src/share/classes/java/awt/image/PixelGrabber.java
index 85dde7875ce..2053ed71bdc 100644
--- a/jdk/src/share/classes/java/awt/image/PixelGrabber.java
+++ b/jdk/src/share/classes/java/awt/image/PixelGrabber.java
@@ -35,7 +35,7 @@ import java.awt.Image;
* The PixelGrabber class implements an ImageConsumer which can be attached
* to an Image or ImageProducer object to retrieve a subset of the pixels
* in that image. Here is an example:
- *
+ *
{@code
*
* public void handlesinglepixel(int x, int y, int pixel) {
* int alpha = (pixel >> 24) & 0xff;
@@ -65,7 +65,7 @@ import java.awt.Image;
* }
* }
*
- *
+ * }
*
* @see ColorModel#getRGBdefault
*
@@ -165,8 +165,8 @@ public class PixelGrabber implements ImageConsumer {
* accumulated in the default RGB ColorModel. If the forceRGB
* parameter is true, then the pixels will be accumulated in the
* default RGB ColorModel anyway. A buffer is allocated by the
- * PixelGrabber to hold the pixels in either case. If (w < 0) or
- * (h < 0), then they will default to the remaining width and
+ * PixelGrabber to hold the pixels in either case. If {@code (w < 0)} or
+ * {@code (h < 0)}, then they will default to the remaining width and
* height of the source data when that information is delivered.
* @param img the image to retrieve the image data from
* @param x the x coordinate of the upper left corner of the rectangle
@@ -233,10 +233,10 @@ public class PixelGrabber implements ImageConsumer {
* behaves in the following ways, depending on the value of
* ms:
*
- *
If ms == 0, waits until all pixels are delivered
- *
If ms > 0, waits until all pixels are delivered
+ *
If {@code ms == 0}, waits until all pixels are delivered
+ *
If {@code ms > 0}, waits until all pixels are delivered
* as timeout expires.
- *
If ms < 0, returns true if all pixels
+ *
If {@code ms < 0}, returns true if all pixels
* are grabbed, false otherwise and does not wait.
*
* @param ms the number of milliseconds to wait for the image pixels
diff --git a/jdk/src/share/classes/java/awt/image/RGBImageFilter.java b/jdk/src/share/classes/java/awt/image/RGBImageFilter.java
index 59d77e3428d..2f807ddf50f 100644
--- a/jdk/src/share/classes/java/awt/image/RGBImageFilter.java
+++ b/jdk/src/share/classes/java/awt/image/RGBImageFilter.java
@@ -39,7 +39,7 @@ import java.awt.image.ColorModel;
* The only method which needs to be defined to create a useable image
* filter is the filterRGB method. Here is an example of a definition
* of a filter which swaps the red and blue components of an image:
- *
*
* @see FilteredImageSource
* @see ImageFilter
diff --git a/jdk/src/share/classes/java/awt/image/ShortLookupTable.java b/jdk/src/share/classes/java/awt/image/ShortLookupTable.java
index 09309e0045e..f0c18e0878e 100644
--- a/jdk/src/share/classes/java/awt/image/ShortLookupTable.java
+++ b/jdk/src/share/classes/java/awt/image/ShortLookupTable.java
@@ -114,7 +114,7 @@ public class ShortLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if src is
* longer than dst or if for any element
* i of src,
- * (src[i]&0xffff)-offset is either less than
+ * {@code (src[i]&0xffff)-offset} is either less than
* zero or greater than or equal to the length of the
* lookup table for any band.
*/
@@ -165,7 +165,7 @@ public class ShortLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if src is
* longer than dst or if for any element
* i of src,
- * (src[i]&0xffff)-offset is either less than
+ * {@code (src[i]&0xffff)-offset} is either less than
* zero or greater than or equal to the length of the
* lookup table for any band.
*/
diff --git a/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java b/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
index b99eda6c79e..58c1db0b726 100644
--- a/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
+++ b/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
@@ -57,10 +57,10 @@ import java.util.Arrays;
* The following code illustrates extracting the bits of the sample
* representing band b for pixel x,y
* from DataBuffer data:
- *
*/
public class SinglePixelPackedSampleModel extends SampleModel
diff --git a/jdk/src/share/classes/java/awt/image/WritableRaster.java b/jdk/src/share/classes/java/awt/image/WritableRaster.java
index d38d7af3f60..190596af0a2 100644
--- a/jdk/src/share/classes/java/awt/image/WritableRaster.java
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java
@@ -372,13 +372,13 @@ public class WritableRaster extends Raster {
* integral type and less than or equal to 32 bits in size, then calling
* this method is equivalent to executing the following code for all
* x,y addresses valid in both Rasters.
- *
+ *
{@code
* Raster srcRaster;
* WritableRaster dstRaster;
* for (int b = 0; b < srcRaster.getNumBands(); b++) {
* dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b));
* }
- *
+ * }
* Thus, when copying an integral type source to an integral type
* destination, if the source sample size is greater than the destination
* sample size for a particular band, the high order bits of the source
diff --git a/jdk/src/share/classes/javax/imageio/ImageIO.java b/jdk/src/share/classes/javax/imageio/ImageIO.java
index 2474bb6582e..62098779a72 100644
--- a/jdk/src/share/classes/javax/imageio/ImageIO.java
+++ b/jdk/src/share/classes/javax/imageio/ImageIO.java
@@ -228,7 +228,7 @@ public final class ImageIO {
* be used when creating ImageInputStreams and
* ImageOutputStreams.
*
- *
When reading from a standard InputStream>, it
+ *
When reading from a standard InputStream, it
* may be necessary to save previously read information in a cache
* since the underlying stream does not allow data to be re-read.
* Similarly, when writing to a standard
diff --git a/jdk/src/share/classes/javax/imageio/ImageReadParam.java b/jdk/src/share/classes/javax/imageio/ImageReadParam.java
index d24b7ef99e7..6053348d100 100644
--- a/jdk/src/share/classes/javax/imageio/ImageReadParam.java
+++ b/jdk/src/share/classes/javax/imageio/ImageReadParam.java
@@ -80,7 +80,7 @@ import java.awt.image.BufferedImage;
*
*
The resulting region is then subsampled according to the
* factors given in {@link IIOParam#setSourceSubsampling
- * IIOParam.setSourceSubsampling}. The first pixel,
+ * IIOParam.setSourceSubsampling}. The first pixel,
* the number of pixels per row, and the number of rows all depend
* on the subsampling settings.
* Call the minimum X and Y coordinates of the resulting rectangle
diff --git a/jdk/src/share/classes/javax/imageio/ImageReader.java b/jdk/src/share/classes/javax/imageio/ImageReader.java
index c1d62ababcb..ebbb98324a0 100644
--- a/jdk/src/share/classes/javax/imageio/ImageReader.java
+++ b/jdk/src/share/classes/javax/imageio/ImageReader.java
@@ -230,8 +230,8 @@ public abstract class ImageReader {
* increased as each image (or thumbnail, or image metadata) is
* read. If seekForwardOnly is true, then a call to
* read(index) will throw an
- * IndexOutOfBoundsException if index <
- * this.minIndex; otherwise, the value of
+ * IndexOutOfBoundsException if {@code index < this.minIndex};
+ * otherwise, the value of
* minIndex will be set to index. If
* seekForwardOnly is false, the value of
* minIndex will remain 0 regardless of any read
@@ -328,8 +328,8 @@ public abstract class ImageReader {
* increased as each image (or thumbnail, or image metadata) is
* read. If seekForwardOnly is true, then a call to
* read(index) will throw an
- * IndexOutOfBoundsException if index <
- * this.minIndex; otherwise, the value of
+ * IndexOutOfBoundsException if {@code index < this.minIndex};
+ * otherwise, the value of
* minIndex will be set to index. If
* seekForwardOnly is false, the value of
* minIndex will remain 0 regardless of any read
@@ -600,8 +600,7 @@ public abstract class ImageReader {
*
Note that formats that return false from
* this method may nonetheless allow tiling (e.g. Restart
* Markers in JPEG), and random access will likely be reasonably
- * efficient on tiles. See {@link #isImageTiled
- * isImageTiled}.
+ * efficient on tiles. See {@link #isImageTiled isImageTiled}.
*
*
A reader for which all images are guaranteed to support
* easy random access, or are guaranteed not to support easy
@@ -1212,11 +1211,10 @@ public abstract class ImageReader {
/**
* Returns true if this plug-in supports reading
- * just a {@link java.awt.image.Raster Raster} of pixel data.
+ * just a {@link java.awt.image.Raster Raster} of pixel data.
* If this method returns false, calls to
- * {@link #readRaster readRaster} or {@link #readTileRaster
- * readTileRaster} will throw an
- * UnsupportedOperationException.
+ * {@link #readRaster readRaster} or {@link #readTileRaster readTileRaster}
+ * will throw an UnsupportedOperationException.
*
*
The default implementation returns false.
*
@@ -1236,7 +1234,7 @@ public abstract class ImageReader {
* application must determine how to interpret the pixel data by other
* means. Any destination or image-type parameters in the supplied
* ImageReadParam object are ignored, but all other
- * parameters are used exactly as in the {@link #read read}
+ * parameters are used exactly as in the {@link #read read}
* method, except that any destination offset is used as a logical rather
* than a physical offset. The size of the returned Raster
* will always be that of the source region clipped to the actual image.
@@ -1249,10 +1247,9 @@ public abstract class ImageReader {
*
*
Any registered readUpdateListeners are ignored, as
* there is no BufferedImage, but all other listeners are
- * called exactly as they are for the {@link #read read}
- * method.
+ * called exactly as they are for the {@link #read read} method.
*
- *
If {@link #canReadRaster canReadRaster()} returns
+ *
If {@link #canReadRaster canReadRaster()} returns
* false, this method throws an
* UnsupportedOperationException.
*
@@ -1481,13 +1478,13 @@ public abstract class ImageReader {
* The application must determine how to interpret the pixel data by other
* means.
*
- *
If {@link #canReadRaster canReadRaster()} returns
+ *
If {@link #canReadRaster canReadRaster()} returns
* false, this method throws an
* UnsupportedOperationException.
*
*
The default implementation checks if reading
* Rasters is supported, and if so calls {@link
- * #readRaster readRaster(imageIndex, null)} if
+ * #readRaster readRaster(imageIndex, null)} if
* tileX and tileY are 0, or throws an
* IllegalArgumentException otherwise.
*
@@ -1548,8 +1545,8 @@ public abstract class ImageReader {
* source render size or any format-specific settings), they will
* be ignored.
*
- *
The default implementation just calls {@link #read
- * read(imageIndex, param)}.
+ *
The default implementation just calls
+ * {@link #read read(imageIndex, param)}.
*
* @param imageIndex the index of the image to be retrieved.
* @param param an ImageReadParam used to control
@@ -2544,9 +2541,8 @@ public abstract class ImageReader {
* the supplied ImageReadParam. The actual
* subsampling factors, destination size, and destination offset
* are not taken into consideration, thus further
- * clipping must take place. The {@link #computeRegions
- * computeRegions} method performs all necessary
- * clipping.
+ * clipping must take place. The {@link #computeRegions computeRegions}
+ * method performs all necessary clipping.
*
* @param param the ImageReadParam being used, or
* null.
@@ -2601,7 +2597,7 @@ public abstract class ImageReader {
* width or height of 0, an IllegalArgumentException
* is thrown.
*
- *
The {@link #getSourceRegion getSourceRegion}
+ *
The {@link #getSourceRegion getSourceRegion>}
* method may be used if only source clipping is desired.
*
* @param param an ImageReadParam, or null.
diff --git a/jdk/src/share/classes/javax/imageio/ImageTypeSpecifier.java b/jdk/src/share/classes/javax/imageio/ImageTypeSpecifier.java
index 556f8b76985..c9c17dfe4c1 100644
--- a/jdk/src/share/classes/javax/imageio/ImageTypeSpecifier.java
+++ b/jdk/src/share/classes/javax/imageio/ImageTypeSpecifier.java
@@ -840,7 +840,7 @@ public class ImageTypeSpecifier {
* not one of 1, 2, 4, 8, or 16.
* @exception IllegalArgumentException if the
* non-null LUT parameters do not have lengths of
- * exactly 1 << bits.
+ * exactly {@code 1 << bits}.
* @exception IllegalArgumentException if dataType is
* not one of DataBuffer.TYPE_BYTE,
* DataBuffer.TYPE_SHORT,
diff --git a/jdk/src/share/classes/javax/imageio/ImageWriteParam.java b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java
index 4db0e591ea6..adf4f3a9029 100644
--- a/jdk/src/share/classes/javax/imageio/ImageWriteParam.java
+++ b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java
@@ -49,7 +49,7 @@ import java.util.Locale;
* and include additional pixels within the intersected bounds
* according to the horizontal and vertical subsampling factors
* specified by {@link IIOParam#setSourceSubsampling
- * IIOParam.setSourceSubsampling}.
+ * IIOParam.setSourceSubsampling}.
*
*
Individual features such as tiling, progressive encoding, and
* compression may be set in one of four modes.
@@ -462,9 +462,8 @@ public class ImageWriteParam extends IIOParam {
* IllegalStateException.
*
*
MODE_EXPLICIT - The image will be tiled
- * according to parameters given in the {@link #setTiling
- * setTiling} method. Any previously set tiling
- * parameters are discarded.
+ * according to parameters given in the {@link #setTiling setTiling}
+ * method. Any previously set tiling parameters are discarded.
*
*
MODE_COPY_FROM_METADATA - The image will
* conform to the metadata object passed in to a write.
@@ -1421,7 +1420,7 @@ public class ImageWriteParam extends IIOParam {
* with getCompressionQualityDescriptions as part of a user
* interface for setting or displaying the compression quality
* level. See {@link #getCompressionQualityDescriptions
- * getCompressionQualityDescriptions} for more information.
+ * getCompressionQualityDescriptions} for more information.
*
*
If no descriptions are available, null is
* returned. If null is returned from
diff --git a/jdk/src/share/classes/javax/imageio/ImageWriter.java b/jdk/src/share/classes/javax/imageio/ImageWriter.java
index a9ecb042b3e..1fdabdcd5f8 100644
--- a/jdk/src/share/classes/javax/imageio/ImageWriter.java
+++ b/jdk/src/share/classes/javax/imageio/ImageWriter.java
@@ -692,7 +692,7 @@ public abstract class ImageWriter implements ImageTranscoder {
* output prior to the current seek position may be flushed, and
* need not be readable or writable, unless the plug-in needs to
* be able to patch up the header information when
- * endWriteSequence is called (e.g. TIFF).
+ * endWriteSequence is called (e.g. TIFF).
*
*
If canWriteSequence returns false,
* this method will throw an
diff --git a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java
index 1a68b019d59..4ca4f74c4a0 100644
--- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java
+++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java
@@ -729,6 +729,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat {
* @param required true if an object value must be present.
* @param defaultValue the default value for the
* Object reference, or null.
+ * @param the type of the object.
*
* @exception IllegalArgumentException if elementName
* is null, or is not a legal element name for this format.
@@ -765,6 +766,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat {
* @param enumeratedValues a List of
* Objects containing the legal values for the
* object reference.
+ * @param the type of the object.
*
* @exception IllegalArgumentException if elementName
* is null, or is not a legal element name for this format.
@@ -836,6 +838,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat {
* is inclusive.
* @param maxInclusive true if maxValue
* is inclusive.
+ * @param the type of the object.
*
* @exception IllegalArgumentException if elementName
* is null, or is not a legal element name for this
diff --git a/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java b/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java
index 840e6c3f223..de35f5fe11e 100644
--- a/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java
+++ b/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java
@@ -56,9 +56,9 @@ import com.sun.imageio.plugins.bmp.BMPConstants;
*
*
Compression Types
*
Type String
Description
Image Types
- *
BI_RGB
Uncompressed RLE
<= 8-bits/sample
- *
BI_RLE8
8-bit Run Length Encoding
<= 8-bits/sample
- *
BI_RLE4
4-bit Run Length Encoding
<= 4-bits/sample
+ *
BI_RGB
Uncompressed RLE
{@literal <= } 8-bits/sample
+ *
BI_RLE8
8-bit Run Length Encoding
{@literal <=} 8-bits/sample
+ *
BI_RLE4
4-bit Run Length Encoding
{@literal <=} 4-bits/sample
*
BI_BITFIELDS
Packed data
16 or 32 bits/sample
*
*/
diff --git a/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java b/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java
index 269c03acc5b..720aa600129 100644
--- a/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java
+++ b/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java
@@ -46,16 +46,15 @@ import javax.imageio.ImageReadParam;
* This class allows the tables to be specified directly from client
* code. If no tables are specified either in the stream or in a
* JPEGImageReadParam, then the stream is presumed to use
- * the "standard" visually lossless tables. See {@link JPEGQTable
- * JPEGQTable} and {@link JPEGHuffmanTable
- * JPEGHuffmanTable} for more information on the default
- * tables.
+ * the "standard" visually lossless tables. See {@link JPEGQTable JPEGQTable}
+ * and {@link JPEGHuffmanTable JPEGHuffmanTable} for more information
+ * on the default tables.
*
*
The default JPEGImageReadParam returned by the
* getDefaultReadParam method of the builtin JPEG reader
* contains no tables. Default tables may be obtained from the table
- * classes {@link JPEGQTable JPEGQTable} and {@link
- * JPEGHuffmanTable JPEGHuffmanTable}.
+ * classes {@link JPEGQTable JPEGQTable} and
+ * {@link JPEGHuffmanTable JPEGHuffmanTable}.
*
*
If a stream does contain tables, the tables given in a
* JPEGImageReadParam are ignored. Furthermore, if the
@@ -64,13 +63,12 @@ import javax.imageio.ImageReadParam;
* abbreviated images. Once tables have been read from a stream, they
* can be overridden only by tables subsequently read from the same
* stream. In order to specify new tables, the {@link
- * javax.imageio.ImageReader#setInput setInput} method of
+ * javax.imageio.ImageReader#setInput setInput} method of
* the reader must be called to change the stream.
*
*
Note that this class does not provide a means for obtaining the
* tables found in a stream. These may be extracted from a stream by
- * consulting the IIOMetadata object returned by the
- * reader.
+ * consulting the IIOMetadata object returned by the reader.
*
*
* For more information about the operation of the built-in JPEG plug-ins,
diff --git a/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java b/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java
index 4e8a35cbefa..b4df14e99c6 100644
--- a/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java
+++ b/jdk/src/share/classes/javax/imageio/plugins/jpeg/JPEGImageWriteParam.java
@@ -66,8 +66,8 @@ import com.sun.imageio.plugins.jpeg.JPEG;
* when an abbreviated stream must be written without writing any tables
* to a stream first. In order to use this class, the metadata object
* passed into the writer must contain no tables, and no stream metadata
- * must be provided. See {@link JPEGQTable JPEGQTable} and
- * {@link JPEGHuffmanTable JPEGHuffmanTable} for more
+ * must be provided. See {@link JPEGQTable JPEGQTable} and
+ * {@link JPEGHuffmanTable JPEGHuffmanTable} for more
* information on the default tables.
*
*
The default JPEGImageWriteParam returned by the
@@ -80,7 +80,7 @@ import com.sun.imageio.plugins.jpeg.JPEG;
* set of tables has been written, only tables in the metadata can
* override them for subsequent writes, whether to the same stream or
* a different one. In order to specify new tables using this class,
- * the {@link javax.imageio.ImageWriter#reset reset}
+ * the {@link javax.imageio.ImageWriter#reset reset}
* method of the writer must be called.
*
*
diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java
index 969bc8d9a4d..4d4ccec0fa6 100644
--- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java
@@ -78,7 +78,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi {
* ImageInputStream.class, to be returned from
* getInputTypes.
* @deprecated Instead of using this field, directly create
- * the equivalent array { ImageInputStream.class }.
+ * the equivalent array { ImageInputStream.class }.
*/
@Deprecated
public static final Class[] STANDARD_INPUT_TYPE =
diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java
index b6e0c9e46da..7fc1a334a9f 100644
--- a/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java
+++ b/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java
@@ -80,7 +80,7 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi {
* ImageOutputStream.class, to be returned from
* getOutputTypes.
* @deprecated Instead of using this field, directly create
- * the equivalent array { ImageOutputStream.class }.
+ * the equivalent array { ImageOutputStream.class }.
*/
@Deprecated
public static final Class[] STANDARD_OUTPUT_TYPE =
diff --git a/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java b/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java
index c94c98d0359..3f4338d7db9 100644
--- a/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java
+++ b/jdk/src/share/classes/javax/imageio/spi/ServiceRegistry.java
@@ -157,6 +157,8 @@ public class ServiceRegistry {
* or null if the system class loader (or, failing that
* the bootstrap class loader) is to be used.
*
+ * @param the type of the providerClass.
+ *
* @return An Iterator that yields provider objects
* for the given service, in some arbitrary order. The iterator
* will throw an Error if a provider-configuration
@@ -188,6 +190,8 @@ public class ServiceRegistry {
* @param providerClass a Classobject indicating the
* class or interface of the service providers being detected.
*
+ * @param the type of the providerClass.
+ *
* @return An Iterator that yields provider objects
* for the given service, in some arbitrary order. The iterator
* will throw an Error if a provider-configuration
@@ -247,6 +251,7 @@ public class ServiceRegistry {
* @param provider the service provide object to be registered.
* @param category the category under which to register the
* provider.
+ * @param the type of the provider.
*
* @return true if no provider of the same class was previously
* registered in the same category category.
@@ -348,6 +353,7 @@ public class ServiceRegistry {
* @param provider the service provider object to be deregistered.
* @param category the category from which to deregister the
* provider.
+ * @param the type of the provider.
*
* @return true if the provider was previously
* registered in the same category category,
@@ -435,6 +441,7 @@ public class ServiceRegistry {
* @param category the category to be retrieved from.
* @param useOrdering true if pairwise orderings
* should be taken account in ordering the returned objects.
+ * @param the type of the category.
*
* @return an Iterator containing service provider
* objects from the given category, possibly in order.
@@ -490,6 +497,7 @@ public class ServiceRegistry {
* whose filter method will be invoked.
* @param useOrdering true if pairwise orderings
* should be taken account in ordering the returned objects.
+ * @param the type of the category.
*
* @return an Iterator containing service provider
* objects from the given category, possibly in order.
@@ -517,6 +525,7 @@ public class ServiceRegistry {
*
* @param providerClass the Class of the desired
* service provider object.
+ * @param the type of the provider.
*
* @return a currently registered service provider object with the
* desired Classtype, or null is none is
@@ -561,6 +570,7 @@ public class ServiceRegistry {
* @param firstProvider the preferred provider.
* @param secondProvider the provider to which
* firstProvider is preferred.
+ * @param the type of the category.
*
* @return true if a previously unset ordering
* was established.
@@ -606,6 +616,7 @@ public class ServiceRegistry {
* @param firstProvider the formerly preferred provider.
* @param secondProvider the provider to which
* firstProvider was formerly preferred.
+ * @param the type of the category.
*
* @return true if a previously set ordering was
* disestablished.
diff --git a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java
index d51f22aa8b6..ebf984a9ddc 100644
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java
@@ -183,7 +183,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a boolean value from the stream.
*
- * @exception EOFException if the end of the stream is reached.
+ * @exception java.io.EOFException if the end of the stream is reached.
* @exception IOException if an I/O error occurs.
*/
boolean readBoolean() throws IOException;
@@ -201,7 +201,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a signed byte value from the stream.
*
- * @exception EOFException if the end of the stream is reached.
+ * @exception java.io.EOFException if the end of the stream is reached.
* @exception IOException if an I/O error occurs.
*/
byte readByte() throws IOException;
@@ -225,7 +225,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return an unsigned byte value from the stream.
*
- * @exception EOFException if the end of the stream is reached.
+ * @exception java.io.EOFException if the end of the stream is reached.
* @exception IOException if an I/O error occurs.
*/
int readUnsignedByte() throws IOException;
@@ -240,7 +240,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a signed short value from the stream.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -261,7 +261,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return an unsigned short value from the stream, as an int.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -278,7 +278,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return an unsigned char value from the stream.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -296,7 +296,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a signed int value from the stream.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -316,7 +316,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return an unsigned int value from the stream, as a long.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -334,7 +334,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a signed long value from the stream.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -352,7 +352,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a float value from the stream.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -370,7 +370,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a double value from the stream.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*
@@ -469,7 +469,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* then a UTFDataFormatException is thrown.
*
*
If end of file is encountered at any time during this
- * entire process, then an EOFException is thrown.
+ * entire process, then an java.io.EOFException is thrown.
*
*
After every group has been converted to a character by this
* process, the characters are gathered, in the same order in
@@ -488,10 +488,10 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @return a String read from the stream.
*
- * @exception EOFException if this stream reaches the end
+ * @exception java.io.EOFException if this stream reaches the end
* before reading all the bytes.
- * @exception UTFDataFormatException if the bytes do not represent a
- * valid modified UTF-8 encoding of a string.
+ * @exception java.io.UTFDataFormatException if the bytes do not represent
+ * a valid modified UTF-8 encoding of a string.
* @exception IOException if an I/O error occurs.
*/
String readUTF() throws IOException;
@@ -499,7 +499,7 @@ public interface ImageInputStream extends DataInput, Closeable {
/**
* Reads len bytes from the stream, and stores them
* into b starting at index off.
- * If the end of the stream is reached, an EOFException
+ * If the end of the stream is reached, an java.io.EOFException
* will be thrown.
*
*
The bit offset within the stream is reset to zero before
@@ -514,7 +514,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len
is greater than b.length.
* @exception NullPointerException if b is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -523,7 +523,7 @@ public interface ImageInputStream extends DataInput, Closeable {
/**
* Reads b.length bytes from the stream, and stores them
* into b starting at index 0.
- * If the end of the stream is reached, an EOFException
+ * If the end of the stream is reached, an java.io.EOFException
* will be thrown.
*
*
The bit offset within the stream is reset to zero before
@@ -533,7 +533,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @exception NullPointerException if b is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -544,7 +544,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and
* stores them into s starting at index
* off. If the end of the stream is reached, an
- * EOFException will be thrown.
+ * java.io.EOFException will be thrown.
*
*
The bit offset within the stream is reset to zero before
* the read occurs.
@@ -558,7 +558,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len
is greater than s.length.
* @exception NullPointerException if s is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -569,7 +569,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and
* stores them into c starting at index
* off. If the end of the stream is reached, an
- * EOFException will be thrown.
+ * java.io.EOFException will be thrown.
*
*
The bit offset within the stream is reset to zero before
* the read occurs.
@@ -583,7 +583,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len
is greater than c.length.
* @exception NullPointerException if c is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -594,7 +594,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and
* stores them into i starting at index
* off. If the end of the stream is reached, an
- * EOFException will be thrown.
+ * java.io.EOFException will be thrown.
*
*
The bit offset within the stream is reset to zero before
* the read occurs.
@@ -608,7 +608,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len
is greater than i.length.
* @exception NullPointerException if i is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -619,7 +619,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and
* stores them into l starting at index
* off. If the end of the stream is reached, an
- * EOFException will be thrown.
+ * java.io.EOFException will be thrown.
*
*
The bit offset within the stream is reset to zero before
* the read occurs.
@@ -633,7 +633,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len is greater than l.length.
* @exception NullPointerException if l is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -644,7 +644,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* floats) from the stream according to the current byte order,
* and stores them into f starting at
* index off. If the end of the stream is reached,
- * an EOFException will be thrown.
+ * an java.io.EOFException will be thrown.
*
*
The bit offset within the stream is reset to zero before
* the read occurs.
@@ -658,7 +658,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len is greater than f.length.
* @exception NullPointerException if f is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -669,7 +669,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* floats) from the stream according to the current byte order,
* and stores them into d starting at
* index off. If the end of the stream is reached,
- * an EOFException will be thrown.
+ * an java.io.EOFException will be thrown.
*
*
The bit offset within the stream is reset to zero before
* the read occurs.
@@ -683,7 +683,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len is greater than d.length.
* @exception NullPointerException if d is
* null.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes.
* @exception IOException if an I/O error occurs.
*/
@@ -748,7 +748,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* @return an int containing the value 0
* or 1.
*
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bits.
* @exception IOException if an I/O error occurs.
*/
@@ -768,13 +768,13 @@ public interface ImageInputStream extends DataInput, Closeable {
* the right side of the return value, as shown by the following
* pseudo-code:
*
- *
+ *
{@code
* long accum = 0L;
* for (int i = 0; i < numBits; i++) {
* accum <<= 1; // Shift left one bit to make room
* accum |= readBit();
* }
- *
+ * }
*
* Note that the result of readBits(32) may thus not
* be equal to that of readInt() if a reverse network
@@ -782,7 +782,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* false).
*
*
If the end of the stream is encountered before all the bits
- * have been read, an EOFException is thrown.
+ * have been read, an java.io.EOFException is thrown.
*
* @param numBits the number of bits to read, as an int
* between 0 and 64, inclusive.
@@ -791,7 +791,7 @@ public interface ImageInputStream extends DataInput, Closeable {
*
* @exception IllegalArgumentException if numBits
* is not between 0 and 64, inclusive.
- * @exception EOFException if the stream reaches the end before
+ * @exception java.io.EOFException if the stream reaches the end before
* reading all the bits.
* @exception IOException if an I/O error occurs.
*/
@@ -850,7 +850,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* returned by getflushedPosition).
*
*
It is legal to seek past the end of the file; an
- * EOFException will be thrown only if a read is
+ * java.io.EOFException will be thrown only if a read is
* performed.
*
* @param pos a long containing the desired file
diff --git a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
index cf66019768b..8f7061f960e 100644
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
@@ -88,7 +88,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream {
/**
* The position prior to which data may be discarded. Seeking
* to a smaller position is not allowed. flushedPos
- * will always be >= 0.
+ * will always be {@literal >= 0}.
*/
protected long flushedPos = 0;
diff --git a/jdk/src/share/classes/javax/imageio/stream/ImageOutputStream.java b/jdk/src/share/classes/javax/imageio/stream/ImageOutputStream.java
index c525ca39c1e..8deddd3b36b 100644
--- a/jdk/src/share/classes/javax/imageio/stream/ImageOutputStream.java
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageOutputStream.java
@@ -59,9 +59,9 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write. Implementers can use the
- * {@link ImageOutputStreamImpl#flushBits flushBits}
- * method of {@link ImageOutputStreamImpl
- * ImageOutputStreamImpl} to guarantee this.
+ * {@link ImageOutputStreamImpl#flushBits flushBits}
+ * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
+ * to guarantee this.
*
* @param b an int whose lower 8 bits are to be
* written.
@@ -99,9 +99,9 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write. Implementers can use the
- * {@link ImageOutputStreamImpl#flushBits flushBits}
- * method of {@link ImageOutputStreamImpl
- * ImageOutputStreamImpl} to guarantee this.
+ * {@link ImageOutputStreamImpl#flushBits flushBits}
+ * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
+ * to guarantee this.
*
* @param b an array of bytes to be written.
* @param off the start offset in the data.
@@ -182,8 +182,7 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
void writeShort(int v) throws IOException;
/**
- * This method is a synonym for
- * {@link #writeShort writeShort}.
+ * This method is a synonym for {@link #writeShort writeShort}.
*
* @param v an int containing the char (unsigned
* short) value to be written.
@@ -430,7 +429,7 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
*
* @exception NullPointerException if s is
* null.
- * @exception UTFDataFormatException if the modified UTF-8
+ * @exception java.io.UTFDataFormatException if the modified UTF-8
* representation of s requires more than 65536 bytes.
* @exception IOException if an I/O error occurs.
*/
diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java
index b2bac942a7b..5b3f10c2486 100644
--- a/jdk/src/share/classes/javax/print/DocFlavor.java
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java
@@ -286,7 +286,7 @@ import java.io.Serializable;
* "autosensing" works is implementation dependent. In general, preformatted
* autosense print data is provided in a byte oriented representation class
* (byte array, InputStream, URL).
- *
+ *
*
*
*
Service Formatted Print Data
@@ -545,7 +545,7 @@ public class DocFlavor implements Serializable, Cloneable {
* the match.
* @return String representing a mime parameter, or
* null if that parameter is not in the mime type string.
- * @exception throws NullPointerException if paramName is null.
+ * @exception NullPointerException if paramName is null.
*/
public String getParameter(String paramName) {
return
diff --git a/jdk/src/share/classes/javax/print/MultiDocPrintJob.java b/jdk/src/share/classes/javax/print/MultiDocPrintJob.java
index 24a23a14105..07863ae7e85 100644
--- a/jdk/src/share/classes/javax/print/MultiDocPrintJob.java
+++ b/jdk/src/share/classes/javax/print/MultiDocPrintJob.java
@@ -47,7 +47,7 @@ public interface MultiDocPrintJob extends DocPrintJob {
* PrintJobListener.
*
* @param multiDoc The documents to be printed. ALL must be a flavor
- * supported by the PrintJob & PrintService.
+ * supported by the PrintJob {@literal &} PrintService.
*
* @param attributes The job attributes to be applied to this print job.
* If this parameter is null then the default attributes are used.
diff --git a/jdk/src/share/classes/javax/print/PrintService.java b/jdk/src/share/classes/javax/print/PrintService.java
index f221fc5d246..04ad21345f5 100644
--- a/jdk/src/share/classes/javax/print/PrintService.java
+++ b/jdk/src/share/classes/javax/print/PrintService.java
@@ -40,7 +40,7 @@ import javax.print.event.PrintServiceAttributeListener;
* a printer's supported attributes.
*
*/
public interface PrintService {
diff --git a/jdk/src/share/classes/javax/print/ServiceUI.java b/jdk/src/share/classes/javax/print/ServiceUI.java
index 7a9dee8c411..38439cc27a6 100644
--- a/jdk/src/share/classes/javax/print/ServiceUI.java
+++ b/jdk/src/share/classes/javax/print/ServiceUI.java
@@ -118,7 +118,7 @@ public class ServiceUI {
* any changes made by the user.
*
* A typical basic usage of this method may be :
- *
* @param gc used to select screen. null means primary or default screen.
diff --git a/jdk/src/share/classes/javax/print/ServiceUIFactory.java b/jdk/src/share/classes/javax/print/ServiceUIFactory.java
index 820acfa1cdd..e8cd0675ace 100644
--- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java
+++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java
@@ -39,8 +39,8 @@ package javax.print;
* initialize services only when needed without any API dependencies
* except in an environment in which they are used.
*
- * Swing UIs are preferred as they provide a more consistent L&F and
- * can support accessibility APIs.
+ * Swing UIs are preferred as they provide a more consistent {@literal L&F}
+ * and can support accessibility APIs.
*
* Example usage:
*
diff --git a/jdk/src/share/classes/javax/print/attribute/AttributeSet.java b/jdk/src/share/classes/javax/print/attribute/AttributeSet.java
index a00d4789cf5..0f90dbdeacd 100644
--- a/jdk/src/share/classes/javax/print/attribute/AttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/AttributeSet.java
@@ -42,7 +42,7 @@ package javax.print.attribute;
* class rather than the attribute object's class itself. An attribute
* object's
* category is determined by calling the {@link Attribute#getCategory()
- * getCategory()} method defined in interface {@link Attribute
+ * getCategory()} method defined in interface {@link Attribute
* Attribute}.
*
* The interfaces of an AttributeSet resemble those of the Java Collections
@@ -217,7 +217,7 @@ public interface AttributeSet {
/**
* Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the =
- * {@link #add(Attribute) add(Attribute)}
+ * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with each
* element from the specified set.
* The behavior of the addAll(AttributeSet)
@@ -301,7 +301,7 @@ public interface AttributeSet {
* This ensures that t1.equals(t2) implies that
* t1.hashCode()==t2.hashCode() for any two attribute sets
* t1 and t2, as required by the general contract of
- * {@link java.lang.Object#hashCode() Object.hashCode()}.
+ * {@link java.lang.Object#hashCode() Object.hashCode()}.
*
* @return The hash code value for this attribute set.
*/
diff --git a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java
index a552436ef97..175281c07bf 100644
--- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java
@@ -36,9 +36,9 @@ import java.util.Date;
*
* Under the hood, a date-time attribute is stored as a value of class
* java.util.Date. You can get a date-time attribute's Date value by
- * calling {@link #getValue() getValue()}. A date-time attribute's
+ * calling {@link #getValue() getValue()}. A date-time attribute's
* Date value is established when it is constructed (see {@link
- * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once
+ * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once
* constructed, a date-time attribute's value is immutable.
*
* To construct a date-time attribute from separate values of the year, month,
diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java
index 7091a0cd92c..4cb3d413ca9 100644
--- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java
@@ -37,8 +37,8 @@ package javax.print.attribute;
* constructors and mutating operations guarantee an additional invariant,
* namely that all attribute values in the DocAttributeSet must be instances
* of interface {@link DocAttribute DocAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant.
*
*
@@ -74,7 +74,7 @@ public interface DocAttributeSet extends AttributeSet {
/**
* Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
+ * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set,
diff --git a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java
index f1dbf8249e6..9847004b36e 100644
--- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java
@@ -81,15 +81,15 @@ import java.io.Serializable;
* for identical objects (==).
*
* You can convert an enumeration value to a string by calling {@link
- * #toString() toString()}. The string is obtained from a table
+ * #toString() toString()}. The string is obtained from a table
* supplied by the enumeration class.
*
* Under the hood, an enumeration value is just an integer, a different integer
* for each enumeration value within an enumeration class. You can get an
* enumeration value's integer value by calling {@link #getValue()
- * getValue()}. An enumeration value's integer value is established
+ * getValue()}. An enumeration value's integer value is established
* when it is constructed (see {@link #EnumSyntax(int)
- * EnumSyntax(int)}). Since the constructor is protected, the only
+ * EnumSyntax(int)}). Since the constructor is protected, the only
* possible enumeration values are the singleton objects declared in the
* enumeration class; additional enumeration values cannot be created at run
* time.
@@ -170,10 +170,10 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
*
* @return The enumeration singleton value stored at index
* i-L in the enumeration value table returned by
- * {@link #getEnumValueTable() getEnumValueTable()},
+ * {@link #getEnumValueTable() getEnumValueTable()},
* where i is this enumeration value's integer value and
* L is the value returned by {@link #getOffset()
- * getOffset()}.
+ * getOffset()}.
*
* @throws ObjectStreamException if the stream can't be deserialised
* @throws InvalidObjectException
@@ -220,18 +220,18 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* Returns the string table for this enumeration value's enumeration class.
* The enumeration class's integer values are assumed to lie in the range
* L..L+N-1, where L is the value returned by
- * {@link #getOffset() getOffset()} and N is the length
+ * {@link #getOffset() getOffset()} and N is the length
* of the string table. The element in the string table at index
* i-L is the value returned by {@link #toString()
- * toString()} for the enumeration value whose integer value
+ * toString()} for the enumeration value whose integer value
* is i. If an integer within the above range is not used by any
* enumeration value, leave the corresponding table element null.
*
* The default implementation returns null. If the enumeration class (a
* subclass of class EnumSyntax) does not override this method to return a
* non-null string table, and the subclass does not override the {@link
- * #toString() toString()} method, the base class {@link
- * #toString() toString()} method will return just a string
+ * #toString() toString()} method, the base class {@link
+ * #toString() toString()} method will return just a string
* representation of this enumeration value's integer value.
* @return the string table
*/
@@ -243,11 +243,11 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* Returns the enumeration value table for this enumeration value's
* enumeration class. The enumeration class's integer values are assumed to
* lie in the range L..L+N-1, where L is the
- * value returned by {@link #getOffset() getOffset()} and
+ * value returned by {@link #getOffset() getOffset()} and
* N is the length of the enumeration value table. The element in the
* enumeration value table at index i-L is the enumeration
* value object whose integer value is i; the {@link #readResolve()
- * readResolve()} method needs this to preserve singleton
+ * readResolve()} method needs this to preserve singleton
* semantics during deserialization of an enumeration instance. If an
* integer within the above range is not used by any enumeration value,
* leave the corresponding table element null.
@@ -255,8 +255,8 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* The default implementation returns null. If the enumeration class (a
* subclass of class EnumSyntax) does not override this method to return
* a non-null enumeration value table, and the subclass does not override
- * the {@link #readResolve() readResolve()} method, the base
- * class {@link #readResolve() readResolve()} method will throw
+ * the {@link #readResolve() readResolve()} method, the base
+ * class {@link #readResolve() readResolve()} method will throw
* an exception whenever an enumeration instance is deserialized from an
* object input stream.
* @return the value table
diff --git a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java
index e3ab3db11f1..f8d9aa99298 100644
--- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java
@@ -388,7 +388,7 @@ public class HashAttributeSet implements AttributeSet, Serializable {
/**
* Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
+ * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with
* each element from the specified set.
* The behavior of the addAll(AttributeSet)
@@ -512,7 +512,7 @@ public class HashAttributeSet implements AttributeSet, Serializable {
* This ensures that t1.equals(t2) implies that
* t1.hashCode()==t2.hashCode() for any two attribute sets
* t1 and t2, as required by the general contract of
- * {@link java.lang.Object#hashCode() Object.hashCode()}.
+ * {@link java.lang.Object#hashCode() Object.hashCode()}.
*
* @return The hash code value for this attribute set.
*/
diff --git a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java
index 95463e69f8b..81ffff90f86 100644
--- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java
@@ -33,9 +33,9 @@ import java.io.Serializable;
*
* Under the hood, an integer attribute is just an integer. You can get an
* integer attribute's integer value by calling {@link #getValue()
- * getValue()}. An integer attribute's integer value is
+ * getValue()}. An integer attribute's integer value is
* established when it is constructed (see {@link #IntegerSyntax(int)
- * IntegerSyntax(int)}). Once constructed, an integer attribute's
+ * IntegerSyntax(int)}). Once constructed, an integer attribute's
* value is immutable.
*
*
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java
index fba253b73da..e81511f71eb 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java
@@ -36,8 +36,8 @@ package javax.print.attribute;
* constructors and mutating operations guarantee an additional invariant,
* namely that all attribute values in the PrintJobAttributeSet must be
* instances of interface {@link PrintJobAttribute PrintJobAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant.
*
*
@@ -72,7 +72,7 @@ public interface PrintJobAttributeSet extends AttributeSet {
/**
* Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
+ * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set,
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
index dc78f25a2db..6f4c285563f 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java
@@ -37,8 +37,8 @@ package javax.print.attribute;
* constructors and mutating operations guarantee an additional invariant,
* namely that all attribute values in the PrintRequestAttributeSet must be
* instances of interface {@link PrintRequestAttribute PrintRequestAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant.
*
*
@@ -73,7 +73,7 @@ public interface PrintRequestAttributeSet extends AttributeSet {
/**
* Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
+ * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set,
diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
index 164f2d310b1..f7c111c9275 100644
--- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
+++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java
@@ -39,8 +39,8 @@ package javax.print.attribute;
* invariant,
* namely that all attribute values in the PrintServiceAttributeSet must be
* instances of interface {@link PrintServiceAttribute PrintServiceAttribute}.
- * The {@link #add(Attribute) add(Attribute)}, and
- * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
+ * The {@link #add(Attribute) add(Attribute)}, and
+ * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant.
*
*
@@ -77,7 +77,7 @@ public interface PrintServiceAttributeSet extends AttributeSet {
/**
* Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the
- * {@link #add(Attribute) add(Attribute)}
+ * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set,
diff --git a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java
index 5b8ca2c8194..a4a103a438d 100644
--- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java
@@ -39,7 +39,7 @@ import java.io.Serializable;
* resolution attribute's values, indicating the units in which the values are
* to be returned. The two most common resolution units are dots per inch (dpi)
* and dots per centimeter (dpcm), and exported constants {@link #DPI
- * DPI} and {@link #DPCM DPCM} are provided for
+ * DPI} and {@link #DPCM DPCM} are provided for
* indicating those units.
*
* Once constructed, a resolution attribute's value is immutable.
@@ -68,9 +68,9 @@ import java.io.Serializable;
* done, which would not be guaranteed if a floating point representation were
* used.
*
- * The exported constant {@link #DPI DPI} is actually the
+ * The exported constant {@link #DPI DPI} is actually the
* conversion factor by which to multiply a value in dpi to get the value in
- * dphi. Likewise, the exported constant {@link #DPCM DPCM} is the
+ * dphi. Likewise, the exported constant {@link #DPCM DPCM} is the
* conversion factor by which to multiply a value in dpcm to get the value in
* dphi. A client can specify a resolution value in units other than dpi or dpcm
* by supplying its own conversion factor. However, since the internal units of
@@ -120,12 +120,12 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* @param feedResolution
* Feed direction resolution.
* @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
+ * Unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if crossFeedResolution <
- * 1 or feedResolution < 1 or units < 1.
+ * (unchecked exception) Thrown if {@code crossFeedResolution < 1}
+ * or {@code feedResolution < 1} or {@code units < 1}.
*/
public ResolutionSyntax(int crossFeedResolution, int feedResolution,
int units) {
@@ -172,14 +172,14 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* The values are rounded to the nearest integer.
*
* @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
+ * Unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}.
*
* @return A two-element array with the cross feed direction resolution
* at index 0 and the feed direction resolution at index 1.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public int[] getResolution(int units) {
return new int[] { getCrossFeedResolution(units),
@@ -192,13 +192,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* the given units. The value is rounded to the nearest integer.
*
* @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or
- * {@link #DPCM DPCM}.
+ * Unit conversion factor, e.g. {@link #DPI DPI} or
+ * {@link #DPCM DPCM}.
*
* @return Cross feed direction resolution.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public int getCrossFeedResolution(int units) {
return convertFromDphi (crossFeedResolution, units);
@@ -209,13 +209,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* given units. The value is rounded to the nearest integer.
*
* @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or {@link
- * #DPCM DPCM}.
+ * Unit conversion factor, e.g. {@link #DPI DPI} or {@link
+ * #DPCM DPCM}.
*
* @return Feed direction resolution.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public int getFeedResolution(int units) {
return convertFromDphi (feedResolution, units);
@@ -229,8 +229,8 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* rounded to the nearest integer.
*
* @param units
- * Unit conversion factor, e.g. {@link #DPI DPI} or {@link
- * #DPCM DPCM}.
+ * Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
+ * #DPCM DPCM}.
* @param unitsName
* Units name string, e.g. "dpi" or "dpcm". If
* null, no units name is appended to the result.
@@ -238,7 +238,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* @return String version of this resolution attribute.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public String toString(int units, String unitsName) {
StringBuffer result = new StringBuffer();
diff --git a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java
index f1f590a2452..e8b43a6a5e7 100644
--- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java
+++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java
@@ -38,8 +38,8 @@ import java.io.Serializable;
* values are measured. Methods are provided to return a two-dimensional size
* attribute's values, indicating the units in which the values are to be
* returned. The two most common size units are inches (in) and millimeters
- * (mm), and exported constants {@link #INCH INCH} and {@link #MM
- * MM} are provided for indicating those units.
+ * (mm), and exported constants {@link #INCH INCH} and {@link #MM
+ * MM} are provided for indicating those units.
*
* Once constructed, a two-dimensional size attribute's value is immutable.
*
@@ -66,9 +66,9 @@ import java.io.Serializable;
* units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
* to an integral 216 x 279 mm will not match.
*
- * The exported constant {@link #INCH INCH} is actually the
+ * The exported constant {@link #INCH INCH} is actually the
* conversion factor by which to multiply a value in inches to get the value in
- * µm. Likewise, the exported constant {@link #MM MM} is the
+ * µm. Likewise, the exported constant {@link #MM MM} is the
* conversion factor by which to multiply a value in mm to get the value in
* µm. A client can specify a resolution value in units other than inches
* or mm by supplying its own conversion factor. However, since the internal
@@ -117,12 +117,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* @param x X dimension.
* @param y Y dimension.
* @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * Unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}.
*
* @exception IllegalArgumentException
- * (Unchecked exception) Thrown if x < 0 or y
- * < 0 or units < 1.
+ * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1}.
*/
protected Size2DSyntax(float x, float y, int units) {
if (x < 0.0f) {
@@ -145,12 +145,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* @param x X dimension.
* @param y Y dimension.
* @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * Unit conversion factor, e.g. {@link #INCH INCH} or
+ * {@link #MM MM}.
*
* @exception IllegalArgumentException
- * (Unchecked exception) Thrown if x < 0 or y
- * < 0 or units < 1.
+ * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0}
+ * or {@code units < 1}.
*/
protected Size2DSyntax(int x, int y, int units) {
if (x < 0) {
@@ -193,14 +193,13 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* as floating-point values.
*
* @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
*
* @return A two-element array with the X dimension at index 0 and the Y
* dimension at index 1.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float[] getSize(int units) {
return new float[] {getX(units), getY(units)};
@@ -211,13 +210,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* units as a floating-point value.
*
* @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
*
* @return X dimension.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float getX(int units) {
return convertFromMicrometers(x, units);
@@ -228,13 +226,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* units as a floating-point value.
*
* @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
*
* @return Y dimension.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float getY(int units) {
return convertFromMicrometers(y, units);
@@ -248,16 +245,16 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* floating point.
*
* @param units
- * Unit conversion factor, e.g. {@link #INCH INCH} or
- * {@link #MM MM}.
+ * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
+ *
* @param unitsName
- * Units name string, e.g. "in" or "mm". If
+ * Units name string, e.g. {@code in} or {@code mm}. If
* null, no units name is appended to the result.
*
* @return String version of this two-dimensional size attribute.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public String toString(int units, String unitsName) {
StringBuffer result = new StringBuffer();
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java b/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java
index a605c9cf699..8e29e972b36 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java
@@ -40,11 +40,11 @@ import javax.print.attribute.PrintJobAttribute;
* can be verified to support color printing.
*
* The table below shows the effects of specifying a Chromaticity attribute of
- * {@link #MONOCHROME MONOCHROME} or {@link #COLOR
- * COLOR} for a monochrome or color document.
+ * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}
+ * for a monochrome or color document.
*
* Printed as is, in monochrome
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Compression.java b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java
index 19c94b45f4e..5679a73f850 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Compression.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Compression.java
@@ -34,7 +34,7 @@ import javax.print.attribute.DocAttribute;
* print data (the doc), not of the Print Job. If a Compression attribute is not
* specified for a doc, the printer assumes the doc's print data is uncompressed
* (i.e., the default Compression value is always {@link #NONE
- * NONE}).
+ * NONE}).
*
* IPP Compatibility: The category name returned by
* getName() is the IPP attribute name. The enumeration's
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java b/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java
index cebbf7b6f2a..3f09cd9088f 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java
@@ -46,13 +46,13 @@ import javax.print.attribute.PrintJobAttribute;
*
*
- * The STAPLE_XXX values are specified with respect to the
+ * The STAPLE_XXX values are specified with respect to the
* document as if the document were a portrait document. If the document is
* actually a landscape or a reverse-landscape document, the client supplies the
* appropriate transformed value. For example, to position a staple in the upper
* left hand corner of a landscape document when held for reading, the client
- * supplies the STAPLE_BOTTOM_LEFT value (since landscape is
+ * supplies the STAPLE_BOTTOM_LEFT value (since landscape is
* defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
* other hand, to position a staple in the upper left hand corner of a
* reverse-landscape document when held for reading, the client supplies the
- * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
+ * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
* -90 degree rotation from portrait, i.e., clockwise).
*
* The angle (vertical, horizontal, angled) of each staple with respect to the
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java
index 8f29b7b2c66..f5b16307df9 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/JobKOctets.java
@@ -67,7 +67,7 @@ import javax.print.attribute.PrintJobAttribute;
* shown in the table below.
*
*
- *
+ *
*
Representation Class
*
Document Size
*
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java b/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
index dbb50f633cc..a800f7c6c42 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
@@ -62,7 +62,7 @@ import javax.print.attribute.PrintRequestAttribute;
* The (x,y) origin is positioned at the top-left of the paper in portrait
* mode regardless of the orientation specified in the requesting context.
* For example a printable area for A4 paper in portrait or landscape
- * orientation will have height > width.
+ * orientation will have height {@literal >} width.
*
* A printable area attribute's values are stored
* internally as integers in units of micrometers (µm), where 1 micrometer
@@ -107,9 +107,9 @@ public final class MediaPrintableArea
* @param units in which the values are expressed.
*
* @exception IllegalArgumentException
- * Thrown if x < 0 or y < 0
- * or w <= 0 or h <= 0 or
- * units < 1.
+ * Thrown if {@code x < 0} or {@code y < 0}
+ * or {@code w <= 0} or {@code h <= 0} or
+ * {@code units < 1}.
*/
public MediaPrintableArea(float x, float y, float w, float h, int units) {
if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) ||
@@ -133,9 +133,9 @@ public final class MediaPrintableArea
* @param units in which the values are expressed.
*
* @exception IllegalArgumentException
- * Thrown if x < 0 or y < 0
- * or w <= 0 or h <= 0 or
- * units < 1.
+ * Thrown if {@code x < 0} or {@code y < 0}
+ * or {@code w <= 0} or {@code h <= 0} or
+ * {@code units < 1}.
*/
public MediaPrintableArea(int x, int y, int w, int h, int units) {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
@@ -159,7 +159,7 @@ public final class MediaPrintableArea
* @return printable area as array of x, y, w, h in the specified units.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float[] getPrintableArea(int units) {
return new float[] { getX(units), getY(units),
@@ -177,7 +177,7 @@ public final class MediaPrintableArea
* specified units.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float getX(int units) {
return convertFromMicrometers(x, units);
@@ -194,7 +194,7 @@ public final class MediaPrintableArea
* specified units.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float getY(int units) {
return convertFromMicrometers(y, units);
@@ -209,7 +209,7 @@ public final class MediaPrintableArea
* @return width of the printable area in the specified units.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float getWidth(int units) {
return convertFromMicrometers(w, units);
@@ -224,7 +224,7 @@ public final class MediaPrintableArea
* @return height of the printable area in the specified units.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public float getHeight(int units) {
return convertFromMicrometers(h, units);
@@ -301,7 +301,7 @@ public final class MediaPrintableArea
* @return String version of this two-dimensional size attribute.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if units < 1.
+ * (unchecked exception) Thrown if {@code units < 1}.
*/
public String toString(int units, String unitsName) {
if (unitsName == null) {
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
index 9f35e34a23a..1d6677fb674 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
@@ -45,7 +45,7 @@ import javax.print.attribute.Attribute;
* MediaSize.getMediaSizeForName(MediaSizeName)
* to find the physical dimensions of the MediaSizeName instances
* enumerated in this API. This is useful for clients which need this
- * information to format & paginate printing.
+ * information to format {@literal &} paginate printing.
*
*
* @author Phil Race, Alan Kaminsky
@@ -71,8 +71,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* Size2DSyntax.MM.
*
* @exception IllegalArgumentException
- * (Unchecked exception) Thrown if x < 0 or y
- * < 0 or units < 1 or x > y.
+ * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}.
*/
public MediaSize(float x, float y,int units) {
super (x, y, units);
@@ -92,8 +92,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* Size2DSyntax.MM.
*
* @exception IllegalArgumentException
- * (Unchecked exception) Thrown if x < 0 or y
- * < 0 or units < 1 or x > y.
+ * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}.
*/
public MediaSize(int x, int y,int units) {
super (x, y, units);
@@ -115,8 +115,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* @param media a media name to associate with this MediaSize
*
* @exception IllegalArgumentException
- * (Unchecked exception) Thrown if x < 0 or y
- * < 0 or units < 1 or x > y.
+ * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}.
*/
public MediaSize(float x, float y,int units, MediaSizeName media) {
super (x, y, units);
@@ -141,8 +141,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* @param media a media name to associate with this MediaSize
*
* @exception IllegalArgumentException
- * (Unchecked exception) Thrown if x < 0 or y
- * < 0 or units < 1 or x > y.
+ * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
+ * {@code units < 1} or {@code x > y}.
*/
public MediaSize(int x, int y,int units, MediaSizeName media) {
super (x, y, units);
@@ -194,7 +194,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* Unit conversion factor, e.g. Size2DSyntax.INCH or
* Size2DSyntax.MM
* @return MediaSizeName matching these dimensions, or null.
- * @exception IllegalArgumentException if x <= 0, y <= 0, or units < 1
+ * @exception IllegalArgumentException if {@code x <= 0},
+ * {@code y <= 0}, or {@code units < 1}.
*
*/
public static MediaSizeName findMedia(float x, float y, int units) {
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java
index 0ac7c93c8ce..88e3a445cd0 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java
@@ -56,56 +56,56 @@ public final class PresentationDirection extends EnumSyntax
/**
* Pages are laid out in columns starting at the top left,
- * proceeeding towards the bottom & right.
+ * proceeeding towards the bottom {@literal &} right.
*/
public static final PresentationDirection TOBOTTOM_TORIGHT =
new PresentationDirection(0);
/**
* Pages are laid out in columns starting at the top right,
- * proceeeding towards the bottom & left.
+ * proceeeding towards the bottom {@literal &} left.
*/
public static final PresentationDirection TOBOTTOM_TOLEFT =
new PresentationDirection(1);
/**
* Pages are laid out in columns starting at the bottom left,
- * proceeeding towards the top & right.
+ * proceeeding towards the top {@literal &} right.
*/
public static final PresentationDirection TOTOP_TORIGHT =
new PresentationDirection(2);
/**
* Pages are laid out in columns starting at the bottom right,
- * proceeeding towards the top & left.
+ * proceeeding towards the top {@literal &} left.
*/
public static final PresentationDirection TOTOP_TOLEFT =
new PresentationDirection(3);
/**
* Pages are laid out in rows starting at the top left,
- * proceeeding towards the right & bottom.
+ * proceeeding towards the right {@literal &} bottom.
*/
public static final PresentationDirection TORIGHT_TOBOTTOM =
new PresentationDirection(4);
/**
* Pages are laid out in rows starting at the bottom left,
- * proceeeding towards the right & top.
+ * proceeeding towards the right {@literal &} top.
*/
public static final PresentationDirection TORIGHT_TOTOP =
new PresentationDirection(5);
/**
* Pages are laid out in rows starting at the top right,
- * proceeeding towards the left & bottom.
+ * proceeeding towards the left {@literal &} bottom.
*/
public static final PresentationDirection TOLEFT_TOBOTTOM =
new PresentationDirection(6);
/**
* Pages are laid out in rows starting at the bottom right,
- * proceeeding towards the left & top.
+ * proceeeding towards the left {@literal &} top.
*/
public static final PresentationDirection TOLEFT_TOTOP =
new PresentationDirection(7);
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
index a6be2838a27..8d507d54389 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
@@ -40,7 +40,7 @@ import javax.print.attribute.PrintServiceAttribute;
* details on color support). The information is intended to be germane to
* this kind of printer without regard to site specific modifications or
* services.
- *
* In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
* to find out more information about this specific printer rather than this
* general kind of printer.
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java
index 8ca5100c48a..e4ad0486496 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterResolution.java
@@ -84,11 +84,11 @@ public final class PrinterResolution extends ResolutionSyntax
* Feed direction resolution.
* @param units
* Unit conversion factor, e.g. ResolutionSyntax.DPI
- * or ResolutionSyntax.>DPCM.
+ * or ResolutionSyntax.DPCM.
*
* @exception IllegalArgumentException
- * (unchecked exception) Thrown if crossFeedResolution <
- * 1 or feedResolution < 1 or units < 1.
+ * (unchecked exception) Thrown if {@code crossFeedResolution < 1} or
+ * {@code feedResolution < 1} or {@code units < 1}.
*/
public PrinterResolution(int crossFeedResolution, int feedResolution,
int units) {
diff --git a/jdk/src/share/classes/javax/swing/text/GlyphView.java b/jdk/src/share/classes/javax/swing/text/GlyphView.java
index 624f737b376..a0ca975c2c3 100644
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -514,7 +514,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
int x1 = x0 + (int) painter.getSpan(this, p0, p1, getTabExpander(), x0);
// calculate y coordinate
- int y = alloc.y + alloc.height - (int) painter.getDescent(this);
+ int y = alloc.y + (int)(painter.getHeight(this) - painter.getDescent(this));
if (underline) {
int yTmp = y + 1;
g.drawLine(x0, yTmp, x1, yTmp);
diff --git a/jdk/src/share/classes/sun/awt/AppContext.java b/jdk/src/share/classes/sun/awt/AppContext.java
index 4af13ce5703..d4ed6525ad8 100644
--- a/jdk/src/share/classes/sun/awt/AppContext.java
+++ b/jdk/src/share/classes/sun/awt/AppContext.java
@@ -310,11 +310,13 @@ public final class AppContext {
// and excludes applets because by the time applet starts
// a number of contexts have already been created by the plugin.
if (numAppContexts.get() == 0) {
- // This check is not necessary, its purpose is to help
- // Plugin devs to catch all the cases of main AC creation.
if (System.getProperty("javaplugin.version") == null &&
System.getProperty("javawebstart.version") == null) {
initMainAppContext();
+ } else if (System.getProperty("javafx.version") != null &&
+ threadGroup.getParent() != null) {
+ // Swing inside JavaFX case
+ SunToolkit.createNewAppContext();
}
}
diff --git a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java
index b394884e81e..69ff359cca3 100644
--- a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java
@@ -334,6 +334,10 @@ public class UnixPrintJob implements CancelablePrintJob {
throw new PrintException("can't get print data: " + e.toString());
}
+ if (data == null) {
+ throw new PrintException("Null print data.");
+ }
+
if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintJobFlavorException("invalid flavor", flavor);
diff --git a/jdk/src/solaris/native/sun/awt/gtk2_interface.c b/jdk/src/solaris/native/sun/awt/gtk2_interface.c
index e1228fc9036..43a4bcfcb08 100644
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c
@@ -794,6 +794,7 @@ gboolean gtk2_load()
}
putenv (new_env);
free (new_env);
+ free (tmp_env);
}
}
diff --git a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c
index 241c96f64d7..75d1cd2f4d2 100644
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c
@@ -269,6 +269,13 @@ Java_sun_awt_X11GraphicsEnvironment_initXRender
static jboolean firstTime = JNI_TRUE;
if (firstTime) {
+#ifdef DISABLE_XRENDER_BY_DEFAULT
+ if (verbose == JNI_FALSE) {
+ xrenderAvailable = JNI_FALSE;
+ firstTime = JNI_FALSE;
+ return xrenderAvailable;
+ }
+#endif
AWT_LOCK();
xrenderAvailable = IsXRenderAvailable(verbose);
AWT_UNLOCK();
diff --git a/jdk/src/windows/classes/sun/print/Win32PrintJob.java b/jdk/src/windows/classes/sun/print/Win32PrintJob.java
index 2428edf5572..844f3ee4f22 100644
--- a/jdk/src/windows/classes/sun/print/Win32PrintJob.java
+++ b/jdk/src/windows/classes/sun/print/Win32PrintJob.java
@@ -340,6 +340,10 @@ public class Win32PrintJob implements CancelablePrintJob {
throw new PrintException("can't get print data: " + e.toString());
}
+ if (data == null) {
+ throw new PrintException("Null print data.");
+ }
+
if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintJobFlavorException("invalid flavor", flavor);
diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp
index 6d645e052a8..42dff896459 100644
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp
@@ -3528,8 +3528,12 @@ UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops,
if (ops == SAVE) {
transTable.put(reinterpret_cast(static_cast(wkey)),
reinterpret_cast(static_cast(translation)));
- deadKeyFlagTable.put(reinterpret_cast(static_cast(wkey)),
- reinterpret_cast(static_cast(deadKeyFlag)));
+ if (deadKeyFlag) {
+ deadKeyFlagTable.put(reinterpret_cast(static_cast(wkey)),
+ reinterpret_cast(static_cast(deadKeyFlag)));
+ } else {
+ deadKeyFlagTable.remove(reinterpret_cast(static_cast(wkey)));
+ }
}
isDeadKey = deadKeyFlag;
diff --git a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java
new file mode 100644
index 00000000000..079426f9ce2
--- /dev/null
+++ b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8007267
+ * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
+ * @author leonid.romanov@oracle.com
+ * @run main DefaultMenuBarTest
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.*;
+import java.lang.reflect.Method;
+
+
+public class DefaultMenuBarTest {
+ static KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.META_MASK);
+
+ static volatile int listenerCallCounter = 0;
+ public static void main(String[] args) throws Exception {
+ if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
+ System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
+ return;
+ }
+
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ createAndShowGUI();
+ }
+ });
+
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Robot robot = new Robot();
+ robot.setAutoDelay(100);
+
+ robot.keyPress(KeyEvent.VK_META);
+ robot.keyPress(ks.getKeyCode());
+ robot.keyRelease(ks.getKeyCode());
+ robot.keyRelease(KeyEvent.VK_META);
+
+ toolkit.realSync();
+
+ if (listenerCallCounter != 1) {
+ throw new Exception("Test failed: ActionListener either wasn't called or was called more than once");
+ }
+ }
+
+ private static void createAndShowGUI() {
+ JMenu menu = new JMenu("File");
+ JMenuItem newItem = new JMenuItem("Open");
+
+ newItem.setAccelerator(ks);
+ newItem.addActionListener(
+ new ActionListener(){
+ public void actionPerformed(ActionEvent e) {
+ listenerCallCounter++;
+ }
+ }
+ );
+ menu.add(newItem);
+
+ JMenuBar defaultMenu = new JMenuBar();
+ defaultMenu.add(menu);
+
+ // Application.getApplication().setDefaultMenuBar(defaultMenu);
+ try {
+ Class appClass = Class.forName("com.apple.eawt.Application");
+ if (appClass != null) {
+ Method method = appClass.getMethod("getApplication");
+ if (method != null) {
+ Object app = method.invoke(null, new Object[]{});
+ if (app != null) {
+ method = appClass.getMethod("setDefaultMenuBar", new Class[]{JMenuBar.class});
+ if (method != null) {
+ method.invoke(app, new Object[]{defaultMenu});
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java
index 04eb28db889..603f786506d 100644
--- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java
+++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -49,6 +49,8 @@ public class LoopRobustness {
public static volatile boolean otherExceptionsCaught = false;
public static void main(String [] args) throws Exception {
+ SunToolkit.createNewAppContext();
+
ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup();
long at;
diff --git a/jdk/test/java/awt/event/KeyEvent/DeadKey/DeadKeySystemAssertionDialog.java b/jdk/test/java/awt/event/KeyEvent/DeadKey/DeadKeySystemAssertionDialog.java
new file mode 100644
index 00000000000..b7523d2b152
--- /dev/null
+++ b/jdk/test/java/awt/event/KeyEvent/DeadKey/DeadKeySystemAssertionDialog.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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.Frame;
+import java.awt.Robot;
+import java.awt.TextField;
+import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
+import sun.awt.SunToolkit;
+/*
+ * @test
+ * @bug 8013849
+ * @summary Awt assert on Hashtable.cpp:124
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main/timeout=5 DeadKeySystemAssertionDialog
+ */
+
+public class DeadKeySystemAssertionDialog {
+
+ public static void main(String[] args) throws Exception {
+
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Frame frame = new Frame();
+ frame.setSize(300, 200);
+
+ TextField textField = new TextField();
+ frame.add(textField);
+
+ frame.setVisible(true);
+ toolkit.realSync();
+
+ textField.requestFocus();
+ toolkit.realSync();
+
+ // Check that the system assertion dialog does not block Java
+ Robot robot = new Robot();
+ robot.setAutoDelay(50);
+ robot.keyPress(KeyEvent.VK_A);
+ robot.keyRelease(KeyEvent.VK_A);
+ toolkit.realSync();
+
+ frame.setVisible(false);
+ frame.dispose();
+ }
+}
diff --git a/jdk/test/javax/print/attribute/autosense/PrintAutoSenseData.java b/jdk/test/javax/print/attribute/autosense/PrintAutoSenseData.java
index 307408fe082..214b9ad339b 100644
--- a/jdk/test/javax/print/attribute/autosense/PrintAutoSenseData.java
+++ b/jdk/test/javax/print/attribute/autosense/PrintAutoSenseData.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4468109
+ * @bug 4468109 8021583
* @summary Test for printing AUTOSENSE DocFlavor. No exception should be thrown.
* @run main PrintAutoSenseData
*/
diff --git a/jdk/test/javax/print/attribute/autosense/sample.txt b/jdk/test/javax/print/attribute/autosense/sample.txt
new file mode 100644
index 00000000000..ea84f750953
--- /dev/null
+++ b/jdk/test/javax/print/attribute/autosense/sample.txt
@@ -0,0 +1 @@
+This is a program for testing AutoSense data.
diff --git a/jdk/test/javax/swing/JTabbedPane/4361477/bug4361477.java b/jdk/test/javax/swing/JTabbedPane/4361477/bug4361477.java
new file mode 100644
index 00000000000..f41d240c5bc
--- /dev/null
+++ b/jdk/test/javax/swing/JTabbedPane/4361477/bug4361477.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 javax.swing.*;
+import javax.swing.event.*;
+import sun.awt.SunToolkit;
+
+/*
+ * @test
+ * @bug 4361477
+ * @summary JTabbedPane throws ArrayOutOfBoundsException
+ * @author Oleg Mokhovikov
+ * @run main bug4361477
+ */
+public class bug4361477 {
+
+ static JTabbedPane tabbedPane;
+ volatile static boolean bStateChanged = false;
+ volatile static Rectangle bounds;
+
+ public static void main(String args[]) throws Exception {
+
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Robot robot = new Robot();
+ robot.setAutoDelay(50);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ @Override
+ public void run() {
+ createAndShowUI();
+ }
+ });
+
+ toolkit.realSync();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ @Override
+ public void run() {
+ bounds = tabbedPane.getUI().getTabBounds(tabbedPane, 0);
+ }
+ });
+
+ Point location = bounds.getLocation();
+ SwingUtilities.convertPointToScreen(location, tabbedPane);
+ robot.mouseMove(location.x + 1, location.y + 1);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+ if (!bStateChanged) {
+ throw new RuntimeException("Tabbed pane state is not changed");
+ }
+ }
+
+ static void createAndShowUI() {
+
+ final JFrame frame = new JFrame();
+ tabbedPane = new JTabbedPane();
+ tabbedPane.add("Tab0", new JPanel());
+ tabbedPane.add("Tab1", new JPanel());
+ tabbedPane.add("Tab2", new JPanel());
+ tabbedPane.setSelectedIndex(2);
+ tabbedPane.addChangeListener(new ChangeListener() {
+
+ public void stateChanged(final ChangeEvent pick) {
+ bStateChanged = true;
+ if (tabbedPane.getTabCount() == 3) {
+ tabbedPane.remove(2);
+ }
+ }
+ });
+
+ frame.getContentPane().add(tabbedPane);
+ frame.setSize(300, 200);
+ frame.setVisible(true);
+ }
+}
diff --git a/jdk/test/javax/swing/JTabbedPane/6495408/bug6495408.java b/jdk/test/javax/swing/JTabbedPane/6495408/bug6495408.java
new file mode 100644
index 00000000000..40f69d53fe9
--- /dev/null
+++ b/jdk/test/javax/swing/JTabbedPane/6495408/bug6495408.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 javax.swing.*;
+import java.awt.*;
+import sun.awt.SunToolkit;
+/*
+ * @test
+ * @bug 6495408
+ * @summary REGRESSION: JTabbedPane throws ArrayIndexOutOfBoundsException
+ * @author Alexander Potochkin
+ * @run main bug6495408
+ */
+
+public class bug6495408 {
+
+ static JTabbedPane tabbedPane;
+
+ public static void main(String[] args) throws Exception {
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ final Robot robot = new Robot();
+ robot.setAutoDelay(50);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ public void run() {
+ final JFrame frame = new JFrame();
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ tabbedPane = new JTabbedPane();
+ tabbedPane.setTabPlacement(JTabbedPane.LEFT);
+ tabbedPane.addTab("Hello", null);
+ frame.add(tabbedPane);
+ frame.setSize(400, 400);
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+ }
+ });
+
+ toolkit.realSync();
+
+ final Rectangle d = new Rectangle();
+ final Point p = new Point();
+
+ for (int i = 0; i < 7; i++) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ int tab = tabbedPane.getTabCount() - 1;
+ Rectangle bounds = tabbedPane.getBoundsAt(tab);
+ if (bounds != null) {
+ d.setBounds(bounds);
+ p.setLocation(d.x + d.width / 2, d.y + d.height / 2);
+ SwingUtilities.convertPointToScreen(p, tabbedPane);
+ robot.mouseMove(p.x, p.y + d.height);
+ tabbedPane.addTab("Hello", null);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/jdk/test/javax/swing/JTabbedPane/7161568/bug7161568.java b/jdk/test/javax/swing/JTabbedPane/7161568/bug7161568.java
new file mode 100644
index 00000000000..73ecbf9ddc9
--- /dev/null
+++ b/jdk/test/javax/swing/JTabbedPane/7161568/bug7161568.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 javax.swing.*;
+import java.awt.event.*;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 7161568
+ * @author Alexander Scherbatiy
+ * @summary Tests that navigating tabs in the JTAbbedPane does not throw NPE
+ * @run main bug7161568
+ */
+public class bug7161568 {
+
+ private static final int N = 50;
+ private static JTabbedPane tabbedPane;
+
+ public static void main(String[] args) throws Exception {
+ UIManager.put("TabbedPane.selectionFollowsFocus", Boolean.FALSE);
+
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ Robot robot = new Robot();
+ robot.setAutoDelay(50);
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ @Override
+ public void run() {
+ createAndShowUI();
+ }
+ });
+
+ toolkit.realSync();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ @Override
+ public void run() {
+ tabbedPane.requestFocus();
+ }
+ });
+
+ toolkit.realSync();
+
+ for (int i = 0; i < N; i++) {
+ robot.keyPress(KeyEvent.VK_LEFT);
+ robot.keyRelease(KeyEvent.VK_LEFT);
+ toolkit.realSync();
+ }
+ }
+
+ static void createAndShowUI() {
+ JFrame frame = new JFrame("Test");
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setSize(100, 100);
+
+ tabbedPane = new JTabbedPane();
+
+ for (int i = 0; i < N; i++) {
+ tabbedPane.addTab("Tab: " + i, new JLabel("Test"));
+ }
+
+ tabbedPane.setSelectedIndex(0);
+
+ frame.getContentPane().add(tabbedPane);
+ frame.setVisible(true);
+ }
+}
diff --git a/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java b/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java
new file mode 100644
index 00000000000..601a31de688
--- /dev/null
+++ b/jdk/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8016833
+ @summary underlines and strikethroughs should be painted at the correct
+ positions for different kind of text styles: normal, superscript and subscript
+ @author Anton Nashatyrev
+ @run main bug8016833
+*/
+import javax.swing.*;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Style;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyledDocument;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug8016833 {
+
+ void drawText(final Graphics g, final boolean underline, final boolean strikethrough, final boolean background) {
+ drawText(g, "mama", underline, strikethrough, background);
+ }
+
+ void drawText(final Graphics g, final String text, final boolean underline, final boolean strikethrough, final boolean background) {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ final JTextPane comp = new JTextPane();
+ final StyledDocument doc = comp.getStyledDocument();
+
+ Style style = comp.addStyle("superscript", null);
+ setNormalStyle(style);
+
+ if (underline) {
+ StyleConstants.setUnderline(style, true);
+ }
+ if (strikethrough) {
+ StyleConstants.setStrikeThrough(style, true);
+ }
+ if (background) {
+ StyleConstants.setBackground(style, Color.BLUE);
+ }
+ try {
+ doc.insertString(doc.getLength(), "mama", style);
+ } catch (BadLocationException e) {
+ throw new RuntimeException(e);
+ }
+
+ comp.setSize(200, 100);
+ comp.paint(g);
+ }
+ });
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ void setNormalStyle(Style style) {
+ StyleConstants.setSuperscript(style, true);
+ }
+
+ int getEmptyPixel() {
+ return 0xFFFFFFFF;
+ }
+
+ boolean isPixelEmpty(int argb) {
+ return (argb & 0x00FFFFFF) == (getEmptyPixel() & 0x00FFFFFF);
+ }
+
+ boolean isLineEmpty(BufferedImage img, int coord, boolean isHorizontal) {
+ int len = isHorizontal ? img.getWidth() : img.getHeight();
+ for (int i = 0; i < len; i++) {
+ int pixel = isHorizontal ? img.getRGB(i, coord) : img.getRGB(coord, i);
+ if (!isPixelEmpty(pixel)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ Rectangle getPixelsOutline(BufferedImage img) {
+ int x1 = 0;
+ while (x1 < img.getWidth() && isLineEmpty(img, x1, false)) {
+ x1++;
+ }
+ int x2 = img.getWidth() - 1;
+ while (x2 >= 0 && isLineEmpty(img, x2, false)) {
+ x2--;
+ }
+ int y1 = 0;
+ while (y1 < img.getHeight() && isLineEmpty(img, y1, true)) {
+ y1++;
+ }
+ int y2 = img.getHeight() - 1;
+ while (y2 >= 0 && isLineEmpty(img, y2, true)) {
+ y2--;
+ }
+
+ return new Rectangle(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
+ }
+
+ BufferedImage createImage() {
+ final BufferedImage img = new BufferedImage(200, 100, BufferedImage.TYPE_INT_ARGB);
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ Graphics g = img.getGraphics();
+ g.setColor(new Color(getEmptyPixel()));
+ g.fillRect(0, 0, 10000, 10000);
+ }
+ });
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ return img;
+ }
+
+ int subPixels(int pix1, int pix2) {
+ if (pix1 == pix2) {
+ return getEmptyPixel();
+ }
+ return pix1;
+ }
+
+ /**
+ * Subtracts img2 from img1
+ */
+ BufferedImage subImages(BufferedImage img1, BufferedImage img2) {
+ if (img1.getHeight() != img2.getHeight() ||
+ img1.getWidth() != img2.getWidth()) {
+ throw new RuntimeException("Different sizes");
+ }
+ BufferedImage ret = new BufferedImage(img1.getWidth(), img1.getHeight(), img1.getType());
+
+ for (int x = 0; x < ret.getWidth(); x++) {
+ for (int y = 0; y < ret.getHeight(); y++) {
+ ret.setRGB(x, y, subPixels(img1.getRGB(x, y), img2.getRGB(x, y)));
+ }
+ }
+ return ret;
+ }
+
+ void testUnderline() {
+ System.out.println(" testUnderline()");
+
+ final BufferedImage img1 = createImage();
+ drawText(img1.getGraphics(), true, false, false);
+ final Rectangle out1 = getPixelsOutline(img1);
+ System.out.println(" Underlined: " + out1);
+
+ final BufferedImage img2 = createImage();
+ drawText(img2.getGraphics(), false, false, false);
+ final Rectangle out2 = getPixelsOutline(img2);
+ System.out.println(" Normal: " + out2);
+
+ final BufferedImage img3 = subImages(img1, img2);
+ final Rectangle out3 = getPixelsOutline(img3);
+ System.out.println(" Sub: " + out3);
+
+ // underline is not too thick
+ assertTrue(out3.getHeight() <= 2);
+ // not too wide
+ assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
+ // not too low
+ assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
+ // not too high
+ assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
+ }
+
+ void testStrikthrough() {
+ System.out.println(" testStrikthrough()");
+
+ final BufferedImage img1 = createImage();
+ drawText(img1.getGraphics(), false, true, false);
+ final Rectangle out1 = getPixelsOutline(img1);
+ System.out.println(" Striked: " + out1);
+
+ final BufferedImage img2 = createImage();
+ drawText(img2.getGraphics(), false, false, false);
+ final Rectangle out2 = getPixelsOutline(img2);
+ System.out.println(" Normal: " + out2);
+
+ final BufferedImage img3 = subImages(img1, img2);
+ final Rectangle out3 = getPixelsOutline(img3);
+ System.out.println(" Sub: " + out3);
+
+ // strikethrough is not too thick
+ assertTrue(out3.getHeight() <= 2);
+ // not too wide
+ assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
+ // not too low
+ assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
+ // not too high
+ assertTrue(out3.getY() - out1.getY() > 1);
+ }
+ void assertTrue(boolean b) {
+ if (!b) {
+ throw new RuntimeException("Assertion failed");
+ }
+ }
+
+ static void testSuperScript() {
+ System.out.println("testSuperScript()");
+ bug8016833 b = new bug8016833() {
+ @Override
+ void setNormalStyle(Style style) {
+ StyleConstants.setSuperscript(style, true);
+ }
+ };
+ b.testUnderline();
+ b.testStrikthrough();
+ }
+
+ static void testSubScript() {
+ System.out.println("testSubScript()");
+ bug8016833 b = new bug8016833() {
+ @Override
+ void setNormalStyle(Style style) {
+ StyleConstants.setSubscript(style, true);
+ }
+ };
+ b.testUnderline();
+ b.testStrikthrough();
+ }
+
+ static void testNormalScript() {
+ System.out.println("testNormalScript()");
+ bug8016833 b = new bug8016833() {
+ @Override
+ void setNormalStyle(Style style) {
+ }
+ };
+ b.testUnderline();
+ b.testStrikthrough();
+ }
+
+ public static void main(String[] args) {
+ testSubScript();
+ testSuperScript();
+ testNormalScript();
+ }
+}
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 1caced10393..e78fa28b744 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -223,3 +223,4 @@ ce5a90df517bdceb2739d7dd3e6764b070def802 jdk8-b98
6d85acab769eb79bc058f5640fa86a6ef096a583 jdk8-b99
82f68da70e471ee5640016e3f38c014347a5c785 jdk8-b100
0324dbf07b0f1cc51ad9fa18976489d02d23b60d jdk8-b101
+453a305e116507847cc6577b80b4d9794bcb08bf jdk8-b102
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
index 0468a8e9134..9c20777e137 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
@@ -101,7 +101,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
Content tdSummary) {
ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
String name = emd.name();
- Content strong = HtmlTree.STRONG(
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
writer.getDocLink(context, cd, (MemberDoc) emd,
name, false));
Content code = HtmlTree.CODE(strong);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
index 6583b891809..a2fa33b68a5 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
@@ -225,7 +225,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.STRONG(
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
Content code = HtmlTree.CODE(strong);
tdSummary.addContent(code);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
index df4b5ea1ef8..88e1441b7ed 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
@@ -262,7 +262,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
annotationInfoTree.addContent(hr);
Tag[] deprs = annotationType.tags("deprecated");
if (Util.isDeprecated(annotationType)) {
- Content strong = HtmlTree.STRONG(deprecatedPhrase);
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
Content div = HtmlTree.DIV(HtmlStyle.block, strong);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
index 47e9346a072..b98739c9390 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
@@ -547,7 +547,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
classInfoTree.addContent(hr);
Tag[] deprs = classDoc.tags("deprecated");
if (Util.isDeprecated(classDoc)) {
- Content strong = HtmlTree.STRONG(deprecatedPhrase);
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
Content div = HtmlTree.DIV(HtmlStyle.block, strong);
if (deprs.length > 0) {
Tag[] commentTags = deprs[0].inlineTags();
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java
index 9643e878117..382f16f1f00 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java
@@ -222,7 +222,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.STRONG(
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
writer.getDocLink(context, (MemberDoc) member, member.name(), false));
Content code = HtmlTree.CODE(strong);
tdSummary.addContent(code);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
index 4f1dbbd9bff..f599ac2ff6b 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
@@ -139,7 +139,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
holder.typeName() : holder.qualifiedTypeName(),
false);
Content codeLink = HtmlTree.CODE(link);
- Content strong = HtmlTree.STRONG(holder.isClass()?
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
strong.addContent(writer.getSpace());
strong.addContent(codeLink);
@@ -256,7 +256,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.STRONG(
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false));
Content code = HtmlTree.CODE(strong);
tdSummary.addContent(code);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java
index 2884d3b45bb..d5e0bf0c71f 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java
@@ -316,7 +316,7 @@ public class HelpWriter extends HtmlDocletWriter {
liConst.addContent(constPara);
ul.addContent(liConst);
Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
- Content line30 = HtmlTree.EM(getResource("doclet.Help_line_30"));
+ Content line30 = HtmlTree.SPAN(HtmlStyle.italic, getResource("doclet.Help_line_30"));
divContent.addContent(line30);
contentTree.addContent(divContent);
}
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
index cde30f30d32..63aa42be9b1 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
@@ -467,8 +467,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
}
}
Content rawContent = new RawHtml(content);
- Content em = HtmlTree.EM(rawContent);
- return em;
+ return rawContent;
}
/**
@@ -1029,7 +1028,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
public Content italicsClassName(ClassDoc cd, boolean qual) {
Content name = new StringContent((qual)? cd.qualifiedName(): cd.name());
- return (cd.isInterface())? HtmlTree.I(name): name;
+ return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.italic, name): name;
}
/**
@@ -1545,7 +1544,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
Content div;
Content result = commentTagsToContent(null, doc, tags, first);
if (depr) {
- Content italic = HtmlTree.I(result);
+ Content italic = HtmlTree.SPAN(HtmlStyle.italic, result);
div = HtmlTree.DIV(HtmlStyle.block, italic);
htmltree.addContent(div);
}
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java
index 235c913b913..bb67b99c200 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java
@@ -159,7 +159,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
holder.typeName() : holder.qualifiedTypeName(),
false);
Content codelLink = HtmlTree.CODE(link);
- Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()?
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.asClassDoc().isClass()?
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
strong.addContent(writer.getSpace());
strong.addContent(codelLink);
@@ -309,7 +309,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
label = writer.specifiedByLabel;
context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
}
- Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
+ Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, label));
dl.addContent(dt);
Content overriddenTypeLink =
writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType));
@@ -364,7 +364,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
Content intfaclink = writer.getLink(new LinkInfoImpl(
writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
Content codeIntfacLink = HtmlTree.CODE(intfaclink);
- Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
+ Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, writer.specifiedByLabel));
dl.addContent(dt);
Content methlink = writer.getDocLink(
LinkInfoImpl.Kind.MEMBER, implementedMeth,
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java
index 487d9ff101a..d44dd25feb0 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java
@@ -164,7 +164,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.STRONG(
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member)));
Content code = HtmlTree.CODE(strong);
tdSummary.addContent(code);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
index cdd88372250..26d3a8f0b4c 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java
@@ -183,7 +183,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
printedHeader = true;
}
Content arr_i_name = new StringContent(arr[i].name());
- if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
+ if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
Content li = HtmlTree.LI(link);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java
index ef8c0fbbc5f..38b7b1cee32 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java
@@ -174,7 +174,7 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter {
printedHeader = true;
}
Content arr_i_name = new StringContent(arr[i].name());
- if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
+ if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.italic, arr_i_name);
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
Content li = HtmlTree.LI(link);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java
index 9018b77ece6..838732b5212 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java
@@ -135,7 +135,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
holder.typeName() : holder.qualifiedTypeName(),
false);
Content codeLink = HtmlTree.CODE(link);
- Content strong = HtmlTree.STRONG(holder.isClass()?
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, holder.isClass()?
writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
strong.addContent(writer.getSpace());
strong.addContent(codeLink);
@@ -252,13 +252,12 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- Content strong = HtmlTree.STRONG(
- writer.getDocLink(context,
- cd,
- (MemberDoc) member,
- member.name().substring(0, member.name().lastIndexOf("Property")),
- false,
- true));
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ writer.getDocLink(context, cd,
+ (MemberDoc) member,
+ member.name().substring(0, member.name().lastIndexOf("Property")),
+ false,
+ true));
Content code = HtmlTree.CODE(strong);
tdSummary.addContent(code);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java
index 94bde2e35ec..ce6a0fd053d 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java
@@ -175,7 +175,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
Tag[] deprs = member.tags("deprecated");
Content div;
if (Util.isDeprecated((ProgramElementDoc) member)) {
- Content strong = HtmlTree.STRONG(deprecatedPhrase);
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
div = HtmlTree.DIV(HtmlStyle.block, strong);
div.addContent(getSpace());
if (deprs.length > 0) {
@@ -186,7 +186,7 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
} else {
ClassDoc cd = ((ProgramElementDoc)member).containingClass();
if (cd != null && Util.isDeprecated(cd)) {
- Content strong = HtmlTree.STRONG(deprecatedPhrase);
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
div = HtmlTree.DIV(HtmlStyle.block, strong);
div.addContent(getSpace());
tdSummary.addContent(div);
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
index fc63f4f8654..95e9a74ed78 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
@@ -118,7 +118,7 @@ public class TagletWriterImpl extends TagletWriter {
if (deprs.length > 0) {
Content body = commentTagsToOutput(null, doc,
deprs[0].inlineTags(), false);
- result.addContent(HtmlTree.I(body));
+ result.addContent(HtmlTree.SPAN(HtmlStyle.italic, body));
}
} else {
if (Util.isDeprecated(member.containingClass())) {
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
index a1719bbe8cf..c20ac4c5d5f 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -59,6 +59,7 @@ public enum HtmlStyle {
indexContainer,
indexHeader,
inheritance,
+ italic,
legalCopy,
nameValue,
navBarCell1Rev,
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
index e6c101a5d4b..e0343f21d94 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
@@ -281,17 +281,6 @@ public class HtmlTree extends Content {
return htmltree;
}
- /**
- * Generates a EM tag with some content.
- *
- * @param body content to be added to the tag
- * @return an HtmlTree object for the EM tag
- */
- public static HtmlTree EM(Content body) {
- HtmlTree htmltree = new HtmlTree(HtmlTag.EM, nullCheck(body));
- return htmltree;
- }
-
/**
* Generates a FRAME tag.
*
@@ -415,17 +404,6 @@ public class HtmlTree extends Content {
return htmltree;
}
- /**
- * Generates a I tag with some content.
- *
- * @param body content for the tag
- * @return an HtmlTree object for the I tag
- */
- public static HtmlTree I(Content body) {
- HtmlTree htmltree = new HtmlTree(HtmlTag.I, nullCheck(body));
- return htmltree;
- }
-
/**
* Generates a LI tag with some content.
*
@@ -558,17 +536,6 @@ public class HtmlTree extends Content {
return htmltree;
}
- /**
- * Generates a STRONG tag with some content.
- *
- * @param body content for the tag
- * @return an HtmlTree object for the STRONG tag
- */
- public static HtmlTree STRONG(Content body) {
- HtmlTree htmltree = new HtmlTree(HtmlTag.STRONG, nullCheck(body));
- return htmltree;
- }
-
/**
* Generates a SPAN tag with some content.
*
diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
index 6634d8aedfe..b2adb742b81 100644
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
@@ -77,6 +77,7 @@ Document title and Copyright styles
float:right;
padding:0px 21px;
font-size:.8em;
+ font-style:italic;
z-index:200;
margin-top:-7px;
}
@@ -519,3 +520,6 @@ h1.hidden {
.strong {
font-weight:bold;
}
+.italic {
+ font-style:italic;
+}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/Main.java b/langtools/src/share/classes/com/sun/tools/javac/Main.java
index eb3acca5c8e..2587d198972 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/Main.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/Main.java
@@ -26,8 +26,6 @@
package com.sun.tools.javac;
import java.io.PrintWriter;
-import java.lang.reflect.*;
-
/**
* The programmatic interface for the Java Programming Language
@@ -44,23 +42,12 @@ import java.lang.reflect.*;
@jdk.Supported
public class Main {
- /** Unsupported command line interface.
- * @param args The command line parameters.
+ /** Main entry point for the launcher.
+ * Note: This method calls System.exit.
+ * @param args command line arguments
*/
public static void main(String[] args) throws Exception {
- if (args.length > 0 && args[0].equals("-Xjdb")) {
- String[] newargs = new String[args.length + 2];
- Class> c = Class.forName("com.sun.tools.example.debug.tty.TTY");
- Method method = c.getDeclaredMethod ("main", new Class>[] {args.getClass()});
- method.setAccessible(true);
- System.arraycopy(args, 1, newargs, 3, args.length - 1);
- newargs[0] = "-connect";
- newargs[1] = "com.sun.jdi.CommandLineLaunch:options=-esa -ea:com.sun.tools...";
- newargs[2] = "com.sun.tools.javac.Main";
- method.invoke(null, new Object[] { newargs });
- } else {
System.exit(compile(args));
- }
}
/** Programmatic interface to the Java Programming Language
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
index 3f0fc861da3..cc438a73510 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1478,74 +1478,82 @@ public class Gen extends JCTree.Visitor {
code.statBegin(TreeInfo.endPos(body));
genFinalizer(env);
code.statBegin(TreeInfo.endPos(env.tree));
- Chain exitChain = code.branch(goto_);
- endFinalizerGap(env);
- if (startpc != endpc) for (List l = catchers; l.nonEmpty(); l = l.tail) {
- // start off with exception on stack
- code.entryPoint(stateTry, l.head.param.sym.type);
- genCatch(l.head, env, startpc, endpc, gaps);
- genFinalizer(env);
- if (hasFinalizer || l.tail.nonEmpty()) {
- code.statBegin(TreeInfo.endPos(env.tree));
- exitChain = Code.mergeChains(exitChain,
- code.branch(goto_));
- }
- endFinalizerGap(env);
+ Chain exitChain;
+ if (startpc != endpc) {
+ exitChain = code.branch(goto_);
+ } else {
+ exitChain = code.branch(dontgoto);
}
- if (hasFinalizer) {
- // Create a new register segement to avoid allocating
- // the same variables in finalizers and other statements.
- code.newRegSegment();
-
- // Add a catch-all clause.
-
- // start off with exception on stack
- int catchallpc = code.entryPoint(stateTry, syms.throwableType);
-
- // Register all exception ranges for catch all clause.
- // The range of the catch all clause is from the beginning
- // of the try or synchronized block until the present
- // code pointer excluding all gaps in the current
- // environment's GenContext.
- int startseg = startpc;
- while (env.info.gaps.nonEmpty()) {
- int endseg = env.info.gaps.next().intValue();
- registerCatch(body.pos(), startseg, endseg,
- catchallpc, 0);
- startseg = env.info.gaps.next().intValue();
+ endFinalizerGap(env);
+ if (startpc != endpc) {
+ for (List l = catchers; l.nonEmpty(); l = l.tail) {
+ // start off with exception on stack
+ code.entryPoint(stateTry, l.head.param.sym.type);
+ genCatch(l.head, env, startpc, endpc, gaps);
+ genFinalizer(env);
+ if (hasFinalizer || l.tail.nonEmpty()) {
+ code.statBegin(TreeInfo.endPos(env.tree));
+ exitChain = Code.mergeChains(exitChain,
+ code.branch(goto_));
+ }
+ endFinalizerGap(env);
}
- code.statBegin(TreeInfo.finalizerPos(env.tree));
- code.markStatBegin();
- Item excVar = makeTemp(syms.throwableType);
- excVar.store();
- genFinalizer(env);
- excVar.load();
- registerCatch(body.pos(), startseg,
- env.info.gaps.next().intValue(),
- catchallpc, 0);
- code.emitop0(athrow);
- code.markDead();
+ if (hasFinalizer) {
+ // Create a new register segement to avoid allocating
+ // the same variables in finalizers and other statements.
+ code.newRegSegment();
- // If there are jsr's to this finalizer, ...
- if (env.info.cont != null) {
- // Resolve all jsr's.
- code.resolve(env.info.cont);
+ // Add a catch-all clause.
- // Mark statement line number
+ // start off with exception on stack
+ int catchallpc = code.entryPoint(stateTry, syms.throwableType);
+
+ // Register all exception ranges for catch all clause.
+ // The range of the catch all clause is from the beginning
+ // of the try or synchronized block until the present
+ // code pointer excluding all gaps in the current
+ // environment's GenContext.
+ int startseg = startpc;
+ while (env.info.gaps.nonEmpty()) {
+ int endseg = env.info.gaps.next().intValue();
+ registerCatch(body.pos(), startseg, endseg,
+ catchallpc, 0);
+ startseg = env.info.gaps.next().intValue();
+ }
code.statBegin(TreeInfo.finalizerPos(env.tree));
code.markStatBegin();
- // Save return address.
- LocalItem retVar = makeTemp(syms.throwableType);
- retVar.store();
-
- // Generate finalizer code.
- env.info.finalize.genLast();
-
- // Return.
- code.emitop1w(ret, retVar.reg);
+ Item excVar = makeTemp(syms.throwableType);
+ excVar.store();
+ genFinalizer(env);
+ excVar.load();
+ registerCatch(body.pos(), startseg,
+ env.info.gaps.next().intValue(),
+ catchallpc, 0);
+ code.emitop0(athrow);
code.markDead();
+
+ // If there are jsr's to this finalizer, ...
+ if (env.info.cont != null) {
+ // Resolve all jsr's.
+ code.resolve(env.info.cont);
+
+ // Mark statement line number
+ code.statBegin(TreeInfo.finalizerPos(env.tree));
+ code.markStatBegin();
+
+ // Save return address.
+ LocalItem retVar = makeTemp(syms.throwableType);
+ retVar.store();
+
+ // Generate finalizer code.
+ env.info.finalize.genLast();
+
+ // Return.
+ code.emitop1w(ret, retVar.reg);
+ code.markDead();
+ }
}
}
// Resolve all breaks.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java b/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java
index 882449fdd69..a2cd3c55de7 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java
@@ -172,8 +172,8 @@ public class JavacAnnoConstructs {
}
// So we have a containing type
- String annoTypeName = annoType.getSimpleName();
- String containerTypeName = containerType.getSimpleName();
+ String annoTypeName = annoType.getName();
+ String containerTypeName = containerType.getName();
int directIndex = -1, containerIndex = -1;
Attribute.Compound direct = null, container = null;
// Find directly (explicit or implicit) present annotations
@@ -303,8 +303,8 @@ public class JavacAnnoConstructs {
}
// So we have a containing type
- String annoTypeName = annoType.getSimpleName();
- String containerTypeName = containerType.getSimpleName();
+ String annoTypeName = annoType.getName();
+ String containerTypeName = containerType.getName();
int directIndex = -1, containerIndex = -1;
Attribute.Compound direct = null, container = null;
// Find directly (explicit or implicit) present annotations
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
index 7a2f93368c1..e7c1e12b1cf 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java
@@ -973,7 +973,6 @@ public class Pretty extends JCTree.Visitor {
printBrackets((JCArrayTypeTree) elem);
}
if (tree.elems != null) {
- if (tree.elemtype != null) print("[]");
print("{");
printExprs(tree.elems);
print("}");
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
index e0b74340b77..b94dd5f8a4f 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
@@ -781,7 +781,7 @@ public class TreeMaker implements JCTree.Factory {
class AnnotationBuilder implements Attribute.Visitor {
JCExpression result = null;
public void visitConstant(Attribute.Constant v) {
- result = Literal(v.value);
+ result = Literal(v.type.getTag(), v.value);
}
public void visitClass(Attribute.Class clazz) {
result = ClassLiteral(clazz.classType).setType(syms.classType);
diff --git a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
index d3f9bf3f954..048f2186df5 100644
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -48,7 +48,7 @@ public class TestClassCrossReferences extends JavadocTester {
"Link to external member gcd"},
{BUG_ID + FS + "C.html",
- "
" + NL + "
Overrides:
" + NL +
+ "
" + NL + "
Overrides:
" + NL +
"
toString in class java.lang.Object
" + NL +
"
"}
};
diff --git a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java
index c3fe082ddad..78921d49d27 100644
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -39,13 +39,13 @@ public class TestExternalOverridenMethod extends JavadocTester {
private static final String BUG_ID = "4857717";
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "XReader.html",
- "
" +
- "Deprecated.As of JDK version 1.5, replaced by" + NL +
+ "Deprecated. As of JDK version 1.5, replaced by" + NL +
" " +
- "setUndecorated(boolean).
" + NL + ""},
+ "setUndecorated(boolean)." + NL + ""},
{BUG_ID + FS + "serialized-form.html", "" +
- "Deprecated.As of JDK version" +
+ "Deprecated. As of JDK version" +
" 1.5, replaced by" + NL +
" " +
- "setUndecorated(boolean)." + NL + ""}};
+ "setUndecorated(boolean)." + NL + ""}};
// Test for valid HTML generation which should not comprise of empty
// definition list tags.
diff --git a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java
index d0f1afc2bf3..cfaff523fde 100644
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -83,7 +83,7 @@ public class TestInterface extends JavadocTester {
},
//Make sure "Specified By" has substituted type parameters.
{BUG_ID + FS + "pkg" + FS + "Child.html",
- "
" + NL +
diff --git a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java
index 47873bc3433..4d90d8791fb 100644
--- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -72,7 +72,7 @@ public class TestMemberInheritence extends JavadocTester {
// Test overriding/implementing methods with generic parameters.
{BUG_ID + FS + "pkg" + FS + "BaseClass.html",
- "
"},
//FIELD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"@AnnotationTypeUndocumented(optional=\"Field Annotation\"," + NL +
" required=1994)" + NL +
- "public int field"},
+ "public int field"},
//CONSTRUCTOR
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"@AnnotationTypeUndocumented(optional=\"Constructor Annotation\"," + NL +
" required=1994)" + NL +
- "public AnnotationTypeUsage()"},
+ "public AnnotationTypeUsage()"},
//METHOD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
"@AnnotationTypeUndocumented(optional=\"Method Annotation\"," + NL +
" required=1994)" + NL +
- "public void method()"},
+ "public void method()"},
//=================================
// Make sure annotation types do not
diff --git a/langtools/test/com/sun/javadoc/testOptions/TestOptions.java b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java
new file mode 100644
index 00000000000..1327ff47737
--- /dev/null
+++ b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 4749567
+ * @summary Test the output for -header and -footer options.
+ * @author Bhavesh Patel
+ * @library ../lib/
+ * @build JavadocTester TestOptions
+ * @run main TestOptions
+ */
+
+public class TestOptions extends JavadocTester {
+
+ //Test information.
+ private static final String BUG_ID = "4749567";
+
+ //Javadoc arguments.
+ private static final String[] ARGS = new String[] {
+ "-d", BUG_ID, "-header", "Test header", "-footer", "Test footer",
+ "-sourcepath", SRC_DIR, "pkg"
+ };
+
+ private static final String[][] TEST = {
+ {BUG_ID + FS + "pkg" + FS + "package-summary.html",
+ "
"}
+ };
+
+ private static final String[][] NEGATED_TEST = NO_TEST;
+
+ /**
+ * The entry point of the test.
+ * @param args the array of command line arguments.
+ */
+ public static void main(String[] args) {
+ TestOptions tester = new TestOptions();
+ run(tester, ARGS, TEST, NEGATED_TEST);
+ tester.printSummary();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugId() {
+ return BUG_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugName() {
+ return getClass().getName();
+ }
+}
+
diff --git a/langtools/test/com/sun/javadoc/testOptions/pkg/Foo.java b/langtools/test/com/sun/javadoc/testOptions/pkg/Foo.java
new file mode 100644
index 00000000000..b2a32176bd1
--- /dev/null
+++ b/langtools/test/com/sun/javadoc/testOptions/pkg/Foo.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 pkg;
+
+public class Foo {}
+
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java
index 7568b0a2516..68999480d44 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -46,9 +46,9 @@ public class TestOverridenMethodDocCopy extends JavadocTester {
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Description copied from class: " +
+ "Description copied from class: " +
"" +
- "BaseClass"
+ "BaseClass"
}
};
private static final String[][] NEGATED_TEST = NO_TEST;
diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
index aa136d8be91..21a6760d308 100644
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -40,12 +40,12 @@ public class TestOverridenPrivateMethods extends JavadocTester {
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "
"},
@@ -55,7 +55,7 @@ public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester {
//The package private method should be overriden since the base and sub class are in the same
//package.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "
"}
@@ -65,18 +65,18 @@ public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester {
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "
" + NL + ""},
{BUG_ID + FS + "serialized-form.html", "" +
- "Deprecated.As of JDK version" +
+ "Deprecated. As of JDK version" +
" 1.5, replaced by" + NL +
" " +
- "setUndecorated(boolean)." + NL + ""}};
+ "setUndecorated(boolean)." + NL + ""}};
// Test with -nodeprecated option. The serialized-form.html should
// ignore the -nodeprecated tag and display the deprecation info. This
diff --git a/langtools/test/tools/javac/T8020997/CannotCompileRepeatedAnnoTest.java b/langtools/test/tools/javac/T8020997/CannotCompileRepeatedAnnoTest.java
new file mode 100644
index 00000000000..2e7edbb58b9
--- /dev/null
+++ b/langtools/test/tools/javac/T8020997/CannotCompileRepeatedAnnoTest.java
@@ -0,0 +1,46 @@
+
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8020997
+ * @summary Cannot compile class with repeating annotation
+ * @compile CannotCompileRepeatedAnnoTest.java
+ */
+
+import java.lang.annotation.*;
+
+@Anno(req = true)
+@Anno()
+public class CannotCompileRepeatedAnnoTest {
+}
+
+@Repeatable(Container.class)
+@interface Anno {
+ boolean req() default false;
+}
+
+@interface Container{
+ Anno[] value();
+}
diff --git a/langtools/test/tools/javac/T8022186/DeadCodeGeneratedForEmptyTryTest.java b/langtools/test/tools/javac/T8022186/DeadCodeGeneratedForEmptyTryTest.java
new file mode 100644
index 00000000000..d573dd552a6
--- /dev/null
+++ b/langtools/test/tools/javac/T8022186/DeadCodeGeneratedForEmptyTryTest.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8022186
+ * @summary javac generates dead code if a try with an empty body has a finalizer
+ */
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ConstantPool;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_String_info;
+import com.sun.tools.classfile.ConstantPool.CPInfo;
+import com.sun.tools.classfile.ConstantPool.InvalidIndex;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Instruction.KindVisitor;
+import com.sun.tools.classfile.Instruction.TypeKind;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.Assert;
+import java.io.BufferedInputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public class DeadCodeGeneratedForEmptyTryTest {
+
+ public static void main(String[] args) throws Exception {
+ new DeadCodeGeneratedForEmptyTryTest().run();
+ }
+
+ void run() throws Exception {
+ checkClassFile(Paths.get(System.getProperty("test.classes"),
+ this.getClass().getName() + "$Test.class"));
+ }
+
+ int utf8Index;
+ int numberOfRefToStr = 0;
+ ConstantPool constantPool;
+
+ void checkClassFile(final Path path) throws Exception {
+ ClassFile classFile = ClassFile.read(
+ new BufferedInputStream(Files.newInputStream(path)));
+ constantPool = classFile.constant_pool;
+ utf8Index = constantPool.getUTF8Index("STR_TO_LOOK_FOR");
+ for (Method method: classFile.methods) {
+ if (method.getName(constantPool).equals("methodToLookFor")) {
+ Code_attribute codeAtt = (Code_attribute)method.attributes.get(Attribute.Code);
+ for (Instruction inst: codeAtt.getInstructions()) {
+ inst.accept(codeVisitor, null);
+ }
+ }
+ }
+ Assert.check(numberOfRefToStr == 1,
+ "There should only be one reference to a CONSTANT_String_info structure in the generated code");
+ }
+
+ CodeVisitor codeVisitor = new CodeVisitor();
+
+ class CodeVisitor implements KindVisitor {
+
+ void checkIndirectRefToString(int cp_index) {
+ try {
+ CPInfo cInfo = constantPool.get(cp_index);
+ if (cInfo instanceof CONSTANT_String_info) {
+ CONSTANT_String_info strInfo = (CONSTANT_String_info)cInfo;
+ if (strInfo.string_index == utf8Index) {
+ numberOfRefToStr++;
+ }
+ }
+ } catch (InvalidIndex ex) {
+ throw new AssertionError("invalid constant pool index at " + cp_index);
+ }
+ }
+
+ @Override
+ public Void visitNoOperands(Instruction instr, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitArrayType(Instruction instr, TypeKind kind, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitBranch(Instruction instr, int offset, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitConstantPoolRef(Instruction instr, int index, Void p) {
+ checkIndirectRefToString(index);
+ return null;
+ }
+
+ @Override
+ public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Void p) {
+ checkIndirectRefToString(index);
+ return null;
+ }
+
+ @Override
+ public Void visitLocal(Instruction instr, int index, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitLocalAndValue(Instruction instr, int index, int value, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitValue(Instruction instr, int value, Void p) {
+ return null;
+ }
+
+ @Override
+ public Void visitUnknown(Instruction instr, Void p) {
+ return null;
+ }
+
+ }
+
+ public class Test {
+ void methodToLookFor() {
+ try {
+ } finally {
+ System.out.println("STR_TO_LOOK_FOR");
+ }
+ }
+ }
+}
diff --git a/langtools/test/tools/javac/processing/model/element/8009367/TestQualifiedNameUsed.java b/langtools/test/tools/javac/processing/model/element/8009367/TestQualifiedNameUsed.java
new file mode 100644
index 00000000000..5a8b12de589
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/element/8009367/TestQualifiedNameUsed.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8009367
+ * @summary Test that the correct kind of names (binary) are used when comparing
+ * Class and Symbol for repeatable Classes.
+ * @library /tools/javac/lib
+ * @build JavacTestingAbstractProcessor TestQualifiedNameUsed p.Q p.QQ p.R p.RR
+ * @run compile -processor TestQualifiedNameUsed -proc:only TestQualifiedNameUsed.java
+ */
+
+import java.lang.annotation.Repeatable;
+import java.util.Set;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import static javax.lang.model.util.ElementFilter.*;
+
+import com.sun.tools.javac.util.Assert;
+
+import java.util.Arrays;
+
+public class TestQualifiedNameUsed extends JavacTestingAbstractProcessor {
+ @Q
+ @p.Q
+ @p.R.Q
+ public boolean process(Set extends TypeElement> annotations,
+ RoundEnvironment roundEnv) {
+ if (!roundEnv.processingOver()) {
+ boolean hasRun = false;
+ for (Element element : roundEnv.getRootElements()) {
+ for (ExecutableElement e : methodsIn(element.getEnclosedElements())) {
+ if (e.getSimpleName().contentEquals("value"))
+ continue; // don't want to look Q.value() in this file
+
+ hasRun = true;
+ Q[] qs = e.getAnnotationsByType(Q.class);
+ Assert.check(qs.length == 1);
+ Assert.check(qs[0] instanceof Q);
+
+ p.Q[] ps = e.getAnnotationsByType(p.Q.class);
+ Assert.check(ps.length == 1);
+ Assert.check(ps[0] instanceof p.Q);
+
+ p.R.Q[] rs = e.getAnnotationsByType(p.R.Q.class);
+ Assert.check(rs.length == 1);
+ Assert.check(rs[0] instanceof p.R.Q);
+ }
+ }
+ if (!hasRun) throw new RuntimeException("No methods!");
+ }
+ return true;
+ }
+}
+
+@Repeatable(QQ.class)
+@interface Q {}
+
+@interface QQ {
+ Q[] value();
+}
diff --git a/langtools/test/tools/javac/processing/model/element/8009367/p/Q.java b/langtools/test/tools/javac/processing/model/element/8009367/p/Q.java
new file mode 100644
index 00000000000..d41331c8275
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/Q.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 p;
+
+import java.lang.annotation.Repeatable;
+
+@Repeatable(QQ.class)
+public @interface Q {}
diff --git a/langtools/test/tools/javac/processing/model/element/8009367/p/QQ.java b/langtools/test/tools/javac/processing/model/element/8009367/p/QQ.java
new file mode 100644
index 00000000000..e13e8d7ea7f
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/QQ.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 p;
+
+public @interface QQ {
+ Q[] value();
+}
diff --git a/langtools/test/tools/javac/processing/model/element/8009367/p/R.java b/langtools/test/tools/javac/processing/model/element/8009367/p/R.java
new file mode 100644
index 00000000000..da41577be11
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/R.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 p;
+
+import java.lang.annotation.Repeatable;
+
+public class R {
+
+ @Repeatable(RR.class)
+ public @interface Q {}
+}
diff --git a/langtools/test/tools/javac/processing/model/element/8009367/p/RR.java b/langtools/test/tools/javac/processing/model/element/8009367/p/RR.java
new file mode 100644
index 00000000000..2782d01181b
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/element/8009367/p/RR.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 p;
+
+public @interface RR {
+ R.Q[] value();
+}
diff --git a/langtools/test/tools/javac/tree/NewArrayPretty.java b/langtools/test/tools/javac/tree/NewArrayPretty.java
new file mode 100644
index 00000000000..dbac462d349
--- /dev/null
+++ b/langtools/test/tools/javac/tree/NewArrayPretty.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 8014826
+ * @summary test Pretty print of NewArray
+ * @author ksrini
+ */
+import com.sun.source.tree.ClassTree;
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.tree.JCTree;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class NewArrayPretty {
+ private final JavaCompiler tool;
+ NewArrayPretty() {
+ tool = ToolProvider.getSystemJavaCompiler();
+ }
+ public static void main(String... args) throws Exception {
+ NewArrayPretty nap = new NewArrayPretty();
+ nap.run("Class[] cls = null");
+ nap.run("Class[] cls = new Class[]{Object.class}");
+ }
+ void run(String code) throws IOException {
+ String src = "public class Test {" + code + ";}";
+
+ JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, null,
+ null, Arrays.asList(new MyFileObject(src)));
+
+ for (CompilationUnitTree cut : ct.parse()) {
+ JCTree.JCVariableDecl var =
+ (JCTree.JCVariableDecl) ((ClassTree) cut.getTypeDecls().get(0)).getMembers().get(0);
+
+ if (!code.equals(var.toString())) {
+ System.err.println("Expected: " + code);
+ System.err.println("Obtained: " + var.toString());
+ throw new RuntimeException("strings do not match!");
+ }
+ }
+ }
+}
+class MyFileObject extends SimpleJavaFileObject {
+
+ private String text;
+
+ public MyFileObject(String text) {
+ super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+ this.text = text;
+ }
+
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+ return text;
+ }
+}
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index 84447b8528b..e918394eb1a 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -211,3 +211,4 @@ d6bd440ac5b97bb1205b6c3274569c1cfe626723 jdk8-b96
10a1ab9e20a42d278aa1a89698f2a4cf5883d00d jdk8-b99
598321c438b52d9408a2671fb3fc2b2947d0f654 jdk8-b100
a302b05d0ee460679501dc01004f70eb395fadf5 jdk8-b101
+e966ff0a3ffef8a687eaf5a14167bb595b623d02 jdk8-b102
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
index 0c1e4e68d44..0ccc8a40489 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
@@ -45,6 +45,7 @@ import static jdk.nashorn.internal.codegen.CompilerConstants.methodDescriptor;
import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
import static jdk.nashorn.internal.codegen.CompilerConstants.staticField;
import static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor;
+import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
import static jdk.nashorn.internal.ir.Symbol.IS_INTERNAL;
import static jdk.nashorn.internal.ir.Symbol.IS_TEMP;
import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALLSITE_FAST_SCOPE;
@@ -131,6 +132,7 @@ import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
import jdk.nashorn.internal.runtime.Source;
import jdk.nashorn.internal.runtime.Undefined;
+import jdk.nashorn.internal.runtime.arrays.ArrayData;
import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
/**
@@ -1262,7 +1264,11 @@ final class CodeGenerator extends NodeOperatorVisitor extends ObjectCreator {
final T value = valueIter.next();
if (symbol != null && value != null) {
- final int index = ArrayIndex.getArrayIndex(key);
+ final int index = getArrayIndex(key);
- if (index < 0) {
+ if (!isValidArrayIndex(index)) {
putField(method, key, symbol.getFieldIndex(), value);
} else {
- putSlot(method, index, value);
+ putSlot(method, ArrayIndex.toLongIndex(index), value);
}
}
}
@@ -177,9 +180,13 @@ public abstract class FieldObjectCreator extends ObjectCreator {
* @param index Slot index.
* @param value Value to store.
*/
- private void putSlot(final MethodEmitter method, final int index, final T value) {
+ private void putSlot(final MethodEmitter method, final long index, final T value) {
method.dup();
- method.load(index);
+ if (JSType.isRepresentableAsInt(index)) {
+ method.load((int) index);
+ } else {
+ method.load(index);
+ }
loadValue(value);
method.dynamicSetIndex(callSiteFlags);
}
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java b/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java
index 6ad03c73691..2921ea9ecbc 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java
@@ -25,13 +25,15 @@
package jdk.nashorn.internal.codegen;
+import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndex;
+import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.isValidArrayIndex;
+
import java.util.ArrayList;
import java.util.List;
import jdk.nashorn.internal.ir.Symbol;
import jdk.nashorn.internal.runtime.AccessorProperty;
import jdk.nashorn.internal.runtime.Property;
import jdk.nashorn.internal.runtime.PropertyMap;
-import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
/**
* Class that creates PropertyMap sent to script object constructors.
@@ -76,7 +78,7 @@ public class MapCreator {
final String key = keys.get(i);
final Symbol symbol = symbols.get(i);
- if (symbol != null && !ArrayIndex.isIntArrayIndex(key)) {
+ if (symbol != null && !isValidArrayIndex(getArrayIndex(key))) {
properties.add(new AccessorProperty(key, getPropertyFlags(symbol, hasArguments), structure, symbol.getFieldIndex()));
}
}
@@ -93,7 +95,7 @@ public class MapCreator {
final String key = keys.get(i);
final Symbol symbol = symbols.get(i);
- if (symbol != null && !ArrayIndex.isIntArrayIndex(key)) {
+ if (symbol != null && !isValidArrayIndex(getArrayIndex(key))) {
properties.add(new AccessorProperty(key, getPropertyFlags(symbol, hasArguments), spillIndex++));
}
}
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java b/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java
index 67fdf5c1440..d30d5645fad 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java
@@ -26,9 +26,13 @@
package jdk.nashorn.internal.codegen;
import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
+import static jdk.nashorn.internal.codegen.CompilerConstants.virtualCallNoLookup;
import static jdk.nashorn.internal.codegen.types.Type.OBJECT;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
+
import jdk.nashorn.internal.codegen.types.Type;
import jdk.nashorn.internal.ir.Expression;
import jdk.nashorn.internal.ir.LiteralNode;
@@ -36,6 +40,8 @@ import jdk.nashorn.internal.ir.Symbol;
import jdk.nashorn.internal.runtime.Property;
import jdk.nashorn.internal.runtime.PropertyMap;
import jdk.nashorn.internal.runtime.ScriptObject;
+import jdk.nashorn.internal.runtime.arrays.ArrayData;
+import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
import jdk.nashorn.internal.scripts.JO;
/**
@@ -63,56 +69,82 @@ public class SpillObjectCreator extends ObjectCreator {
protected void makeObject(final MethodEmitter method) {
assert !isScope() : "spill scope objects are not currently supported";
- final int length = keys.size();
- final Object[] presetValues = new Object[propertyMap.size()];
- final Class> clazz = JO.class;
+ final int length = keys.size();
+ final Object[] presetValues = new Object[length];
+ final Set postsetValues = new LinkedHashSet<>();
+ final int callSiteFlags = codegen.getCallSiteFlags();
+ ArrayData arrayData = ArrayData.allocate(new Object[0]);
- // Compute constant values
+ // Compute constant property values
for (int i = 0; i < length; i++) {
final String key = keys.get(i);
- final Property property = propertyMap.findProperty(key);
+ final Expression value = values.get(i);
+ if (value == null) {
+ continue; // getter or setter
+ }
+
+ final Object constantValue = LiteralNode.objectAsConstant(value);
+ if (constantValue == LiteralNode.POSTSET_MARKER) {
+ postsetValues.add(i);
+ continue;
+ }
+
+ final Property property = propertyMap.findProperty(key);
if (property != null) {
- presetValues[property.getSlot()] = LiteralNode.objectAsConstant(values.get(i));
+ // normal property key
+ presetValues[property.getSlot()] = constantValue;
+ } else {
+ // array index key
+ final long oldLength = arrayData.length();
+ final int index = ArrayIndex.getArrayIndex(key);
+ assert ArrayIndex.isValidArrayIndex(index);
+ final long longIndex = ArrayIndex.toLongIndex(index);
+ if (longIndex >= oldLength) {
+ arrayData = arrayData.ensure(longIndex);
+ }
+ arrayData = arrayData.set(index, constantValue, false);
+ if (longIndex > oldLength) {
+ arrayData = arrayData.delete(oldLength, longIndex - 1);
+ }
}
}
- method._new(clazz).dup();
+ // create object and invoke constructor
+ method._new(JO.class).dup();
codegen.loadConstant(propertyMap);
-
method.invoke(constructorNoLookup(JO.class, PropertyMap.class));
+ // Set spill array with preset values
method.dup();
codegen.loadConstant(presetValues);
+ method.putField(Type.getInternalName(ScriptObject.class), "spill", Type.OBJECT_ARRAY.getDescriptor());
+
+ // Set array data if any
+ if (arrayData.length() > 0) {
+ method.dup();
+ codegen.loadConstant(arrayData);
+ method.invoke(virtualCallNoLookup(ScriptObject.class, "setArray",void.class, ArrayData.class));
+ }
// Create properties with non-constant values
- for (int i = 0; i < length; i++) {
+ for (int i : postsetValues) {
final String key = keys.get(i);
final Property property = propertyMap.findProperty(key);
- if (property != null && presetValues[property.getSlot()] == LiteralNode.POSTSET_MARKER) {
+ if (property == null) {
+ final int index = ArrayIndex.getArrayIndex(key);
+ assert ArrayIndex.isValidArrayIndex(index);
method.dup();
+ method.load(ArrayIndex.toLongIndex(index));
+ codegen.load(values.get(i));
+ method.dynamicSetIndex(callSiteFlags);
+ } else {
+ method.dup();
+ method.getField(Type.getInternalName(ScriptObject.class), "spill", Type.OBJECT_ARRAY.getDescriptor());
method.load(property.getSlot());
codegen.load(values.get(i)).convert(OBJECT);
method.arraystore();
- presetValues[property.getSlot()] = null;
- }
- }
-
- method.putField(Type.typeFor(ScriptObject.class).getInternalName(), "spill", Type.OBJECT_ARRAY.getDescriptor());
- final int callSiteFlags = codegen.getCallSiteFlags();
-
- // Assign properties with valid array index keys
- for (int i = 0; i < length; i++) {
- final String key = keys.get(i);
- final Property property = propertyMap.findProperty(key);
- final Expression value = values.get(i);
-
- if (property == null && value != null) {
- method.dup();
- method.load(keys.get(i));
- codegen.load(value);
- method.dynamicSetIndex(callSiteFlags);
}
}
}
diff --git a/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java b/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java
index 40b1a95cd72..ecf8bec8b68 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java
@@ -115,6 +115,11 @@ abstract class ArrayBufferView extends ScriptObject {
this.elementLength = elementLength;
}
+ @Override
+ public ArrayData copy() {
+ throw new UnsupportedOperationException(); // Not used for ArrayBuffers
+ }
+
@Override
public Object[] asObjectArray() {
final Object[] array = new Object[elementLength];
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/NashornLoader.java b/nashorn/src/jdk/nashorn/internal/runtime/NashornLoader.java
index bdd071b5283..4e349730451 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/NashornLoader.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/NashornLoader.java
@@ -44,26 +44,29 @@ import jdk.nashorn.tools.Shell;
*
*/
abstract class NashornLoader extends SecureClassLoader {
- private static final String OBJECTS_PKG = "jdk.nashorn.internal.objects";
- private static final String RUNTIME_PKG = "jdk.nashorn.internal.runtime";
+ private static final String OBJECTS_PKG = "jdk.nashorn.internal.objects";
+ private static final String RUNTIME_PKG = "jdk.nashorn.internal.runtime";
+ private static final String RUNTIME_ARRAYS_PKG = "jdk.nashorn.internal.runtime.arrays";
private static final String RUNTIME_LINKER_PKG = "jdk.nashorn.internal.runtime.linker";
- private static final String SCRIPTS_PKG = "jdk.nashorn.internal.scripts";
+ private static final String SCRIPTS_PKG = "jdk.nashorn.internal.scripts";
private static final Permission[] SCRIPT_PERMISSIONS;
- static {
- SCRIPT_PERMISSIONS = new Permission[4];
+ static {
/*
* Generated classes get access to runtime, runtime.linker, objects, scripts packages.
* Note that the actual scripts can not access these because Java.type, Packages
* prevent these restricted packages. And Java reflection and JSR292 access is prevented
* for scripts. In other words, nashorn generated portions of script classes can access
- * clases in these implementation packages.
+ * classes in these implementation packages.
*/
- SCRIPT_PERMISSIONS[0] = new RuntimePermission("accessClassInPackage." + RUNTIME_PKG);
- SCRIPT_PERMISSIONS[1] = new RuntimePermission("accessClassInPackage." + RUNTIME_LINKER_PKG);
- SCRIPT_PERMISSIONS[2] = new RuntimePermission("accessClassInPackage." + OBJECTS_PKG);
- SCRIPT_PERMISSIONS[3] = new RuntimePermission("accessClassInPackage." + SCRIPTS_PKG);
+ SCRIPT_PERMISSIONS = new Permission[] {
+ new RuntimePermission("accessClassInPackage." + RUNTIME_PKG),
+ new RuntimePermission("accessClassInPackage." + RUNTIME_LINKER_PKG),
+ new RuntimePermission("accessClassInPackage." + OBJECTS_PKG),
+ new RuntimePermission("accessClassInPackage." + SCRIPTS_PKG),
+ new RuntimePermission("accessClassInPackage." + RUNTIME_ARRAYS_PKG)
+ };
}
private final Context context;
@@ -97,6 +100,7 @@ abstract class NashornLoader extends SecureClassLoader {
final String pkgName = name.substring(0, i);
switch (pkgName) {
case RUNTIME_PKG:
+ case RUNTIME_ARRAYS_PKG:
case RUNTIME_LINKER_PKG:
case OBJECTS_PKG:
case SCRIPTS_PKG:
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java
index 9e3efeed5b9..1278d49ff95 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java
@@ -56,7 +56,7 @@ public abstract class ArrayData {
* Constructor
* @param length Virtual length of the array.
*/
- public ArrayData(final long length) {
+ protected ArrayData(final long length) {
this.length = length;
}
@@ -182,6 +182,14 @@ public abstract class ArrayData {
return length;
}
+ /**
+ * Return a copy of the array that can be modified without affecting this instance.
+ * It is safe to return themselves for immutable subclasses.
+ *
+ * @return a new array
+ */
+ public abstract ArrayData copy();
+
/**
* Return a copy of the array data as an Object array.
*
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java
index f59229c40ec..58d1a49db22 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java
@@ -177,15 +177,5 @@ public final class ArrayIndex {
return index & JSType.MAX_UINT;
}
- /**
- * Check whether a key string represents a valid array index in JavaScript and is small enough
- * to fit into a positive int.
- *
- * @param key the key
- * @return true if key works as a valid int array index
- */
- public static boolean isIntArrayIndex(final String key) {
- return getArrayIndex(key) >= 0;
- }
}
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java
index 71d4d15205e..8d2de2ced89 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java
@@ -30,7 +30,7 @@ import jdk.nashorn.internal.runtime.ScriptObject;
/**
* Iterator over a NativeArray
*/
-public class ArrayIterator extends ArrayLikeIterator