From 5d2b14d198ab63daec64fc0ef51036462eda3bc0 Mon Sep 17 00:00:00 2001
From: Vladimir Ivanov
diff --git a/jdk/src/java.base/share/classes/java/lang/module/package-info.java b/jdk/src/java.base/share/classes/java/lang/module/package-info.java
index b531f13748c..c8e2c04d975 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/package-info.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/package-info.java
@@ -27,7 +27,7 @@
* Classes to support module descriptors and creating configurations of modules
* by means of resolution and service binding.
*
- * Resolution is the process of computing the transitive closure of a set
* of root modules over a set of observable modules by resolving the
@@ -97,7 +97,7 @@
* resolved so that it reads all other modules in the resulting configuration and
* all modules in parent configurations. Service binding is the process of augmenting a graph of resolved modules
* from the set of observable modules induced by the service-use dependence
diff --git a/jdk/src/java.base/share/classes/java/lang/package-info.java b/jdk/src/java.base/share/classes/java/lang/package-info.java
index 26a0daf1c93..5868aee8fcf 100644
--- a/jdk/src/java.base/share/classes/java/lang/package-info.java
+++ b/jdk/src/java.base/share/classes/java/lang/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
* by the {@code throw} statement. Subclasses of {@code Throwable}
* represent errors and exceptions.
*
- *
+ *
* There are a few standard system properties used to
+ There are a few standard system properties used to
alter the mechanisms and behavior of the various classes of the
java.net package. Some are checked only once at startup of the VM,
and therefore are best set using the -D option of the java command,
@@ -39,7 +39,7 @@ the
+
java.net.preferIPv4Stack (default: false)Summary of relevant Java Virtual Machine changes
+ * Summary of relevant Java Virtual Machine changes
* The following low-level information summarizes relevant parts of the
* Java Virtual Machine specification. For full details, please see the
* current version of that specification.
*
* Each occurrence of an {@code invokedynamic} instruction is called a dynamic call site.
- * {@code invokedynamic} instructions
+ * {@code invokedynamic} instructions
* A dynamic call site is originally in an unlinked state. In this state, there is
* no target method for the call site to invoke.
* Resolution
+ * Resolution
*
* Service binding
+ * Service binding
*
* Character Encodings
*
* The specification of the {@link java.nio.charset.Charset
diff --git a/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html b/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html
index f4bf1243681..003749ba7f2 100644
--- a/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html
+++ b/jdk/src/java.base/share/classes/java/net/doc-files/net-properties.html
@@ -1,5 +1,6 @@
+
-
Networking Properties
-Networking Properties
+IPv4 / IPv6
@@ -62,7 +62,7 @@ and detail all of these properties.
Both of these properties are checked only once, at startup.
- +A proxy server allows indirect connection to network services and is used mainly for security (to get through firewalls) and @@ -155,7 +155,7 @@ of proxies.
globally through their user interface). Note that this property is checked only once at startup. - +http.agent (default: “Java/<version>”)
@@ -214,7 +214,7 @@ of proxies.
All these properties are checked only once at startup.
- +The java.net package, when doing name resolution, uses an address cache for both security and performance reasons. Any address diff --git a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java index b38bdea058a..57ab6322be0 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ * performing I/O operations, such as files and sockets; defines selectors, for * multiplexed, non-blocking I/O operations. * - * + * * *
*
@@ -136,7 +136,7 @@ * file channel connected to the same underlying file as the {@link java.io} * class. * - * + * * Channels Description *
* Multiplexed, non-blocking I/O Description
{@link java.nio.channels.SelectableChannel} @@ -222,7 +222,7 @@ * directly; custom channel classes should extend the appropriate {@link * java.nio.channels.SelectableChannel} subclasses defined in this package. * - * + * * **
diff --git a/jdk/src/java.base/share/classes/java/nio/file/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/package-info.java index 556df2b8c6a..611138eef8e 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/file/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ * package is used by service provider implementors wishing to extend the * platform default provider, or to construct other provider implementations. * - * Asynchronous I/O Description Symbolic Links
+ *Symbolic Links
*Many operating systems and file systems support for symbolic links. * A symbolic link is a special file that serves as a reference to another file. * For the most part, symbolic links are transparent to applications and @@ -45,7 +45,7 @@ * that are semantically close but support for these other types of links is * not included in this package.
* - *Interoperability
+ *Interoperability
*The {@link java.io.File} class defines the {@link java.io.File#toPath * toPath} method to construct a {@link java.nio.file.Path} by converting * the abstract path represented by the {@code java.io.File} object. The resulting @@ -65,7 +65,7 @@ * or on some other machine. The exact nature of any such inconsistencies are * system-dependent and are therefore unspecified.
* - *Synchronized I/O File Integrity
+ *Synchronized I/O File Integrity
*The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link * java.nio.file.StandardOpenOption#DSYNC DSYNC} options are used when opening a file * to require that updates to the file are written synchronously to the underlying diff --git a/jdk/src/java.base/share/classes/java/nio/package-info.java b/jdk/src/java.base/share/classes/java/nio/package-info.java index b36faeac3c6..595a21ed390 100644 --- a/jdk/src/java.base/share/classes/java/nio/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ * the contents of which can be used to extend the platform's default * implementations or to construct alternative implementations. * - * + * * *
*
diff --git a/jdk/src/java.base/share/classes/java/util/package-info.java b/jdk/src/java.base/share/classes/java/util/package-info.java index e6406f14d3d..ff82404b45f 100644 --- a/jdk/src/java.base/share/classes/java/util/package-info.java +++ b/jdk/src/java.base/share/classes/java/util/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ * miscellaneous utility classes (a string tokenizer, a random-number * generator, and a bit array). * - * Buffers Description {@index "Java Collections Framework"}
+ *{@index "Java Collections Framework"}
**
-- Collections Framework Overview *
- diff --git a/jdk/src/java.base/share/classes/java/util/zip/package-info.java b/jdk/src/java.base/share/classes/java/util/zip/package-info.java index a6ec2072413..f89085e1af3 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/package-info.java +++ b/jdk/src/java.base/share/classes/java/util/zip/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,13 +37,13 @@ * Info-ZIP Application Note 970311 - a detailed description of * the Info-ZIP format upon which the {@code java.util.zip} classes * are based. - *
- An implementation may optionally support the + *
- An implementation may optionally support the * ZIP64(tm) format extensions defined by the * * PKWARE ZIP File Format Specification. The ZIP64(tm) format * extensions are used to overcome the size limitations of the * original ZIP format. - *
- APPENDIX D of + *
- APPENDIX D of * * PKWARE ZIP File Format Specification - Language Encoding Flag * (EFS) to encode ZIP entry filename and comment fields using UTF-8. From e0cd6e69c0fb4cd8f2ff02790955b877e03e32b9 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons
Date: Tue, 30 May 2017 15:49:45 -0700 Subject: [PATCH 005/130] 8181290: Invalid HTML 5 in core-libs docs Reviewed-by: mchung, lancea --- .../classes/org/omg/CORBA/doc-files/generatedfiles.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html index 3f4ce0ea7dc..39aa88463cf 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/doc-files/generatedfiles.html @@ -42,7 +42,7 @@ is the name of an IDL interface. Helper Files
+Helper Files
Helper files supply several static methods needed to manipulate the type. These include
Any
insert and extract operations for the type, @@ -57,7 +57,7 @@ the object reference does not support the requested type. A different system exc is raised to indicate other kinds of errors. Trying to narrow a null will always succeed with a return value of null. -Holder Files
+Holder Files
Support for out and inout parameter passing modes requires the use of additional holder classes. These classes are available for all of the basic IDL datatypes in the
org.omg.CORBA
package @@ -74,7 +74,7 @@ false for boolean, 0 for numeric and char types, null for strings, null for obje theorg.omg.CORBA.portable.Streamable
interface. -Operations Files
+Operations Files
A non abstract IDL interface is mapped to two public Java interfaces: a signature interface and an operations interface. @@ -96,7 +96,7 @@ expressed in IDL is reflected in both the Java signature interface and operations interface hierarchies. -
Stubs
+Stubs
For the mapping of a non-object-oriented language, there will be a programming interface to the stubs for each interface type. Generally, the stubs From 696328559d6693e9fc91dbc9c8c0e021d23dc984 Mon Sep 17 00:00:00 2001 From: Hamlin Li
* * @author David Connelly + * @since 1.1 */ public class CRC32 implements Checksum { diff --git a/jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java b/jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java index e1e5249c251..05c6f891c16 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/CheckedInputStream.java @@ -35,6 +35,7 @@ import java.io.IOException; * * @see Checksum * @author David Connelly + * @since 1.1 */ public class CheckedInputStream extends FilterInputStream { diff --git a/jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java b/jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java index 698b9410f5f..9267d8e1c89 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/CheckedOutputStream.java @@ -36,6 +36,7 @@ import java.io.IOException; * * @see Checksum * @author David Connelly + * @since 1.1 */ public class CheckedOutputStream extends FilterOutputStream { diff --git a/jdk/src/java.base/share/classes/java/util/zip/Checksum.java b/jdk/src/java.base/share/classes/java/util/zip/Checksum.java index eb681861785..db9490cd2c6 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/Checksum.java +++ b/jdk/src/java.base/share/classes/java/util/zip/Checksum.java @@ -30,6 +30,7 @@ import java.nio.ByteBuffer; * An interface representing a data checksum. * * @author David Connelly + * @since 1.1 */ public interface Checksum { diff --git a/jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java b/jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java index 77adbe90c12..a5639b3ebb1 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java +++ b/jdk/src/java.base/share/classes/java/util/zip/DataFormatException.java @@ -29,6 +29,7 @@ package java.util.zip; * Signals that a data format error has occurred. * * @author David Connelly + * @since 1.1 */ public class DataFormatException extends Exception { diff --git a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java index 6eb5065040e..494018939b6 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java +++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java @@ -69,6 +69,7 @@ package java.util.zip; * * @see Inflater * @author David Connelly + * @since 1.1 */ public class Deflater { diff --git a/jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java b/jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java index a1f768caea4..ac8f2ae90c4 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java @@ -37,6 +37,7 @@ import java.io.IOException; * * @see Deflater * @author David Connelly + * @since 1.1 */ public class DeflaterOutputStream extends FilterOutputStream { diff --git a/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java b/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java index d5a2f4544df..f5f530f5da6 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/GZIPInputStream.java @@ -38,6 +38,7 @@ import java.io.EOFException; * * @see InflaterInputStream * @author David Connelly + * @since 1.1 * */ public diff --git a/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java b/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java index 67a20a1c291..9ff56f156c2 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java @@ -32,6 +32,7 @@ import java.io.IOException; * This class implements a stream filter for writing compressed data in * the GZIP file format. * @author David Connelly + * @since 1.1 * */ public diff --git a/jdk/src/java.base/share/classes/java/util/zip/Inflater.java b/jdk/src/java.base/share/classes/java/util/zip/Inflater.java index 2aab545f2a1..edf0add3314 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/Inflater.java +++ b/jdk/src/java.base/share/classes/java/util/zip/Inflater.java @@ -68,6 +68,7 @@ package java.util.zip; * * @see Deflater * @author David Connelly + * @since 1.1 * */ public diff --git a/jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java b/jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java index 57e38b341c8..fd4c05736fa 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/InflaterInputStream.java @@ -37,6 +37,7 @@ import java.io.EOFException; * * @see Inflater * @author David Connelly + * @since 1.1 */ public class InflaterInputStream extends FilterInputStream { diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java b/jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java index db7f500424f..4f54718e0e1 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java @@ -30,6 +30,7 @@ package java.util.zip; * which manipulate ZIP files. * * @author David Connelly + * @since 1.1 */ interface ZipConstants { /* diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java index c00b5bf6789..e52ea06cf2e 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -39,6 +39,7 @@ import static java.util.zip.ZipConstants64.*; * This class is used to represent a ZIP file entry. * * @author David Connelly + * @since 1.1 */ public class ZipEntry implements ZipConstants, Cloneable { diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java index 83ce2441eeb..74264ed21a4 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -70,6 +70,7 @@ import static java.util.zip.ZipUtils.*; * thrown. * * @author David Connelly + * @since 1.1 */ public class ZipFile implements ZipConstants, Closeable { diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java index c615aaa7eb9..29cbc23f7de 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java @@ -40,6 +40,7 @@ import static java.util.zip.ZipUtils.*; * entries. * * @author David Connelly + * @since 1.1 */ public class ZipInputStream extends InflaterInputStream implements ZipConstants { diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index b298653b39d..1770ef3bff9 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -41,6 +41,7 @@ import sun.security.action.GetPropertyAction; * entries. * * @author David Connelly + * @since 1.1 */ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstants { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java index 6cbff526932..bfdd022c138 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/AuthPermission.java @@ -139,6 +139,7 @@ package javax.security.auth; * @implNote * Implementations may define additional target names, but should use naming * conventions such as reverse domain name notation to avoid name clashes. + * @since 1.4 */ public final class AuthPermission extends java.security.BasicPermission { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java b/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java index 4c72dda0484..66a84f46aa9 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/DestroyFailedException.java @@ -32,6 +32,7 @@ package javax.security.auth; * the {@code Destroyable} interface when the {@code destroy} * method fails. * + * @since 1.4 */ public class DestroyFailedException extends Exception { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java b/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java index eeb2ba0541e..5758cc4f453 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/Destroyable.java @@ -29,6 +29,7 @@ package javax.security.auth; * Objects such as credentials may optionally implement this interface * to provide the capability to destroy its contents. * + * @since 1.4 * @see javax.security.auth.Subject */ public interface Destroyable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/Policy.java b/jdk/src/java.base/share/classes/javax/security/auth/Policy.java index 605161e363a..b9f61da72db 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/Policy.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/Policy.java @@ -153,6 +153,7 @@ import sun.security.util.Debug; * These two APIs provide callers the means to query the * Policy for Principal-based Permission entries. * + * @since 1.4 * @see java.security.Security security properties */ @Deprecated(since="1.4") diff --git a/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java b/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java index 217bf9ea95f..fdd1d017986 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/PrivateCredentialPermission.java @@ -100,6 +100,7 @@ import sun.security.util.ResourcesMgr; * "a.b.Principal" with the name, "duke", and "c.d.Principal", with the name, * "dukette". * + * @since 1.4 */ public final class PrivateCredentialPermission extends Permission { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java b/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java index ff44d06f307..d69be787daf 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/RefreshFailedException.java @@ -32,6 +32,7 @@ package javax.security.auth; * the {@code Refreshable} interface when the {@code refresh} * method fails. * + * @since 1.4 */ public class RefreshFailedException extends Exception { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java b/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java index 8f727eafc28..73f1ec48431 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/Refreshable.java @@ -32,6 +32,7 @@ package javax.security.auth; * may implement this interface to allow callers to refresh the time period * for which it is valid. * + * @since 1.4 * @see javax.security.auth.Subject */ public interface Refreshable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/Subject.java b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java index 96c6eeaf30e..602298df9b6 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/Subject.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/Subject.java @@ -94,6 +94,7 @@ import sun.security.util.ResourcesMgr; * {@code Principal} implementations associated with Subjects * must implement {@code Serializable}. * + * @since 1.4 * @see java.security.Principal * @see java.security.DomainCombiner */ diff --git a/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java b/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java index a6cc910d3ab..b80cec126a5 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java @@ -43,6 +43,7 @@ import java.lang.ref.WeakReference; * with Principals from the {@code Subject} associated with this * {@code SubjectDomainCombiner}. * + * @since 1.4 */ public class SubjectDomainCombiner implements java.security.DomainCombiner { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java index 83855ca0484..d8522e40d8f 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/Callback.java @@ -40,6 +40,7 @@ package javax.security.auth.callback; * if appropriate, to return requested information back to the * underlying security services. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler * @see javax.security.auth.callback.ChoiceCallback * @see javax.security.auth.callback.ConfirmationCallback diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java index d9ef17a700f..03e1b14a5ff 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/CallbackHandler.java @@ -63,6 +63,7 @@ package javax.security.auth.callback; *Date: Wed, 31 May 2017 19:54:16 -0700 Subject: [PATCH 006/130] 8181082: class-level since tag issues in java.base & java.datatransfer module Reviewed-by: alanb, serb --- .../java.base/share/classes/java/lang/RuntimePermission.java | 1 + jdk/src/java.base/share/classes/java/lang/reflect/Array.java | 1 + .../java.base/share/classes/java/lang/reflect/Constructor.java | 1 + jdk/src/java.base/share/classes/java/lang/reflect/Field.java | 1 + .../classes/java/lang/reflect/InvocationTargetException.java | 1 + jdk/src/java.base/share/classes/java/lang/reflect/Member.java | 1 + jdk/src/java.base/share/classes/java/lang/reflect/Method.java | 1 + jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java | 1 + jdk/src/java.base/share/classes/java/math/BigDecimal.java | 1 + jdk/src/java.base/share/classes/java/net/NetPermission.java | 1 + jdk/src/java.base/share/classes/java/net/SocketOptions.java | 1 + jdk/src/java.base/share/classes/java/net/SocketPermission.java | 1 + .../share/classes/java/security/AccessControlContext.java | 1 + .../share/classes/java/security/AccessControlException.java | 1 + .../java.base/share/classes/java/security/AccessController.java | 1 + .../java.base/share/classes/java/security/AllPermission.java | 1 + .../java.base/share/classes/java/security/BasicPermission.java | 1 + jdk/src/java.base/share/classes/java/security/Certificate.java | 1 + jdk/src/java.base/share/classes/java/security/CodeSource.java | 1 + .../java.base/share/classes/java/security/DigestException.java | 1 + .../share/classes/java/security/DigestInputStream.java | 1 + .../share/classes/java/security/DigestOutputStream.java | 1 + .../share/classes/java/security/GeneralSecurityException.java | 1 + jdk/src/java.base/share/classes/java/security/Guard.java | 1 + .../java.base/share/classes/java/security/GuardedObject.java | 1 + jdk/src/java.base/share/classes/java/security/Identity.java | 1 + .../java.base/share/classes/java/security/IdentityScope.java | 1 + .../share/classes/java/security/InvalidKeyException.java | 1 + .../share/classes/java/security/InvalidParameterException.java | 1 + jdk/src/java.base/share/classes/java/security/Key.java | 1 + jdk/src/java.base/share/classes/java/security/KeyException.java | 1 + .../share/classes/java/security/KeyManagementException.java | 1 + jdk/src/java.base/share/classes/java/security/KeyPair.java | 1 + .../java.base/share/classes/java/security/KeyPairGenerator.java | 1 + .../share/classes/java/security/KeyPairGeneratorSpi.java | 1 + .../java.base/share/classes/java/security/MessageDigest.java | 1 + .../java.base/share/classes/java/security/MessageDigestSpi.java | 1 + .../share/classes/java/security/NoSuchAlgorithmException.java | 1 + .../share/classes/java/security/NoSuchProviderException.java | 1 + jdk/src/java.base/share/classes/java/security/Permission.java | 1 + .../share/classes/java/security/PermissionCollection.java | 1 + jdk/src/java.base/share/classes/java/security/Permissions.java | 1 + jdk/src/java.base/share/classes/java/security/Policy.java | 1 + jdk/src/java.base/share/classes/java/security/Principal.java | 1 + jdk/src/java.base/share/classes/java/security/PrivateKey.java | 1 + .../java.base/share/classes/java/security/PrivilegedAction.java | 1 + .../share/classes/java/security/PrivilegedActionException.java | 1 + .../share/classes/java/security/PrivilegedExceptionAction.java | 1 + .../java.base/share/classes/java/security/ProtectionDomain.java | 1 + jdk/src/java.base/share/classes/java/security/Provider.java | 1 + .../share/classes/java/security/ProviderException.java | 1 + jdk/src/java.base/share/classes/java/security/PublicKey.java | 1 + .../share/classes/java/security/SecureClassLoader.java | 1 + jdk/src/java.base/share/classes/java/security/SecureRandom.java | 1 + jdk/src/java.base/share/classes/java/security/Security.java | 1 + .../share/classes/java/security/SecurityPermission.java | 1 + jdk/src/java.base/share/classes/java/security/Signature.java | 1 + .../share/classes/java/security/SignatureException.java | 1 + jdk/src/java.base/share/classes/java/security/SignatureSpi.java | 1 + jdk/src/java.base/share/classes/java/security/SignedObject.java | 1 + jdk/src/java.base/share/classes/java/security/Signer.java | 1 + .../share/classes/java/security/UnresolvedPermission.java | 1 + .../classes/java/security/UnresolvedPermissionCollection.java | 1 + jdk/src/java.base/share/classes/java/security/acl/Acl.java | 1 + jdk/src/java.base/share/classes/java/security/acl/AclEntry.java | 1 + .../share/classes/java/security/acl/AclNotFoundException.java | 1 + jdk/src/java.base/share/classes/java/security/acl/Group.java | 1 + .../share/classes/java/security/acl/LastOwnerException.java | 1 + .../share/classes/java/security/acl/NotOwnerException.java | 1 + jdk/src/java.base/share/classes/java/security/acl/Owner.java | 1 + .../java.base/share/classes/java/security/acl/Permission.java | 1 + .../share/classes/java/security/cert/CRLException.java | 1 + .../java.base/share/classes/java/security/cert/Certificate.java | 1 + .../java/security/cert/CertificateEncodingException.java | 1 + .../share/classes/java/security/cert/CertificateException.java | 1 + .../classes/java/security/cert/CertificateExpiredException.java | 1 + .../java/security/cert/CertificateNotYetValidException.java | 1 + .../classes/java/security/cert/CertificateParsingException.java | 1 + jdk/src/java.base/share/classes/java/security/cert/X509CRL.java | 1 + .../share/classes/java/security/cert/X509CRLEntry.java | 1 + .../share/classes/java/security/cert/X509Certificate.java | 1 + .../share/classes/java/security/cert/X509Extension.java | 1 + .../share/classes/java/security/interfaces/DSAKey.java | 1 + .../classes/java/security/interfaces/DSAKeyPairGenerator.java | 1 + .../share/classes/java/security/interfaces/DSAParams.java | 1 + .../share/classes/java/security/interfaces/DSAPrivateKey.java | 1 + .../share/classes/java/security/interfaces/DSAPublicKey.java | 1 + .../classes/java/security/interfaces/RSAPrivateCrtKey.java | 1 + .../share/classes/java/security/interfaces/RSAPrivateKey.java | 1 + .../share/classes/java/security/interfaces/RSAPublicKey.java | 1 + .../share/classes/java/security/spec/RSAPrivateCrtKeySpec.java | 1 + .../share/classes/java/security/spec/RSAPrivateKeySpec.java | 1 + .../share/classes/java/security/spec/RSAPublicKeySpec.java | 1 + jdk/src/java.base/share/classes/java/text/BreakIterator.java | 1 + .../java.base/share/classes/java/text/CharacterIterator.java | 1 + jdk/src/java.base/share/classes/java/text/ChoiceFormat.java | 1 + .../share/classes/java/text/CollationElementIterator.java | 1 + jdk/src/java.base/share/classes/java/text/CollationKey.java | 1 + jdk/src/java.base/share/classes/java/text/Collator.java | 1 + jdk/src/java.base/share/classes/java/text/DateFormat.java | 1 + .../java.base/share/classes/java/text/DateFormatSymbols.java | 1 + jdk/src/java.base/share/classes/java/text/DecimalFormat.java | 1 + .../java.base/share/classes/java/text/DecimalFormatSymbols.java | 1 + jdk/src/java.base/share/classes/java/text/FieldPosition.java | 1 + jdk/src/java.base/share/classes/java/text/Format.java | 1 + jdk/src/java.base/share/classes/java/text/MessageFormat.java | 1 + jdk/src/java.base/share/classes/java/text/NumberFormat.java | 1 + jdk/src/java.base/share/classes/java/text/ParseException.java | 1 + jdk/src/java.base/share/classes/java/text/ParsePosition.java | 1 + .../java.base/share/classes/java/text/RuleBasedCollator.java | 1 + jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java | 1 + .../share/classes/java/text/StringCharacterIterator.java | 1 + .../share/classes/java/util/concurrent/CompletionService.java | 2 ++ .../classes/java/util/concurrent/ExecutorCompletionService.java | 2 ++ .../share/classes/java/util/concurrent/locks/LockSupport.java | 2 ++ jdk/src/java.base/share/classes/java/util/jar/JarEntry.java | 2 ++ jdk/src/java.base/share/classes/java/util/zip/Adler32.java | 1 + jdk/src/java.base/share/classes/java/util/zip/CRC32.java | 1 + .../share/classes/java/util/zip/CheckedInputStream.java | 1 + .../share/classes/java/util/zip/CheckedOutputStream.java | 1 + jdk/src/java.base/share/classes/java/util/zip/Checksum.java | 1 + .../share/classes/java/util/zip/DataFormatException.java | 1 + jdk/src/java.base/share/classes/java/util/zip/Deflater.java | 1 + .../share/classes/java/util/zip/DeflaterOutputStream.java | 1 + .../java.base/share/classes/java/util/zip/GZIPInputStream.java | 1 + .../java.base/share/classes/java/util/zip/GZIPOutputStream.java | 1 + jdk/src/java.base/share/classes/java/util/zip/Inflater.java | 1 + .../share/classes/java/util/zip/InflaterInputStream.java | 1 + jdk/src/java.base/share/classes/java/util/zip/ZipConstants.java | 1 + jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java | 1 + jdk/src/java.base/share/classes/java/util/zip/ZipFile.java | 1 + .../java.base/share/classes/java/util/zip/ZipInputStream.java | 1 + .../java.base/share/classes/java/util/zip/ZipOutputStream.java | 1 + .../share/classes/javax/security/auth/AuthPermission.java | 1 + .../classes/javax/security/auth/DestroyFailedException.java | 1 + .../share/classes/javax/security/auth/Destroyable.java | 1 + jdk/src/java.base/share/classes/javax/security/auth/Policy.java | 1 + .../javax/security/auth/PrivateCredentialPermission.java | 1 + .../classes/javax/security/auth/RefreshFailedException.java | 1 + .../share/classes/javax/security/auth/Refreshable.java | 1 + .../java.base/share/classes/javax/security/auth/Subject.java | 1 + .../classes/javax/security/auth/SubjectDomainCombiner.java | 1 + .../share/classes/javax/security/auth/callback/Callback.java | 1 + .../classes/javax/security/auth/callback/CallbackHandler.java | 1 + .../classes/javax/security/auth/callback/ChoiceCallback.java | 1 + .../javax/security/auth/callback/ConfirmationCallback.java | 1 + .../classes/javax/security/auth/callback/LanguageCallback.java | 1 + .../classes/javax/security/auth/callback/NameCallback.java | 1 + .../classes/javax/security/auth/callback/PasswordCallback.java | 1 + .../classes/javax/security/auth/callback/TextInputCallback.java | 1 + .../javax/security/auth/callback/TextOutputCallback.java | 1 + .../security/auth/callback/UnsupportedCallbackException.java | 1 + .../javax/security/auth/login/AccountExpiredException.java | 1 + .../javax/security/auth/login/AppConfigurationEntry.java | 1 + .../share/classes/javax/security/auth/login/Configuration.java | 1 + .../javax/security/auth/login/CredentialExpiredException.java | 1 + .../classes/javax/security/auth/login/FailedLoginException.java | 1 + .../share/classes/javax/security/auth/login/LoginContext.java | 1 + .../share/classes/javax/security/auth/login/LoginException.java | 1 + .../share/classes/javax/security/auth/spi/LoginModule.java | 1 + .../classes/javax/security/auth/x500/X500PrivateCredential.java | 1 + .../share/classes/java/awt/datatransfer/Clipboard.java | 1 + .../share/classes/java/awt/datatransfer/ClipboardOwner.java | 1 + .../share/classes/java/awt/datatransfer/DataFlavor.java | 1 + .../share/classes/java/awt/datatransfer/StringSelection.java | 1 + .../share/classes/java/awt/datatransfer/Transferable.java | 1 + .../java/awt/datatransfer/UnsupportedFlavorException.java | 1 + 167 files changed, 171 insertions(+) diff --git a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java index b1a4280498a..762740a5917 100644 --- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java +++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java @@ -403,6 +403,7 @@ import java.lang.module.ModuleFinder; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 */ public final class RuntimePermission extends BasicPermission { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Array.java b/jdk/src/java.base/share/classes/java/lang/reflect/Array.java index 2d6d717ad15..f43936df58c 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Array.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Array.java @@ -36,6 +36,7 @@ import jdk.internal.HotSpotIntrinsicCandidate; * conversion would occur. * * @author Nakul Saraiya + * @since 1.1 */ public final class Array { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java index 3f7a45581f0..a519d7feaf4 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java @@ -59,6 +59,7 @@ import java.util.StringJoiner; * * @author Kenneth Russell * @author Nakul Saraiya + * @since 1.1 */ public final class Constructor extends Executable { private Class clazz; diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java index 1f1192f6a5b..2bbb3c55010 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java @@ -60,6 +60,7 @@ import sun.reflect.annotation.TypeAnnotationParser; * * @author Kenneth Russell * @author Nakul Saraiya + * @since 1.1 */ public final class Field extends AccessibleObject implements Member { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java b/jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java index 360d0ba2525..e1133e3c017 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/InvocationTargetException.java @@ -38,6 +38,7 @@ package java.lang.reflect; * * @see Method * @see Constructor + * @since 1.1 */ public class InvocationTargetException extends ReflectiveOperationException { /** diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Member.java b/jdk/src/java.base/share/classes/java/lang/reflect/Member.java index 2241d456059..3ac457d9cb8 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Member.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Member.java @@ -35,6 +35,7 @@ package java.lang.reflect; * @see Constructor * * @author Nakul Saraiya + * @since 1.1 */ public interface Member { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java index 605e758e4c7..026750cdce9 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java @@ -63,6 +63,7 @@ import java.util.StringJoiner; * * @author Kenneth Russell * @author Nakul Saraiya + * @since 1.1 */ public final class Method extends Executable { private Class> clazz; diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java b/jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java index d3875d387c2..8520aabb8db 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Modifier.java @@ -43,6 +43,7 @@ import jdk.internal.reflect.ReflectionFactory; * * @author Nakul Saraiya * @author Kenneth Russell + * @since 1.1 */ public class Modifier { diff --git a/jdk/src/java.base/share/classes/java/math/BigDecimal.java b/jdk/src/java.base/share/classes/java/math/BigDecimal.java index f0b40ffed96..f4e1f4985d6 100644 --- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java +++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java @@ -222,6 +222,7 @@ import java.util.Arrays; * @author Mike Cowlishaw * @author Joseph D. Darcy * @author Sergey V. Kuksenko + * @since 1.1 */ public class BigDecimal extends Number implements Comparable { /** diff --git a/jdk/src/java.base/share/classes/java/net/NetPermission.java b/jdk/src/java.base/share/classes/java/net/NetPermission.java index f156fb7af50..f17c1b46d05 100644 --- a/jdk/src/java.base/share/classes/java/net/NetPermission.java +++ b/jdk/src/java.base/share/classes/java/net/NetPermission.java @@ -167,6 +167,7 @@ import java.util.StringTokenizer; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 */ public final class NetPermission extends BasicPermission { diff --git a/jdk/src/java.base/share/classes/java/net/SocketOptions.java b/jdk/src/java.base/share/classes/java/net/SocketOptions.java index fbfb81eca1a..2e9d28a3ceb 100644 --- a/jdk/src/java.base/share/classes/java/net/SocketOptions.java +++ b/jdk/src/java.base/share/classes/java/net/SocketOptions.java @@ -40,6 +40,7 @@ import java.lang.annotation.Native; * DatagramSocket and MulticastSocket. * * @author David Brown + * @since 1.1 */ diff --git a/jdk/src/java.base/share/classes/java/net/SocketPermission.java b/jdk/src/java.base/share/classes/java/net/SocketPermission.java index a7eec857cbc..d4fa1c1c07d 100644 --- a/jdk/src/java.base/share/classes/java/net/SocketPermission.java +++ b/jdk/src/java.base/share/classes/java/net/SocketPermission.java @@ -142,6 +142,7 @@ import sun.security.util.Debug; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 * * @serial exclude */ diff --git a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java index e15b3906dab..eb60950cc1e 100644 --- a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java +++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java @@ -74,6 +74,7 @@ import sun.security.util.SecurityConstants; * @see AccessController * * @author Roland Schemers + * @since 1.2 */ public final class AccessControlContext { diff --git a/jdk/src/java.base/share/classes/java/security/AccessControlException.java b/jdk/src/java.base/share/classes/java/security/AccessControlException.java index a4f2a7803ad..3d654eebea4 100644 --- a/jdk/src/java.base/share/classes/java/security/AccessControlException.java +++ b/jdk/src/java.base/share/classes/java/security/AccessControlException.java @@ -38,6 +38,7 @@ package java.security; * * @author Li Gong * @author Roland Schemers + * @since 1.2 */ public class AccessControlException extends SecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/AccessController.java b/jdk/src/java.base/share/classes/java/security/AccessController.java index b37b476efdd..e41f40b46f1 100644 --- a/jdk/src/java.base/share/classes/java/security/AccessController.java +++ b/jdk/src/java.base/share/classes/java/security/AccessController.java @@ -259,6 +259,7 @@ import jdk.internal.reflect.Reflection; * * @author Li Gong * @author Roland Schemers + * @since 1.2 */ public final class AccessController { diff --git a/jdk/src/java.base/share/classes/java/security/AllPermission.java b/jdk/src/java.base/share/classes/java/security/AllPermission.java index fcda7ce0bc1..c6e4629167c 100644 --- a/jdk/src/java.base/share/classes/java/security/AllPermission.java +++ b/jdk/src/java.base/share/classes/java/security/AllPermission.java @@ -51,6 +51,7 @@ import sun.security.util.SecurityConstants; * * * @author Roland Schemers + * @since 1.2 * * @serial exclude */ diff --git a/jdk/src/java.base/share/classes/java/security/BasicPermission.java b/jdk/src/java.base/share/classes/java/security/BasicPermission.java index fb5f2a260a3..906d6b91349 100644 --- a/jdk/src/java.base/share/classes/java/security/BasicPermission.java +++ b/jdk/src/java.base/share/classes/java/security/BasicPermission.java @@ -62,6 +62,7 @@ import java.util.concurrent.ConcurrentHashMap; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 */ public abstract class BasicPermission extends Permission diff --git a/jdk/src/java.base/share/classes/java/security/Certificate.java b/jdk/src/java.base/share/classes/java/security/Certificate.java index 2d3db8f0383..d56446925b1 100644 --- a/jdk/src/java.base/share/classes/java/security/Certificate.java +++ b/jdk/src/java.base/share/classes/java/security/Certificate.java @@ -56,6 +56,7 @@ import java.util.Date; * the certificate and satisfy itself of its validity. * * @author Benjamin Renaud + * @since 1.1 * @deprecated A new certificate handling package is created in the Java platform. * This Certificate interface is entirely deprecated and * is here to allow for a smooth transition to the new diff --git a/jdk/src/java.base/share/classes/java/security/CodeSource.java b/jdk/src/java.base/share/classes/java/security/CodeSource.java index f710fe31fc9..93d9983f12a 100644 --- a/jdk/src/java.base/share/classes/java/security/CodeSource.java +++ b/jdk/src/java.base/share/classes/java/security/CodeSource.java @@ -44,6 +44,7 @@ import sun.net.util.URLUtil; * * @author Li Gong * @author Roland Schemers + * @since 1.2 */ public class CodeSource implements java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/DigestException.java b/jdk/src/java.base/share/classes/java/security/DigestException.java index 2327c982845..f2755304afc 100644 --- a/jdk/src/java.base/share/classes/java/security/DigestException.java +++ b/jdk/src/java.base/share/classes/java/security/DigestException.java @@ -29,6 +29,7 @@ package java.security; * This is the generic Message Digest exception. * * @author Benjamin Renaud + * @since 1.1 */ public class DigestException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/DigestInputStream.java b/jdk/src/java.base/share/classes/java/security/DigestInputStream.java index 747537df253..a76ebdacdfc 100644 --- a/jdk/src/java.base/share/classes/java/security/DigestInputStream.java +++ b/jdk/src/java.base/share/classes/java/security/DigestInputStream.java @@ -59,6 +59,7 @@ import java.io.ByteArrayInputStream; * @see DigestOutputStream * * @author Benjamin Renaud + * @since 1.2 */ public class DigestInputStream extends FilterInputStream { diff --git a/jdk/src/java.base/share/classes/java/security/DigestOutputStream.java b/jdk/src/java.base/share/classes/java/security/DigestOutputStream.java index 51db133a5f6..a0a44e26f10 100644 --- a/jdk/src/java.base/share/classes/java/security/DigestOutputStream.java +++ b/jdk/src/java.base/share/classes/java/security/DigestOutputStream.java @@ -51,6 +51,7 @@ import java.io.ByteArrayOutputStream; * @see DigestInputStream * * @author Benjamin Renaud + * @since 1.2 */ public class DigestOutputStream extends FilterOutputStream { diff --git a/jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java b/jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java index dc9ea06ecce..69ee8ead305 100644 --- a/jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java +++ b/jdk/src/java.base/share/classes/java/security/GeneralSecurityException.java @@ -31,6 +31,7 @@ package java.security; * security-related exception classes that extend from it. * * @author Jan Luehe + * @since 1.2 */ public class GeneralSecurityException extends Exception { diff --git a/jdk/src/java.base/share/classes/java/security/Guard.java b/jdk/src/java.base/share/classes/java/security/Guard.java index abafb588659..f64a0d9f275 100644 --- a/jdk/src/java.base/share/classes/java/security/Guard.java +++ b/jdk/src/java.base/share/classes/java/security/Guard.java @@ -38,6 +38,7 @@ package java.security; * * @author Roland Schemers * @author Li Gong + * @since 1.2 */ public interface Guard { diff --git a/jdk/src/java.base/share/classes/java/security/GuardedObject.java b/jdk/src/java.base/share/classes/java/security/GuardedObject.java index a275ddf043e..a2bf3f758e7 100644 --- a/jdk/src/java.base/share/classes/java/security/GuardedObject.java +++ b/jdk/src/java.base/share/classes/java/security/GuardedObject.java @@ -44,6 +44,7 @@ package java.security; * * @author Roland Schemers * @author Li Gong + * @since 1.2 */ public class GuardedObject implements java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/Identity.java b/jdk/src/java.base/share/classes/java/security/Identity.java index d091b942e26..4d79e2d751a 100644 --- a/jdk/src/java.base/share/classes/java/security/Identity.java +++ b/jdk/src/java.base/share/classes/java/security/Identity.java @@ -51,6 +51,7 @@ import java.util.*; * @see Principal * * @author Benjamin Renaud + * @since 1.1 * @deprecated This class is no longer used. Its functionality has been * replaced by {@code java.security.KeyStore}, the * {@code java.security.cert} package, and diff --git a/jdk/src/java.base/share/classes/java/security/IdentityScope.java b/jdk/src/java.base/share/classes/java/security/IdentityScope.java index 107fe0861ad..5b6ec8212f7 100644 --- a/jdk/src/java.base/share/classes/java/security/IdentityScope.java +++ b/jdk/src/java.base/share/classes/java/security/IdentityScope.java @@ -55,6 +55,7 @@ import java.util.Properties; * @see Key * * @author Benjamin Renaud + * @since 1.1 * * @deprecated This class is no longer used. Its functionality has been * replaced by {@code java.security.KeyStore}, the diff --git a/jdk/src/java.base/share/classes/java/security/InvalidKeyException.java b/jdk/src/java.base/share/classes/java/security/InvalidKeyException.java index 2f7568713c7..5349796b150 100644 --- a/jdk/src/java.base/share/classes/java/security/InvalidKeyException.java +++ b/jdk/src/java.base/share/classes/java/security/InvalidKeyException.java @@ -31,6 +31,7 @@ package java.security; * length, uninitialized, etc). * * @author Benjamin Renaud + * @since 1.1 */ public class InvalidKeyException extends KeyException { diff --git a/jdk/src/java.base/share/classes/java/security/InvalidParameterException.java b/jdk/src/java.base/share/classes/java/security/InvalidParameterException.java index a095f90de36..18d413eba39 100644 --- a/jdk/src/java.base/share/classes/java/security/InvalidParameterException.java +++ b/jdk/src/java.base/share/classes/java/security/InvalidParameterException.java @@ -31,6 +31,7 @@ package java.security; * to a method. * * @author Benjamin Renaud + * @since 1.1 */ public class InvalidParameterException extends IllegalArgumentException { diff --git a/jdk/src/java.base/share/classes/java/security/Key.java b/jdk/src/java.base/share/classes/java/security/Key.java index 0f8e84e718e..dab747eb403 100644 --- a/jdk/src/java.base/share/classes/java/security/Key.java +++ b/jdk/src/java.base/share/classes/java/security/Key.java @@ -97,6 +97,7 @@ package java.security; * @see Signer * * @author Benjamin Renaud + * @since 1.1 */ public interface Key extends java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/KeyException.java b/jdk/src/java.base/share/classes/java/security/KeyException.java index 59cdd6f3ab5..b8b87d9516e 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyException.java +++ b/jdk/src/java.base/share/classes/java/security/KeyException.java @@ -33,6 +33,7 @@ package java.security; * @see KeyManagementException * * @author Benjamin Renaud + * @since 1.1 */ public class KeyException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/KeyManagementException.java b/jdk/src/java.base/share/classes/java/security/KeyManagementException.java index be212b9fdc1..fe1ab3eda94 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyManagementException.java +++ b/jdk/src/java.base/share/classes/java/security/KeyManagementException.java @@ -38,6 +38,7 @@ package java.security; * * * @author Benjamin Renaud + * @since 1.1 * * @see Key * @see KeyException diff --git a/jdk/src/java.base/share/classes/java/security/KeyPair.java b/jdk/src/java.base/share/classes/java/security/KeyPair.java index 6147a16aa59..1d9e1640553 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyPair.java +++ b/jdk/src/java.base/share/classes/java/security/KeyPair.java @@ -36,6 +36,7 @@ import java.util.*; * @see PrivateKey * * @author Benjamin Renaud + * @since 1.1 */ public final class KeyPair implements java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java index b2f87720e80..26c80b43dbd 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java +++ b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java @@ -121,6 +121,7 @@ import sun.security.util.Debug; * other algorithms are supported. * * @author Benjamin Renaud + * @since 1.1 * * @see java.security.spec.AlgorithmParameterSpec */ diff --git a/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java b/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java index dfe8c04218d..d0790d45b2c 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java +++ b/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java @@ -43,6 +43,7 @@ import java.security.spec.AlgorithmParameterSpec; * of 1024 bits. * * @author Benjamin Renaud + * @since 1.2 * * * @see KeyPairGenerator diff --git a/jdk/src/java.base/share/classes/java/security/MessageDigest.java b/jdk/src/java.base/share/classes/java/security/MessageDigest.java index 14eb6d6e7fe..be163c179f9 100644 --- a/jdk/src/java.base/share/classes/java/security/MessageDigest.java +++ b/jdk/src/java.base/share/classes/java/security/MessageDigest.java @@ -96,6 +96,7 @@ import javax.crypto.SecretKey; * other algorithms are supported. * * @author Benjamin Renaud + * @since 1.1 * * @see DigestInputStream * @see DigestOutputStream diff --git a/jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java b/jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java index 0d5ace1f7bf..699e8c25e72 100644 --- a/jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java +++ b/jdk/src/java.base/share/classes/java/security/MessageDigestSpi.java @@ -43,6 +43,7 @@ import sun.security.jca.JCAUtil; * Implementations are free to implement the Cloneable interface. * * @author Benjamin Renaud + * @since 1.2 * * * @see MessageDigest diff --git a/jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java b/jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java index 951e44e41dc..24455d31064 100644 --- a/jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java +++ b/jdk/src/java.base/share/classes/java/security/NoSuchAlgorithmException.java @@ -30,6 +30,7 @@ package java.security; * requested but is not available in the environment. * * @author Benjamin Renaud + * @since 1.1 */ public class NoSuchAlgorithmException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java b/jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java index 9874adb145e..e2f9265be2a 100644 --- a/jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java +++ b/jdk/src/java.base/share/classes/java/security/NoSuchProviderException.java @@ -30,6 +30,7 @@ package java.security; * requested but is not available in the environment. * * @author Benjamin Renaud + * @since 1.1 */ public class NoSuchProviderException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/Permission.java b/jdk/src/java.base/share/classes/java/security/Permission.java index 088f97c35a6..0eb0496ce3b 100644 --- a/jdk/src/java.base/share/classes/java/security/Permission.java +++ b/jdk/src/java.base/share/classes/java/security/Permission.java @@ -60,6 +60,7 @@ package java.security; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 */ public abstract class Permission implements Guard, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/PermissionCollection.java b/jdk/src/java.base/share/classes/java/security/PermissionCollection.java index 1aa41cab022..ca15210b177 100644 --- a/jdk/src/java.base/share/classes/java/security/PermissionCollection.java +++ b/jdk/src/java.base/share/classes/java/security/PermissionCollection.java @@ -91,6 +91,7 @@ import java.util.stream.StreamSupport; * * * @author Roland Schemers + * @since 1.2 */ public abstract class PermissionCollection implements java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/Permissions.java b/jdk/src/java.base/share/classes/java/security/Permissions.java index 6bb5fa1a445..fa37fcb4698 100644 --- a/jdk/src/java.base/share/classes/java/security/Permissions.java +++ b/jdk/src/java.base/share/classes/java/security/Permissions.java @@ -75,6 +75,7 @@ import java.io.IOException; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 * * @serial exclude */ diff --git a/jdk/src/java.base/share/classes/java/security/Policy.java b/jdk/src/java.base/share/classes/java/security/Policy.java index bad4f522367..54663a5a0f8 100644 --- a/jdk/src/java.base/share/classes/java/security/Policy.java +++ b/jdk/src/java.base/share/classes/java/security/Policy.java @@ -78,6 +78,7 @@ import sun.security.util.SecurityConstants; * * @author Roland Schemers * @author Gary Ellison + * @since 1.2 * @see java.security.Provider * @see java.security.ProtectionDomain * @see java.security.Permission diff --git a/jdk/src/java.base/share/classes/java/security/Principal.java b/jdk/src/java.base/share/classes/java/security/Principal.java index db1e7d5fd02..40ee260bca9 100644 --- a/jdk/src/java.base/share/classes/java/security/Principal.java +++ b/jdk/src/java.base/share/classes/java/security/Principal.java @@ -35,6 +35,7 @@ import javax.security.auth.Subject; * @see java.security.cert.X509Certificate * * @author Li Gong + * @since 1.1 */ public interface Principal { diff --git a/jdk/src/java.base/share/classes/java/security/PrivateKey.java b/jdk/src/java.base/share/classes/java/security/PrivateKey.java index 7d8a7ea7041..0bc933bd901 100644 --- a/jdk/src/java.base/share/classes/java/security/PrivateKey.java +++ b/jdk/src/java.base/share/classes/java/security/PrivateKey.java @@ -54,6 +54,7 @@ package java.security; * * @author Benjamin Renaud * @author Josh Bloch + * @since 1.1 */ public interface PrivateKey extends Key, javax.security.auth.Destroyable { diff --git a/jdk/src/java.base/share/classes/java/security/PrivilegedAction.java b/jdk/src/java.base/share/classes/java/security/PrivilegedAction.java index b993cea4d2f..fec7a37d9ba 100644 --- a/jdk/src/java.base/share/classes/java/security/PrivilegedAction.java +++ b/jdk/src/java.base/share/classes/java/security/PrivilegedAction.java @@ -34,6 +34,7 @@ package java.security; * throw checked exceptions must use {@code PrivilegedExceptionAction} * instead. * + * @since 1.2 * @see AccessController * @see AccessController#doPrivileged(PrivilegedAction) * @see PrivilegedExceptionAction diff --git a/jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java b/jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java index 2de69698599..ebc12e74e0b 100644 --- a/jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java +++ b/jdk/src/java.base/share/classes/java/security/PrivilegedActionException.java @@ -43,6 +43,7 @@ package java.security; * cause, and may be accessed via the {@link Throwable#getCause()} * method, as well as the aforementioned "legacy method." * + * @since 1.2 * @see PrivilegedExceptionAction * @see AccessController#doPrivileged(PrivilegedExceptionAction) * @see AccessController#doPrivileged(PrivilegedExceptionAction,AccessControlContext) diff --git a/jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java b/jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java index 59a9ba7dc18..35b9abfe354 100644 --- a/jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java +++ b/jdk/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java @@ -35,6 +35,7 @@ package java.security; * computations that do not throw * checked exceptions should use {@code PrivilegedAction} instead. * + * @since 1.2 * @see AccessController * @see AccessController#doPrivileged(PrivilegedExceptionAction) * @see AccessController#doPrivileged(PrivilegedExceptionAction, diff --git a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java index 1a9ac151a70..365096f619a 100644 --- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java +++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java @@ -59,6 +59,7 @@ import sun.security.util.SecurityConstants; * @author Li Gong * @author Roland Schemers * @author Gary Ellison + * @since 1.2 */ public class ProtectionDomain { diff --git a/jdk/src/java.base/share/classes/java/security/Provider.java b/jdk/src/java.base/share/classes/java/security/Provider.java index cc5313e2a19..f17cfca932a 100644 --- a/jdk/src/java.base/share/classes/java/security/Provider.java +++ b/jdk/src/java.base/share/classes/java/security/Provider.java @@ -102,6 +102,7 @@ import java.util.function.Function; * * @author Benjamin Renaud * @author Andreas Sterbenz + * @since 1.1 */ public abstract class Provider extends Properties { diff --git a/jdk/src/java.base/share/classes/java/security/ProviderException.java b/jdk/src/java.base/share/classes/java/security/ProviderException.java index b372ee75752..48c3638a524 100644 --- a/jdk/src/java.base/share/classes/java/security/ProviderException.java +++ b/jdk/src/java.base/share/classes/java/security/ProviderException.java @@ -32,6 +32,7 @@ package java.security; * throw specialized, provider-specific runtime errors. * * @author Benjamin Renaud + * @since 1.1 */ public class ProviderException extends RuntimeException { diff --git a/jdk/src/java.base/share/classes/java/security/PublicKey.java b/jdk/src/java.base/share/classes/java/security/PublicKey.java index df49807eea4..986f9d0c72f 100644 --- a/jdk/src/java.base/share/classes/java/security/PublicKey.java +++ b/jdk/src/java.base/share/classes/java/security/PublicKey.java @@ -34,6 +34,7 @@ package java.security; * See, for example, the DSAPublicKey interface in * {@code java.security.interfaces}. * + * @since 1.1 * @see Key * @see PrivateKey * @see Certificate diff --git a/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java index 4f0bfa4c27f..a6b8b6cffe6 100644 --- a/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java +++ b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java @@ -39,6 +39,7 @@ import sun.security.util.Debug; * * @author Li Gong * @author Roland Schemers + * @since 1.2 */ public class SecureClassLoader extends ClassLoader { /* diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandom.java b/jdk/src/java.base/share/classes/java/security/SecureRandom.java index ae1f04f2896..254f378aac6 100644 --- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java +++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java @@ -143,6 +143,7 @@ import sun.security.util.Debug; * * @author Benjamin Renaud * @author Josh Bloch + * @since 1.1 */ public class SecureRandom extends java.util.Random { diff --git a/jdk/src/java.base/share/classes/java/security/Security.java b/jdk/src/java.base/share/classes/java/security/Security.java index 6c341abc92d..2431f1e1745 100644 --- a/jdk/src/java.base/share/classes/java/security/Security.java +++ b/jdk/src/java.base/share/classes/java/security/Security.java @@ -45,6 +45,7 @@ import sun.security.jca.*; * {@code conf/security/java.security} in the Java installation directory. * * @author Benjamin Renaud + * @since 1.1 */ public final class Security { diff --git a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java index e0d25c9689f..5211c23735d 100644 --- a/jdk/src/java.base/share/classes/java/security/SecurityPermission.java +++ b/jdk/src/java.base/share/classes/java/security/SecurityPermission.java @@ -333,6 +333,7 @@ import java.util.StringTokenizer; * * @author Marianne Mueller * @author Roland Schemers + * @since 1.2 */ public final class SecurityPermission extends BasicPermission { diff --git a/jdk/src/java.base/share/classes/java/security/Signature.java b/jdk/src/java.base/share/classes/java/security/Signature.java index fd5dfad650a..c7c25831a35 100644 --- a/jdk/src/java.base/share/classes/java/security/Signature.java +++ b/jdk/src/java.base/share/classes/java/security/Signature.java @@ -113,6 +113,7 @@ import sun.security.jca.GetInstance.Instance; * other algorithms are supported. * * @author Benjamin Renaud + * @since 1.1 * */ diff --git a/jdk/src/java.base/share/classes/java/security/SignatureException.java b/jdk/src/java.base/share/classes/java/security/SignatureException.java index 2e1fa592f60..7788e12301b 100644 --- a/jdk/src/java.base/share/classes/java/security/SignatureException.java +++ b/jdk/src/java.base/share/classes/java/security/SignatureException.java @@ -29,6 +29,7 @@ package java.security; * This is the generic Signature exception. * * @author Benjamin Renaud + * @since 1.1 */ public class SignatureException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/SignatureSpi.java b/jdk/src/java.base/share/classes/java/security/SignatureSpi.java index 9be7701a2fa..99926824bd8 100644 --- a/jdk/src/java.base/share/classes/java/security/SignatureSpi.java +++ b/jdk/src/java.base/share/classes/java/security/SignatureSpi.java @@ -44,6 +44,7 @@ import sun.security.jca.JCAUtil; * of a particular signature algorithm. * * @author Benjamin Renaud + * @since 1.2 * * * @see Signature diff --git a/jdk/src/java.base/share/classes/java/security/SignedObject.java b/jdk/src/java.base/share/classes/java/security/SignedObject.java index 94d4d0ae8a0..810c5706579 100644 --- a/jdk/src/java.base/share/classes/java/security/SignedObject.java +++ b/jdk/src/java.base/share/classes/java/security/SignedObject.java @@ -114,6 +114,7 @@ import java.io.*; * @see Signature * * @author Li Gong + * @since 1.2 */ public final class SignedObject implements Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/Signer.java b/jdk/src/java.base/share/classes/java/security/Signer.java index 3c53f6c055f..88852b2e4be 100644 --- a/jdk/src/java.base/share/classes/java/security/Signer.java +++ b/jdk/src/java.base/share/classes/java/security/Signer.java @@ -38,6 +38,7 @@ import java.io.*; * @see Identity * * @author Benjamin Renaud + * @since 1.1 * * @deprecated This class is no longer used. Its functionality has been * replaced by {@code java.security.KeyStore}, the diff --git a/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java b/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java index 9827788806a..b5dc02dcb38 100644 --- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java +++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermission.java @@ -96,6 +96,7 @@ import java.security.cert.*; * * * @author Roland Schemers + * @since 1.2 */ public final class UnresolvedPermission extends Permission diff --git a/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java b/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java index 5fdc3cbc8e0..bd4fb7562e1 100644 --- a/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java +++ b/jdk/src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java @@ -43,6 +43,7 @@ import java.util.concurrent.CopyOnWriteArrayList; * * * @author Roland Schemers + * @since 1.2 * * @serial include */ diff --git a/jdk/src/java.base/share/classes/java/security/acl/Acl.java b/jdk/src/java.base/share/classes/java/security/acl/Acl.java index 0b2f374a2c9..423afdd695e 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Acl.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Acl.java @@ -82,6 +82,7 @@ import java.security.Principal; * @see java.security.acl.Acl#getPermissions * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java index b785a05f3d7..242470876a6 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java +++ b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java @@ -50,6 +50,7 @@ import java.security.Principal; * @see java.security.acl.Acl * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java index c07852c5490..1585f93637d 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java +++ b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java @@ -30,6 +30,7 @@ package java.security.acl; * non-existent ACL (Access Control List). * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/acl/Group.java b/jdk/src/java.base/share/classes/java/security/acl/Group.java index f68d5dae13c..6ce62330d87 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Group.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Group.java @@ -39,6 +39,7 @@ import java.security.Principal; * Principal or Group. * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java index dab93db9c1e..3d655d7bf48 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java +++ b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java @@ -32,6 +32,7 @@ package java.security.acl; * @see java.security.acl.Owner#deleteOwner * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java index 3c7da3ebc8a..cf3b5975a7a 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java +++ b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java @@ -31,6 +31,7 @@ package java.security.acl; * the object, but the Principal attempting the modification is not an owner. * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/acl/Owner.java b/jdk/src/java.base/share/classes/java/security/acl/Owner.java index 476af4a0a80..0ba70035057 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Owner.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Owner.java @@ -34,6 +34,7 @@ import java.security.Principal; * interface.) The initial owner Principal should be specified as an * argument to the constructor of the class implementing this interface. * + * @since 1.1 * @see java.security.acl.Acl * * @deprecated This package has been replaced by {@code java.security.Policy} diff --git a/jdk/src/java.base/share/classes/java/security/acl/Permission.java b/jdk/src/java.base/share/classes/java/security/acl/Permission.java index 15b77429413..2c867490b6b 100644 --- a/jdk/src/java.base/share/classes/java/security/acl/Permission.java +++ b/jdk/src/java.base/share/classes/java/security/acl/Permission.java @@ -31,6 +31,7 @@ package java.security.acl; * a particular type of access to a resource. * * @author Satish Dharmaraj + * @since 1.1 * * @deprecated This package has been replaced by {@code java.security.Policy} * and related classes since 1.2. diff --git a/jdk/src/java.base/share/classes/java/security/cert/CRLException.java b/jdk/src/java.base/share/classes/java/security/cert/CRLException.java index 7a854316bbd..4b648e9ab9e 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/CRLException.java +++ b/jdk/src/java.base/share/classes/java/security/cert/CRLException.java @@ -31,6 +31,7 @@ import java.security.GeneralSecurityException; * CRL (Certificate Revocation List) Exception. * * @author Hemma Prafullchandra + * @since 1.2 */ public class CRLException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/cert/Certificate.java b/jdk/src/java.base/share/classes/java/security/cert/Certificate.java index 32662ceea15..ad72e638d39 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/Certificate.java +++ b/jdk/src/java.base/share/classes/java/security/cert/Certificate.java @@ -57,6 +57,7 @@ import sun.security.x509.X509CertImpl; * @see CertificateFactory * * @author Hemma Prafullchandra + * @since 1.2 */ public abstract class Certificate implements java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java b/jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java index 618ee0a55b9..c30b96c46c8 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java +++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateEncodingException.java @@ -30,6 +30,7 @@ package java.security.cert; * occurs while attempting to encode a certificate. * * @author Hemma Prafullchandra + * @since 1.2 */ public class CertificateEncodingException extends CertificateException { diff --git a/jdk/src/java.base/share/classes/java/security/cert/CertificateException.java b/jdk/src/java.base/share/classes/java/security/cert/CertificateException.java index f663054000b..ce73103aaab 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/CertificateException.java +++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateException.java @@ -31,6 +31,7 @@ import java.security.GeneralSecurityException; * This exception indicates one of a variety of certificate problems. * * @author Hemma Prafullchandra + * @since 1.2 * @see Certificate */ public class CertificateException extends GeneralSecurityException { diff --git a/jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java b/jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java index 9de0c236c13..635a32f5cda 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java +++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateExpiredException.java @@ -32,6 +32,7 @@ package java.security.cert; * of the certificate. * * @author Hemma Prafullchandra + * @since 1.2 */ public class CertificateExpiredException extends CertificateException { diff --git a/jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java b/jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java index e8722bd339d..75f3e150283 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java +++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateNotYetValidException.java @@ -32,6 +32,7 @@ package java.security.cert; * validity period. * * @author Hemma Prafullchandra + * @since 1.2 */ public class CertificateNotYetValidException extends CertificateException { diff --git a/jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java b/jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java index 06a7d603f29..36fa9650874 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java +++ b/jdk/src/java.base/share/classes/java/security/cert/CertificateParsingException.java @@ -31,6 +31,7 @@ package java.security.cert; * are found in the Certificate. * * @author Hemma Prafullchandra + * @since 1.2 */ public class CertificateParsingException extends CertificateException { diff --git a/jdk/src/java.base/share/classes/java/security/cert/X509CRL.java b/jdk/src/java.base/share/classes/java/security/cert/X509CRL.java index 21332907357..d23e3416272 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/X509CRL.java +++ b/jdk/src/java.base/share/classes/java/security/cert/X509CRL.java @@ -102,6 +102,7 @@ import sun.security.x509.X509CRLImpl; * } * * @author Hemma Prafullchandra + * @since 1.2 * * * @see CRL diff --git a/jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java b/jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java index 268fa819587..4028738dae9 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java +++ b/jdk/src/java.base/share/classes/java/security/cert/X509CRLEntry.java @@ -62,6 +62,7 @@ import sun.security.x509.X509CRLEntryImpl; * @see X509Extension * * @author Hemma Prafullchandra + * @since 1.2 */ public abstract class X509CRLEntry implements X509Extension { diff --git a/jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java b/jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java index 174d6a73838..ab4391e53d5 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java +++ b/jdk/src/java.base/share/classes/java/security/cert/X509Certificate.java @@ -95,6 +95,7 @@ import sun.security.x509.X509CertImpl; * * * @author Hemma Prafullchandra + * @since 1.2 * * * @see Certificate diff --git a/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java b/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java index 9a988f4dc93..b7533a2c697 100644 --- a/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java +++ b/jdk/src/java.base/share/classes/java/security/cert/X509Extension.java @@ -65,6 +65,7 @@ import java.util.Set; * be handled by a Class that understands the extension. * * @author Hemma Prafullchandra + * @since 1.2 */ public interface X509Extension { diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java b/jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java index d78b3e19853..64ac8c4b931 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAKey.java @@ -35,6 +35,7 @@ package java.security.interfaces; * * @author Benjamin Renaud * @author Josh Bloch + * @since 1.1 */ public interface DSAKey { diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java b/jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java index 558ac4419c2..dc231db419c 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAKeyPairGenerator.java @@ -65,6 +65,7 @@ import java.security.*; *
Note: Some earlier implementations of this interface may not support * larger sizes of DSA parameters such as 2048 and 3072-bit. * + * @since 1.1 * @see java.security.KeyPairGenerator */ public interface DSAKeyPairGenerator { diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java b/jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java index 8c46ed57e27..2eafe879e7d 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAParams.java @@ -38,6 +38,7 @@ import java.math.BigInteger; * * @author Benjamin Renaud * @author Josh Bloch + * @since 1.1 */ public interface DSAParams { diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java b/jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java index 81ab3586f69..b23a5c14d42 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAPrivateKey.java @@ -37,6 +37,7 @@ import java.math.BigInteger; * @see DSAPublicKey * * @author Benjamin Renaud + * @since 1.1 */ public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey { diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java b/jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java index e56b795ae70..fb4a2f3226e 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/DSAPublicKey.java @@ -37,6 +37,7 @@ import java.math.BigInteger; * @see DSAPrivateKey * * @author Benjamin Renaud + * @since 1.1 */ public interface DSAPublicKey extends DSAKey, java.security.PublicKey { diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java index 0408feabbbc..89dd478c831 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateCrtKey.java @@ -32,6 +32,7 @@ import java.math.BigInteger; * using the Chinese Remainder Theorem (CRT) information values. * * @author Jan Luehe + * @since 1.2 * * * @see RSAPrivateKey diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java index 5d69ad6837e..390da4e89fd 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPrivateKey.java @@ -31,6 +31,7 @@ import java.math.BigInteger; * The interface to an RSA private key. * * @author Jan Luehe + * @since 1.2 * * * @see RSAPrivateCrtKey diff --git a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java index a698c05f738..f19530604d7 100644 --- a/jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java +++ b/jdk/src/java.base/share/classes/java/security/interfaces/RSAPublicKey.java @@ -31,6 +31,7 @@ import java.math.BigInteger; * The interface to an RSA public key. * * @author Jan Luehe + * @since 1.2 * */ diff --git a/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java index d0ba70be443..1c66e537983 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java @@ -33,6 +33,7 @@ import java.math.BigInteger; * efficiency. * * @author Jan Luehe + * @since 1.2 * * * @see java.security.Key diff --git a/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java index e7491461684..6a750354e1b 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/RSAPrivateKeySpec.java @@ -31,6 +31,7 @@ import java.math.BigInteger; * This class specifies an RSA private key. * * @author Jan Luehe + * @since 1.2 * * * @see java.security.Key diff --git a/jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java b/jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java index 9a944f962b1..68ce197c939 100644 --- a/jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java +++ b/jdk/src/java.base/share/classes/java/security/spec/RSAPublicKeySpec.java @@ -31,6 +31,7 @@ import java.math.BigInteger; * This class specifies an RSA public key. * * @author Jan Luehe + * @since 1.2 * * * @see java.security.Key diff --git a/jdk/src/java.base/share/classes/java/text/BreakIterator.java b/jdk/src/java.base/share/classes/java/text/BreakIterator.java index 0c780258e47..ffb5d5938e5 100644 --- a/jdk/src/java.base/share/classes/java/text/BreakIterator.java +++ b/jdk/src/java.base/share/classes/java/text/BreakIterator.java @@ -221,6 +221,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * and the next is a word; otherwise, it's the material between words.) * * + * @since 1.1 * @see CharacterIterator * */ diff --git a/jdk/src/java.base/share/classes/java/text/CharacterIterator.java b/jdk/src/java.base/share/classes/java/text/CharacterIterator.java index efa7ab413b0..b6e5e8b1196 100644 --- a/jdk/src/java.base/share/classes/java/text/CharacterIterator.java +++ b/jdk/src/java.base/share/classes/java/text/CharacterIterator.java @@ -98,6 +98,7 @@ package java.text; * } * } * + * @since 1.1 * @see StringCharacterIterator * @see AttributedCharacterIterator */ diff --git a/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java b/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java index 8f76aaedf04..13697dfcc8f 100644 --- a/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java +++ b/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java @@ -163,6 +163,7 @@ import java.util.Arrays; * @see DecimalFormat * @see MessageFormat * @author Mark Davis + * @since 1.1 */ public class ChoiceFormat extends NumberFormat { diff --git a/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java b/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java index 7060ac0c8b6..9da55b26625 100644 --- a/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java +++ b/jdk/src/java.base/share/classes/java/text/CollationElementIterator.java @@ -104,6 +104,7 @@ import sun.text.normalizer.NormalizerBase; * @see Collator * @see RuleBasedCollator * @author Helena Shih, Laura Werner, Richard Gillam + * @since 1.1 */ public final class CollationElementIterator { diff --git a/jdk/src/java.base/share/classes/java/text/CollationKey.java b/jdk/src/java.base/share/classes/java/text/CollationKey.java index 4f9c3c6ac49..318f3c4d26b 100644 --- a/jdk/src/java.base/share/classes/java/text/CollationKey.java +++ b/jdk/src/java.base/share/classes/java/text/CollationKey.java @@ -95,6 +95,7 @@ package java.text; * @see Collator * @see RuleBasedCollator * @author Helena Shih + * @since 1.1 */ public abstract class CollationKey implements Comparable
* * @author David Connelly + * @since 1.1 */ public class Adler32 implements Checksum { diff --git a/jdk/src/java.base/share/classes/java/util/zip/CRC32.java b/jdk/src/java.base/share/classes/java/util/zip/CRC32.java index 4b04ab20238..b60dea653e4 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/CRC32.java +++ b/jdk/src/java.base/share/classes/java/util/zip/CRC32.java @@ -38,6 +38,7 @@ import jdk.internal.HotSpotIntrinsicCandidate; * a {@link NullPointerException} to be thrown.{ diff --git a/jdk/src/java.base/share/classes/java/text/Collator.java b/jdk/src/java.base/share/classes/java/text/Collator.java index ce2f8945856..cd8fa44d3b9 100644 --- a/jdk/src/java.base/share/classes/java/text/Collator.java +++ b/jdk/src/java.base/share/classes/java/text/Collator.java @@ -123,6 +123,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * @see CollationElementIterator * @see Locale * @author Helena Shih, Laura Werner, Richard Gillam + * @since 1.1 */ public abstract class Collator diff --git a/jdk/src/java.base/share/classes/java/text/DateFormat.java b/jdk/src/java.base/share/classes/java/text/DateFormat.java index 620dbe87372..f4e7a5ab849 100644 --- a/jdk/src/java.base/share/classes/java/text/DateFormat.java +++ b/jdk/src/java.base/share/classes/java/text/DateFormat.java @@ -167,6 +167,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * @see java.util.GregorianCalendar * @see java.util.TimeZone * @author Mark Davis, Chen-Lieh Huang, Alan Liu + * @since 1.1 */ public abstract class DateFormat extends Format { diff --git a/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java b/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java index 0360631a02d..724c1e71ac3 100644 --- a/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java +++ b/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java @@ -98,6 +98,7 @@ import sun.util.locale.provider.TimeZoneNameUtility; * @see SimpleDateFormat * @see java.util.SimpleTimeZone * @author Chen-Lieh Huang + * @since 1.1 */ public class DateFormatSymbols implements Serializable, Cloneable { diff --git a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java index eb5107cdea4..448cf6f2d75 100644 --- a/jdk/src/java.base/share/classes/java/text/DecimalFormat.java +++ b/jdk/src/java.base/share/classes/java/text/DecimalFormat.java @@ -381,6 +381,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * @see ParsePosition * @author Mark Davis * @author Alan Liu + * @since 1.1 */ public class DecimalFormat extends NumberFormat { diff --git a/jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java b/jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java index cf7e7e5ffc7..989d6f26377 100644 --- a/jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java +++ b/jdk/src/java.base/share/classes/java/text/DecimalFormatSymbols.java @@ -60,6 +60,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * @see DecimalFormat * @author Mark Davis * @author Alan Liu + * @since 1.1 */ public class DecimalFormatSymbols implements Cloneable, Serializable { diff --git a/jdk/src/java.base/share/classes/java/text/FieldPosition.java b/jdk/src/java.base/share/classes/java/text/FieldPosition.java index 955221dee80..7a6e2a58e93 100644 --- a/jdk/src/java.base/share/classes/java/text/FieldPosition.java +++ b/jdk/src/java.base/share/classes/java/text/FieldPosition.java @@ -68,6 +68,7 @@ package java.text; * formatToCharacterIterator
. * * @author Mark Davis + * @since 1.1 * @see java.text.Format */ public class FieldPosition { diff --git a/jdk/src/java.base/share/classes/java/text/Format.java b/jdk/src/java.base/share/classes/java/text/Format.java index ee6fb4d1fb7..be324eb63ba 100644 --- a/jdk/src/java.base/share/classes/java/text/Format.java +++ b/jdk/src/java.base/share/classes/java/text/Format.java @@ -129,6 +129,7 @@ import java.io.Serializable; * @see java.text.DateFormat * @see java.text.MessageFormat * @author Mark Davis + * @since 1.1 */ public abstract class Format implements Serializable, Cloneable { diff --git a/jdk/src/java.base/share/classes/java/text/MessageFormat.java b/jdk/src/java.base/share/classes/java/text/MessageFormat.java index 1275f3cc33a..b80eb054f51 100644 --- a/jdk/src/java.base/share/classes/java/text/MessageFormat.java +++ b/jdk/src/java.base/share/classes/java/text/MessageFormat.java @@ -344,6 +344,7 @@ import java.util.Locale; * @see SimpleDateFormat * * @author Mark Davis + * @since 1.1 */ public class MessageFormat extends Format { diff --git a/jdk/src/java.base/share/classes/java/text/NumberFormat.java b/jdk/src/java.base/share/classes/java/text/NumberFormat.java index 7e86bbe35d5..86953f21c9a 100644 --- a/jdk/src/java.base/share/classes/java/text/NumberFormat.java +++ b/jdk/src/java.base/share/classes/java/text/NumberFormat.java @@ -185,6 +185,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * @see ChoiceFormat * @author Mark Davis * @author Helena Shih + * @since 1.1 */ public abstract class NumberFormat extends Format { diff --git a/jdk/src/java.base/share/classes/java/text/ParseException.java b/jdk/src/java.base/share/classes/java/text/ParseException.java index f9ad001fa52..264c4803fc5 100644 --- a/jdk/src/java.base/share/classes/java/text/ParseException.java +++ b/jdk/src/java.base/share/classes/java/text/ParseException.java @@ -45,6 +45,7 @@ package java.text; * @see java.text.Format * @see java.text.FieldPosition * @author Mark Davis + * @since 1.1 */ public class ParseException extends Exception { diff --git a/jdk/src/java.base/share/classes/java/text/ParsePosition.java b/jdk/src/java.base/share/classes/java/text/ParsePosition.java index be3ffce61eb..85e5c9d9e3c 100644 --- a/jdk/src/java.base/share/classes/java/text/ParsePosition.java +++ b/jdk/src/java.base/share/classes/java/text/ParsePosition.java @@ -51,6 +51,7 @@ package java.text; * records the current position. * * @author Mark Davis + * @since 1.1 * @see java.text.Format */ diff --git a/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java b/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java index e3c2c8c309e..c8140a5efa0 100644 --- a/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java +++ b/jdk/src/java.base/share/classes/java/text/RuleBasedCollator.java @@ -242,6 +242,7 @@ import java.util.Locale; * @see Collator * @see CollationElementIterator * @author Helena Shih, Laura Werner, Richard Gillam + * @since 1.1 */ public class RuleBasedCollator extends Collator{ // IMPLEMENTATION NOTES: The implementation of the collation algorithm is diff --git a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java index 70987ad99df..4990338e1a6 100644 --- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java +++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java @@ -434,6 +434,7 @@ import sun.util.locale.provider.LocaleProviderAdapter; * @see DateFormat * @see DateFormatSymbols * @author Mark Davis, Chen-Lieh Huang, Alan Liu + * @since 1.1 */ public class SimpleDateFormat extends DateFormat { diff --git a/jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java b/jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java index 66b5be65157..b5d510cd642 100644 --- a/jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java +++ b/jdk/src/java.base/share/classes/java/text/StringCharacterIterator.java @@ -47,6 +47,7 @@ package java.text; * entireString
. * * @see CharacterIterator + * @since 1.1 */ public final class StringCharacterIterator implements CharacterIterator diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java b/jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java index f647e213128..5e5232efa7a 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/CompletionService.java @@ -57,6 +57,8 @@ package java.util.concurrent; * happen-before * actions taken by that task, which in turn happen-before * actions following a successful return from the corresponding {@code take()}. + * + * @since 1.5 */ public interface CompletionService{ /** diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java b/jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java index 77208837d57..67dcfc26c17 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ExecutorCompletionService.java @@ -97,6 +97,8 @@ package java.util.concurrent; * if (result != null) * use(result); * }} + * + * @since 1.5 */ public class ExecutorCompletionService implements CompletionService { private final Executor executor; diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java b/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java index 7bf6e8a54cd..09c4368c6cc 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java @@ -133,6 +133,8 @@ import jdk.internal.misc.Unsafe; * Class> ensureLoaded = LockSupport.class; * } * }} + * + * @since 1.5 */ public class LockSupport { private LockSupport() {} // Cannot be instantiated. diff --git a/jdk/src/java.base/share/classes/java/util/jar/JarEntry.java b/jdk/src/java.base/share/classes/java/util/jar/JarEntry.java index b0e6841bf83..28a69cf805c 100644 --- a/jdk/src/java.base/share/classes/java/util/jar/JarEntry.java +++ b/jdk/src/java.base/share/classes/java/util/jar/JarEntry.java @@ -32,6 +32,8 @@ import java.security.cert.Certificate; /** * This class is used to represent a JAR file entry. + * + * @since 1.2 */ public class JarEntry extends ZipEntry { diff --git a/jdk/src/java.base/share/classes/java/util/zip/Adler32.java b/jdk/src/java.base/share/classes/java/util/zip/Adler32.java index 425c35d1bf4..5881282a8e3 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/Adler32.java +++ b/jdk/src/java.base/share/classes/java/util/zip/Adler32.java @@ -39,6 +39,7 @@ import jdk.internal.HotSpotIntrinsicCandidate; * a {@link NullPointerException} to be thrown. All default handler implementations must provide a public * zero-argument constructor. * + * @since 1.4 * @see java.security.Security security properties */ public interface CallbackHandler { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java index 26cfd23e30c..564a7984551 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ChoiceCallback.java @@ -31,6 +31,7 @@ package javax.security.auth.callback; * method of a {@code CallbackHandler} to display a list of choices * and to retrieve the selected choice(s). * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class ChoiceCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java index 56fead57f0c..99bb5f8c17f 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/ConfirmationCallback.java @@ -31,6 +31,7 @@ package javax.security.auth.callback; * method of a {@code CallbackHandler} to ask for YES/NO, * OK/CANCEL, YES/NO/CANCEL or other similar confirmations. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class ConfirmationCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java index bcd2fdf0741..c0bf6e31896 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/LanguageCallback.java @@ -33,6 +33,7 @@ import java.util.Locale; * method of a {@code CallbackHandler} to retrieve the {@code Locale} * used for localizing text. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class LanguageCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java index 500f8d1ee10..5c289df2c43 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/NameCallback.java @@ -30,6 +30,7 @@ package javax.security.auth.callback; * {@code NameCallback} to the {@code handle} * method of a {@code CallbackHandler} to retrieve name information. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class NameCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java index b35eaa8d0e4..63e52fea112 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/PasswordCallback.java @@ -30,6 +30,7 @@ package javax.security.auth.callback; * {@code PasswordCallback} to the {@code handle} * method of a {@code CallbackHandler} to retrieve password information. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class PasswordCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java index b9f93b73e44..0fea6a3c7d6 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextInputCallback.java @@ -31,6 +31,7 @@ package javax.security.auth.callback; * method of a {@code CallbackHandler} to retrieve generic text * information. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class TextInputCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java index 400a2c6e3ed..ba4551e3880 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/TextOutputCallback.java @@ -31,6 +31,7 @@ package javax.security.auth.callback; * method of a {@code CallbackHandler} to display information messages, * warning messages and error messages. * + * @since 1.4 * @see javax.security.auth.callback.CallbackHandler */ public class TextOutputCallback implements Callback, java.io.Serializable { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java b/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java index 605a3e35ebb..be11761f7b2 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/callback/UnsupportedCallbackException.java @@ -29,6 +29,7 @@ package javax.security.auth.callback; * Signals that a {@code CallbackHandler} does not * recognize a particular {@code Callback}. * + * @since 1.4 */ public class UnsupportedCallbackException extends Exception { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java index 43dd84eb527..e979fc7cd52 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AccountExpiredException.java @@ -35,6 +35,7 @@ package javax.security.auth.login; * throws this exception to notify the application. The application can * then take the appropriate steps to notify the user. * + * @since 1.4 */ public class AccountExpiredException extends AccountException { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java b/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java index 1e9acbf051a..f567b3be871 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/AppConfigurationEntry.java @@ -39,6 +39,7 @@ import java.util.Collections; * options. Please refer to the {@code Configuration} class for * more information on the different control flags and their semantics. * + * @since 1.4 * @see javax.security.auth.login.Configuration */ public class AppConfigurationEntry { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java index 1f0b6c95597..e08bf3eb3d7 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/Configuration.java @@ -182,6 +182,7 @@ import sun.security.jca.GetInstance; * Java Security Standard Algorithm Names Specification * for a list of standard Configuration types. * + * @since 1.4 * @see javax.security.auth.login.LoginContext * @see java.security.Security security properties */ diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java index 8e279bd604b..b0914d2c914 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/CredentialExpiredException.java @@ -37,6 +37,7 @@ package javax.security.auth.login; * the application. The application can then take the appropriate * steps to assist the user in updating the password. * + * @since 1.4 */ public class CredentialExpiredException extends CredentialException { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java b/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java index 895583138db..82170a99fc9 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/FailedLoginException.java @@ -32,6 +32,7 @@ package javax.security.auth.login; * For example, a {@code LoginModule} throws this exception if * the user entered an incorrect password. * + * @since 1.4 */ public class FailedLoginException extends LoginException { diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java index af46b200701..deaf3aac426 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginContext.java @@ -182,6 +182,7 @@ import sun.security.util.ResourcesMgr; * * * + * @since 1.4 * @see java.security.Security * @see javax.security.auth.AuthPermission * @see javax.security.auth.Subject diff --git a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java index 065f57f986c..3861cfcf0b9 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/login/LoginException.java @@ -28,6 +28,7 @@ package javax.security.auth.login; /** * This is the basic login exception. * + * @since 1.4 * @see javax.security.auth.login.LoginContext */ diff --git a/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java b/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java index 3206b5a5d27..1c19b7d8832 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/spi/LoginModule.java @@ -122,6 +122,7 @@ import java.util.Map; * no arguments. This allows classes which load the {@code LoginModule} * to instantiate it. * + * @since 1.4 * @see javax.security.auth.login.LoginContext * @see javax.security.auth.login.Configuration */ diff --git a/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java b/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java index e3a7fdbd7dc..a4f37a36818 100644 --- a/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java +++ b/jdk/src/java.base/share/classes/javax/security/auth/x500/X500PrivateCredential.java @@ -36,6 +36,7 @@ import javax.security.auth.Destroyable; * This enables looking up the private credentials for an X.500 principal * in a subject. * + * @since 1.4 */ public final class X500PrivateCredential implements Destroyable { private X509Certificate cert; diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java index 6211692d5c9..b1a90285d10 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java @@ -48,6 +48,7 @@ import java.io.IOException; * * @author Amy Fowler * @author Alexander Gerasimov + * @since 1.1 */ public class Clipboard { diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java index 4c68a3b5624..bc5e239be2d 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java @@ -39,6 +39,7 @@ package java.awt.datatransfer; * @see java.awt.datatransfer.Clipboard * * @author Amy Fowler + * @since 1.1 */ public interface ClipboardOwner { diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java index 7cc256e9e6d..701957ed795 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java @@ -112,6 +112,7 @@ import java.util.Objects; * @author Blake Sullivan * @author Laurence P. G. Cable * @author Jeff Dunn + * @since 1.1 */ public class DataFlavor implements Externalizable, Cloneable { diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java index aecf3f40f52..03817dbde74 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java @@ -39,6 +39,7 @@ import java.io.*; * and all equivalent flavors is deprecated. No other *
DataFlavor
s are supported. * + * @since 1.1 * @see java.awt.datatransfer.DataFlavor#stringFlavor * @see java.awt.datatransfer.DataFlavor#plainTextFlavor */ diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java index 3ba437748ab..fdb947ab05c 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java @@ -37,6 +37,7 @@ import java.io.IOException; * a section in The Java Tutorial, for more information. * * @author Amy Fowler + * @since 1.1 */ public interface Transferable { diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java index b3d9f17d21c..11ecbd1ab5d 100644 --- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java +++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java @@ -30,6 +30,7 @@ package java.awt.datatransfer; * @see Transferable#getTransferData * * @author Amy Fowler + * @since 1.1 */ public class UnsupportedFlavorException extends Exception { From fc10ff7fe06cd08ff9ca1d98b2ca4e7317a72121 Mon Sep 17 00:00:00 2001 From: Valerie PengDate: Thu, 1 Jun 2017 03:26:30 +0000 Subject: [PATCH 007/130] 8180635: (doc) Clarify the compatibility and interoperability issue when using provider default values Updated the javadoc of KeyPairGenerator, KeyGenerator, AlgorithmParameterGenerator and their Spi classes Reviewed-by: mullan --- .../security/AlgorithmParameterGenerator.java | 16 +++++++++++----- .../security/AlgorithmParameterGeneratorSpi.java | 13 ++++++++++--- .../classes/java/security/KeyPairGenerator.java | 11 +++++++++-- .../java/security/KeyPairGeneratorSpi.java | 13 ++++++++++--- .../share/classes/javax/crypto/KeyGenerator.java | 9 +++++++++ .../classes/javax/crypto/KeyGeneratorSpi.java | 15 ++++++++++++++- 6 files changed, 63 insertions(+), 14 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java index 8694b603c07..c67fc37eadb 100644 --- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java +++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGenerator.java @@ -61,11 +61,17 @@ import java.util.Objects; * * * In case the client does not explicitly initialize the - * AlgorithmParameterGenerator - * (via a call to an {@code init} method), each provider must supply (and - * document) a default initialization. For example, the Sun provider uses a - * default modulus prime size of 1024 bits for the generation of DSA - * parameters. + * AlgorithmParameterGenerator (via a call to an {@code init} method), + * each provider must supply (and document) a default initialization. + * See the Keysize Restriction sections of the + * + * JDK Providers + * document for information on the AlgorithmParameterGenerator defaults + * used by JDK providers. + * However, note that defaults may vary across different providers. + * Additionally, the default value for a provider may change in a future + * version. Therefore, it is recommended to explicitly initialize the + * AlgorithmParameterGenerator instead of relying on provider-specific defaults. * *
Every implementation of the Java platform is required to support the * following standard {@code AlgorithmParameterGenerator} algorithms and diff --git a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java index 721fb52ac18..ece70f65f35 100644 --- a/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java +++ b/jdk/src/java.base/share/classes/java/security/AlgorithmParameterGeneratorSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +39,15 @@ import java.security.spec.AlgorithmParameterSpec; *
In case the client does not explicitly initialize the * AlgorithmParameterGenerator (via a call to an {@code engineInit} * method), each provider must supply (and document) a default initialization. - * For example, the Sun provider uses a default modulus prime size of 1024 - * bits for the generation of DSA parameters. + * See the Keysize Restriction sections of the + * + * JDK Providers + * document for information on the AlgorithmParameterGenerator defaults + * used by JDK providers. + * However, note that defaults may vary across different providers. + * Additionally, the default value for a provider may change in a future + * version. Therefore, it is recommended to explicitly initialize the + * AlgorithmParameterGenerator instead of relying on provider-specific defaults. * * @author Jan Luehe * diff --git a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java index 26c80b43dbd..fba444ebe56 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java +++ b/jdk/src/java.base/share/classes/java/security/KeyPairGenerator.java @@ -95,8 +95,15 @@ import sun.security.util.Debug; *
In case the client does not explicitly initialize the KeyPairGenerator * (via a call to an {@code initialize} method), each provider must * supply (and document) a default initialization. - * For example, the Sun provider uses a default modulus size (keysize) - * of 1024 bits for DSA key pairs. + * See the Keysize Restriction sections of the + * + * JDK Providers + * document for information on the KeyPairGenerator defaults used by + * JDK providers. + * However, note that defaults may vary across different providers. + * Additionally, the default value for a provider may change in a future + * version. Therefore, it is recommended to explicitly initialize the + * KeyPairGenerator instead of relying on provider-specific defaults. * *
Note that this class is abstract and extends from * {@code KeyPairGeneratorSpi} for historical reasons. diff --git a/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java b/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java index d0790d45b2c..85f02b2ad86 100644 --- a/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java +++ b/jdk/src/java.base/share/classes/java/security/KeyPairGeneratorSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +39,15 @@ import java.security.spec.AlgorithmParameterSpec; *
In case the client does not explicitly initialize the KeyPairGenerator * (via a call to an {@code initialize} method), each provider must * supply (and document) a default initialization. - * For example, the Sun provider uses a default modulus size (keysize) - * of 1024 bits. + * See the Keysize Restriction sections of the + * + * JDK Providers + * document for information on the KeyPairGenerator defaults used by + * JDK providers. + * However, note that defaults may vary across different providers. + * Additionally, the default value for a provider may change in a future + * version. Therefore, it is recommended to explicitly initialize the + * KeyPairGenerator instead of relying on provider-specific defaults. * * @author Benjamin Renaud * @since 1.2 diff --git a/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java b/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java index 135f0ce33df..b9b621478c3 100644 --- a/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java +++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java @@ -83,6 +83,15 @@ import sun.security.util.Debug; *
In case the client does not explicitly initialize the KeyGenerator * (via a call to an {@code init} method), each provider must * supply (and document) a default initialization. + * See the Keysize Restriction sections of the + * + * JDK Providers + * document for information on the KeyGenerator defaults used by + * JDK providers. + * However, note that defaults may vary across different providers. + * Additionally, the default value for a provider may change in a future + * version. Therefore, it is recommended to explicitly initialize the + * KeyGenerator instead of relying on provider-specific defaults. * *
Every implementation of the Java platform is required to support the * following standard {@code KeyGenerator} algorithms with the keysizes in diff --git a/jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java b/jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java index f271e413cfc..57d86254281 100644 --- a/jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java +++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGeneratorSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,19 @@ import java.security.spec.*; * cryptographic service provider who wishes to supply the implementation * of a key generator for a particular algorithm. * + *
In case the client does not explicitly initialize the KeyGenerator + * (via a call to an {@code init} method), each provider must + * supply (and document) a default initialization. + * See the Keysize Restriction sections of the + * + * JDK Providers + * document for information on the KeyGenerator defaults used by + * JDK providers. + * However, note that defaults may vary across different providers. + * Additionally, the default value for a provider may change in a future + * version. Therefore, it is recommended to explicitly initialize the + * KeyGenerator instead of relying on provider-specific defaults. + * * @author Jan Luehe * * @see SecretKey From 3171214a123c590c15b6855f88a325dc873f5800 Mon Sep 17 00:00:00 2001 From: Roger Riggs
Date: Wed, 31 May 2017 23:45:36 -0400 Subject: [PATCH 008/130] 8180582: The bind to rmiregistry is rejected by registryFilter even though registryFilter is set The Registry MAXDEPTH should allow binding more complex objects Reviewed-by: dfuchs, smarks --- .../sun/rmi/registry/RegistryImpl.java | 4 +- .../serialFilter/RegistryFilterTest.java | 88 +++++++++++++++---- 2 files changed, 74 insertions(+), 18 deletions(-) diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java b/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java index d45cfac685e..6b75a2a6ecb 100644 --- a/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java +++ b/jdk/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java @@ -102,10 +102,10 @@ public class RegistryImpl extends java.rmi.server.RemoteServer private static final String REGISTRY_FILTER_PROPNAME = "sun.rmi.registry.registryFilter"; /** Registry max depth of remote invocations. **/ - private static int REGISTRY_MAX_DEPTH = 5; + private static final int REGISTRY_MAX_DEPTH = 20; /** Registry maximum array size in remote invocations. **/ - private static int REGISTRY_MAX_ARRAY_SIZE = 10000; + private static final int REGISTRY_MAX_ARRAY_SIZE = 10000; /** * The registryFilter created from the value of the {@code "sun.rmi.registry.registryFilter"} diff --git a/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java b/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java index e29e24aea8a..2d5562fed61 100644 --- a/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java +++ b/jdk/test/java/rmi/registry/serialFilter/RegistryFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,24 +21,18 @@ * questions. */ -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.ObjectOutputStream; import java.io.Serializable; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; +import java.rmi.AlreadyBoundException; import java.rmi.MarshalledObject; import java.rmi.NotBoundException; import java.rmi.Remote; import java.rmi.RemoteException; -import java.rmi.AlreadyBoundException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; -import java.util.Objects; import java.security.Security; +import java.util.Objects; import org.testng.Assert; import org.testng.TestNG; @@ -57,7 +51,8 @@ import org.testng.annotations.Test; * @summary Test filters for the RMI Registry * @run testng/othervm RegistryFilterTest * @run testng/othervm - * -Dsun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass + * -Dsun.rmi.registry.registryFilter=!java.lang.Long;!RegistryFilterTest$RejectableClass;maxdepth=19 + * -Dtest.maxdepth=19 * RegistryFilterTest * @run testng/othervm/policy=security.policy * -Djava.security.properties=${test.src}/java.security-extra1 @@ -68,6 +63,8 @@ public class RegistryFilterTest { private static int port; private static Registry registry; + static final int REGISTRY_MAX_DEPTH = 20; + static final int REGISTRY_MAX_ARRAY = 10000; static final String registryFilter = @@ -125,7 +122,7 @@ public class RegistryFilterTest { /* - * Test registry rejects an object with the max array size + 1. + * Test registry rejects an object with the max array size + 1. */ @Test(dataProvider="bindData") public void simpleBind(String name, Remote obj, boolean blacklisted) throws RemoteException, AlreadyBoundException, NotBoundException { @@ -139,9 +136,9 @@ public class RegistryFilterTest { } /* - * Test registry rejects an object with a well known class - * if blacklisted in the security properties. - */ + * Test registry rejects an object with a well known class + * if blacklisted in the security properties. + */ @Test public void simpleRejectableClass() throws RemoteException, AlreadyBoundException, NotBoundException { RejectableClass r1 = null; @@ -150,9 +147,46 @@ public class RegistryFilterTest { r1 = new RejectableClass(); registry.bind(name, r1); registry.unbind(name); - Assert.assertNull(registryFilter, "Registry filter should not have rejected"); + Assert.assertNull(registryFilter, "Registry filter should have rejected"); } catch (Exception rex) { - Assert.assertNotNull(registryFilter, "Registry filter should have rejected"); + Assert.assertNotNull(registryFilter, "Registry filter should not have rejected"); + } + } + + /* + * Test registry does not reject an object with depth at the built-in limit. + */ + @Test + public void simpleDepthBuiltinNonRejectable() throws RemoteException, AlreadyBoundException, NotBoundException { + int depthOverride = Integer.getInteger("test.maxdepth", REGISTRY_MAX_DEPTH); + depthOverride = Math.min(depthOverride, REGISTRY_MAX_DEPTH); + System.out.printf("overrideDepth: %d, filter: %s%n", depthOverride, registryFilter); + try { + String name = "reject2"; + DepthRejectableClass r1 = DepthRejectableClass.create(depthOverride); + registry.bind(name, r1); + registry.unbind(name); + } catch (Exception rex) { + Assert.fail("Registry filter should not have rejected depth: " + + depthOverride); + } + } + + /* + * Test registry rejects an object with depth at the limit + 1. + */ + @Test + public void simpleDepthRejectable() throws RemoteException, AlreadyBoundException, NotBoundException { + int depthOverride = Integer.getInteger("test.maxdepth", REGISTRY_MAX_DEPTH); + depthOverride = Math.min(depthOverride, REGISTRY_MAX_DEPTH); + System.out.printf("overrideDepth: %d, filter: %s%n", depthOverride, registryFilter); + try { + String name = "reject3"; + DepthRejectableClass r1 = DepthRejectableClass.create(depthOverride + 1); + registry.bind(name, r1); + Assert.fail("Registry filter should have rejected depth: " + depthOverride + 1); + } catch (Exception rex) { + // Rejection expected } } @@ -173,6 +207,7 @@ public class RegistryFilterTest { return super.toString() + "//" + Objects.toString(obj); } } + /** * A simple Serializable Remote object that is passed by value. * It and its contents are checked by the Registry serial filter. @@ -183,4 +218,25 @@ public class RegistryFilterTest { RejectableClass() {} } + /** + * A simple Serializable Remote object that is passed by value. + * It and its contents are checked by the Registry serial filter. + */ + static class DepthRejectableClass implements Serializable, Remote { + private static final long serialVersionUID = 362498820763181264L; + private final DepthRejectableClass next; + + private DepthRejectableClass(DepthRejectableClass next) { + this.next = next; + } + + static DepthRejectableClass create(int depth) { + DepthRejectableClass next = new DepthRejectableClass(null); + for (int i = 1; i < depth; i++) { + next = new DepthRejectableClass(next); + } + return next; + } + } + } From 4fff93d5b64caf007671642a8cf89ac9c04cfe19 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Thu, 1 Jun 2017 09:28:59 -0400 Subject: [PATCH 009/130] 8181156: html5 issues in java.base javadoc Reviewed-by: alanb --- .../java/lang/invoke/package-info.java | 35 ++++-- .../share/classes/java/net/InetAddress.java | 4 +- .../java.base/share/classes/java/net/URI.java | 18 +-- .../java/nio/channels/package-info.java | 112 ++++++++++++------ .../java/nio/charset/package-info.java | 16 +-- .../java/nio/file/attribute/package-info.java | 38 ++++-- .../share/classes/java/nio/package-info.java | 27 +++-- .../java/util/spi/CalendarNameProvider.java | 36 +++--- 8 files changed, 176 insertions(+), 110 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java b/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java index c9dabfdc3a5..7e4ce134ec0 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/package-info.java @@ -77,7 +77,8 @@ * * The bootstrap method is invoked on at least three values: *
- *
- a {@code MethodHandles.Lookup}, a lookup object on the caller class in which dynamic call site occurs
+ *- a {@code MethodHandles.Lookup}, a lookup object on the caller class + * in which dynamic call site occurs
*- a {@code String}, the method name mentioned in the call site
*- a {@code MethodType}, the resolved type descriptor of the call
*- optionally, between 1 and 251 additional static arguments taken from the constant pool
@@ -165,17 +166,27 @@ * Given these rules, here are examples of legal bootstrap method declarations, * given various numbers {@code N} of extra arguments. * The first rows (marked {@code *}) will work for any number of extra arguments. - *- *
- * N sample bootstrap method - * * CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
- * * CallSite bootstrap(Object... args)
- * * CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)
- * 0 CallSite bootstrap(Lookup caller, String name, MethodType type)
- * 0 CallSite bootstrap(Lookup caller, Object... nameAndType)
- * 1 CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)
- * 2 CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
- * 2 CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)
+ * 2 CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)
+ *
* The last example assumes that the extra arguments are of type * {@code CONSTANT_String} and {@code CONSTANT_Integer}, respectively. diff --git a/jdk/src/java.base/share/classes/java/net/InetAddress.java b/jdk/src/java.base/share/classes/java/net/InetAddress.java index 22d9ce80303..95b38875d9c 100644 --- a/jdk/src/java.base/share/classes/java/net/InetAddress.java +++ b/jdk/src/java.base/share/classes/java/net/InetAddress.java @@ -75,7 +75,7 @@ import sun.net.util.IPAddressUtil; * + *+ * N Sample bootstrap method + * * + *CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
+ * * + * CallSite bootstrap(Object... args)
+ * * + * CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)
+ * 0 + * CallSite bootstrap(Lookup caller, String name, MethodType type)
+ * 0 + * CallSite bootstrap(Lookup caller, Object... nameAndType)
+ * 1 + * CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)
+ * 2 + * CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)
+ * 2 + * CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)
* 2 + *CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)
*
* - *unicast + *- * unicast *An identifier for a single interface. A packet sent to * a unicast address is delivered to the interface identified by * that address. @@ -94,7 +94,7 @@ import sun.net.util.IPAddressUtil; * IP address loops around and becomes IP input on the local * host. This address is often used when testing a * client. multicast + *diff --git a/jdk/src/java.base/share/classes/java/net/URI.java b/jdk/src/java.base/share/classes/java/net/URI.java index 48c224798a0..eab652cbbf5 100644 --- a/jdk/src/java.base/share/classes/java/net/URI.java +++ b/jdk/src/java.base/share/classes/java/net/URI.java @@ -253,32 +253,32 @@ import java.lang.NullPointerException; // for javadoc * which are taken from that specification, are used below to describe these * constraints: * - * multicast *An identifier for a set of interfaces (typically belonging * to different nodes). A packet sent to a multicast address is * delivered to all interfaces identified by that address. + *
*
* - *alpha + *- * alpha *The US-ASCII alphabetic characters, * {@code 'A'} through {@code 'Z'} * and {@code 'a'} through {@code 'z'} digit + *- * digit *The US-ASCII decimal digit characters, * {@code '0'} through {@code '9'} alphanum + *- * alphanum *All alpha and digit characters unreserved + *- * unreserved *All alphanum characters together with those in the string * {@code "_-!.~'()*"} punct + *- * punct *The characters in the string {@code ",;:$&+="} reserved + *- * reserved *All punct characters together with those in the string * {@code "?/[]@"} escaped + *- * escaped *Escaped octets, that is, triplets consisting of the percent * character ({@code '%'}) followed by two hexadecimal digits * ({@code '0'}-{@code '9'}, {@code 'A'}-{@code 'F'}, and * {@code 'a'}-{@code 'f'}) other + *other *The Unicode characters that are not in the US-ASCII character set, * are not control characters (according to the {@link * java.lang.Character#isISOControl(char) Character.isISOControl} diff --git a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java index 57ab6322be0..d29ae67590f 100644 --- a/jdk/src/java.base/share/classes/java/nio/channels/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/channels/package-info.java @@ -30,31 +30,44 @@ * * * - * - *
- * Channels Description {@link java.nio.channels.Channel} + ** @@ -109,13 +122,19 @@ * be constructed that uses a given charset to encode characters into bytes and * write them to a given writable byte channel. * - *+ *
+ *+ * Channels + *Description - * {@link java.nio.channels.Channel} *A nexus for I/O operations {@link java.nio.channels.ReadableByteChannel} + *- * + * {@link java.nio.channels.ReadableByteChannel} *Can read into a buffer {@link java.nio.channels.ScatteringByteChannel} + *- * + * {@link java.nio.channels.ScatteringByteChannel} *Can read into a sequence of buffers {@link java.nio.channels.WritableByteChannel} + *- * + * {@link java.nio.channels.WritableByteChannel} *Can write from a buffer {@link java.nio.channels.GatheringByteChannel} + *- * + * {@link java.nio.channels.GatheringByteChannel} *Can write from a sequence of buffers {@link java.nio.channels.ByteChannel} + *- * + * {@link java.nio.channels.ByteChannel} *Can read/write to/from a buffer - * {@link java.nio.channels.SeekableByteChannel} - *A {@code ByteChannel} connected to an entity that contains a variable-length sequence of bytes {@link java.nio.channels.AsynchronousChannel} + *+ * + * {@link java.nio.channels.SeekableByteChannel} + *A {@code ByteChannel} connected to an entity that contains a variable-length + * sequence of bytes - * + * {@link java.nio.channels.AsynchronousChannel} *Supports asynchronous I/O operations. {@link java.nio.channels.AsynchronousByteChannel} + *- * + * {@link java.nio.channels.AsynchronousByteChannel} *Can read and write bytes asynchronously {@link java.nio.channels.NetworkChannel} + *- * + * {@link java.nio.channels.NetworkChannel} *A channel to a network socket {@link java.nio.channels.MulticastChannel} + *- * + * {@link java.nio.channels.MulticastChannel} *Can join Internet Protocol (IP) multicast groups {@link java.nio.channels.Channels} + ** {@link java.nio.channels.Channels} *Utility methods for channel/stream interoperation - *
- * File channels Description {@link java.nio.channels.FileChannel} + ** @@ -137,26 +156,34 @@ * class. * * - *+ *
+ *+ * File channels + *Description - * + * {@link java.nio.channels.FileChannel} *Reads, writes, maps, and manipulates files {@link java.nio.channels.FileLock} + *- * + * {@link java.nio.channels.FileLock} *A lock on a (region of a) file {@link java.nio.MappedByteBuffer} + ** + * {@link java.nio.MappedByteBuffer} *A direct byte buffer mapped to a region of a file - *
- * Multiplexed, non-blocking I/O Description
{@link java.nio.channels.SelectableChannel} + ** @@ -224,17 +251,25 @@ * * * - *+ *
+ *+ * Multiplexed, non-blocking I/O + *Description - * {@link java.nio.channels.SelectableChannel} *A channel that can be multiplexed {@link java.nio.channels.DatagramChannel} + *- * + * {@link java.nio.channels.DatagramChannel} *A channel to a datagram-oriented socket {@link java.nio.channels.Pipe.SinkChannel} + *- * + * {@link java.nio.channels.Pipe.SinkChannel} *The write end of a pipe {@link java.nio.channels.Pipe.SourceChannel} + *- * + * {@link java.nio.channels.Pipe.SourceChannel} *The read end of a pipe {@link java.nio.channels.ServerSocketChannel} + *- * + * {@link java.nio.channels.ServerSocketChannel} *A channel to a stream-oriented listening socket {@link java.nio.channels.SocketChannel} + *- * + * {@link java.nio.channels.SocketChannel} *A channel for a stream-oriented connecting socket {@link java.nio.channels.Selector} + *- * {@link java.nio.channels.Selector} *A multiplexor of selectable channels {@link java.nio.channels.SelectionKey} + *- * {@link java.nio.channels.SelectionKey} *A token representing the registration
of a channel * with a selector{@link java.nio.channels.Pipe} + ** {@link java.nio.channels.Pipe} *Two channels that form a unidirectional pipe - *
- * Asynchronous I/O Description {@link java.nio.channels.AsynchronousFileChannel} + ** @@ -277,7 +312,6 @@ * so that sophisticated users can take advantage of operating-system-specific * asynchronous I/O mechanisms when very high performance is required. * - *+ *
+ *+ * + * Asynchronous I/O Description - * + * {@link java.nio.channels.AsynchronousFileChannel} *An asynchronous channel for reading, writing, and manipulating a file {@link java.nio.channels.AsynchronousSocketChannel} + *- * + * {@link java.nio.channels.AsynchronousSocketChannel} *An asynchronous channel to a stream-oriented connecting socket {@link java.nio.channels.AsynchronousServerSocketChannel} + *- * + * {@link java.nio.channels.AsynchronousServerSocketChannel} *An asynchronous channel to a stream-oriented listening socket {@link java.nio.channels.CompletionHandler} + *- * + * {@link java.nio.channels.CompletionHandler} *A handler for consuming the result of an asynchronous operation {@link java.nio.channels.AsynchronousChannelGroup} + ** + * {@link java.nio.channels.AsynchronousChannelGroup} *A grouping of asynchronous channels for the purpose of resource sharing
*Unless otherwise noted, passing a {@code null} argument to a constructor * or method in any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. diff --git a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java index 9d93a710a25..80141dc8b6a 100644 --- a/jdk/src/java.base/share/classes/java/nio/charset/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/charset/package-info.java @@ -27,17 +27,19 @@ * Defines charsets, decoders, and encoders, for translating between * bytes and Unicode characters. * - *
- *
- * Class name Description {@link java.nio.charset.Charset} + *diff --git a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java index 1dd20f627c7..11f5d6e2720 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/file/attribute/package-info.java @@ -26,25 +26,41 @@ /** * Interfaces and classes providing access to file and file system attributes. * - *+ *
+ *Class name + *DescriptiPath + * - * {@link java.nio.charset.Charset} *A named mapping between characters
and bytes{@link java.nio.charset.CharsetDecoder} + *- * {@link java.nio.charset.CharsetDecoder} *Decodes bytes into characters {@link java.nio.charset.CharsetEncoder} + *- * {@link java.nio.charset.CharsetEncoder} *Encodes characters into bytes {@link java.nio.charset.CoderResult} + *- * {@link java.nio.charset.CoderResult} *Describes coder results {@link java.nio.charset.CodingErrorAction} + ** * {@link java.nio.charset.CodingErrorAction} *Describes actions to take when
coding errors are detected- *
- * Attribute views Description {@link java.nio.file.attribute.AttributeView} + ** diff --git a/jdk/src/java.base/share/classes/java/nio/package-info.java b/jdk/src/java.base/share/classes/java/nio/package-info.java index 595a21ed390..9fa17c945e0 100644 --- a/jdk/src/java.base/share/classes/java/nio/package-info.java +++ b/jdk/src/java.base/share/classes/java/nio/package-info.java @@ -62,28 +62,31 @@ * * * - *+ *
+ *+ * Attribute views + *Description - * {@link java.nio.file.attribute.AttributeView} *Can read or update non-opaque values associated with objects in a file system {@link java.nio.file.attribute.FileAttributeView} + *- * + * {@link java.nio.file.attribute.FileAttributeView} *Can read or update file attributes {@link java.nio.file.attribute.BasicFileAttributeView} + *- * + * + * {@link java.nio.file.attribute.BasicFileAttributeView} *Can read or update a basic set of file attributes {@link java.nio.file.attribute.PosixFileAttributeView} + *- * + * + * {@link java.nio.file.attribute.PosixFileAttributeView} *Can read or update POSIX defined file attributes {@link java.nio.file.attribute.DosFileAttributeView} + *- * + * + * {@link java.nio.file.attribute.DosFileAttributeView} *Can read or update FAT file attributes {@link java.nio.file.attribute.FileOwnerAttributeView} + *- * + * + * {@link java.nio.file.attribute.FileOwnerAttributeView} *Can read or update the owner of a file {@link java.nio.file.attribute.AclFileAttributeView} + *- * + * + * {@link java.nio.file.attribute.AclFileAttributeView} *Can read or update Access Control Lists {@link java.nio.file.attribute.UserDefinedFileAttributeView} + *- * + * + * {@link java.nio.file.attribute.UserDefinedFileAttributeView} *Can read or update user-defined file attributes {@link java.nio.file.attribute.FileStoreAttributeView} + ** + * {@link java.nio.file.attribute.FileStoreAttributeView} *Can read or update file system attributes - *
- * Buffers Description {@link java.nio.Buffer} + ** diff --git a/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java b/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java index 396ffeae696..004aab08f9a 100644 --- a/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java +++ b/jdk/src/java.base/share/classes/java/util/spi/CalendarNameProvider.java @@ -46,7 +46,7 @@ import java.util.Map; * Calendar}. The following are calendar-common fields and their values to be * supported for each calendar system. * - *+ *
+ *+ * Buffers + *Description - * {@link java.nio.Buffer} *Position, limit, and capacity; *
clear, flip, rewind, and mark/reset{@link java.nio.ByteBuffer} + *- * {@link java.nio.ByteBuffer} *Get/put, compact, views; allocate, wrap {@link java.nio.MappedByteBuffer} + *- * + * {@link java.nio.MappedByteBuffer} *A byte buffer mapped to a file {@link java.nio.CharBuffer} + *- * {@link java.nio.CharBuffer} *Get/put, compact; allocate, wrap {@link java.nio.DoubleBuffer} + *- * {@link java.nio.DoubleBuffer} *' ' {@link java.nio.FloatBuffer} + *- * {@link java.nio.FloatBuffer} *' ' {@link java.nio.IntBuffer} + *- * {@link java.nio.IntBuffer} *' ' {@link java.nio.LongBuffer} + *- * {@link java.nio.LongBuffer} *' ' {@link java.nio.ShortBuffer} + *- * {@link java.nio.ShortBuffer} *' ' {@link java.nio.ByteOrder} + ** {@link java.nio.ByteOrder} *Typesafe enumeration for byte orders + *
*
* *@@ -57,8 +57,8 @@ import java.util.Map; * * *- * *{@link Calendar#MONTH} - *{@link Calendar#JANUARY} to {@link Calendar#UNDECIMBER} + *{@link Calendar#MONTH} + *{@link Calendar#JANUARY} to {@link Calendar#UNDECIMBER} *Month numbering is 0-based (e.g., 0 - January, ..., 11 - * December). Some calendar systems have 13 months. Month * names need to be supported in both the formatting and @@ -67,14 +67,14 @@ import java.util.Map; * in both of the forms. *- * *{@link Calendar#DAY_OF_WEEK} - *{@link Calendar#SUNDAY} to {@link Calendar#SATURDAY} + *{@link Calendar#DAY_OF_WEEK} + *{@link Calendar#SUNDAY} to {@link Calendar#SATURDAY} *Day-of-week numbering is 1-based starting from Sunday (i.e., 1 - Sunday, * ..., 7 - Saturday). *- * * @@ -82,7 +82,7 @@ import java.util.Map; * *{@link Calendar#AM_PM} - *{@link Calendar#AM} to {@link Calendar#PM} + *{@link Calendar#AM_PM} + *{@link Calendar#AM} to {@link Calendar#PM} *0 - AM, 1 - PM *The following are calendar-specific fields and their values to be supported. * - *
+ *
*
- + - * *@@ -94,8 +94,8 @@ import java.util.Map; * * *- * @@ -104,8 +104,8 @@ import java.util.Map; *{@code "gregory"} - *{@link Calendar#ERA} + *{@code "gregory"} + *{@link Calendar#ERA} *0 *{@link java.util.GregorianCalendar#BC} (BCE) *{@link java.util.GregorianCalendar#AD} (CE) * *- * @@ -114,8 +114,8 @@ import java.util.Map; *{@code "buddhist"} - *{@link Calendar#ERA} + *{@code "buddhist"} + *{@link Calendar#ERA} *0 *BC (BCE) *B.E. (Buddhist Era) * *- * @@ -144,8 +144,8 @@ import java.util.Map; * Year representation in {@code SimpleDateFormat}. * *{@code "japanese"} - *{@link Calendar#ERA} + *{@code "japanese"} + *{@link Calendar#ERA} *0 *Seireki (Before Meiji) *- * @@ -154,8 +154,8 @@ import java.util.Map; *{@code "roc"} - *{@link Calendar#ERA} + *{@code "roc"} + *{@link Calendar#ERA} *0 *Before R.O.C. *R.O.C. * *- * From eb2e12eefd58d9d8889b84b9750021ab9aedadc2 Mon Sep 17 00:00:00 2001 From: Roger Riggs{@code "islamic"} - *{@link Calendar#ERA} + *{@code "islamic"} + *{@link Calendar#ERA} *0 *Before AH *Date: Thu, 1 Jun 2017 10:21:43 -0400 Subject: [PATCH 010/130] 8181156: html5 issues in java.base javadoc Reviewed-by: ihse, erikj --- make/CompileJavaModules.gmk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 76bdf22b950..090434a1607 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -42,8 +42,7 @@ java.activation_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS ################################################################################ -java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline \ - --doclint-format html4 +java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline java.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties java.base_CLEAN := intrinsic.properties From b45b8855a2dbf219b219321caca619836c1b66fe Mon Sep 17 00:00:00 2001 From: Mark Sheppard Date: Thu, 1 Jun 2017 17:49:34 +0100 Subject: [PATCH 011/130] 8176784: Amend HREF to technote/guides in CORBA API docs to unilinks for guides Reviewed-by: chegar, rriggs --- .../javax/rmi/PortableRemoteObject.java | 2 ++ .../org/omg/CORBA/ACTIVITY_COMPLETED.java | 6 +++--- .../org/omg/CORBA/ACTIVITY_REQUIRED.java | 6 +++--- .../classes/org/omg/CORBA/BAD_CONTEXT.java | 6 +++--- .../classes/org/omg/CORBA/BAD_INV_ORDER.java | 6 +++--- .../classes/org/omg/CORBA/BAD_OPERATION.java | 6 +++--- .../share/classes/org/omg/CORBA/BAD_PARAM.java | 9 ++++----- .../share/classes/org/omg/CORBA/BAD_QOS.java | 6 +++--- .../classes/org/omg/CORBA/BAD_TYPECODE.java | 6 +++--- .../share/classes/org/omg/CORBA/Bounds.java | 6 +++--- .../org/omg/CORBA/CODESET_INCOMPATIBLE.java | 6 +++--- .../classes/org/omg/CORBA/COMM_FAILURE.java | 10 +++++----- .../classes/org/omg/CORBA/DATA_CONVERSION.java | 10 +++++----- .../share/classes/org/omg/CORBA/FREE_MEM.java | 6 +++--- .../share/classes/org/omg/CORBA/IMP_LIMIT.java | 6 +++--- .../classes/org/omg/CORBA/INITIALIZE.java | 6 +++--- .../share/classes/org/omg/CORBA/INTERNAL.java | 10 +++++----- .../classes/org/omg/CORBA/INTF_REPOS.java | 6 +++--- .../org/omg/CORBA/INVALID_ACTIVITY.java | 6 +++--- .../org/omg/CORBA/INVALID_TRANSACTION.java | 6 +++--- .../share/classes/org/omg/CORBA/INV_FLAG.java | 6 +++--- .../share/classes/org/omg/CORBA/INV_IDENT.java | 6 +++--- .../classes/org/omg/CORBA/INV_OBJREF.java | 10 +++++----- .../classes/org/omg/CORBA/INV_POLICY.java | 6 +++--- .../share/classes/org/omg/CORBA/MARSHAL.java | 6 +++--- .../classes/org/omg/CORBA/NO_IMPLEMENT.java | 4 ++-- .../share/classes/org/omg/CORBA/NO_MEMORY.java | 6 +++--- .../classes/org/omg/CORBA/NO_PERMISSION.java | 6 +++--- .../classes/org/omg/CORBA/NO_RESOURCES.java | 6 +++--- .../classes/org/omg/CORBA/NO_RESPONSE.java | 6 +++--- .../org/omg/CORBA/OBJECT_NOT_EXIST.java | 10 +++++----- .../classes/org/omg/CORBA/OBJ_ADAPTER.java | 10 +++++----- .../share/classes/org/omg/CORBA/ORB.java | 2 ++ .../classes/org/omg/CORBA/PERSIST_STORE.java | 6 +++--- .../share/classes/org/omg/CORBA/REBIND.java | 6 +++--- .../classes/org/omg/CORBA/SystemException.java | 6 +++--- .../share/classes/org/omg/CORBA/TIMEOUT.java | 6 +++--- .../org/omg/CORBA/TRANSACTION_MODE.java | 6 +++--- .../org/omg/CORBA/TRANSACTION_REQUIRED.java | 6 +++--- .../org/omg/CORBA/TRANSACTION_ROLLEDBACK.java | 6 +++--- .../org/omg/CORBA/TRANSACTION_UNAVAILABLE.java | 6 +++--- .../share/classes/org/omg/CORBA/TRANSIENT.java | 6 +++--- .../share/classes/org/omg/CORBA/UNKNOWN.java | 10 +++++----- .../org/omg/CORBA/UnknownUserException.java | 6 +++--- .../classes/org/omg/CORBA/UserException.java | 6 +++--- .../org/omg/CORBA/WrongTransaction.java | 6 +++--- .../share/classes/org/omg/CORBA/package.html | 18 ++++++++---------- .../classes/org/omg/CosNaming/package.html | 8 +++----- .../org/omg/PortableServer/package.html | 2 +- 49 files changed, 162 insertions(+), 163 deletions(-) diff --git a/corba/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java b/corba/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java index c1a9bafdcf2..6cd0dc79cda 100644 --- a/corba/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java +++ b/corba/src/java.corba/share/classes/javax/rmi/PortableRemoteObject.java @@ -62,6 +62,8 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction; * attempts to narrow it to conform to * the given interface. If the operation is successful the result will be an * object of the specified type, otherwise an exception will be thrown. + * + * See also {@extLink rmi_iiop_guides RMI-IIOP developer's guides}.
*/ public class PortableRemoteObject { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java b/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java index 29f3a6ca734..b7334539631 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_COMPLETED.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * the Activity, or that the Activity completed in a manner other than that * originally requested. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java b/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java index bbf4297d998..1e319930a4c 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ACTIVITY_REQUIRED.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,8 @@ package org.omg.CORBA; * Activity context was necessary to perform the invoked operation, but one * was not found associated with the calling thread. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java index 7fb34ed0cce..f32f686c48f 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_CONTEXT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java index 529006df413..183042867f4 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_INV_ORDER.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java index 8f114ad805f..44ce51721aa 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_OPERATION.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java index adcb5c5f2e3..cdeee3b93c2 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_PARAM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,10 +37,9 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions - * @see meaning of - * minor codes + *See also {@extLink jidlexception documentation on Java IDL exceptions}, + * {@extLink jidlexception_minorcodes meaning of minor codes} + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java index 4f445203579..c21b30a01f8 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_QOS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ package org.omg.CORBA; * support the quality of service required by an invocation parameter that * has a quality of service semantics associated with it. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java index b9ddfbd47e2..076aea32d8f 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/BAD_TYPECODE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/Bounds.java b/corba/src/java.corba/share/classes/org/omg/CORBA/Bounds.java index 2e2fe3e946c..3c6c0231cea 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/Bounds.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/Bounds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ package org.omg.CORBA; * the legal bounds for the object that a method is trying * to access. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class Bounds extends org.omg.CORBA.UserException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java index c5d46cc05dc..5b1e465a3fd 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/CODESET_INCOMPATIBLE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,8 +29,8 @@ package org.omg.CORBA; * This exception is raised whenever meaningful communication is not possible * between client and server native code sets. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java index 400a9897c7e..b85c2671b7c 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/COMM_FAILURE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,11 +33,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section meaning - * of minor codes to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * - * @see meaning of - * minor codes + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java b/corba/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java index af206702d39..3a58ea7d5f7 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/DATA_CONVERSION.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,11 +35,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section meaning - * of minor codes to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java b/corba/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java index 43811e2f95a..6196a7c3148 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/FREE_MEM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java b/corba/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java index b2ac1c81f84..93df8e31a53 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/IMP_LIMIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,8 +36,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java index e955d8605dc..9768d9836bc 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INITIALIZE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java index 931b40d182f..bec91d6642f 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INTERNAL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,11 +33,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section meaning - * of minor codes to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes meaning of minor codes} + * to see the minor codes for this exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java index 5a9160317d6..ef06d427852 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INTF_REPOS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java index 93a29623a87..12a13f8e0dd 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_ACTIVITY.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; * suspended. It is also raised when an attempted invocation is made that * is incompatible with the Activity's current state. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java index 170dd3eb4a4..219c549de46 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INVALID_TRANSACTION.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 * */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java index c91436d0aa4..6ad485c87cc 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_FLAG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java index 24310d8bb14..167ff5f3a94 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_IDENT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java index 718a46aee7c..821ffcf101d 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_OBJREF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,11 +37,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section Minor - * Code Meanings to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java index 0f3f9f778df..5eea852c4d9 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/INV_POLICY.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class INV_POLICY extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java b/corba/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java index ce479c243ec..adec5d6f43f 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/MARSHAL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +39,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section Minor - * Code Meanings to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * * @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java index e1379a07d05..6beff5b0313 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_IMPLEMENT.java @@ -36,8 +36,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *
- * See the section Minor - * Code Meanings to see the minor codes for this exception. + * See the section {extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * * @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java index 8c63493c5ee..b88a9260de5 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_MEMORY.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java index 79f8eaa17a0..a2dadde4881 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_PERMISSION.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java index 421ea57951f..82552ad6125 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESOURCES.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java index 2384a32fd30..759986c1bed 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/NO_RESPONSE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java b/corba/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java index 9003ad08882..e9871fe31a4 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/OBJECT_NOT_EXIST.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +39,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section Minor - * Code Meanings to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java b/corba/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java index 7af0fdc6fc2..e0432a14d67 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/OBJ_ADAPTER.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,11 +34,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section Minor - * Code Meanings to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meanings} + * to see the minor codes for this exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since JDK1.2 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java index cff282b8d07..eefcfba10d2 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java @@ -184,6 +184,8 @@ import java.security.PrivilegedAction; * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, * and thereafter the ${java.home}/lib directory. * + *See also {@extLink idl_guides IDL developer's guide}.
+ * * @since JDK1.2 */ abstract public class ORB { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java index 241e33ec395..00eff183183 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/PERSIST_STORE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class PERSIST_STORE extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/REBIND.java b/corba/src/java.corba/share/classes/org/omg/CORBA/REBIND.java index f6728a0cfa8..6692b725fed 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/REBIND.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/REBIND.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * This exception is also raised if the current effective RebindPolicy has * a value of NO_RECONNECT and a connection must be reopened. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/SystemException.java b/corba/src/java.corba/share/classes/org/omg/CORBA/SystemException.java index 2f5e90652c9..fa808c61088 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/SystemException.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/SystemException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,8 +44,8 @@ import com.sun.corba.se.impl.util.SUNVMCID; * declared in signatures of the Java methods mapped from operations in * IDL interfaces. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public abstract class SystemException extends java.lang.RuntimeException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java b/corba/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java index 551768eaf52..ed4a9790130 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TIMEOUT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ package org.omg.CORBA; * specified time-to-live period has been exceeded. It is a standard system * exception because time-to-live QoS can be applied to any invocation. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @since J2SE 1.5 */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java index e9341fadcba..f4ce02cbe2a 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_MODE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,8 @@ package org.omg.CORBA; * a string describing the exception. * The OMG CORBA core 2.4 specification has details. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class TRANSACTION_MODE extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java index 53edaf5e9a5..5f4d94ebf1e 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_REQUIRED.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,8 @@ package org.omg.CORBA; * a string describing the exception. * The OMG Transaction Service specfication has details. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class TRANSACTION_REQUIRED extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java index e5aa07628ff..52e597c421d 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,8 +36,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class TRANSACTION_ROLLEDBACK extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java index 9bf6d360381..5870c44967b 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,8 @@ package org.omg.CORBA; * a string describing the exception. * The OMG CORBA core 2.4 specification has details. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class TRANSACTION_UNAVAILABLE extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java index 201a9c27b3e..fc03856d477 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/TRANSIENT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,8 +36,8 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class TRANSIENT extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java b/corba/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java index f033478551c..ba57f3e73b3 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UNKNOWN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +39,11 @@ package org.omg.CORBA; * what caused the exception, and a completion status. It may also contain * a string describing the exception. *- * See the section Minor - * Code Meanings to see the minor codes for this exception. + * See the section {@extLink jidlexception_minorcodes Minor Code Meaning} + * to see the minor codes for this exception. * - * @see documentation on - * Java IDL exceptions + *
See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class UNKNOWN extends SystemException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java b/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java index f9c8550927d..4a65b0ad7f7 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UnknownUserException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ package org.omg.CORBA; *UnknownUserException
object. This is available from the *Environment
object returned by the methodRequest.env
. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
* @see Request */ diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/UserException.java b/corba/src/java.corba/share/classes/org/omg/CORBA/UserException.java index 3e8e211d35f..fa803d74098 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/UserException.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/UserException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,8 @@ package org.omg.CORBA; * means that they need to * be declared in method signatures. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public abstract class UserException extends java.lang.Exception implements org.omg.CORBA.portable.IDLEntity { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java b/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java index 0b9fb7ae2dc..a9670d271d7 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/WrongTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,8 @@ package org.omg.CORBA; * which the client originally sent the request. * See the OMG Transaction Service Specification for details. * - * @see documentation on - * Java IDL exceptions + *See also {@extLink jidlexception documentation on Java IDL exceptions}. + *
*/ public final class WrongTransaction extends UserException { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/package.html b/corba/src/java.corba/share/classes/org/omg/CORBA/package.html index 6aa046ed3b3..d8eb9905953 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/package.html +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/package.html @@ -147,9 +147,7 @@ resolve initial object references. These are:register_initial_reference(String id, org.omg.CORBA.Object obj)
-An example that uses some of these methods is -Getting Started with Java IDL. +
An example that uses some of these methods is {@extLink idl_getting_started Getting Started with Java IDL}.
Exceptions
@@ -158,9 +156,8 @@ Java programming language. If a method is defined to throw an exception, then any code using that method must have atry
/catch
block and handle that exception when it is thrown. -The documentation on Java -IDL exceptions has more information and explains the difference between +
The documentation on {@extLink jidlexception Java IDL exceptions } +has more information and explains the difference between system exceptions and user-defined exceptions.
The following is a list of the system exceptions (which are unchecked @@ -447,8 +444,8 @@ object, whereas the
narrow
method for an interface that is abstract will take an object in the Java programming language. The helper class for a non-abstract interface that has at least one abstract base interface will provide both versions of thenarrow
method. -The Hello World -tutorial uses a
narrow
method that looks like this: +The {@extLink idl_guides Hello World tutorial} +uses a
narrow
method that looks like this:// create and initialize the ORB ORB orb = ORB.init(args, null); @@ -548,6 +545,7 @@ abstract public class AccountHelper }+Value Type Helper Classes
A helper class for a value type includes different renderings of the same methods generated for non-value type methods. The main difference @@ -861,8 +859,8 @@ ValueMember Related Documentation For overviews, guides, and a tutorial, please see:-
diff --git a/corba/src/java.corba/share/classes/org/omg/CosNaming/package.html b/corba/src/java.corba/share/classes/org/omg/CosNaming/package.html index 3e13aef2342..265485464f1 100644 --- a/corba/src/java.corba/share/classes/org/omg/CosNaming/package.html +++ b/corba/src/java.corba/share/classes/org/omg/CosNaming/package.html @@ -3,7 +3,7 @@ - @@ -41,13 +41,13 @@ - @@ -107,7 +107,7 @@ @@ -292,16 +292,16 @@ - + - + - + - +- -Java IDL home page +
- {@extLink idl_guides Java IDL tutorial page}.
+- {@extLink rmi_iiop_guides RMI-IIOP developer's guide}.
JVM Tool Interface - +- The JVM Tool Interface () - is a programming interface used by development and monitoring tools. - It provides both a way to inspect the state and + The JVM Tool Interface () + is a programming interface used by development and monitoring tools. + It provides both a way to inspect the state and to control the execution of applications running in the Java virtual machine (VM). @@ -376,21 +376,21 @@may not be available in all implementations of the Java virtual machine. -is a two-way interface. + is a two-way interface. A client of , hereafter called an agent, can be notified of - interesting occurrences through events . + interesting occurrences throughevents .- can query and control the application through many - functions , - either in response to events or + can query and control the application through many +functions , + either in response to events or independent of them. - Agents run in the same process with and communicate directly with + Agents run in the same process with and communicate directly with the virtual machine executing the application being examined. This communication is through a native interface (). The native in-process interface allows - maximal control with minimal intrusion on the part of a tool. + maximal control with minimal intrusion on the part of a tool. Typically, agents are relatively compact. They can be controlled by a separate process which implements the bulk of a tool's function without interfering with the target application's normal execution. @@ -400,12 +400,12 @@ Tools can be written directly to or indirectly through higher level interfaces. The Java Platform Debugger Architecture includes , but also - contains higher-level, out-of-process debugger interfaces. The higher-level - interfaces are more appropriate than for many tools. - For more information on the Java Platform Debugger Architecture, - see the - Java - Platform Debugger Architecture website . + contains higher-level, out-of-process debugger interfaces. The higher-level + interfaces are more appropriate thanfor many tools. + For more information on the Java Platform Debugger Architecture, + see the + Java + Platform Debugger Architecture website .@@ -424,16 +424,16 @@ - An agent is deployed in a platform specific manner but is typically the - platform equivalent of a dynamic library. On the @@ -460,7 +460,7 @@ a function is exported, at the same point during VM execution as it would have called the dynamic entry point Agent_OnUnLoad. A statically loaded agent cannot be unloaded. The Agent_OnUnload_L function will still be - called to do any other agent shutdown related tasks. + called to do any other agent shutdown related tasks. If a statically linked agent L exports a function called Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad function will be ignored. @@ -472,19 +472,19 @@ Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach function will be ignored. - +Windows operating - system, for example, an agent library is a "Dynamic Linked Library" (DLL). + An agent is deployed in a platform specific manner but is typically the + platform equivalent of a dynamic library. On theWindows operating + system, for example, an agent library is a "Dynamic Linked Library" (DLL). On theSolaris Operating Environment, an agent library is a shared object (.so
file). An agent may be started at VM startup by specifying the agent library name using acommand line option . - Some implementations may support a mechanism to+ Some implementations may support a mechanism to start agents in the livephase . The details of how this is initiated are implementation specific.The term "command-line option" is used below to mean options supplied in the @@ -557,29 +557,29 @@JavaVMInitArgs
argument to theJNI_CreateJavaVM
function of the JNI Invocation API. - One of the two following - command-line options is used on VM startup to + One of the two following + command-line options is used on VM startup to properly load and run agents. - These arguments identify the library containing + These arguments identify the library containing the agent as well as an options - string to be passed in at startup. + string to be passed in at startup.
-agentlib:
<agent-lib-name>=
<options>- @@ -494,10 +494,10 @@ Typically, the <agent-lib-name> is expanded to an operating system specific file name. The <options> will be passed to the agent on start-up. - For example, if the option -
-agentlib:foo=opt1,opt2
is specified, the VM will attempt to + For example, if the option +-agentlib:foo=opt1,opt2
is specified, the VM will attempt to load the shared libraryfoo.dll
from the systemPATH
- underWindows orlibfoo.so
from the + underWindows orlibfoo.so
from theLD_LIBRARY_PATH
under theSolaris operating environment. If the agent library is statically linked into the executable @@ -510,8 +510,8 @@ to load the library. No library name expansion will occur. The <options> will be passed to the agent on start-up. - For example, if the option --agentpath:c:\myLibs\foo.dll=opt1,opt2
is specified, the VM will attempt to + For example, if the option +-agentpath:c:\myLibs\foo.dll=opt1,opt2
is specified, the VM will attempt to load the shared libraryc:\myLibs\foo.dll
. If the agent library is statically linked into the executable then no actual loading takes place. @@ -523,13 +523,13 @@ in the library will be invoked. If the agent library is statically linked into the executable then the system will attempt to invoke theAgent_OnLoad_<agent-lib-name>
entry point where - <agent-lib-name> is the basename of the + <agent-lib-name> is the basename of the agent. In the above example-agentpath:c:\myLibs\foo.dll=opt1,opt2
, the system will attempt to find and call theAgent_OnLoad_foo
start-up routine. Libraries loaded with-agentlib:
or-agentpath:
will be searched for JNI native method implementations to facilitate the - use of Java programming language code in tools, as is needed for + use of Java programming language code in tools, as is needed forbytecode instrumentation . The agent libraries will be searched after all other libraries have been @@ -537,11 +537,11 @@ implementations of non-agent methods can use theNativeMethodBind event ). - These switches do the above and nothing more - they do not change the - state of the VM or. No command line options are needed - to enable + These switches do the above and nothing more - they do not change the + state of the VM or . No command line options are needed + to enable or aspects of , this is handled programmatically - by the use of + by the use of capabilities .or Agent_OnAttach
for statically linked agents will be invoked. - Exactly one call to a start-up function is made per agent. + Exactly one call to a start-up function is made per agent. Agent_OnAttach_L
If an agent is started during the - +OnLoad
phase then its agent library must export a start-up function with the following prototype:-JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved) Or for a statically linked agent named 'L':-JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved) - The VM will start the agent by calling this function. + The VM will start the agent by calling this function. It will be called early enough in VM initialization that:
- -
system properties may be set before they have been used in the start-up of the VM- the full set of +
- the full set of
capabilities is still available (note that capabilities that configure the VM - may only be available at this time--see the + may only be available at this time--see theCapability function section )- no bytecodes have executed
- no classes have been loaded
@@ -588,13 +588,13 @@ Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved) The VM will call theAgent_OnLoad
orAgent_OnLoad_<agent-lib-name>
function with - <options> as the second argument - + <options> as the second argument - that is, using the command-line option examples, -"opt1,opt2"
will be passed to thechar *options
+"opt1,opt2"
will be passed to thechar *options
argument ofAgent_OnLoad
. Theoptions
argument is encoded as amodified UTF-8 string. - If =<options> is not specified, + If =<options> is not specified, a zero length string is passed tooptions
. The lifespan of theoptions
string is theAgent_OnLoad
orAgent_OnLoad_<agent-lib-name>
@@ -602,26 +602,26 @@ Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved) be copied. The period between whenAgent_OnLoad
is called and when it returns is called the OnLoad phase. - Since the VM is not initialized during the OnLoad + Since the VM is not initialized during the OnLoadphase , - the set of allowed operations + the set of allowed operations insideAgent_OnLoad
is restricted (see the function descriptions for the - functionality available at this time). - The agent can safely process the options and set - event callbacks with. Once - the VM initialization event is received - (that is, the VMInit + functionality available at this time). + The agent can safely process the options and set + event callbacks with. Once + the VM initialization event is received + (that is, the VMInit callback is invoked), the agent can complete its initialization.Early startup is required so that agents can set the desired capabilities, many of which must be set before the VM is initialized. - In JVMDI, the -Xdebug command-line option provided - very coarse-grain control of capabilities. + In JVMDI, the -Xdebug command-line option provided + very coarse-grain control of capabilities. JVMPI implementations use various tricks to provide a single "JVMPI on" switch. - No reasonable command-line + No reasonable command-line option could provide the fine-grain of control required to balance needed capabilities vs - performance impact. + performance impact. Early startup is also needed so that agents can control the execution environment - modifying the file system and system properties to install their functionality. @@ -631,75 +631,75 @@ Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved) Agent_OnLoad_<agent-lib-name>
is used to indicate an error. Any value other than zero indicates an error and causes termination of the VM.- A VM may support a mechanism that allows agents to be started in the VM during the live + A VM may support a mechanism that allows agents to be started in the VM during the live phase . The details of how this is supported, - are implementation specific. For example, a tool may use some platform specific mechanism, + are implementation specific. For example, a tool may use some platform specific mechanism, or implementation specific API, to attach to the running VM, and request it start a given agent. If an agent is started during the live phase then its agent library - must export a start-up function + must export a start-up function with the following prototype:-JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm, char *options, void *reserved) Or for a statically linked agent named 'L':-JNIEXPORT jint JNICALL +JNIEXPORT jint JNICALL Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved) - - The VM will start the agent by calling this function. + + The VM will start the agent by calling this function. It will be called in the context of a thread that is attached to the VM. The first argument <vm> is the Java VM. The <options> argument is the startup options provided to the agent. <options> is encoded as amodified UTF-8 string. - If startup options were not provided, a zero length string is passed to -options
. The lifespan of theoptions
string is the + If startup options were not provided, a zero length string is passed to +options
. The lifespan of theoptions
string is theAgent_OnAttach
orAgent_OnAttach_<agent-lib-name>
call. If needed beyond this time the string or parts of the string must be copied. - Note that somecapabilities + Note that somecapabilities may not be available in the live phase. TheAgent_OnAttach
orAgent_OnAttach_<agent-lib-name >
function initializes the agent and returns a value - to the VM to indicate if an error occurred. Any value other than zero indicates an error. - An error does not cause the VM to terminate. Instead the VM ignores the error, or takes - some implementation specific action -- for example it might print an error to standard error, + to the VM to indicate if an error occurred. Any value other than zero indicates an error. + An error does not cause the VM to terminate. Instead the VM ignores the error, or takes + some implementation specific action -- for example it might print an error to standard error, or record the error in a system log.- The library may optionally export a + The library may optionally export a shutdown function with the following prototype: @@ -709,17 +709,17 @@ Agent_OnUnload_L(JavaVM *vm) or simply VMs launched deep within scripts, a-JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm) Or for a statically linked agent named 'L':-JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Agent_OnUnload_L(JavaVM *vm) This function will be called by the VM when the library is about to be unloaded. The library will be unloaded (unless it is statically linked into the - executable) and this function will be called if some platform specific + executable) and this function will be called if some platform specific mechanism causes the unload (an unload mechanism is not specified in this document) - or the library is (in effect) unloaded by the termination of the VM whether through + or the library is (in effect) unloaded by the termination of the VM whether through normal termination or VM failure, including start-up failure. Uncontrolled shutdown is, of couse, an exception to this rule. - Note the distinction between this function and the + Note the distinction between this function and theVM Death event : for the VM Death event - to be sent, the VM must have run at least to the point of initialization and a valid + to be sent, the VM must have run at least to the point of initialization and a validenvironment must exist which has set a callback for VMDeath and enabled the event. None of these are required for Agent_OnUnload
orAgent_OnUnload_<agent-lib-name>
and this function is also called if the library is unloaded for other reasons. - In the case that a VM Death event is sent, it will be sent before this + In the case that a VM Death event is sent, it will be sent before this function is called (assuming this function is called due to VM termination). This function can be used to clean-up resources allocated by the agent.JAVA_TOOL_OPTIONS
variable is provided so that agents may be launched in these cases. - Platforms which support environment variables or other named strings, may support the -JAVA_TOOL_OPTIONS
variable. This variable will be broken into options at white-space - boundaries. White-space characters include space, tab, carriage-return, new-line, - vertical-tab, and form-feed. Sequences of white-space characters are considered - equivalent to a single white-space character. No white-space is included in the options + Platforms which support environment variables or other named strings, may support the +JAVA_TOOL_OPTIONS
variable. This variable will be broken into options at white-space + boundaries. White-space characters include space, tab, carriage-return, new-line, + vertical-tab, and form-feed. Sequences of white-space characters are considered + equivalent to a single white-space character. No white-space is included in the options unless quoted. Quoting is as follows:-
-- All characters enclosed between a pair of single quote marks (''), except a single +
- All characters enclosed between a pair of single quote marks (''), except a single quote, are quoted.
- Double quote characters have no special meaning inside a pair of single quote marks.
-- All characters enclosed between a pair of double quote marks (""), except a double +
- All characters enclosed between a pair of double quote marks (""), except a double quote, are quoted.
- Single quote characters have no special meaning inside a pair of double quote marks.
- A quoted part can start or end anywhere in the variable.
@@ -727,24 +727,24 @@ Agent_OnUnload_L(JavaVM *vm) the option like any other character and do not mark white-space boundaries.- The pair of quote marks is not included in the option.
JNI_CreateJavaVM
(in the JNI Invocation API) will prepend these options to the options supplied - in itsJavaVMInitArgs
argument. Platforms may disable this feature in cases where security is - a concern; for example, the Reference Implementation disables this feature on Unix systems when - the effective user or group ID differs from the real ID. - This feature is intended to support the initialization of tools -- specifically including the - launching of native or Java programming language agents. Multiple tools may wish to use this - feature, so the variable should not be overwritten, instead, options should be appended to - the variable. Note that since the variable is processed at the time of the JNI Invocation +JNI_CreateJavaVM
(in the JNI Invocation API) will prepend these options to the options supplied + in itsJavaVMInitArgs
argument. Platforms may disable this feature in cases where security is + a concern; for example, the Reference Implementation disables this feature on Unix systems when + the effective user or group ID differs from the real ID. + This feature is intended to support the initialization of tools -- specifically including the + launching of native or Java programming language agents. Multiple tools may wish to use this + feature, so the variable should not be overwritten, instead, options should be appended to + the variable. Note that since the variable is processed at the time of the JNI Invocation API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled.The specification supports the use of multiple simultaneous agents. - Each agent has its own environment. + Each agent has its own environment. That is, the state is separate for each agent - changes to one environment do not affect the - others. The state of a + others. The state of a environment includes: - Although their
- @@ -752,7 +752,7 @@ Agent_OnUnload_L(JavaVM *vm)
the event callbacks the capabilities the memory allocation/deallocation hooks state + Although their state is separate, agents inspect and modify the shared state of the VM, they also share the native environment in which they execute. As such, an agent can perturb the results of other agents or cause them @@ -761,30 +761,30 @@ Agent_OnUnload_L(JavaVM *vm) of preventing destructive interactions between agents. Techniques to reduce the likelihood of these occurrences are beyond the scope of this document. - An agent creates a environment - by passing a version - as the interface ID to the JNI Invocation API function - + An agent creates a environment + by passing a version + as the interface ID to the JNI Invocation API function + . See GetEnv
Accessing - for more details on the creation and use of + for more details on the creation and use ofFunctions environments. - Typically, environments are created by calling GetEnv
from + Typically,environments are created by calling GetEnv
from. Agent_OnLoad
This interface does not include some events that one might expect in an interface with profiling support. Some examples include object allocation events and full speed - method enter and exit events. The interface instead provides support for + method enter and exit events. The interface instead provides support for bytecode instrumentation, the ability to alter the Java virtual machine bytecode instructions which comprise the target program. Typically, these alterations are to add "events" to the code of a method - for example, to add, at the beginning of a method, - a call to MyProfiler.methodEntered()
. + a call toMyProfiler.methodEntered()
. Since the changes are purely additive, they do not modify application state or behavior. Because the inserted agent code is standard bytecodes, the VM can run at full speed, - optimizing not only the target program but also the instrumentation. If the + optimizing not only the target program but also the instrumentation. If the instrumentation does not involve switching from bytecode execution, no expensive state transitions are needed. The result is high performance events. This approach also provides complete control to the agent: instrumentation can be @@ -792,14 +792,14 @@ Agent_OnUnload_L(JavaVM *vm) can be conditional. Instrumentation can run entirely in Java programming language code or can call into the native agent. Instrumentation can simply maintain counters or can statistically sample events. - + Instrumentation can be inserted in one of three ways:- + The class modification functionality provided in this interface is intended to provide a mechanism for instrumentation (the
- Static Instrumentation: The class file is instrumented before it is loaded into the VM - for example, by creating a duplicate directory of
*.class
files which have been modified to add the instrumentation. - This method is extremely awkward and, in general, an agent cannot know + This method is extremely awkward and, in general, an agent cannot know the origin of the class files which will be loaded.- @@ -817,21 +817,21 @@ Agent_OnUnload_L(JavaVM *vm)
function. Classes can be modified multiple times and can be returned to their original state. - The mechanism allows instrumentation which changes during the + The mechanism allows instrumentation which changes during the course of execution. event and the function) and, during development, for fix-and-continue debugging (the function). - - Care must be taken to avoid perturbing dependencies, especially when + + Care must be taken to avoid perturbing dependencies, especially when instrumenting core classes. For example, an approach to getting notification - of every object allocation is to instrument the constructor on + of every object allocation is to instrument the constructor on Object
. Assuming that the constructor is initially empty, the constructor could be changed to:@@ -839,15 +839,15 @@ Agent_OnUnload_L(JavaVM *vm) MyProfiler.allocationTracker(this); } - However, if this change was made using the + However, if this change was made using the- event then this might impact a typical VM as follows: + event then this might impact a typical VM as follows: the first created object will call the constructor causing a class load of MyProfiler
; which will then cause object creation, and sinceMyProfiler
isn't loaded yet, infinite recursion; resulting in a stack overflow. A refinement of this would be to delay invoking the tracking method until a safe time. For - example,trackAllocations
could be set in the + example,trackAllocations
could be set in the handler for theVMInit
event.static boolean trackAllocations = false; @@ -881,17 +881,17 @@ Agent_OnUnload_L(JavaVM *vm) uses modified UTF-8 to encode character strings. This is the same encoding used by JNI. - Modified UTF-8 differs - from standard UTF-8 in the representation of supplementary characters + Modified UTF-8 differs + from standard UTF-8 in the representation of supplementary characters and of the null character. See the - + Modified UTF-8 Strings section of the JNI specification for details.Since this interface provides access to the state of applications running in the - Java virtual machine; + Java virtual machine; terminology refers to the Java platform and not the native platform (unless stated otherwise). For example: @@ -903,20 +903,20 @@ Agent_OnUnload_L(JavaVM *vm)
Sun, Sun Microsystems, the Sun logo, Java, and JVM - are trademarks or registered trademarks of Oracle + are trademarks or registered trademarks of Oracle and/or its affiliates, in the U.S. and other countries.- Native code accesses @@ -980,12 +980,12 @@ jvmtiEnv *jvmti;features - by calling functions. + Native code accesses features + by calling functions. Access to functions is by use of an interface pointer - in the same manner as - Java + in the same manner as + Java Native Interface (JNI) functions are accessed. - Theinterface pointer is called the + The interface pointer is called the environment pointer. An environment pointer is a pointer to an environment and has @@ -924,8 +924,8 @@ Agent_OnUnload_L(JavaVM *vm) An environment has information about its connection. The first value in the environment is a pointer to the function table. The function table is an array of pointers to functions. - Every function pointer is at a predefined offset inside the - array. + Every function pointer is at a predefined offset inside the + array. When used from the C language: double indirection is used to access the functions; @@ -945,7 +945,7 @@ jvmtiEnv *jvmti; ... jvmtiError err = jvmti->GetLoadedClasses(&class_count, &classes); - Unless otherwise stated, all examples and declarations in this + Unless otherwise stated, all examples and declarations in this specification use the C language. A environment can be obtained through the JNI Invocation API @@ -955,24 +955,24 @@ jvmtiEnv *jvmti; ... (*jvm)->GetEnv(jvm, &jvmti, JVMTI_VERSION_1_0); - Each call to GetEnv
+ Each call toGetEnv
creates a newconnection and thus - a new environment. + a new environment. The version
argument ofGetEnv
must be aversion. The returned environment may have a different version than the requested version but the returned environment must be compatible. - GetEnv
will returnJNI_EVERSION
if a +GetEnv
will returnJNI_EVERSION
if a compatible version is not available, ifis not supported or is not supported in the current VM configuration. Other interfaces may be added for creating environments in specific contexts. Each environment has its own state (for example, - desired events , -event handling functions , and -capabilities ). - An environment is released with -. + desired events , +event handling functions , and +capabilities ). + An environment is released with +. Thus, unlike JNI which has one environment per thread, environments work across threads and are created dynamically. functions always return an error code via the -function return value. + function return value. Some functions can return additional - values through pointers provided by the calling function. + values through pointers provided by the calling function. In some cases, functions allocate memory that your program must explicitly deallocate. This is indicated in the individual - function descriptions. Empty lists, arrays, sequences, etc are + function descriptions. Empty lists, arrays, sequences, etc are returned as NULL
. In the event that thefunction encounters @@ -996,26 +996,26 @@ jvmtiEnv *jvmti; - @@ -1035,21 +1035,21 @@ jvmtiEnv *jvmti;functions identify objects with JNI references + functions identify objects with JNI references ( and ) and their derivatives ( and ). - References passed to - functions can be either global or local, but they must be - strong references. All references returned by functions are - local references--these local references are created + References passed to + functions can be either global or local, but they must be + strong references. All references returned by functions are + local references--these local references are created during the call. - Local references are a resource that must be managed (see the - - JNI Documentation ). + Local references are a resource that must be managed (see the ++ JNI Documentation ). When threads return from native code all local references are freed. Note that some threads, including typical agent threads, will never return from native code. - A thread is ensured the ability to create sixteen local + A thread is ensured the ability to create sixteen local references without the need for any explicit management. For threads executing a limited number ofcalls before returning from native code - (for example, threads processing events), + (for example, threads processing events), it may be determined that no explicit management is needed. However, long running agent threads will need explicit @@ -1023,7 +1023,7 @@ jvmtiEnv *jvmti; PushLocalFrame
andPopLocalFrame
. Conversely, to preserve references beyond the return from native code, they must be converted to global references. - These rules do not apply toand + These rules do not apply to and as they are not s. - functions never throw exceptions; error conditions are - communicated via the + functions never throw exceptions; error conditions are + communicated via the function return value . - Any existing exception state is preserved across a call to a + Any existing exception state is preserved across a call to afunction. See the - Java Exceptions section of the JNI specification for information on handling exceptions.- These functions provide for the allocation and deallocation of + These functions provide for the allocation and deallocation of memory used by @@ -2425,16 +2425,16 @@ jvmtiEnv *jvmti;functionality and can be used to provide working memory for agents. Memory managed by is not compatible with other memory @@ -1059,7 +1059,7 @@ jvmtiEnv *jvmti; Allocate - Allocate an area of memory through the @@ -1097,9 +1097,9 @@ jvmtiEnv *jvmti;allocator. + Allocate an area of memory through the allocator. The allocated memory should be freed with . Deallocate - Deallocate mem
using theallocator. + Deallocate mem
using theallocator. This function should - be used to deallocate any memory allocated and returned + be used to deallocate any memory allocated and returned by a function (including memory allocated with ). All allocated memory must be deallocated @@ -1143,60 +1143,60 @@ jvmtiEnv *jvmti; - Why not alive?
-
- New.
-- Terminated (
Terminated ( ) JVMTI_THREAD_STATE_TERMINATED
- Alive (
Alive ( ) JVMTI_THREAD_STATE_ALIVE
- Suspended?
-
- Suspended (
Suspended ( ) JVMTI_THREAD_STATE_SUSPENDED
- Not suspended
- Interrupted?
-
- Interrupted (
Interrupted ( ) JVMTI_THREAD_STATE_INTERRUPTED
- Not interrupted.
- In native?
-
- In native code (
In native code ( ) JVMTI_THREAD_STATE_IN_NATIVE
- In Java programming language code
- What alive state?
-
- The answers are represented by the following bit vector. + The answers are represented by the following bit vector.- Runnable (
-Runnable ( ) JVMTI_THREAD_STATE_RUNNABLE
- Blocked (
-Blocked ( ) JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
- Waiting (
Waiting ( ) JVMTI_THREAD_STATE_WAITING
- Timed wait?
-
- Indefinite (
-Indefinite ( JVMTI_THREAD_STATE_WAITING_INDEFINITELY
- Timed (
Timed ( ) JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT
- Why waiting?
@@ -1210,7 +1210,7 @@ jvmtiEnv *jvmti;-
- Object.wait (
-Object.wait ( ) JVMTI_THREAD_STATE_IN_OBJECT_WAIT
- LockSupport.park (
-LockSupport.park ( ) JVMTI_THREAD_STATE_PARKED
- Sleeping (
Sleeping ( ) JVMTI_THREAD_STATE_SLEEPING
Thread is alive. Zero if thread is new (not started) or terminated. @@ -1223,7 +1223,7 @@ jvmtiEnv *jvmti; Thread is waiting to enter a synchronization block/method or, - after an Object.wait()
, waiting to re-enter a + after anObject.wait()
, waiting to re-enter a synchronization block/method.@@ -1250,8 +1250,8 @@ jvmtiEnv *jvmti; Thread suspended. @@ -1313,7 +1313,7 @@ jvmtiEnv *jvmti; Rules There can be no more than one answer to a question, although there can be no - answer (because the answer is unknown, does not apply, or none of the answers is + answer (because the answer is unknown, does not apply, or none of the answers is correct). An answer is set only when the enclosing answers match. That is, no more than one ofjava.lang.Thread.suspend()
- or asuspend function - (such as ) + or a suspend function + (such as ) has been called on the thread. If this bit is set, the other bits refer to the thread state before suspension. @@ -1322,32 +1322,32 @@ jvmtiEnv *jvmti;
can be set (aJVMTI_THREAD_STATE_WAITING
J2SE compliant implementation will always set - one of these ifJVMTI_THREAD_STATE_ALIVE
is set). - And if any of these are set, the enclosing answer -JVMTI_THREAD_STATE_ALIVE
is set. + one of these ifJVMTI_THREAD_STATE_ALIVE
is set). + And if any of these are set, the enclosing answer +JVMTI_THREAD_STATE_ALIVE
is set. No more than one ofcan be set (a
JVMTI_THREAD_STATE_WAITING_INDEFINITELY
JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT
J2SE compliant implementation will always set - one of these ifJVMTI_THREAD_STATE_WAITING
is set). - And if either is set, the enclosing answers -JVMTI_THREAD_STATE_ALIVE
and -JVMTI_THREAD_STATE_WAITING
are set. + one of these ifJVMTI_THREAD_STATE_WAITING
is set). + And if either is set, the enclosing answers +JVMTI_THREAD_STATE_ALIVE
and +JVMTI_THREAD_STATE_WAITING
are set. No more than one of- can be set. And if any of these is set, the enclosing answers -
JVMTI_THREAD_STATE_IN_OBJECT_WAIT
JVMTI_THREAD_STATE_PARKED
JVMTI_THREAD_STATE_SLEEPING
JVMTI_THREAD_STATE_ALIVE
and -JVMTI_THREAD_STATE_WAITING
are set. + can be set. And if any of these is set, the enclosing answers +JVMTI_THREAD_STATE_ALIVE
and +JVMTI_THREAD_STATE_WAITING
are set. Also, ifJVMTI_THREAD_STATE_SLEEPING
is set, thenJVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT
is set. - If a state A is implemented using the mechanism of - state B then it is state A which + If a state A is implemented using the mechanism of + state B then it is state A which is returned by this function. For example, ifThread.sleep(long)
is implemented usingObject.wait(long)
@@ -1364,16 +1364,16 @@ jvmtiEnv *jvmti; And finally,JVMTI_THREAD_STATE_TERMINATED
cannot be set unless -JVMTI_THREAD_STATE_ALIVE
is not set. +JVMTI_THREAD_STATE_ALIVE
is not set. The thread state representation is designed for extension in future versions of the specification; thread state values should be used accordingly, that is - they should not be used as ordinals. + they should not be used as ordinals. Most queries can be made by testing a single bit, if use in a switch statement is desired, the state bits should be masked with the interesting bits. - All bits not defined above are reserved for future use. + All bits not defined above are reserved for future use. A VM, compliant to the current specification, must set reserved bits to zero. - An agent should ignore reserved bits -- + An agent should ignore reserved bits -- they should not be assumed to be zero and thus should not be included in comparisons. Examples @@ -1390,8 +1390,8 @@ jvmtiEnv *jvmti; The state of a thread at aObject.wait(3000)
would be:- JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING + - JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + + JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING + + JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + JVMTI_THREAD_STATE_MONITOR_WAITING The state of a thread suspended while runnable would be: @@ -1423,7 +1423,7 @@ jvmtiEnv *jvmti; To distinguish timed from untimedObject.wait
:- if (state & JVMTI_THREAD_STATE_IN_OBJECT_WAIT) { + if (state & JVMTI_THREAD_STATE_IN_OBJECT_WAIT) { if (state & JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT) { printf("in Object.wait(long timeout)\n"); } else { @@ -1436,7 +1436,7 @@ jvmtiEnv *jvmti; The thread state represented by java.lang.Thread.State
returned fromjava.lang.Thread.getState()
is a subset of the - information returned from this function. + information returned from this function. The correspondingjava.lang.Thread.State
can be determined by using the provided conversion masks. For example, this returns the name of thejava.lang.Thread.State
thread state: @@ -1466,7 +1466,7 @@ jvmtiEnv *jvmti;- The thread to query. + The thread to query. @@ -1484,15 +1484,15 @@ jvmtiEnv *jvmti;Get Current Thread - Get the current thread. + Get the current thread. The current thread is the Java programming language thread which has called the function. The function may return NULL
in the start phase if thecapability is enabled and the can_generate_early_vmstart
java.lang.Thread
class has not been initialized yet. - Note that mostfunctions that take a thread - as an argument will accept NULL
to mean + Note that mostfunctions that take a thread + as an argument will accept NULL
to mean the current thread.new @@ -1516,12 +1516,12 @@ jvmtiEnv *jvmti; Get all live threads. The threads are Java programming language threads; that is, threads that are attached to the VM. - A thread is live ifjava.lang.Thread.isAlive()
+ A thread is live ifjava.lang.Thread.isAlive()
would returntrue
, that is, the thread has been started and has not yet died. The universe of threads is determined by the context of theenvironment, which typically is all threads attached to the VM. - Note that this includes agent threads + Note that this includes agent threads (see ). jvmdi @@ -1549,8 +1549,8 @@ jvmtiEnv *jvmti;Suspend Thread - Suspend the specified thread. If the calling thread is specified, - this function will not return until some other thread calls + Suspend the specified thread. If the calling thread is specified, + this function will not return until some other thread calls . If the thread is currently suspended, this function does nothing and returns an error. @@ -1563,7 +1563,7 @@ jvmtiEnv *jvmti; - The thread to suspend. + The thread to suspend. @@ -1592,22 +1592,22 @@ jvmtiEnv *jvmti; The threads are Java programming language threads; native threads which are not attached to the VM are not Java programming language threads. - A thread is live ifjava.lang.Thread.isAlive()
+ A thread is live ifjava.lang.Thread.isAlive()
would returntrue
, that is, the thread has been started and has not yet died. - The universe of threads is determined + The universe of threads is determined by the context of theenvironment, which, typically, is all threads attached to the VM, - except critical VM internal threads and agent threads + except critical VM internal threads and agent threads (see ). - If the calling thread is specified, + If the calling thread is specified, all other threads are suspended first then the caller thread is suspended - - this function will not return until some other thread calls + this function will not return until some other thread calls . The list of actually - suspended threads is returned in + suspended threads is returned in . Suspension is as defined in . @@ -1662,13 +1662,13 @@ jvmtiEnv *jvmti; Suspend Thread List - Suspend the - threads specified in the - array. + Suspend the + threads specified in the + array. Threads may be resumed with or . - If the calling thread is specified in the + If the calling thread is specified in the array, this function will not return until some other thread resumes it. Errors encountered in the suspension of a thread @@ -1696,11 +1696,11 @@ jvmtiEnv *jvmti; jvmtiError - An agent supplied array of + An agent supplied array of -elements. On return, filled with the error code for the suspend of the corresponding thread. - The error code will be + The error code will be if the thread was suspended by this call. Possible error codes are those specified @@ -1715,12 +1715,12 @@ jvmtiEnv *jvmti; @@ -1748,12 +1748,12 @@ jvmtiEnv *jvmti; Resume Thread - Resume a suspended thread. + Resume a suspended thread. Any threads currently suspended through a suspend function (eg. - ) + ) or java.lang.Thread.suspend()
- will resume execution; + will resume execution; all other threads are unaffected.jvmdi @@ -1740,7 +1740,7 @@ jvmtiEnv *jvmti; Thread was not suspended.- The state of the thread has been modified, and is now inconsistent. + The state of the thread has been modified, and is now inconsistent. Resume Thread List - Resume the @@ -1777,11 +1777,11 @@ jvmtiEnv *jvmti;- threads specified in the - array. + Resume the + threads specified in the + array. Any thread suspended through a suspend function (eg. - ) + ) or java.lang.Thread.suspend()
will resume execution.jvmtiError - An agent supplied array of + An agent supplied array of elements. On return, filled with the error code for the resume of the corresponding thread. - The error code will be + The error code will be if the thread was suspended by this call. Possible error codes are those specified @@ -1796,9 +1796,9 @@ jvmtiEnv *jvmti; Stop Thread - Send the specified asynchronous exception to the specified thread + Send the specified asynchronous exception to the specified thread (similar to java.lang.Thread.stop
). - Normally, this function is used to kill the specified thread with an + Normally, this function is used to kill the specified thread with an instance of the exceptionThreadDeath
.jvmdi @@ -1883,7 +1883,7 @@ jvmtiEnv *jvmti;- Get thread information. The fields of the structure + Get thread information. The fields of the structure are filled in with details of the specified thread. jvmdi @@ -1910,8 +1910,8 @@ jvmtiEnv *jvmti;Get Owned Monitor Info - Get information about the monitors owned by the - specified thread. + Get information about the monitors owned by the + specified thread. jvmdiClone @@ -1943,7 +1943,7 @@ jvmtiEnv *jvmti; Get Owned Monitor Stack Depth Info -@@ -1954,18 +1954,18 @@ jvmtiEnv *jvmti; - The stack depth. Corresponds to the stack depth used in the + The stack depth. Corresponds to the stack depth used in the Stack Frame functions . That is, zero is the current frame, one is the frame which - called the current frame. And it is negative one if the - implementation cannot determine the stack depth (e.g., for + called the current frame. And it is negative one if the + implementation cannot determine the stack depth (e.g., for monitors acquired by JNIMonitorEnter
).- Get information about the monitors owned by the - specified thread and the depth of the stack frame which locked them. + Get information about the monitors owned by the + specified thread and the depth of the stack frame which locked them. new @@ -2000,7 +2000,7 @@ jvmtiEnv *jvmti; Get Current Contended Monitor - Get the object, if any, whose monitor the specified thread is waiting to + Get the object, if any, whose monitor the specified thread is waiting to enter or waiting to regain through java.lang.Object.wait
.jvmdi @@ -2057,7 +2057,7 @@ jvmtiEnv *jvmti;- The @@ -2071,13 +2071,13 @@ jvmtiEnv *jvmti; The parameterarg
parameter passed to + Thearg
parameter passed to. is forwarded on to the start function (specified with) as its single argument. - This function allows the creation of agent threads - for handling communication with another process or for handling events - without the need to load a special subclass of java.lang.Thread
or - implementer ofjava.lang.Runnable
. + This function allows the creation of agent threads + for handling communication with another process or for handling events + without the need to load a special subclass ofjava.lang.Thread
or + implementer ofjava.lang.Runnable
. Instead, the created thread can run entirely in native code. However, the created thread does require a newly created instance - ofjava.lang.Thread
(referenced by the argumentthread
) to + ofjava.lang.Thread
(referenced by the argumentthread
) to which it will be associated. The thread object can be created with JNI calls. @@ -2105,14 +2105,14 @@ jvmtiEnv *jvmti; added to the thread group and the thread is not seen on queries of the thread group at either the Java programming language orlevels. - The thread is not visible to Java programming language queries but is - included in queries (for example, + The thread is not visible to Java programming language queries but is + included in queries (for example, and ). Upon execution of proc
, the new thread will be attached to the - VM -- see the JNI documentation on -Attaching to the VM .jvmdiClone @@ -2152,8 +2152,8 @@ jvmtiEnv *jvmti;- - is less than + + is less than or greater than @@ -2169,7 +2169,7 @@ jvmtiEnv *jvmti; This value is NULL
unless set with this function. Agents can allocate memory in which they store thread specific information. By setting thread-local storage it can then be - accessed with + accessed with. This function is called by the agent to set the value of the @@ -2188,10 +2188,10 @@ jvmtiEnv *jvmti; - +- value is set to -NULL
+ + value is set to +NULL
The value to be entered into the thread-local storage. @@ -2205,7 +2205,7 @@ jvmtiEnv *jvmti;Get Thread Local Storage Called by the agent to get the value of the thread-local - storage. + storage. jvmpi @@ -2220,10 +2220,10 @@ jvmtiEnv *jvmti; - Pointer through which the value of the thread local + Pointer through which the value of the thread local storage is returned. If thread-local storage has not been set with - @@ -2294,8 +2294,8 @@ jvmtiEnv *jvmti;the returned + the returned pointer is NULL
.- Get information about the thread group. The fields of the - structure + Get information about the thread group. The fields of the + structure are filled in with details of the specified thread group. jvmdi @@ -2312,7 +2312,7 @@ jvmtiEnv *jvmti;jvmtiThreadGroupInfo On return, filled with information describing the specified - thread group. + thread group. @@ -2373,15 +2373,15 @@ jvmtiEnv *jvmti; Stack frames are as described in, - That is, they correspond to method - invocations (including native methods) but do not correspond to platform native or + That is, they correspond to method + invocations (including native methods) but do not correspond to platform native or VM internal frames. A implementation may use method invocations to launch a thread and the corresponding frames may be included in the stack as presented by these functions -- that is, there may be frames shown deeper than main()
andrun()
. - However this presentation must be consistent across allfunctionality which + However this presentation must be consistent across all functionality which uses stack frames or stack depth. jvmtiFrameInfo - On return, this agent allocated buffer is filled - with stack frame information. + On return, this agent allocated buffer is filled + with stack frame information. @@ -2445,7 +2445,7 @@ jvmtiEnv *jvmti; - On return, the number of records filled into + On return, the number of records filled into frame_buffer
. - This will be + This will be min(max_frame_count
, stackDepth).Get information about the stack of a thread. If is less than the depth of the stack, - the topmost frames are returned, + the topmost frames are returned, otherwise the entire stack is returned. The topmost frames, those most recently invoked, are at the beginning of the returned buffer. @@ -2457,23 +2457,23 @@ jvmtiFrameInfo frames[5]; jint count; jvmtiError err; -err = (*jvmti)->GetStackTrace(jvmti, aThread, 0, 5, +err = (*jvmti)->GetStackTrace(jvmti, aThread, 0, 5, frames, &count); if (err == JVMTI_ERROR_NONE && count >= 1) { char *methodName; - err = (*jvmti)->GetMethodName(jvmti, frames[0].method, + err = (*jvmti)->GetMethodName(jvmti, frames[0].method, &methodName, NULL, NULL); if (err == JVMTI_ERROR_NONE) { printf("Executing method: %s", methodName); } } - + check example code. Theneed not be suspended - to call this function. + to call this function. The function can be used to map locations to line numbers. Note that @@ -2492,15 +2492,15 @@ if (err == JVMTI_ERROR_NONE && count >= 1) { - Begin retrieving frames at this depth. - If non-negative, count from the current frame, - the first frame retrieved is at depth @@ -2516,17 +2516,17 @@ if (err == JVMTI_ERROR_NONE && count >= 1) {start_depth
. + Begin retrieving frames at this depth. + If non-negative, count from the current frame, + the first frame retrieved is at depthstart_depth
. For example, if zero, start from the current frame; if one, start from the caller of the current frame; if two, start from the caller of the caller of the current frame; and so on. If negative, count from below the oldest frame, - the first frame retrieved is at depth stackDepth+ start_depth
, - where stackDepth is the count of frames on the stack. + the first frame retrieved is at depth stackDepth+ start_depth
, + where stackDepth is the count of frames on the stack. For example, if negative one, only the oldest frame is retrieved; if negative two, start from the frame called by the oldest frame.jvmtiFrameInfo - On return, this agent allocated buffer is filled - with stack frame information. + On return, this agent allocated buffer is filled + with stack frame information. On return, points to the number of records filled in. - For non-negative @@ -2546,23 +2546,23 @@ if (err == JVMTI_ERROR_NONE && count >= 1) { Get information about the stacks of all live threads (includingstart_depth
, this will be + For non-negativestart_depth
, this will be min(max_frame_count
, stackDepth- start_depth
). - For negativestart_depth
, this will be + For negativestart_depth
, this will be min(max_frame_count
,-start_depth
).agent threads ). Ifis less than the depth of a stack, - the topmost frames are returned for that thread, + the topmost frames are returned for that thread, otherwise the entire stack is returned. The topmost frames, those most recently invoked, are at the beginning of the returned buffer. - All stacks are collected simultaneously, that is, no changes will occur to the + All stacks are collected simultaneously, that is, no changes will occur to the thread state or stacks between the sampling of one thread and the next. The threads need not be suspended. - + jvmtiStackInfo *stack_info; jint thread_count; int ti; jvmtiError err; -err = (*jvmti)->GetAllStackTraces(jvmti, MAX_FRAMES, &stack_info, &thread_count); +err = (*jvmti)->GetAllStackTraces(jvmti, MAX_FRAMES, &stack_info, &thread_count); if (err != JVMTI_ERROR_NONE) { - ... + ... } for (ti = 0; ti < thread_count; ++ti) { jvmtiStackInfo *infop = &stack_info[ti]; @@ -2577,9 +2577,9 @@ for (ti = 0; ti < thread_count; ++ti) { } } /* this one Deallocate call frees all data allocated by GetAllStackTraces */ -err = (*jvmti)->Deallocate(jvmti, stack_info); +err = (*jvmti)->Deallocate(jvmti, stack_info); -+ check example code. @@ -2599,12 +2599,12 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);jvmtiStackInfo - On return, this buffer is filled - with stack information for each thread. - The number of @@ -2625,11 +2625,11 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);records is determined + On return, this buffer is filled + with stack information for each thread. + The number of records is determined by . - Note that this buffer is allocated to include the + Note that this buffer is allocated to include the buffers pointed to by . These buffers must not be separately deallocated. Get information about the stacks of the supplied threads. If is less than the depth of a stack, - the topmost frames are returned for that thread, + the topmost frames are returned for that thread, otherwise the entire stack is returned. The topmost frames, those most recently invoked, are at the beginning of the returned buffer. - All stacks are collected simultaneously, that is, no changes will occur to the + All stacks are collected simultaneously, that is, no changes will occur to the thread state or stacks between the sampling one thread and the next. The threads need not be suspended. @@ -2667,12 +2667,12 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); jvmtiStackInfo - On return, this buffer is filled - with stack information for each thread. - The number of @@ -2703,8 +2703,8 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);records is determined + On return, this buffer is filled + with stack information for each thread. + The number of records is determined by . - Note that this buffer is allocated to include the + Note that this buffer is allocated to include the buffers pointed to by . These buffers must not be separately deallocated. @@ -2713,7 +2713,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); - If false
, -+ If false
, +must be false
.Return the stack showing - model of the stack; + model of the stack; otherwise, show the internal representation of the stack with inlined and optimized methods missing. If the virtual machine is using the Java Virtual Machine Specification stack model @@ -2734,9 +2734,9 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); The agent passes in a buffer - large enough to hold @@ -2788,27 +2788,27 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);max_count
records of + large enough to holdmax_count
records of. This buffer must be - pre-allocated by the agent. + pre-allocated by the agent. Pop Frame Pop the current frame of thread
's stack. - Popping a frame takes you to the previous frame. - When the thread is resumed, the execution + Popping a frame takes you to the previous frame. + When the thread is resumed, the execution state of the thread is reset to the state immediately before the called method was invoked. That is (usingterminology): Note however, that any changes to the arguments, which - occurred in the called method, remain; - when execution continues, the first instruction to - execute will be the invoke. + occurred in the called method, remain; + when execution continues, the first instruction to + execute will be the invoke. - Between calling
- the current frame is discarded as the previous frame becomes the current one
- the operand stack is restored--the argument values are added back - and if the invoke was not
invokestatic
, + and if the invoke was notinvokestatic
,objectref
is added back as well- the Java virtual machine PC is restored to the opcode of the invoke instruction
PopFrame
and resuming the - thread the state of the stack is undefined. - To pop frames beyond the first, + Between callingPopFrame
and resuming the + thread the state of the stack is undefined. + To pop frames beyond the first, these three steps must be repeated:- A lock acquired by calling the called method - (if it is a
- suspend the thread via an event (step, breakpoint, ...)
@@ -2816,11 +2816,11 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);- resume the thread
synchronized
method) + A lock acquired by calling the called method + (if it is asynchronized
method) and locks acquired by enteringsynchronized
- blocks within the called method are released. - Note: this does not apply to native locks or + blocks within the called method are released. + Note: this does not apply to native locks orjava.util.concurrent.locks
locks. Finally blocks are not executed. @@ -2829,7 +2829,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); The specified thread must be suspended (which implies it cannot be the current thread). - Both the called method and calling method must be non-native Java programming + Both the called method and calling method must be non-native Java programming language methods. Noevents are generated by this function. @@ -2892,7 +2892,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); - On return, points to the index of the currently + On return, points to the index of the currently executing instruction. Is set to -1
if the frame is executing a native method. @@ -2906,11 +2906,11 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);Notify Frame Pop - When the frame that is currently at + When the frame that is currently at is popped from the stack, generate a - event. See the + event. See the event for details. - Only frames corresponding to non-native Java programming language + Only frames corresponding to non-native Java programming language methods can receive notification. The specified thread must either be the current thread @@ -2922,7 +2922,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); - + The thread of the frame for which the frame pop event will be generated. @@ -2935,7 +2935,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);- + -The frame at @@ -2954,7 +2954,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); The method which will return early is referred to as the called method. The called method is the current method (as defined by -depth
is executing a native method.) + ) for the specified thread at the time the function is called. @@ -2962,17 +2962,17 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); The return occurs when execution of Java programming language code is resumed on this thread. Between calling one of these functions and resumption - of thread execution, the state of the stack is undefined. + of thread execution, the state of the stack is undefined. - No further instructions are executed in the called method. + No further instructions are executed in the called method. Specifically, finally blocks are not executed. Note: this can cause inconsistent states in the application. - A lock acquired by calling the called method - (if it is a synchronized
method) + A lock acquired by calling the called method + (if it is asynchronized
method) and locks acquired by enteringsynchronized
- blocks within the called method are released. - Note: this does not apply to native locks or + blocks within the called method are released. + Note: this does not apply to native locks orjava.util.concurrent.locks
locks. Events, such as, @@ -2989,7 +2989,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); This function can be used to return from a method whose result type is Object
- or a subclass ofObject
. + or a subclass ofObject
.new @@ -3005,7 +3005,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); - The return value for the called frame. + The return value for the called frame. An object or @@ -3017,12 +3017,12 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Or the implementation is unable to provide this functionality on this frame.NULL
.- The result type of the called method is not + + The result type of the called method is not -Object
or a subclass ofObject
.- The supplied is not compatible with the + + The supplied is not compatible with the result type of the called method. @@ -3039,8 +3039,8 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); -This function can be used to return from a method whose result type is int
,short
, -char
,byte
, or -boolean
. +char
,byte
, or +boolean
.new @@ -3067,10 +3067,10 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Or the implementation is unable to provide this functionality on this frame. - The result type of the called method is not + + The result type of the called method is not int
,short
, -char
,byte
, or +char
,byte
, orboolean
.@@ -3113,7 +3113,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Or the implementation is unable to provide this functionality on this frame. -+ The result type of the called method is not long
.@@ -3156,7 +3156,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Or the implementation is unable to provide this functionality on this frame. -+ The result type of the called method is not float
.@@ -3197,7 +3197,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Attempted to return early from a frame corresponding to a native method. Or the implementation is unable to provide this functionality on this frame. -+ The result type of the called method is not double
.@@ -3234,8 +3234,8 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Or the implementation is unable to provide this functionality on this frame. -- The called method has a result type. + + The called method has a result type. Thread was not the current thread and was not suspended. @@ -3254,12 +3254,12 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Functionality includes the ability to view the objects in the heap and to tag these objects. - + A tag is a value associated with an object. Tags are explicitly set by the agent using the - +function or by - callback functions such as . + callback functions such as . Tags are local to the environment; that is, the tags of one environment are not visible in another. @@ -3267,10 +3267,10 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Tags are jlong
values which can be used simply to mark an object or to store a pointer to more detailed information. Objects which have not been tagged have a - tag of zero. + tag of zero. Setting a tag to zero makes the object untagged.Heap functions which iterate through the heap and recursively follow object references use agent supplied callback functions @@ -3278,7 +3278,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); These heap callback functions must adhere to the following restrictions -- These callbacks must not use JNI functions. - These callbacks must not use -functions except + These callbacks must not use functions except callback safe functions which specifically allow such use (see the raw monitor, memory management, and environment local storage functions). @@ -3289,7 +3289,7 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); be invoked at a time. The Heap Filter Flags can be used to prevent reporting - based on the tag status of an object or its class. + based on the tag status of an object or its class. If no flags are set (the jint
is zero), objects will not be filtered out. @@ -3310,43 +3310,43 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); The Heap Visit Control Flags are returned by the heap callbacks - and can be used to abort the iteration. For the -Heap - Reference Callback , it can also be used + and can be used to abort the iteration. For the +Heap + Reference Callback , it can also be used to prune the graph of traversed references (JVMTI_VISIT_OBJECTS
is not set). -- The Heap Reference Enumeration is provided by the - If we are visiting an object and if this callback - was initiated by +, + was initiated by , traverse the references of this object. Otherwise ignored. - Abort the iteration. Ignore all other bits. Heap - Reference Callback and -Primitive Field - Callback to + The Heap Reference Enumeration is provided by the +Heap + Reference Callback and +Primitive Field + Callback to describe the kind of reference being reported. -Reference from an object to its class. - +Reference from an object to the value of one of its instance fields. @@ -3361,11 +3361,11 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);Reference from a class to its protection domain. - +- Reference from a class to one of its interfaces. + Reference from a class to one of its interfaces. Note: interfaces are defined via a constant pool reference, - so the referenced interfaces may also be reported with a + so the referenced interfaces may also be reported with a JVMTI_HEAP_REFERENCE_CONSTANT_POOL
reference kind.@@ -3375,10 +3375,10 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Reference from a class to a resolved entry in the constant pool. - Reference from a class to its superclass. + Reference from a class to its superclass. A callback is not sent if the superclass is java.lang.Object
. Note: loaded classes define superclasses via a constant pool - reference, so the referenced superclass may also be reported with + reference, so the referenced superclass may also be reported with aJVMTI_HEAP_REFERENCE_CONSTANT_POOL
reference kind.@@ -3408,88 +3408,88 @@ err = (*jvmti)->Deallocate(jvmti, stack_info); Definitions for the single character type descriptors of primitive types. - 'Z' - Java programming language +boolean
- JNIjboolean
-'B' - Java programming language +byte
- JNIjbyte
-'C' - Java programming language +char
- JNIjchar
-'S' - Java programming language +short
- JNIjshort
-'I' - Java programming language +int
- JNIjint
-'J' - Java programming language +long
- JNIjlong
-'F' - Java programming language +float
- JNIjfloat
-'D' - Java programming language +double
- JNIjdouble
-- Reference information returned for - and + Reference information returned for + and references. - - For , the - referrer object is not a class or an inteface. - In this case, index
is the index of the field - in the class of the referrer object. ++ For , the + referrer object is not a class or an inteface. + In this case, index
is the index of the field + in the class of the referrer object. This class is referred to below as C. For, the referrer object is a class (referred to below as C) or an interface (referred to below as I). - In this case, index
is the index of the field in + In this case,index
is the index of the field in that class or interface. - If the referrer object is not an interface, then the field - indices are determined as follows: + If the referrer object is not an interface, then the field + indices are determined as follows:- If the referrer object is an interface, then the field + If the referrer object is an interface, then the field indices are determined as follows:
- make a list of all the fields in C and its - superclasses, starting with all the fields in + superclasses, starting with all the fields in
-java.lang.Object
and ending with all the fields in C.- Within this list, put +
- Within this list, put the fields for a given class in the order returned by
-. - Assign the fields in this list indices - n, n+1, ..., in order, where n +
- Assign the fields in this list indices + n, n+1, ..., in order, where n is the count of the fields in all the interfaces - implemented by C. - Note that C implements all interfaces + implemented by C. + Note that C implements all interfaces directly implemented by its superclasses; as well as all superinterfaces of these interfaces.
-
@@ -3522,7 +3522,7 @@ class C2 extends C1 implements I2 { Assume that- make a list of the fields directly declared in +
- make a list of the fields directly declared in I.
-- Within this list, put +
- Within this list, put the fields in the order returned by
-. - Assign the fields in this list indices - n, n+1, ..., in order, where n +
- Assign the fields in this list indices + n, n+1, ..., in order, where n is the count of the fields in all the superinterfaces of I.
called on C1
returns the fields ofC1
in the - order: a, b; and that the fields ofC2
are + order: a, b; and that the fields ofC2
are returned in the order: q, r. An instance of classC1
will have the following field indices: @@ -3569,7 +3569,7 @@ class C2 extends C1 implements I2 { The count of the fields in the interfaces implemented byC2
is three (n=3):p
ofI0
, -x
ofI1
andy
ofI2
+x
ofI1
andy
ofI2
(an interface ofC2
). Note that the fieldp
ofI0
is only included once. @@ -3611,7 +3611,7 @@ class C2 extends C1 implements I2 { The classC2
will have the same field indices. Note that a field may have a different index depending on the object that is viewing it -- for example field "a" above. - Note also: not all field indices may be visible from the + Note also: not all field indices may be visible from the callbacks, but all indices are shown for illustrative purposes. The interfaceI1
will have the @@ -3631,46 +3631,46 @@ class C2 extends C1 implements I2 {- - Reference information returned for + Reference information returned for references. - + The array index. - - Reference information returned for + Reference information returned for references. - - The index into the constant pool of the class. See the description in + + The index into the constant pool of the class. See the description in . - - Reference information returned for + Reference information returned for references. @@ -3688,7 +3688,7 @@ class C2 extends C1 implements I2 { - The depth of the frame. + The depth of the frame. @@ -3711,11 +3711,11 @@ class C2 extends C1 implements I2 { - - Reference information returned for + Reference information returned for references. @@ -3733,7 +3733,7 @@ class C2 extends C1 implements I2 { - The depth of the frame. + The depth of the frame. @@ -3744,8 +3744,8 @@ class C2 extends C1 implements I2 { - Reference information returned for other references. @@ -3800,8 +3800,8 @@ class C2 extends C1 implements I2 { - The information returned about referrers. @@ -3809,50 +3809,50 @@ class C2 extends C1 implements I2 { jvmtiHeapReferenceInfoField -- The referrer information for - + + The referrer information for + and references. jvmtiHeapReferenceInfoArray -- The referrer information for + + The referrer information for For references. jvmtiHeapReferenceInfoConstantPool -- The referrer information for + + The referrer information for For references. jvmtiHeapReferenceInfoStackLocal -- The referrer information for + + The referrer information for For references. jvmtiHeapReferenceInfoJniLocal -- The referrer information for + + The referrer information for For references. jvmtiHeapReferenceInfoReserved -+ reserved for future use. @@ -4033,10 +4033,10 @@ class C2 extends C1 implements I2 { + @@ -3860,22 +3860,22 @@ class C2 extends C1 implements I2 { The callback to be called to describe an - object in the heap. Used by the + object in the heap. Used by the -function, ignored by the function. + jvmtiHeapReferenceCallback The callback to be called to describe an - object reference. Used by the + object reference. Used by the -function, ignored by the function. + jvmtiPrimitiveFieldCallback @@ -3884,7 +3884,7 @@ class C2 extends C1 implements I2 { The callback to be called to describe a primitive field. -+ jvmtiArrayPrimitiveValueCallback @@ -3893,7 +3893,7 @@ class C2 extends C1 implements I2 { The callback to be called to describe an array of primitive values. -+ jvmtiStringPrimitiveValueCallback @@ -3901,7 +3901,7 @@ class C2 extends C1 implements I2 {The callback to be called to describe a String value. -+ jvmtiReservedCallback @@ -3909,7 +3909,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3917,7 +3917,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3925,7 +3925,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3933,7 +3933,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3941,7 +3941,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3949,7 +3949,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3957,7 +3957,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3965,7 +3965,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3973,7 +3973,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3981,7 +3981,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -+ jvmtiReservedCallback @@ -3989,7 +3989,7 @@ class C2 extends C1 implements I2 {Reserved for future use.. -- The tag of the class of object (zero if the class is not tagged). - If the object represents a runtime class, - the @@ -4051,7 +4051,7 @@ class C2 extends C1 implements I2 {class_tag
is the tag - associated withjava.lang.Class
+ The tag of the class of object (zero if the class is not tagged). + If the object represents a runtime class, + theclass_tag
is the tag + associated withjava.lang.Class
(zero ifjava.lang.Class
is not tagged).The object tag value, or zero if the object is not tagged. To set the tag value to be associated with the object - the agent sets the @@ -4063,17 +4063,17 @@ class C2 extends C1 implements I2 {jlong
pointed to by the parameter. + the agent sets thejlong
pointed to by the parameter.- The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. - +Heap Reference Callback - Agent supplied callback function. + Agent supplied callback function. Describes a reference from an object or the VM (the referrer) to another object (the referree) or a heap root to a referree. @@ -4097,12 +4097,12 @@ class C2 extends C1 implements I2 { jvmtiHeapReferenceInfo - Details about the reference. + Details about the reference. Set when the reference_kind is, , , - , + , , or . Otherwise NULL
. @@ -4111,9 +4111,9 @@ class C2 extends C1 implements I2 {- The tag of the class of referree object (zero if the class is not tagged). - If the referree object represents a runtime class, - the @@ -4131,14 +4131,14 @@ class C2 extends C1 implements I2 {class_tag
is the tag + The tag of the class of referree object (zero if the class is not tagged). + If the referree object represents a runtime class, + theclass_tag
is the tag associated withjava.lang.Class
(zero ifjava.lang.Class
is not tagged).- Size of the referree object (in bytes). + Size of the referree object (in bytes). See . - Points to the referree object tag value, or zero if the object is not + Points to the referree object tag value, or zero if the object is not tagged. To set the tag value to be associated with the object the agent sets the jlong
pointed to by the parameter. @@ -4147,14 +4147,14 @@ class C2 extends C1 implements I2 {- Points to the tag of the referrer object, or + Points to the tag of the referrer object, or points to the zero if the referrer - object is not tagged. + object is not tagged. @@ -4167,7 +4167,7 @@ class C2 extends C1 implements I2 {NULL
if the referrer in not an object (that is, this callback is reporting a heap root). To set the tag value to be associated with the referrer object the agent sets thejlong
pointed to by the parameter. - If this callback is reporting a reference from an object to itself, + If this callback is reporting a reference from an object to itself,referrer_tag_ptr == tag_ptr
.- The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. @@ -4177,7 +4177,7 @@ class C2 extends C1 implements I2 {Primitive Field Callback - Agent supplied callback function which + Agent supplied callback function which describes a primitive field of an object (the object). A primitive field is a field whose type is a primitive type. This callback will describe a static field if the object is a class, @@ -4195,7 +4195,7 @@ class C2 extends C1 implements I2 { jvmtiHeapReferenceKind - The kind of field -- instance or static ( @@ -4210,17 +4210,17 @@ class C2 extends C1 implements I2 {or + The kind of field -- instance or static ( or ). - The tag of the class of the object (zero if the class is not tagged). - If the object represents a runtime class, the - object_class_tag
is the tag - associated withjava.lang.Class
+ The tag of the class of the object (zero if the class is not tagged). + If the object represents a runtime class, the +object_class_tag
is the tag + associated withjava.lang.Class
(zero ifjava.lang.Class
is not tagged).- Points to the tag of the object, or zero if the object is not + Points to the tag of the object, or zero if the object is not tagged. To set the tag value to be associated with the object the agent sets the jlong
pointed to by the parameter. @@ -4241,7 +4241,7 @@ class C2 extends C1 implements I2 {- The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. @@ -4251,7 +4251,7 @@ class C2 extends C1 implements I2 {Array Primitive Value Callback - Agent supplied callback function. + Agent supplied callback function. Describes the values in an array of a primitive type. This function should return a bit vector of the desired @@ -4266,20 +4266,20 @@ class C2 extends C1 implements I2 { - The tag of the class of the array object (zero if the class is not tagged). + The tag of the class of the array object (zero if the class is not tagged). - Size of the array (in bytes). + Size of the array (in bytes). See . - Points to the tag of the array object, or zero if the object is not + Points to the tag of the array object, or zero if the object is not tagged. To set the tag value to be associated with the object the agent sets the jlong
pointed to by the parameter. @@ -4307,7 +4307,7 @@ class C2 extends C1 implements I2 {- The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. @@ -4317,7 +4317,7 @@ class C2 extends C1 implements I2 {String Primitive Value Callback - Agent supplied callback function. + Agent supplied callback function. Describes the value of a java.lang.String. This function should return a bit vector of the desired @@ -4332,21 +4332,21 @@ class C2 extends C1 implements I2 { - The tag of the class of the String class (zero if the class is not tagged). + The tag of the class of the String class (zero if the class is not tagged). Is this needed? - Size of the string (in bytes). + Size of the string (in bytes). See . - Points to the tag of the String object, or zero if the object is not + Points to the tag of the String object, or zero if the object is not tagged. To set the tag value to be associated with the object the agent sets the jlong
pointed to by the parameter. @@ -4361,15 +4361,15 @@ class C2 extends C1 implements I2 {- The length of the string. - The length is equal to the number of 16-bit Unicode + The length of the string. + The length is equal to the number of 16-bit Unicode characters in the string. - The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. @@ -4388,27 +4388,27 @@ class C2 extends C1 implements I2 {Follow References -- This function initiates a traversal over the objects that are + + This function initiates a traversal over the objects that are directly and indirectly reachable from the specified object or, - if initial_object
is not specified, all objects + ifinitial_object
is not specified, all objects reachable from the heap roots. - The heap root are the set of system classes, - JNI globals, references from thread stacks, and other objects used as roots - for the purposes of garbage collection. + The heap root are the set of system classes, + JNI globals, references from thread stacks, and other objects used as roots + for the purposes of garbage collection. This function operates by traversing the reference graph. Let A, B, ... represent objects. When a reference from A to B is traversed, - when a reference from a heap root to B is traversed, - or when B is specified as the, + when a reference from a heap root to B is traversed, + or when B is specified as the , then B is said to be visited. - A reference from A to B is not traversed until A + A reference from A to B is not traversed until A is visited. References are reported in the same order that the references are traversed. - Object references are reported by invoking the agent supplied + Object references are reported by invoking the agent supplied callback function . - In a reference from A to B, A is known + In a reference from A to B, A is known as the referrer and B as the referree. The callback is invoked exactly once for each reference from a referrer; this is true even if there are reference cycles or multiple paths to @@ -4416,10 +4416,10 @@ class C2 extends C1 implements I2 { There may be more than one reference between a referrer and a referree, each reference is reported. These references may be distinguished by examining the - and - reference_kind
parameters of the reference_info
callback. @@ -4456,10 +4456,10 @@ class C2 extends C1 implements I2 { whether the callback will be invoked, it does not influence which objects are visited nor does it influence whether other callbacks will be invoked. - However, the + However, the visit control flags returned by- do determine if the objects referenced by the + do determine if the objects referenced by the current object as visited. The heap filter flags andprovided as parameters to this function @@ -4468,7 +4468,7 @@ class C2 extends C1 implements I2 { For example, if the only callback that was set is and klass
is set to the array of bytes class, then only arrays of byte will be - reported. + reported. The table below summarizes this:@@ -4547,22 +4547,22 @@ class C2 extends C1 implements I2 { During the execution of this function the state of the heap does not change: no objects are allocated, no objects are - garbage collected, and the state of objects (including - held values) does not change. - As a result, threads executing Java + garbage collected, and the state of objects (including + held values) does not change. + As a result, threads executing Java programming language code, threads attempting to resume the - execution of Java programming language code, and threads + execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled.
new - + @@ -4623,12 +4623,12 @@ class C2 extends C1 implements I2 { - This bit vector of + This bit vector of heap filter flags . restricts the objects for which the callback function is called. This applies to both the object and primitive callbacks. @@ -4575,7 +4575,7 @@ class C2 extends C1 implements I2 { class- Callbacks are only reported when the object is an instance of + Callbacks are only reported when the object is an instance of this class. Objects which are instances of a subclass of klass
are not reported. @@ -4599,14 +4599,14 @@ class C2 extends C1 implements I2 {Structure defining the set of callback functions. - +NULL
is passed as the user supplied data- User supplied data to be passed to the callback. + User supplied data to be passed to the callback. Iterate Through Heap -- Initiate an iteration over all objects in the heap. - This includes both reachable and + + Initiate an iteration over all objects in the heap. + This includes both reachable and unreachable objects. Objects are visited in no particular order. - Heap objects are reported by invoking the agent supplied + Heap objects are reported by invoking the agent supplied callback function . References between objects are not reported. If only reachable objects are desired, or if object reference information @@ -4642,7 +4642,7 @@ class C2 extends C1 implements I2 { . A primitive field is reported after the object with that field is visited; - it is reported by invoking the agent supplied + it is reported by invoking the agent supplied callback function . @@ -4660,7 +4660,7 @@ class C2 extends C1 implements I2 { For example, if the only callback that was set is and klass
is set to the array of bytes class, then only arrays of byte will be - reported. The table below summarizes this (contrast this with + reported. The table below summarizes this (contrast this with): @@ -4739,11 +4739,11 @@ class C2 extends C1 implements I2 { During the execution of this function the state of the heap does not change: no objects are allocated, no objects are - garbage collected, and the state of objects (including - held values) does not change. - As a result, threads executing Java + garbage collected, and the state of objects (including + held values) does not change. + As a result, threads executing Java programming language code, threads attempting to resume the - execution of Java programming language code, and threads + execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled.
new @@ -4754,7 +4754,7 @@ class C2 extends C1 implements I2 {- This bit vector of + This bit vector of heap filter flags . restricts the objects for which the callback function is called. This applies to both the object and primitive callbacks. @@ -4766,7 +4766,7 @@ class C2 extends C1 implements I2 {callbacks are not limited to instances of a particular class - Callbacks are only reported when the object is an instance of + Callbacks are only reported when the object is an instance of this class. Objects which are instances of a subclass of klass
are not reported. @@ -4781,14 +4781,14 @@ class C2 extends C1 implements I2 {Structure defining the set callback functions. - +NULL
is passed as the user supplied data- User supplied data to be passed to the callback. + User supplied data to be passed to the callback. @@ -4803,7 +4803,7 @@ class C2 extends C1 implements I2 {Get Tag Retrieve the tag associated with an object. - The tag is a long value typically used to store a + The tag is a long value typically used to store a unique identifier or pointer to object information. The tag is set with - -. @@ -4824,7 +4824,7 @@ class C2 extends C1 implements I2 { - On return, the referenced long is set to the value + On return, the referenced long is set to the value of the tag. @@ -4837,7 +4837,7 @@ class C2 extends C1 implements I2 {Set Tag Set the tag associated with an object. - The tag is a long value typically used to store a + The tag is a long value typically used to store a unique identifier or pointer to object information. The tag is visible with . @@ -4895,7 +4895,7 @@ class C2 extends C1 implements I2 { - Return the number of objects with any of the tags + Return the number of objects with any of the tags in @@ -4905,7 +4905,7 @@ class C2 extends C1 implements I2 {. this information is not returned - Returns the array of objects with any of the tags + Returns the array of objects with any of the tags in @@ -4936,13 +4936,13 @@ class C2 extends C1 implements I2 { This function does not return until the garbage collection is finished. - Although garbage collection is as complete - as possible there is no guarantee that all + Although garbage collection is as complete + as possible there is no guarantee that all. - events will have been - sent by the time that this function - returns. In particular, an object may be - prevented from being freed because it + events will have been + sent by the time that this function + returns. In particular, an object may be + prevented from being freed because it is awaiting finalization. new @@ -4960,7 +4960,7 @@ class C2 extends C1 implements I2 {- These functions and data types were introduced in the original + These functions and data types were introduced in the original version 1.0 and have been superseded by more powerful and flexible versions @@ -4970,7 +4970,7 @@ class C2 extends C1 implements I2 {
- - Allow access to primitive values (the value of Strings, arrays, + Allow access to primitive values (the value of Strings, arrays, and primitive fields)
@@ -5034,13 +5034,13 @@ class C2 extends C1 implements I2 {Reference from an object to its class. - +Reference from an object to the value of one of its instance fields. For references of this kind the referrer_index
parameter to thejvmtiObjectReferenceCallback is the index of the - the instance field. The index is based on the order of all the + the instance field. The index is based on the order of all the object's fields. This includes all fields of the directly declared static and instance fields in the class, and includes all fields (both public and private) fields declared in superclasses and superinterfaces. @@ -5063,7 +5063,7 @@ class C2 extends C1 implements I2 {Reference from a class to its protection domain. - +Reference from a class to one of its interfaces. @@ -5072,7 +5072,7 @@ class C2 extends C1 implements I2 { For references of this kind thereferrer_index
parameter to thejvmtiObjectReferenceCallback is the index of the - the static field. The index is based on the order of all the + the static field. The index is based on the order of all the object's fields. This includes all fields of the directly declared static and instance fields in the class, and includes all fields (both public and private) fields declared in superclasses and superinterfaces. @@ -5095,11 +5095,11 @@ class C2 extends C1 implements I2 {- Continue the iteration. + Continue the iteration. If this is a reference iteration, follow the references of this object. - +- Continue the iteration. + Continue the iteration. If this is a reference iteration, ignore the references of this object. @@ -5125,9 +5125,9 @@ class C2 extends C1 implements I2 { - The tag of the class of object (zero if the class is not tagged). - If the object represents a runtime class, - the @@ -5138,60 +5138,6 @@ class C2 extends C1 implements I2 { Size of the object (in bytes). Seeclass_tag
is the tag + The tag of the class of object (zero if the class is not tagged). + If the object represents a runtime class, + theclass_tag
is the tag associated withjava.lang.Class
(zero ifjava.lang.Class
is not tagged).. - - The object tag value, or zero if the object is not tagged. - To set the tag value to be associated with the object - the agent sets the - - -jlong
pointed to by the parameter. -- - The user supplied data that was passed into the iteration function. - - - - - -- + + +jvmtiIterationControl -Heap Root Object Callback -- Agent supplied callback function. - Describes (but does not pass in) an object that is a root for the purposes - of garbage collection. - - Return value should be -JVMTI_ITERATION_CONTINUE
to continue iteration, -JVMTI_ITERATION_IGNORE
to continue iteration without pursuing - references from referree object orJVMTI_ITERATION_ABORT
to stop iteration. - - See theheap callback - function restrictions . -- - -jvmtiHeapRootKind -- The kind of heap root. - - - -- - The tag of the class of object (zero if the class is not tagged). - If the object represents a runtime class, the - - -class_tag
is the tag - associated withjava.lang.Class
- (zero ifjava.lang.Class
is not tagged). -- - Size of the object (in bytes). See -. - @@ -5203,22 +5149,76 @@ class C2 extends C1 implements I2 { - The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. + jvmtiIterationControl +Heap Root Object Callback ++ Agent supplied callback function. + Describes (but does not pass in) an object that is a root for the purposes + of garbage collection. + + Return value should be +JVMTI_ITERATION_CONTINUE
to continue iteration, +JVMTI_ITERATION_IGNORE
to continue iteration without pursuing + references from referree object orJVMTI_ITERATION_ABORT
to stop iteration. + + See theheap callback + function restrictions . ++ + +jvmtiHeapRootKind ++ The kind of heap root. + + + ++ + The tag of the class of object (zero if the class is not tagged). + If the object represents a runtime class, the + + +class_tag
is the tag + associated withjava.lang.Class
+ (zero ifjava.lang.Class
is not tagged). ++ + Size of the object (in bytes). See + + +. + + + The object tag value, or zero if the object is not tagged. + To set the tag value to be associated with the object + the agent sets the + + +jlong
pointed to by the parameter. ++ + The user supplied data that was passed into the iteration function. + + +jvmtiIterationControl Stack Reference Object Callback Agent supplied callback function. - Describes (but does not pass in) an object on the stack that is a root for + Describes (but does not pass in) an object on the stack that is a root for the purposes of garbage collection. Return value should be JVMTI_ITERATION_CONTINUE
to continue iteration, -JVMTI_ITERATION_IGNORE
to continue iteration without pursuing +JVMTI_ITERATION_IGNORE
to continue iteration without pursuing references from referree object orJVMTI_ITERATION_ABORT
to stop iteration. See theheap callback @@ -5235,9 +5235,9 @@ class C2 extends C1 implements I2 { - The tag of the class of object (zero if the class is not tagged). - If the object represents a runtime class, the @@ -5264,7 +5264,7 @@ class C2 extends C1 implements I2 {class_tag
is the tag - associated withjava.lang.Class
+ The tag of the class of object (zero if the class is not tagged). + If the object represents a runtime class, theclass_tag
is the tag + associated withjava.lang.Class
(zero ifjava.lang.Class
is not tagged).- The depth of the frame. + The depth of the frame. @@ -5282,7 +5282,7 @@ class C2 extends C1 implements I2 {- The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. @@ -5292,12 +5292,12 @@ class C2 extends C1 implements I2 {jvmtiIterationControl Object Reference Callback - Agent supplied callback function. + Agent supplied callback function. Describes a reference from an object (the referrer) to another object (the referree). Return value should be JVMTI_ITERATION_CONTINUE
to continue iteration, -JVMTI_ITERATION_IGNORE
to continue iteration without pursuing +JVMTI_ITERATION_IGNORE
to continue iteration without pursuing references from referree object orJVMTI_ITERATION_ABORT
to stop iteration. See theheap callback @@ -5313,24 +5313,24 @@ class C2 extends C1 implements I2 { ) + and an error (- The tag of the class of referree object (zero if the class is not tagged). + The tag of the class of referree object (zero if the class is not tagged). If the referree object represents a runtime class, - the class_tag
is the tag - associated withjava.lang.Class
+ theclass_tag
is the tag + associated withjava.lang.Class
(zero ifjava.lang.Class
is not tagged).- Size of the referree object (in bytes). + Size of the referree object (in bytes). See . - The referree object tag value, or zero if the object is not + The referree object tag value, or zero if the object is not tagged. To set the tag value to be associated with the object the agent sets the jlong
pointed to by the parameter. @@ -5345,11 +5345,11 @@ class C2 extends C1 implements I2 {- + For references of type @@ -6356,7 +6356,7 @@ class C2 extends C1 implements I2 {JVMTI_REFERENCE_FIELD
orJVMTI_REFERENCE_STATIC_FIELD
the index - of the field in the referrer object. The index is based on the - order of all the object's fields - seeJVMTI_REFERENCE_FIELD orJVMTI_REFERENCE_STATIC_FIELD @@ -5362,7 +5362,7 @@ class C2 extends C1 implements I2 { For references of type for further description. For references of other kinds theJVMTI_REFERENCE_CONSTANT_POOL
the index into the constant pool of the class - see- JVMTI_REFERENCE_CONSTANT_POOL for further + JVMTI_REFERENCE_CONSTANT_POOLreferrer_index
is @@ -5372,7 +5372,7 @@ class C2 extends C1 implements I2 {- The user supplied data that was passed into the iteration function. + The user supplied data that was passed into the iteration function. @@ -5380,17 +5380,17 @@ class C2 extends C1 implements I2 {Iterate Over Objects Reachable From Object -+ @@ -5532,7 +5532,7 @@ class C2 extends C1 implements I2 {This function iterates over all objects that are directly and indirectly reachable from the specified object. For each object A (known - as the referrer) with a reference to object B the specified + as the referrer) with a reference to object B the specified callback function is called to describe the object reference. The callback is called exactly once for each reference from a referrer; this is true even if there are reference cycles or multiple paths to the referrer. There may be more than one reference between a referrer and a referree, - These may be distinguished by the + These may be distinguished by the and . The callback for an object will always occur after the callback for @@ -5401,18 +5401,18 @@ class C2 extends C1 implements I2 { During the execution of this function the state of the heap does not change: no objects are allocated, no objects are - garbage collected, and the state of objects (including - held values) does not change. - As a result, threads executing Java + garbage collected, and the state of objects (including + held values) does not change. + As a result, threads executing Java programming language code, threads attempting to resume the - execution of Java programming language code, and threads + execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled. new - + @@ -5447,9 +5447,9 @@ class C2 extends C1 implements I2 { @@ -5427,14 +5427,14 @@ class C2 extends C1 implements I2 { The callback to be called to describe each object reference. - +NULL
is passed as the user supplied data- User supplied data to be passed to the callback. + User supplied data to be passed to the callback. This function iterates over the root objects and all objects that are directly and indirectly reachable from the root objects. - The root objects comprise the set of system classes, - JNI globals, references from thread stacks, and other objects used as roots - for the purposes of garbage collection. + The root objects comprise the set of system classes, + JNI globals, references from thread stacks, and other objects used as roots + for the purposes of garbage collection. For each root the or callback is called. @@ -5462,7 +5462,7 @@ class C2 extends C1 implements I2 { this is true even if there are reference cycles or multiple paths to the referrer. There may be more than one reference between a referrer and a referree, - These may be distinguished by the + These may be distinguished by the and . The callback for an object will always occur after the callback for @@ -5472,26 +5472,26 @@ class C2 extends C1 implements I2 { references which are reported. Roots are always reported to the profiler before any object references - are reported. In other words, the + are reported. In other words, the callback will not be called until the appropriate callback has been called - for all roots. If the callback is + for all roots. If the callback is specified as NULL
then this function returns after reporting the root objects to the profiler. During the execution of this function the state of the heap does not change: no objects are allocated, no objects are - garbage collected, and the state of objects (including - held values) does not change. - As a result, threads executing Java + garbage collected, and the state of objects (including + held values) does not change. + As a result, threads executing Java programming language code, threads attempting to resume the - execution of Java programming language code, and threads + execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled.new - + jvmtiHeapRootCallback @@ -5502,7 +5502,7 @@ class C2 extends C1 implements I2 {JVMTI_HEAP_ROOT_JNI_GLOBAL
,JVMTI_HEAP_ROOT_SYSTEM_CLASS
,JVMTI_HEAP_ROOT_MONITOR
, -JVMTI_HEAP_ROOT_THREAD
, or +JVMTI_HEAP_ROOT_THREAD
, orJVMTI_HEAP_ROOT_OTHER
.NULL
is passed as the user supplied data- User supplied data to be passed to the callback. + User supplied data to be passed to the callback. @@ -5542,14 +5542,14 @@ class C2 extends C1 implements I2 {Iterate Over Heap -- Iterate over all objects in the heap. This includes both reachable and + + Iterate over all objects in the heap. This includes both reachable and unreachable objects. The parameter indicates the objects for which the callback function is called. If this parameter - is JVMTI_HEAP_OBJECT_TAGGED
then the callback will only be - called for every object that is tagged. If the parameter is + isJVMTI_HEAP_OBJECT_TAGGED
then the callback will only be + called for every object that is tagged. If the parameter isJVMTI_HEAP_OBJECT_UNTAGGED
then the callback will only be for objects that are not tagged. If the parameter isJVMTI_HEAP_OBJECT_EITHER
then the callback will be @@ -5558,11 +5558,11 @@ class C2 extends C1 implements I2 { During the execution of this function the state of the heap does not change: no objects are allocated, no objects are - garbage collected, and the state of objects (including - held values) does not change. - As a result, threads executing Java + garbage collected, and the state of objects (including + held values) does not change. + As a result, threads executing Java programming language code, threads attempting to resume the - execution of Java programming language code, and threads + execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled.new @@ -5591,7 +5591,7 @@ class C2 extends C1 implements I2 {NULL
is passed as the user supplied data- User supplied data to be passed to the callback. + User supplied data to be passed to the callback. @@ -5602,15 +5602,15 @@ class C2 extends C1 implements I2 {Iterate Over Instances Of Class - Iterate over all objects in the heap that are instances of the specified class. - This includes direct instances of the specified class and + Iterate over all objects in the heap that are instances of the specified class. + This includes direct instances of the specified class and instances of all subclasses of the specified class. This includes both reachable and unreachable objects. The parameter indicates the objects for which the callback function is called. If this parameter - is JVMTI_HEAP_OBJECT_TAGGED
then the callback will only be - called for every object that is tagged. If the parameter is + isJVMTI_HEAP_OBJECT_TAGGED
then the callback will only be + called for every object that is tagged. If the parameter isJVMTI_HEAP_OBJECT_UNTAGGED
then the callback will only be called for objects that are not tagged. If the parameter isJVMTI_HEAP_OBJECT_EITHER
then the callback will be @@ -5619,11 +5619,11 @@ class C2 extends C1 implements I2 { During the execution of this function the state of the heap does not change: no objects are allocated, no objects are - garbage collected, and the state of objects (including - held values) does not change. - As a result, threads executing Java + garbage collected, and the state of objects (including + held values) does not change. + As a result, threads executing Java programming language code, threads attempting to resume the - execution of Java programming language code, and threads + execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled.new @@ -5649,7 +5649,7 @@ class C2 extends C1 implements I2 {The iterator function to be called for each - @@ -5659,7 +5659,7 @@ class C2 extends C1 implements I2 {instance matching + instance matching the . NULL
is passed as the user supplied data- User supplied data to be passed to the callback. + User supplied data to be passed to the callback. @@ -5672,19 +5672,19 @@ class C2 extends C1 implements I2 {- These functions are used to retrieve or set the value of a local variable. + These functions are used to retrieve or set the value of a local variable. The variable is identified by the depth of the frame containing its - value and the variable's slot number within that frame. - The mapping of variables to - slot numbers can be obtained with the function + value and the variable's slot number within that frame. + The mapping of variables to + slot numbers can be obtained with the function . Get Local Variable - Object - This function can be used to retrieve the value of a local - variable whose type is Object
or a subclass ofObject
. + This function can be used to retrieve the value of a local + variable whose type isObject
or a subclass ofObject
.jvmdi @@ -5712,7 +5712,7 @@ class C2 extends C1 implements I2 { - On return, points to the variable's value. + On return, points to the variable's value. @@ -5720,11 +5720,11 @@ class C2 extends C1 implements I2 {Invalid -slot
.+ The variable type is not -Object
or a subclass ofObject
.+ Not a visible frame @@ -5736,7 +5736,7 @@ class C2 extends C1 implements I2 { This function can be used to retrieve the value of the local object variable at slot 0 (the "this
" object) from non-static frames. This function can retrieve the "this
" object from - native method frames, whereasGetLocalObject()
would + native method frames, whereasGetLocalObject()
would returnJVMTI_ERROR_OPAQUE_FRAME
in those cases.new @@ -5759,7 +5759,7 @@ class C2 extends C1 implements I2 {- On return, points to the variable's value. + On return, points to the variable's value. @@ -5772,10 +5772,10 @@ class C2 extends C1 implements I2 {Get Local Variable - Int - This function can be used to retrieve the value of a local + This function can be used to retrieve the value of a local variable whose type is int
, -short
,char
,byte
, or -boolean
. +short
,char
,byte
, or +boolean
.jvmdi @@ -5803,7 +5803,7 @@ class C2 extends C1 implements I2 { - On return, points to the variable's value. + On return, points to the variable's value. @@ -5811,13 +5811,13 @@ class C2 extends C1 implements I2 {Invalid -slot
.- The variable type is not + + The variable type is not -int
,short
, -char
,byte
, or +char
,byte
, orboolean
.+ Not a visible frame @@ -5826,8 +5826,8 @@ class C2 extends C1 implements I2 {Get Local Variable - Long - This function can be used to retrieve the value of a local - variable whose type is long
. + This function can be used to retrieve the value of a local + variable whose type islong
.jvmdi @@ -5855,7 +5855,7 @@ class C2 extends C1 implements I2 { - On return, points to the variable's value. + On return, points to the variable's value. @@ -5863,10 +5863,10 @@ class C2 extends C1 implements I2 {Invalid -slot
.+ The variable type is not -long
.+ Not a visible frame @@ -5875,8 +5875,8 @@ class C2 extends C1 implements I2 {Get Local Variable - Float - This function can be used to retrieve the value of a local - variable whose type is float
. + This function can be used to retrieve the value of a local + variable whose type isfloat
.jvmdi @@ -5904,7 +5904,7 @@ class C2 extends C1 implements I2 { - On return, points to the variable's value. + On return, points to the variable's value. @@ -5912,10 +5912,10 @@ class C2 extends C1 implements I2 {Invalid -slot
.+ The variable type is not -float
.+ Not a visible frame @@ -5924,8 +5924,8 @@ class C2 extends C1 implements I2 {Get Local Variable - Double - This function can be used to retrieve the value of a local - variable whose type is long
. + This function can be used to retrieve the value of a local + variable whose type islong
.jvmdi @@ -5953,7 +5953,7 @@ class C2 extends C1 implements I2 { - On return, points to the variable's value. + On return, points to the variable's value. @@ -5961,10 +5961,10 @@ class C2 extends C1 implements I2 {Invalid -slot
.+ The variable type is not -double
.+ Not a visible frame @@ -5973,8 +5973,8 @@ class C2 extends C1 implements I2 {Set Local Variable - Object - This function can be used to set the value of a local - variable whose type is Object
or a subclass ofObject
. + This function can be used to set the value of a local + variable whose type isObject
or a subclass ofObject
.jvmdi @@ -6015,7 +6015,7 @@ class C2 extends C1 implements I2 { Object
or a subclass ofObject
.- The supplied is not compatible + The supplied is not compatible with the variable type. @@ -6027,10 +6027,10 @@ class C2 extends C1 implements I2 { Set Local Variable - Int - This function can be used to set the value of a local + This function can be used to set the value of a local variable whose type is int
, -short
,char
,byte
, or -boolean
. +short
,char
,byte
, or +boolean
.jvmdi @@ -6066,10 +6066,10 @@ class C2 extends C1 implements I2 { Invalid -slot
.- The variable type is not + + The variable type is not int
,short
, -char
,byte
, or +char
,byte
, orboolean
.@@ -6081,8 +6081,8 @@ class C2 extends C1 implements I2 { Set Local Variable - Long - This function can be used to set the value of a local - variable whose type is long
. + This function can be used to set the value of a local + variable whose type islong
.jvmdi @@ -6118,7 +6118,7 @@ class C2 extends C1 implements I2 { Invalid -slot
.+ The variable type is not long
.@@ -6130,8 +6130,8 @@ class C2 extends C1 implements I2 { Set Local Variable - Float - This function can be used to set the value of a local - variable whose type is float
. + This function can be used to set the value of a local + variable whose type isfloat
.jvmdi @@ -6167,7 +6167,7 @@ class C2 extends C1 implements I2 { Invalid -slot
.+ The variable type is not float
.@@ -6179,8 +6179,8 @@ class C2 extends C1 implements I2 { Set Local Variable - Double - This function can be used to set the value of a local - variable whose type is double
. + This function can be used to set the value of a local + variable whose type isdouble
.jvmdi @@ -6216,7 +6216,7 @@ class C2 extends C1 implements I2 { Invalid -slot
.+ The variable type is not double
.@@ -6267,7 +6267,7 @@ class C2 extends C1 implements I2 { - @@ -6304,7 +6304,7 @@ class C2 extends C1 implements I2 {+ The designated bytecode already has a breakpoint. - @@ -6325,14 +6325,14 @@ class C2 extends C1 implements I2 { by+ There's no breakpoint at the designated bytecode. klass
andfield
is about to be accessed. An event will be generated for each access of the field - until it is canceled with + until it is canceled with. Field accesses from Java programming language code or from JNI code are watched, fields modified by other means are not watched. Note that users should be aware that their own field accesses will trigger the watch. A field can only have one field access watch set. - Modification of a field is not considered an access--use + Modification of a field is not considered an access--use to monitor modifications. - @@ -6365,8 +6365,8 @@ class C2 extends C1 implements I2 {+ The designated field is already being watched for accesses. Clear Field Access Watch - Cancel a field access watch previously set by - , on the + Cancel a field access watch previously set by + , on the field specified by klass
andfield
. @@ -6391,7 +6391,7 @@ class C2 extends C1 implements I2 {- @@ -6405,7 +6405,7 @@ class C2 extends C1 implements I2 { by+ The designated field is not being watched for accesses. klass
andfield
is about to be modified. An event will be generated for each modification of the field - until it is canceled with + until it is canceled with. Field modifications from Java programming language code or from JNI code are watched, fields modified by other means are not watched. @@ -6433,7 +6433,7 @@ class C2 extends C1 implements I2 { - @@ -6443,8 +6443,8 @@ class C2 extends C1 implements I2 {+ The designated field is already being watched for modifications. Clear Field Modification Watch - Cancel a field modification watch previously set by - , on the + Cancel a field modification watch previously set by + , on the field specified by klass
andfield
. @@ -6469,7 +6469,7 @@ class C2 extends C1 implements I2 {- @@ -6857,9 +6857,9 @@ class C2 extends C1 implements I2 {+ The designated field is not being watched for modifications. class_count_ptr
, and the array itself viaclasses_ptr
. - Array classes of all types (including arrays of primitive types) are - included in the returned list. Primitive classes (for example, -java.lang.Integer.TYPE
) are not included in this list. + Array classes of all types (including arrays of primitive types) are + included in the returned list. Primitive classes (for example, +java.lang.Integer.TYPE
) are not included in this list.jvmdi @@ -6887,8 +6887,8 @@ class C2 extends C1 implements I2 { Get Classloader Classes Returns an array of those classes for which this class loader has - been recorded as an initiating loader. Each - class in the returned array was created by this class loader, + been recorded as an initiating loader. Each + class in the returned array was created by this class loader, either by defining it directly or by delegation to another class loader. See @@ -8465,7 +8465,7 @@ class C2 extends C1 implements I2 { For the method indicated by. @@ -6930,14 +6930,14 @@ class C2 extends C1 implements I2 { Get Class Signature - For the class indicated by klass
, return the -JNI - type signature + For the class indicated byklass
, return the +JNI + type signature and the generic signature of the class. For example,java.util.List
is"Ljava/util/List;"
andint[]
is"[I"
The returned name for primitive classes - is the type signature character of the corresponding primitive type. + is the type signature character of the corresponding primitive type. For example,java.lang.Integer.TYPE
is"I"
.jvmdiClone @@ -6952,7 +6952,7 @@ class C2 extends C1 implements I2 {- + the signature is not returned @@ -6962,14 +6962,14 @@ class C2 extends C1 implements I2 { - + the generic signature is not returned On return, points to the generic signature of the class, encoded as a @@ -6980,7 +6980,7 @@ class C2 extends C1 implements I2 {modified UTF-8 string. If there is no generic signature attribute for the class, then, - on return, points toNULL
. + on return, points toNULL
.Get Class Status - Get the status of the class. Zero or more of the following bits can be + Get the status of the class. Zero or more of the following bits can be set. @@ -7017,7 +7017,7 @@ class C2 extends C1 implements I2 { @@ -6999,7 +6999,7 @@ class C2 extends C1 implements I2 { Class is an array. If set, all other bits are zero. - Class is a primitive class (for example, java.lang.Integer.TYPE
). + Class is a primitive class (for example,java.lang.Integer.TYPE
). If set, all other bits are zero.- On return, points to the current state of this class as one or + On return, points to the current state of this class as one or more of the @@ -7030,11 +7030,11 @@ class C2 extends C1 implements I2 {class status flags .Get Source File Name For the class indicated by klass
, return the source file - name viasource_name_ptr
. The returned string - is a file name only and never contains a directory name. + name viasource_name_ptr
. The returned string + is a file name only and never contains a directory name. - For primitive classes (for example,java.lang.Integer.TYPE
) - and for arrays this function returns + For primitive classes (for example,java.lang.Integer.TYPE
) + and for arrays this function returns. jvmdi @@ -7057,7 +7057,7 @@ class C2 extends C1 implements I2 {- + Class information does not include a source file name. This includes cases where the class is an array class or primitive class. @@ -7072,17 +7072,17 @@ class C2 extends C1 implements I2 { viamodifiers_ptr
. Access flags are defined in. - If the class is an array class, then its public, private, and protected - modifiers are the same as those of its component type. For arrays of - primitives, this component type is represented by one of the primitive - classes (for example, java.lang.Integer.TYPE
). + If the class is an array class, then its public, private, and protected + modifiers are the same as those of its component type. For arrays of + primitives, this component type is represented by one of the primitive + classes (for example,java.lang.Integer.TYPE
). - If the class is a primitive class, its public modifier is always true, - and its protected and private modifiers are always false. + If the class is a primitive class, its public modifier is always true, + and its protected and private modifiers are always false. - If the class is an array class or a primitive class then its final - modifier is always true and its interface modifier is always false. - The values of its other modifiers are not determined by this specification. + If the class is an array class or a primitive class then its final + modifier is always true and its interface modifier is always false. + The values of its other modifiers are not determined by this specification.jvmdi @@ -7112,7 +7112,7 @@ class C2 extends C1 implements I2 {For the class indicated by klass
, return a count of methods viamethod_count_ptr
and a list of - method IDs viamethods_ptr
. The method list contains + method IDs viamethods_ptr
. The method list contains constructors and static initializers as well as true methods. Only directly declared methods are returned (not inherited methods). An empty method list is returned for array classes and primitive classes @@ -7185,7 +7185,7 @@ class C2 extends C1 implements I2 {- @@ -7194,7 +7194,7 @@ class C2 extends C1 implements I2 {+ is not prepared. Get Implemented Interfaces - Return the direct super-interfaces of this class. For a class, this + Return the direct super-interfaces of this class. For a class, this function returns the interfaces declared in its implements
clause. For an interface, this function returns the interfaces declared in itsextends
clause. @@ -7225,7 +7225,7 @@ class C2 extends C1 implements I2 {- @@ -7234,10 +7234,10 @@ class C2 extends C1 implements I2 {+ is not prepared. Get Class Version Numbers - For the class indicated by klass
, + For the class indicated byklass
, return the minor and major version numbers, as defined in -. + . new @@ -7253,7 +7253,7 @@ class C2 extends C1 implements I2 { On return, points to the value of the - minor_version
item of the +minor_version
item of the Class File Format. Note: to be consistent with the Class File Format, the minor version number is the first parameter. @@ -7263,13 +7263,13 @@ class C2 extends C1 implements I2 {On return, points to the value of the - major_version
item of the +major_version
item of the Class File Format.- @@ -7278,13 +7278,13 @@ class C2 extends C1 implements I2 {+ The class is a primitive or array class. Get Constant Pool - For the class indicated by klass
, + For the class indicated byklass
, return the raw bytes of the constant pool in the format of the -constant_pool
item of +constant_pool
item of. The format of the constant pool may differ between versions - of the Class File Format, so, the - minor and major + of the Class File Format, so, the + minor and major class version numbers should be checked for compatibility. @@ -7294,17 +7294,17 @@ class C2 extends C1 implements I2 { more or fewer entries than the defining constant pool. Entries may be in a different order. The constant pool returned by GetConstantPool() will match the - constant pool used by + constant pool used byGetBytecodes() . That is, the bytecodes returned by GetBytecodes() will have constant pool indices which refer to constant pool entries returned by GetConstantPool(). - Note that since- and can change + Note that since + and can change the constant pool, the constant pool returned by this function - can change accordingly. Thus, the correspondence between + can change accordingly. Thus, the correspondence between GetConstantPool() and GetBytecodes() does not hold if there - is an intervening class retransformation or redefinition. + is an intervening class retransformation or redefinition. The value of a constant pool entry used by a given bytecode will match that of the defining class file (even if the indices don't match). Constant pool entries which are not used directly or indirectly by @@ -7342,13 +7342,13 @@ class C2 extends C1 implements I2 { On return, points to the raw constant pool, that is the bytes - defined by the constant_pool
item of the + defined by theconstant_pool
item of the Class File Format- @@ -7360,7 +7360,7 @@ class C2 extends C1 implements I2 { Determines whether a class object reference represents an interface. The+ The class is a primitive or array class. jboolean
result isJNI_TRUE
if the "class" is actually an interface, -JNI_FALSE
otherwise. +JNI_FALSE
otherwise.jvmdi @@ -7390,7 +7390,7 @@ class C2 extends C1 implements I2 { Determines whether a class object reference represents an array. The jboolean
result isJNI_TRUE
if the class is an array, -JNI_FALSE
otherwise. +JNI_FALSE
otherwise.jvmdi @@ -7420,11 +7420,11 @@ class C2 extends C1 implements I2 { Determines whether a class is modifiable. If a class is modifiable ( returns JNI_TRUE
) the class can be - redefined with(assuming + redefined with (assuming the agent possesses the capability) or - retransformed with (assuming + retransformed with (assuming the agent possesses the capability). @@ -7433,7 +7433,7 @@ class C2 extends C1 implements I2 { redefined nor retransformed. Primitive classes (for example, java.lang.Integer.TYPE
), - array classes, and some implementation defined classes are never modifiable. + array classes, and some implementation defined classes are never modifiable.new @@ -7511,11 +7511,11 @@ class C2 extends C1 implements I2 {Get Source Debug Extension - For the class indicated by klass
, return the debug + For the class indicated byklass
, return the debug extension viasource_debug_extension_ptr
. - The returned string + The returned string contains exactly the debug extension information present in the - class file ofklass
. + class file ofklass
.jvmdi @@ -7537,7 +7537,7 @@ class C2 extends C1 implements I2 { - @@ -7546,15 +7546,15 @@ class C2 extends C1 implements I2 {+ Class information does not include a debug extension. Retransform Classes - This function facilitates the + This function facilitates the bytecode instrumentation of already loaded classes. To replace the class definition without reference to the existing - bytecodes, as one might do when recompiling from source for + bytecodes, as one might do when recompiling from source for fix-and-continue debugging,function should be used instead. - When classes are initially loaded or when they are + When classes are initially loaded or when they are redefined , the initial class file bytes can be transformed with theevent. @@ -7562,16 +7562,16 @@ class C2 extends C1 implements I2 { (whether or not a transformation has previously occurred). This retransformation follows these steps: -
See the- starting from the initial class file bytes +
- starting from the initial class file bytes
- for each
retransformation incapable agent which received aClassFileLoadHook
event during the previous - load or redefine, the bytes it returned + load or redefine, the bytes it returned (via thenew_class_data
parameter) - are reused as the output of the transformation; + are reused as the output of the transformation; note that this is equivalent to reapplying the previous transformation, unaltered. except that theClassFileLoadHook
event @@ -7589,7 +7589,7 @@ class C2 extends C1 implements I2 {event for more details. - The initial class file bytes represent the bytes passed to + The initial class file bytes represent the bytes passed to ClassLoader.defineClass
orRedefineClasses
(before any transformations were applied), however they may not exactly match them. @@ -7601,13 +7601,13 @@ class C2 extends C1 implements I2 { order may not be preserved. Retransformation can cause new versions of methods to be installed. - Old method versions may become + Old method versions may becomeobsolete - The new method version will be used on new invokes. + The new method version will be used on new invokes. If a method has active stack frames, those active frames continue to - run the bytecodes of the original method version. + run the bytecodes of the original method version. - This function does not cause any initialization except that which + This function does not cause any initialization except that which would occur under the customary JVM semantics. In other words, retransforming a class does not cause its initializers to be run. The values of static fields will remain as they were @@ -7620,7 +7620,7 @@ class C2 extends C1 implements I2 { All attributes are updated. Instances of the retransformed class are not affected -- fields retain their - previous values. + previous values.Tags on the instances are also unaffected. @@ -7629,8 +7629,8 @@ class C2 extends C1 implements I2 { will be sent. The retransformation may change method bodies, the constant pool and attributes. - The retransformation must not add, remove or rename fields or methods, change the - signatures of methods, change modifiers, or change inheritance. + The retransformation must not add, remove or rename fields or methods, change the + signatures of methods, change modifiers, or change inheritance. These restrictions may be lifted in future versions. See the error return description below for information on error codes returned if an unsupported retransformation is attempted. @@ -7640,7 +7640,7 @@ class C2 extends C1 implements I2 { If any error code is returned other thanJVMTI_ERROR_NONE
, none of the classes to be retransformed will have a new definition installed. When this function returns (with the error code ofJVMTI_ERROR_NONE
) - all of the classes to be retransformed will have their new definitions installed. + all of the classes to be retransformed will have their new definitions installed.new @@ -7663,7 +7663,7 @@ class C2 extends C1 implements I2 { - One of the cannot be modified. + One of the cannot be modified. See . @@ -7676,7 +7676,7 @@ class C2 extends C1 implements I2 { A retransformed class file is malformed (The VM would return a ClassFormatError
).- The retransformed class file definitions would lead to a circular definition + The retransformed class file definitions would lead to a circular definition (the VM would return a ClassCircularityError
).@@ -7739,22 +7739,22 @@ class C2 extends C1 implements I2 { This function is used to replace the definition of a class with a new definition, as might be needed in fix-and-continue debugging. - Where the existing class file bytes are to be transformed, for + Where the existing class file bytes are to be transformed, for example in bytecode instrumentation ,should be used. Redefinition can cause new versions of methods to be installed. - Old method versions may become + Old method versions may become obsolete - The new method version will be used on new invokes. + The new method version will be used on new invokes. If a method has active stack frames, those active frames continue to - run the bytecodes of the original method version. - If resetting of stack frames is desired, use + run the bytecodes of the original method version. + If resetting of stack frames is desired, useto pop frames with obsolete method versions. - This function does not cause any initialization except that which + This function does not cause any initialization except that which would occur under the customary JVM semantics. In other words, redefining a class does not cause its initializers to be run. The values of static fields will remain as they were @@ -7767,7 +7767,7 @@ class C2 extends C1 implements I2 { All attributes are updated. Instances of the redefined class are not affected -- fields retain their - previous values. + previous values. Tags on the instances are also unaffected. @@ -7776,8 +7776,8 @@ class C2 extends C1 implements I2 { will be sent (if enabled), but no otherevents will be sent. The redefinition may change method bodies, the constant pool and attributes. - The redefinition must not add, remove or rename fields or methods, change the - signatures of methods, change modifiers, or change inheritance. + The redefinition must not add, remove or rename fields or methods, change the + signatures of methods, change modifiers, or change inheritance. These restrictions may be lifted in future versions. See the error return description below for information on error codes returned if an unsupported redefinition is attempted. @@ -7788,7 +7788,7 @@ class C2 extends C1 implements I2 { If any error code is returned other than JVMTI_ERROR_NONE
, none of the classes to be redefined will have a new definition installed. When this function returns (with the error code ofJVMTI_ERROR_NONE
) - all of the classes to be redefined will have their new definitions installed. + all of the classes to be redefined will have their new definitions installed.jvmdi @@ -7827,7 +7827,7 @@ class C2 extends C1 implements I2 { A new class file is malformed (The VM would return a ClassFormatError
).- The new class file definitions would lead to a circular definition + The new class file definitions would lead to a circular definition (the VM would return a ClassCircularityError
).@@ -7876,7 +7876,7 @@ class C2 extends C1 implements I2 { For the object indicated by object
, return viasize_ptr
the size of the object. This size is an implementation-specific approximation of - the amount of storage consumed by this object. + the amount of storage consumed by this object. It may include some or all of the object's overhead, and thus is useful for comparison within an implementation but not between implementations. @@ -7909,11 +7909,11 @@ class C2 extends C1 implements I2 { For the object indicated byobject
, return viahash_code_ptr
a hash code. This hash code could be used to maintain a hash table of object references, - however, on some implementations this can cause significant performance - impacts--in most cases -tags + however, on some implementations this can cause significant performance + impacts--in most cases +tags will be a more efficient means of associating information with objects. - This function guarantees + This function guarantees the same hash code value for a particular object throughout its lifejvmdi @@ -7979,7 +7979,7 @@ class C2 extends C1 implements I2 {Get information about the object's monitor. - The fields of the @@ -8098,14 +8098,14 @@ class C2 extends C1 implements I2 {structure + The fields of the structure are filled in with information about usage of the monitor. Decide and then clarify suspend requirements. @@ -7999,7 +7999,7 @@ class C2 extends C1 implements I2 { jvmtiMonitorUsage - On return, filled with monitor information for the + On return, filled with monitor information for the specified object. @@ -8014,7 +8014,7 @@ class C2 extends C1 implements I2 {Return the list of object monitors. - Note: details about each monitor can be examined with + Note: details about each monitor can be examined with . new @@ -8025,7 +8025,7 @@ class C2 extends C1 implements I2 {- On return, pointer to the number + On return, pointer to the number of monitors returned in @@ -8056,7 +8056,7 @@ class C2 extends C1 implements I2 {monitors_ptr
.. Field signatures are defined in the - JNI Specification +JNI Specification and are referred to asfield descriptors
in. - + the generic signature is not returned On return, points to the generic signature of the field, encoded as a @@ -8187,7 +8187,7 @@ class C2 extends C1 implements I2 {modified UTF-8 string. If there is no generic signature attribute for the field, then, - on return, points toNULL
. + on return, points toNULL
.For the field indicated by klass
andfield
, return a value indicating whether the field is synthetic viais_synthetic_ptr
. - Synthetic fields are generated by the compiler but not present in the + Synthetic fields are generated by the compiler but not present in the original source code.jvmdi @@ -8241,7 +8241,7 @@ class C2 extends C1 implements I2 { An original method version which is not equivalent to the new method version is called obsolete and is assigned a new method ID; the original method ID now refers to the new method version. - A method ID can be tested for obsolescence with + A method ID can be tested for obsolescence with. @@ -8253,8 +8253,8 @@ class C2 extends C1 implements I2 { signature_ptr
. Method signatures are defined in the -JNI Specification - and are referred to asmethod descriptors
in +JNI Specification + and are referred to asmethod descriptors
in. Note this is different than method signatures as defined in the Java Language Specification. @@ -8291,14 +8291,14 @@ class C2 extends C1 implements I2 { - + the generic signature is not returned On return, points to the generic signature of the method, encoded as a @@ -8379,7 +8379,7 @@ class C2 extends C1 implements I2 { For the method indicated bymodified UTF-8 string. If there is no generic signature attribute for the method, then, - on return, points toNULL
. + on return, points toNULL
.method
, return the number of local variable slots used by the method, including the local variables used to pass parameters to the - method on its invocation. + method on its invocation. Seemax_locals
in. method
, return a table of source line number entries. The size of the table is returned viaentry_count_ptr
and the table itself is - returned viatable_ptr
. + returned viatable_ptr
.jvmdi @@ -8498,7 +8498,7 @@ class C2 extends C1 implements I2 { - @@ -8510,10 +8510,10 @@ class C2 extends C1 implements I2 { For the method indicated by+ Class information does not include line numbers. method
, return the beginning and ending addresses throughstart_location_ptr
andend_location_ptr
. In a - conventional byte code indexing scheme, + conventional byte code indexing scheme,start_location_ptr
will always point to zero - andend_location_ptr
- will always point to the byte code count minus one. + andend_location_ptr
+ will always point to the byte code count minus one.jvmdi @@ -8534,9 +8534,9 @@ class C2 extends C1 implements I2 { - On return, points to the first location, or + On return, points to the first location, or -1
if location information is not available. - If the information is available and + If the information is available andreturns then this will always be zero. @@ -8551,7 +8551,7 @@ class C2 extends C1 implements I2 { - @@ -8571,7 +8571,7 @@ class C2 extends C1 implements I2 {+ Class information does not include method sizes. The length of the valid section for this local variable. - The last code array index where the local variable is valid + The last code array index where the local variable is valid is @@ -8596,7 +8596,7 @@ class C2 extends C1 implements I2 {start_location + length
.The local variable's generic signature, encoded as a @@ -8722,7 +8722,7 @@ class C2 extends C1 implements I2 {modified UTF-8 string. - The value of this field will beNULL
for any local + The value of this field will beNULL
for any local variable which does not have a generic type.For the method indicated by method
, return a value indicating whether the method is synthetic viais_synthetic_ptr
. - Synthetic methods are generated by the compiler but not present in the + Synthetic methods are generated by the compiler but not present in the original source code.jvmdi @@ -8793,7 +8793,7 @@ class C2 extends C1 implements I2 { This function modifies the failure handling of native method resolution by allowing retry with a prefix applied to the name. - When used with the + When used with theClassFileLoadHook event , it enables native methods to beinstrumented . @@ -8805,7 +8805,7 @@ class C2 extends C1 implements I2 {native boolean foo(int x); - We could transform the class file (with the + We could transform the class file (with the ClassFileLoadHook event) so that this becomes:boolean foo(int x) { @@ -8823,28 +8823,28 @@ native boolean wrapped_foo(int x); better but would make these examples less readable. The wrapper will allow data to be collected on the native - method call, but now the problem becomes linking up the - wrapped method with the native implementation. - That is, the methodwrapped_foo
needs to be + method call, but now the problem becomes linking up the + wrapped method with the native implementation. + That is, the methodwrapped_foo
needs to be resolved to the native implementation offoo
, which might be:Java_somePackage_someClass_foo(JNIEnv* env, jint x) This function allows the prefix to be specified and the - proper resolution to occur. + proper resolution to occur. Specifically, when the standard resolution fails, the resolution is retried taking the prefix into consideration. There are two ways that resolution occurs, explicit resolution with the JNI functionRegisterNatives
- and the normal automatic resolution. For -RegisterNatives
, the VM will attempt this + and the normal automatic resolution. For +RegisterNatives
, the VM will attempt this association:method(foo) -> nativeImplementation(foo) When this fails, the resolution will be retried with - the specified prefix prepended to the method name, + the specified prefix prepended to the method name, yielding the correct resolution:method(wrapped_foo) -> nativeImplementation(foo) @@ -8854,7 +8854,7 @@ method(wrapped_foo) -> nativeImplementation(foo) method(wrapped_foo) -> nativeImplementation(wrapped_foo) When this fails, the resolution will be retried with - the specified prefix deleted from the implementation name, + the specified prefix deleted from the implementation name, yielding the correct resolution:method(wrapped_foo) -> nativeImplementation(foo) @@ -8863,7 +8863,7 @@ method(wrapped_foo) -> nativeImplementation(foo) resolution fails, native methods can be wrapped selectively. Since eachenvironment is independent and - can do its own transformation of the bytecodes, more + can do its own transformation of the bytecodes, more than one layer of wrappers may be applied. Thus each environment needs its own prefix. Since transformations are applied in order, the prefixes, if applied, will @@ -8871,21 +8871,21 @@ method(wrapped_foo) -> nativeImplementation(foo) The order of transformation application is described in the event. Thus if three environments applied - wrappers, foo
might become + wrappers,foo
might become$env3_$env2_$env1_foo
. But if, say, the second environment did not apply a wrapper to -foo
it would be just -$env3_$env1_foo
. To be able to +foo
it would be just +$env3_$env1_foo
. To be able to efficiently determine the sequence of prefixes, an intermediate prefix is only applied if its non-native - wrapper exists. Thus, in the last example, even though + wrapper exists. Thus, in the last example, even though$env1_foo
is not a native method, the -$env1_
prefix is applied since +$env1_
prefix is applied since$env1_foo
exists. Since the prefixes are used at resolution time and since resolution may be arbitrarily delayed, a - native method prefix must remain set as long as there + native method prefix must remain set as long as there are corresponding prefixed native methods.new @@ -8918,7 +8918,7 @@ method(wrapped_foo) -> nativeImplementation(foo) For a meta-agent that performs multiple independent class file transformations (for example as a proxy for another layer of agents) this function allows each transformation - to have its own prefix. + to have its own prefix. The prefixes are applied in the order supplied and are processed in the same manor as described for the application of prefixes from multipleenvironments @@ -8929,13 +8929,13 @@ method(wrapped_foo) -> nativeImplementation(foo) disables prefixing in this environment. and this function - are the two ways to set the prefixes. - Calling SetNativeMethodPrefix
with - a prefix is the same as calling this function with -of 1
. - CallingSetNativeMethodPrefix
with -NULL
is the same as calling this function with -of 0
. + are the two ways to set the prefixes. + CallingSetNativeMethodPrefix
with + a prefix is the same as calling this function with +of 1
. + CallingSetNativeMethodPrefix
with +NULL
is the same as calling this function with +of 0
.new @@ -9014,16 +9014,16 @@ method(wrapped_foo) -> nativeImplementation(foo) - + Not monitor owner - +Raw Monitor Enter - Gain exclusive ownership of a raw monitor. + Gain exclusive ownership of a raw monitor. The same thread may enter a monitor more then once. The thread must exit @@ -9064,7 +9064,7 @@ method(wrapped_foo) -> nativeImplementation(foo)- @@ -9075,9 +9075,9 @@ method(wrapped_foo) -> nativeImplementation(foo)+ Not monitor owner Wait for notification of the raw monitor. - Causes the current thread to wait until either another thread calls - or - + Causes the current thread to wait until either another thread calls + or + for the specified raw monitor, or the specified timeout has elapsed. @@ -9102,10 +9102,10 @@ method(wrapped_foo) -> nativeImplementation(foo)- @@ -9151,7 +9151,7 @@ method(wrapped_foo) -> nativeImplementation(foo)+ Not monitor owner -+ Wait was interrupted, try again - @@ -9161,7 +9161,7 @@ method(wrapped_foo) -> nativeImplementation(foo)+ Not monitor owner Get Raw Monitor Use - The fields of the structure + The fields of the structure are filled in with information about usage of the raw monitor. new @@ -9178,7 +9178,7 @@ method(wrapped_foo) -> nativeImplementation(foo)jvmtiMonitorUsage - On return, filled with monitor information for the + On return, filled with monitor information for the specified raw monitor. @@ -9192,7 +9192,7 @@ method(wrapped_foo) -> nativeImplementation(foo)Return the list of raw monitors. - Note: details about each monitor can be examined with + Note: details about each monitor can be examined with . new @@ -9203,7 +9203,7 @@ method(wrapped_foo) -> nativeImplementation(foo)- On return, pointer to the number + On return, pointer to the number of monitors returned in @@ -9223,13 +9223,13 @@ method(wrapped_foo) -> nativeImplementation(foo)monitors_ptr
.- Provides the ability to intercept and resend + Provides the ability to intercept and resend Java Native Interface (JNI) function calls by manipulating the JNI function table. - See - +JNI + See JNI Functions in the Java Native Interface Specification. - The following example illustrates intercepting the + The following example illustrates intercepting theNewGlobalRef
JNI call in order to count reference creation.@@ -9274,19 +9274,19 @@ myInit() { check that the example compiles and executes. - + Set JNI Function Table - Set the JNI function table + Set the JNI function table in all current and future JNI environments. As a result, all future JNI calls are directed to the specified functions. Use to get the function table to pass to this function. - For this function to take effect the the updated table entries must be + For this function to take effect the the updated table entries must be used by the JNI clients. Since the table is defined const
some compilers may optimize - away the access to the table, thus preventing this function from taking + away the access to the table, thus preventing this function from taking effect. The table is copied--changes to the local copy of the table have no effect. @@ -9310,16 +9310,16 @@ myInit() {Get JNI Function Table Get the JNI function table. The JNI function table is copied into allocated memory. - If @@ -9332,7 +9332,7 @@ myInit() {+ If has been called, the modified (not the original) function table is returned. - Only the function table is copied, no other aspects of the environment + Only the function table is copied, no other aspects of the environment are copied. See the examples above .jniNativeInterface - On return, @@ -9354,13 +9354,13 @@ myInit() { table have no effect. This is an atomic action, all callbacks are set at once. No events are sent before this function is called. - When an entry is*function_table
+ On return,*function_table
points a newly allocated copy of the JNI function table.NULL
or when the event is beyond + When an entry isNULL
or when the event is beyondno event is sent. - Details on events are + Details on events are described later in this document. An event must be enabled and have a callback in order to be - sent--the order in which this function and -+ sent--the order in which this function and + are called does not affect the result. new @@ -9391,28 +9391,28 @@ myInit() {Set Event Notification Mode - Control the generation of events. + Control the generation of events. If - If is JVMTI_ENABLE
, + Ifis JVMTI_ENABLE
, the eventwill be enabled - If is JVMTI_DISABLE
, + Ifis JVMTI_DISABLE
, the eventwill be disabled thread
isNULL
, - the event is enabled or disabled globally; otherwise, it is - enabled or disabled for a particular thread. - An event is generated for + the event is enabled or disabled globally; otherwise, it is + enabled or disabled for a particular thread. + An event is generated for a particular thread if it is enabled either at the thread or global - levels. + levels. Seebelow for information on specific events. The following events cannot be controlled at the thread - level through this function. + level through this function.- Initially, no events are enabled at either the thread level + Initially, no events are enabled at either the thread level or the global level. Any needed capabilities (see Event Enabling Capabilities below) must be possessed before calling this function. - Details on events are + Details on events are described
- @@ -9424,13 +9424,13 @@ myInit() {
below .jvmdiClone @@ -9472,10 +9472,10 @@ myInit() {is non- NULL
and is not live (has not been started or is now dead).- thread level control was attempted on events which do not + thread level control was attempted on events which do not permit thread level control. -+ The Required Event Enabling Capability is not possessed. @@ -9484,14 +9484,14 @@ myInit() {@@ -11028,7 +11028,7 @@ myInit() { Generate Events - Generate events to represent the current state of the VM. - For example, if is + Generate events to represent the current state of the VM. + For example, if is JVMTI_EVENT_COMPILED_METHOD_LOAD
, aevent will be sent for each currently compiled method. Methods that were loaded and now have been unloaded are not sent. - The history of what events have previously been sent does not - effect what events are sent by this function--for example, + The history of what events have previously been sent does not + effect what events are sent by this function--for example, all currently compiled methods will be sent each time this function is called. @@ -9502,14 +9502,14 @@ myInit() { Attempts to execute Java programming language code or JNI functions may be paused until this function returns - so neither should be called from the thread sending the event. - This function returns only after the missed events have been + This function returns only after the missed events have been sent, processed and have returned. The event may be sent on a different thread than the thread on which the event occurred. - The callback for the event must be set with - + The callback for the event must be set with + and the event must be enabled with - + or the events will not occur. If the VM no longer has the information to generate some or all of the requested events, the events are simply not sent - @@ -9538,13 +9538,13 @@ myInit() { - - is + + -is and JVMTI_EVENT_COMPILED_METHOD_LOAD
is false
.+ is other than or JVMTI_EVENT_COMPILED_METHOD_LOAD
. @@ -9566,63 +9566,63 @@ myInit() { JVMTI_EVENT_DYNAMIC_CODE_GENERATED
- Java programming language primitive type - byte
. + Java programming language primitive type -byte
. JNI typejbyte
.- Java programming language primitive type - char
. + Java programming language primitive type -char
. JNI typejchar
.- Java programming language primitive type - short
. + Java programming language primitive type -short
. JNI typejshort
.- Java programming language primitive type - int
. + Java programming language primitive type -int
. JNI type. - Java programming language primitive type - long
. + Java programming language primitive type -long
. JNI type. - Java programming language primitive type - float
. + Java programming language primitive type -float
. JNI type. - Java programming language primitive type - double
. + Java programming language primitive type -double
. JNI type. - Java programming language primitive type - boolean
. + Java programming language primitive type -boolean
. JNI type. - Java programming language object type - java.lang.Object
. + Java programming language object type -java.lang.Object
. JNI type. Returned values are JNI local references and must be managed. - Java programming language object type - java.lang.Thread
. + Java programming language object type -java.lang.Thread
.type . Returned values are JNI local references and must be managed. - Java programming language object type - java.lang.Class
. + Java programming language object type -java.lang.Class
. JNI type. Returned values are JNI local references and must be managed. - Union of all Java programming language primitive and object types - + Union of all Java programming language primitive and object types - JNI type . Returned values which represent object types are JNI local references and must be managed. - Java programming language field identifier - + Java programming language field identifier - JNI type . - Java programming language method identifier - + Java programming language method identifier - JNI type . @@ -9757,7 +9757,7 @@ myInit() { jvmtiParamInfo - Array of + Array of @@ -9840,7 +9840,7 @@ myInit() {parameters ( jvmtiEnv *jvmti_env
excluded)jvmtiParamInfo - Array of + Array of @@ -9876,7 +9876,7 @@ myInit() {parameters ( jvmtiEnv *jvmti_env
excluded)Extension Event This is the implementation-specific event. - The event handler is set with + The event handler is set with -. Event handlers for extension events must be declared varargs to match this definition. @@ -9927,9 +9927,9 @@ myInit() { Identifies which callback to set. - This index is the + This index is the @@ -9939,18 +9939,18 @@ myInit() {- field of + field of . disable the event - If callback
is non-NULL
, + Ifcallback
is non-NULL
, setcallback
to be the event callback function and enable the event.- @@ -9962,30 +9962,30 @@ myInit() {+ is not an - - returned by + returned by The capabilities functions allow you to change the - functionality available to --that is, - which + functionality available to --that is, + which functions can be called, what events can be generated, and what functionality these events and functions can provide. - The "Capabilities" section of each function and event describe which + The "Capabilities" section of each function and event describe which capabilities, if any, they are associated with. "Required Functionality" means it is available for use and no capabilities must be added to use it. "Optional Functionality" means the agent must possess the capability - before it can be used. + before it can be used. To possess a capability, the agent must add the capability . "Optional Features" describe capabilities which, if added, extend the feature set. - The potentially available capabilities of eachimplementation are different. + The potentially available capabilities of each implementation are different. Depending on the implementation, a capability: @@ -9993,24 +9993,24 @@ myInit() { time, and/or memory footprint. Note that the overhead of using a capability is completely different than the overhead of possessing a capability. Take single stepping as an example. When single stepping is on (that - is, when the event is enabled and thus actively sending events) - the overhead of sending and processing an event - on each instruction is huge in any implementation. - However, the overhead of possessing the capability may be small or large, + is, when the event is enabled and thus actively sending events) + the overhead of sending and processing an event + on each instruction is huge in any implementation. + However, the overhead of possessing the capability may be small or large, depending on the implementation. Also, when and if a capability is potentially available depends on the implementation. Some examples:
- may never be added
- may be added in either the
OnLoad
or live phase in any environment- may be added only during the
OnLoad
phase- may be possessed by only one environment at a time
-- may be possessed by only one environment at a time, +
- may be possessed by only one environment at a time, and only during the
OnLoad
phase- and so on ...
-
Each- One VM might perform all execution by compiling bytecodes into +
- One VM might perform all execution by compiling bytecodes into native code and be unable to generate single step instructions. In this implementation the capability can not be added.
- Another VM may be able to switch execution to a single stepping - interpreter at any time. In this implementation, having the capability has no + interpreter at any time. In this implementation, having the capability has no overhead and could be added at any time.
- Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted execution engine at start up, but be unable to switch between them. - In this implementation the capability would need to be added + In this implementation the capability would need to be added during the
OnLoad
phase (before bytecode - execution begins) and would have a large impact on execution speed + execution begins) and would have a large impact on execution speed even if single stepping was never used.- Still another VM might be able to add an "is single stepping on" check into compiled bytecodes or a generated interpreter. Again in this implementation @@ -10019,30 +10019,30 @@ myInit() {
environment - has its own set of capabilities. + has its own set of capabilities. Initially, that set is empty. Any desired capability must be added. - If possible, capabilities should be added during theOnLoad
phase. For most - virtual machines certain capabilities require special set up for + If possible, capabilities should be added during theOnLoad
phase. For most + virtual machines certain capabilities require special set up for the virtual machine and this set up must happen - during theOnLoad
phase, before the virtual machine begins execution. + during theOnLoad
phase, before the virtual machine begins execution. Once a capability is added, it can only be removed if explicitly relinquished by the environment. - The agent can, + The agent can,determine what capabilities this VM can potentially provide ,add the capabilities to be used ,release capabilities which are no longer needed , and -examine the currently available + examine the currently available capabilities .For example, a freshly started agent (in the OnLoad
function) - wants to enable all possible capabilities. + wants to enable all possible capabilities. Note that, in general, this is not advisable as the agent may suffer a performance penalty for functionality it is not using. The code might look like this in C: @@ -10055,9 +10055,9 @@ myInit() { err = (*jvmti)->AddCapabilities(jvmti, &capa); For example, if an agent wants to check if it can get - the bytecodes of a method (that is, it wants to check - if it previously added this capability and has not - relinquished it), the code might + the bytecodes of a method (that is, it wants to check + if it previously added this capability and has not + relinquished it), the code might look like this in C:jvmtiCapabilities capa; @@ -10065,13 +10065,13 @@ myInit() { err = (*jvmti)->GetCapabilities(jvmti, &capa); if (err == JVMTI_ERROR_NONE) { - if (capa.can_get_bytecodes) { ... } } + if (capa.can_get_bytecodes) { ... } } - The functions in this category use this capabilities structure + The functions in this category use this capabilities structure which contains boolean flags corresponding to each capability: @@ -10099,14 +10099,14 @@ myInit() { - Can test if a field or method is synthetic - + Can test if a field or method is synthetic - and @@ -10167,19 +10167,19 @@ myInit() { - Can get information about ownership of monitors - + Can get information about ownership of monitors - - Can get exception thrown and + Can getexception thrown andexception catch events- Can set and thus get + Canset and thus getevents @@ -10206,65 +10206,65 @@ myInit() { thread CPU time - Can set and thus get + Canset and thus getevents - Can generate method entry events on entering a method - Can generate method exit events on leaving a method - Can generate ClassFileLoadHook events for every loaded class. - Can generate events when a method is compiled or unloaded - Can generate events on monitor activity - Can generate events on VM allocation of an object - Can generate events when a native method is bound to its implementation - Can generate events when garbage collection begins or ends Can generate events when the garbage collector frees an object @@ -10298,16 +10298,16 @@ myInit() { Can retransform classes with @@ -10322,7 +10322,7 @@ myInit() {. - In addition to the restrictions imposed by the specific + In addition to the restrictions imposed by the specific implementation on this capability (see the Capability section), - this capability must be set before the + this capability must be set before theevent is enabled for the first time in this environment. - An environment that possesses this capability at the time that + An environment that possesses this capability at the time that ClassFileLoadHook
is enabled for the first time is said to be retransformation capable. - An environment that does not possess this capability at the time that + An environment that does not possess this capability at the time thatClassFileLoadHook
is enabled for the first time is said to be retransformation incapable.- Can generate events when the VM is unable to allocate memory from + Can generate events when the VM is unable to allocate memory from the @@ -10355,11 +10355,11 @@ myInit() {Java platform heap. See. Get Potential Capabilities - Returns via the + Returns via the features that can potentially be possessed by this environment at this time. The returned capabilities differ from the complete set of capabilities - implemented by the VM in two cases: another environment possesses + implemented by the VM in two cases: another environment possesses capabilities that can only be possessed by one environment, or the current phase is live, and certain capabilities can only be added during theOnLoad
phase. @@ -10402,7 +10402,7 @@ myInit() { conditional implementations would be used or are even a good idea. The thought is that release documentation for the implementation would be the best means of exposing this information. - Unless new arguments are presented, I intend to remove this + Unless new arguments are presented, I intend to remove this function in the next revision. @@ -10412,15 +10412,15 @@ myInit() {. The returned estimates are in percentage of additional overhead, thus a time impact of 100 mean the application might run - at half the speed. + at half the speed. The estimates are very rough approximations and are not guaranteed. Note also, that the estimates are of the impact of having the capability available--when and if it is used the impact may be much greater. - Estimates can be for a single capability or for a set of + Estimates can be for a single capability or for a set of capabilities. Note that the costs are not necessarily additive, - adding support for one capability might make another available - for free or conversely having two capabilities at once may + adding support for one capability might make another available + for free or conversely having two capabilities at once may have multiplicative impact. Estimates are relative to the current set of capabilities - that is, how much more impact given the currently possessed capabilities. @@ -10460,7 +10460,7 @@ myInit() { - @@ -10470,7 +10470,7 @@ myInit() {+ The desired capabilities are not even potentially available. Add Capabilities - Set new capabilities by adding the capabilities + Set new capabilities by adding the capabilities whose values are set to one ( 1
) in*
. All previous capabilities are retained. @@ -10493,7 +10493,7 @@ myInit() { - @@ -10547,7 +10547,7 @@ myInit() {+ The desired capabilities are not even potentially available. - - + + Get Capabilities - Returns via the optional + Returns via the optional features which this environment currently possesses. Each possessed capability is indicated by a one ( 1
) in the corresponding field of thecapabilities @@ -10578,16 +10578,16 @@ myInit() { These functions provide timing information. - The resolution at which the time is updated is not specified. - They provides nanosecond precision, but not necessarily nanosecond accuracy. + The resolution at which the time is updated is not specified. + They provides nanosecond precision, but not necessarily nanosecond accuracy. Details about the timers, such as their maximum values, can be accessed with - the timer information functions. + the timer information functions. @@ -10621,7 +10621,7 @@ myInit() { jvmtiTimerKind The kind of timer. - On a platform that does not distinguish between user and system time, @@ -10659,12 +10659,12 @@ myInit() {is returned. JVMTI_TIMER_TOTAL_CPU
Get Current Thread CPU Timer Information - Get information about the - timer. - The fields of the structure + Get information about the + timer. + The fields of the structure are filled in with details about the timer. This information is specific to the platform and the implementation of - and thus + and thus does not vary by thread nor does it vary during a particular invocation of the VM. @@ -10696,15 +10696,15 @@ myInit() { Get Current Thread CPU Time - Return the CPU time utilized by the current thread. + Return the CPU time utilized by the current thread. Note that the function provides CPU time for any thread, including - the current thread. GetCurrentThreadCpuTime
+ the current thread.GetCurrentThreadCpuTime
exists to support platforms which cannot - supply CPU time for threads other than the current + supply CPU time for threads other than the current thread or which have more accurate information for - the current thread (see + the current thread (seevs ). On many platforms this call will be equivalent to: @@ -10717,13 +10717,13 @@ myInit() { Can get current thread CPU time. - If this capability is enabled after threads have started, + If this capability is enabled after threads have started, the implementation may choose any time up - to and including the time that the capability is enabled + to and including the time that the capability is enabled as the point where CPU time collection starts. - This capability must be potentially available on any - platform where + This capability must be potentially available on any + platform where @@ -10733,7 +10733,7 @@ myInit() {is potentially available. can_get_thread_cpu_time
On return, points to the CPU time used by this thread - in nanoseconds. + in nanoseconds. This is an unsigned value. If tested or printed as a jlong (signed value) it may appear to be a negative number. @@ -10746,12 +10746,12 @@ myInit() {Get Thread CPU Timer Information - Get information about the - timer. - The fields of the structure + Get information about the + timer. + The fields of the structure are filled in with details about the timer. This information is specific to the platform and the implementation of - and thus + and thus does not vary by thread nor does it vary during a particular invocation of the VM. @@ -10783,19 +10783,19 @@ myInit() { Get Thread CPU Time - Return the CPU time utilized by the specified thread. + Return the CPU time utilized by the specified thread. Get information about this timer with - . + . new @@ -10810,7 +10810,7 @@ myInit() { Can get thread CPU time. - If this capability is enabled after threads have started, + If this capability is enabled after threads have started, the implementation may choose any time up - to and including the time that the capability is enabled + to and including the time that the capability is enabled as the point where CPU time collection starts. On return, points to the CPU time used by the specified thread - in nanoseconds. + in nanoseconds. This is an unsigned value. If tested or printed as a jlong (signed value) it may appear to be a negative number. @@ -10823,9 +10823,9 @@ myInit() {Get Timer Information - Get information about the - @@ -10848,7 +10848,7 @@ myInit() {timer. - The fields of the structure + Get information about the + timer. + The fields of the structure are filled in with details about the timer. This information will not change during a particular invocation of the VM. Get Time - Return the current value of the system timer, in nanoseconds. + Return the current value of the system timer, in nanoseconds. The value returned represents nanoseconds since some fixed but arbitrary time (perhaps in the future, so values may be @@ -10857,7 +10857,7 @@ myInit() { how frequently values change. Get information about this timer with - . + . new @@ -10866,7 +10866,7 @@ myInit() { - On return, points to the time in nanoseconds. + On return, points to the time in nanoseconds. This is an unsigned value. If tested or printed as a jlong (signed value) it may appear to be a negative number. @@ -10881,7 +10881,7 @@ myInit() {Returns the number of processors available to the Java virtual machine. - This value may change during a particular invocation of the virtual machine. + This value may change during a particular invocation of the virtual machine. Applications that are sensitive to the number of available processors should therefore occasionally poll this property. @@ -10893,7 +10893,7 @@ myInit() {On return, points to the maximum number of processors available to the - virtual machine; never smaller than one. + virtual machine; never smaller than one. @@ -10914,18 +10914,18 @@ myInit() {Add To Bootstrap Class Loader Search - This function can be used to cause instrumentation classes to be defined by the + This function can be used to cause instrumentation classes to be defined by the bootstrap class loader. See . After the bootstrap - class loader unsuccessfully searches for a class, the specified platform-dependent - search path will be searched as well. Only one segment may be specified in - the . This function may be called multiple times to add multiple segments, + class loader unsuccessfully searches for a class, the specified platform-dependent + search path will be searched as well. Only one segment may be specified in + the . This function may be called multiple times to add multiple segments, the segments will be searched in the order that this function was called. - In the OnLoad
phase the function may be used to specify any platform-dependent + In theOnLoad
phase the function may be used to specify any platform-dependent search path segment to be searched after the bootstrap class loader unsuccessfully searches for a class. The segment is typically a directory or JAR file. - + In the live phase themay be used to specify any platform-dependent path to a JAR file . The agent should take care that the JAR file does not @@ -10953,7 +10953,7 @@ myInit() {- + @@ -10965,15 +10965,15 @@ myInit() { is an invalid path. In the live phase, anything other than an existing JAR file is an invalid path. This function can be used to cause instrumentation classes to be defined by the system class loader. See . - After the class loader unsuccessfully searches for a class, the specified platform-dependent search - path will be searched as well. Only one segment may be specified in the - . This function may be called multiple times to add multiple segments, the + After the class loader unsuccessfully searches for a class, the specified platform-dependent search + path will be searched as well. Only one segment may be specified in the + . This function may be called multiple times to add multiple segments, the segments will be searched in the order that this function was called. - In the OnLoad
phase the function may be used to specify any platform-dependent + In theOnLoad
phase the function may be used to specify any platform-dependent search path segment to be searched after the system class loader unsuccessfully searches for a class. The segment is typically a directory or JAR file. - + In the live phase theis a platform-dependent path to a JAR file to be searched after the system class loader unsuccessfully searches for a class. The agent should @@ -10981,9 +10981,9 @@ myInit() { defined by the system class loader for the purposes of instrumentation. In the live phase the system class loader supports adding a JAR file to be searched if - the system class loader implements a method nameappendToClassPathForInstrumentation
- which takes a single parameter of typejava.lang.String
. The method is not required - to havepublic
access. + the system class loader implements a method nameappendToClassPathForInstrumentation
+ which takes a single parameter of typejava.lang.String
. The method is not required + to havepublic
access.specifies that a subsequent attempt to resolve a symbolic reference that the Java virtual machine has previously unsuccessfully attempted @@ -11012,7 +11012,7 @@ myInit() { Operation not supported by the system class loader. - +Get System Properties - The list of VM system property keys which may be used with + The list of VM system property keys which may be used with is returned. It is strongly recommended that virtual machines provide the following property keys: @@ -11043,15 +11043,15 @@ myInit() { Provides access to system properties defined by and used by the VM. Properties set on the command-line are included. - This allows getting and setting of these properties + This allows getting and setting of these properties before the VM even begins executing bytecodes. - Since this is a VM view of system properties, the set of available + Since this is a VM view of system properties, the set of available properties will usually be different than that in java.lang.System.getProperties
. - JNI method invocation may be used to access + JNI method invocation may be used to accessjava.lang.System.getProperties
. - The set of properties may grow during execution. + The set of properties may grow during execution.new @@ -11066,7 +11066,7 @@ myInit() { - On return, points to an array of property keys, encoded as + On return, points to an array of property keys, encoded as @@ -11078,25 +11078,25 @@ myInit() {modified UTF-8 strings.Get System Property - Return a VM system property value given the property key. + Return a VM system property value given the property key. The function returns the set of property keys which may be used. The properties which can be retrieved may grow during execution. - Since this is a VM view of system properties, the values - of properties may differ from that returned by + Since this is a VM view of system properties, the values + of properties may differ from that returned by java.lang.System.getProperty(String)
. - A typical VM might copy the values of the VM system + A typical VM might copy the values of the VM system properties into theProperties
held byjava.lang.System
during the initialization of that class. Thereafter any changes to the VM system - properties (with) + properties (with ) or the java.lang.System
system properties (withjava.lang.System.setProperty(String,String)
) would cause the values to diverge. - JNI method invocation may be used to access + JNI method invocation may be used to accessjava.lang.System.getProperty(String)
.new @@ -11119,7 +11119,7 @@ myInit() {- + This property is not available. Use @@ -11129,7 +11129,7 @@ myInit() {to find available properties. Set System Property - Set a VM system property value. + Set a VM system property value. The function returns the set of property keys, some of these may be settable. @@ -11161,7 +11161,7 @@ myInit() { - @@ -11177,7 +11177,7 @@ myInit() {+ This property is not available or is not writeable. Get Phase - Return the current phase of VM execution. + Return the current phase of VM execution. The phases proceed in sequence: @@ -11193,7 +11193,7 @@ myInit() { VMStart
event.- Start phase: when the event + Start phase: when the VMStart
event is sent and until the VMStart
VMInit
event is sent.@@ -11222,8 +11222,8 @@ myInit() { Most events are sent only in the live phase. The following events operate in others phases: - - + + new @@ -11245,7 +11245,7 @@ myInit() { Shutdown a connection created with JNI GetEnv
(see). - Dispose of any resources held by the environment. + Dispose of any resources held by the environment. Environments What resources are reclaimed? What is undone? Breakpoints,watchpoints removed? @@ -11255,7 +11255,7 @@ myInit() { Memory allocated by this environment via calls to functions is not released, this can be done explicitly by the agent by calling . - Raw monitors created by this environment are not destroyed, + Raw monitors created by this environment are not destroyed, this can be done explicitly by the agent by calling . The state of threads waiting on raw monitors created by this environment @@ -11294,7 +11294,7 @@ myInit() { This value is NULL
unless set with this function. Agents can allocate memory in which they store environment specific information. By setting environment-local storage it can then be - accessed with + accessed with. Called by the agent to set the value of the @@ -11307,10 +11307,10 @@ myInit() { - - +- value is set to -NULL
+ + value is set to +NULL
The value to be entered into the environment-local storage. @@ -11324,7 +11324,7 @@ myInit() {Get Environment Local Storage Called by the agent to get the value of the environment-local - storage. + storage. new @@ -11333,10 +11333,10 @@ myInit() { - Pointer through which the value of the environment local + Pointer through which the value of the environment local storage is returned. If environment-local storage has not been set with - @@ -11349,7 +11349,7 @@ myInit() {returned + returned pointer is NULL
.Get Version Number Return the version via version_ptr
. - The return value is the version identifier. + The return value is the version identifier. The version identifier includes major, minor and micro version as well as the interface type.@@ -11362,10 +11362,10 @@ myInit() { Control verbose output. - This is the output which typically is sent to - Mask to extract interface type. + Mask to extract interface type. The value of the version returned by this function masked with JVMTI_VERSION_MASK_INTERFACE_TYPE
is always -JVMTI_VERSION_INTERFACE_JVMTI
+JVMTI_VERSION_INTERFACE_JVMTI
since this is afunction. @@ -11409,11 +11409,11 @@ myInit() { Get Error Name - Return the symbolic name for an - @@ -11459,7 +11459,7 @@ myInit() {error code . + Return the symbolic name for an +error code . - For example -GetErrorName(env, JVMTI_ERROR_NONE, &err_name)
+ For example +GetErrorName(env, JVMTI_ERROR_NONE, &err_name)
would return inerr_name
the string"JVMTI_ERROR_NONE"
.stderr
. + This is the output which typically is sent tostderr
.new @@ -11488,18 +11488,18 @@ myInit() { Although the greatest functionality is achieved with location information referencing the virtual machine bytecode index, the definition of - jlocation
has intentionally been left unconstrained to allow VM +jlocation
has intentionally been left unconstrained to allow VM implementations that do not have this information. This function describes the representation ofjlocation
used in this VM. - If the returned format is, + If the returned format is , jlocation
s can be used as in indices into the array returned by -. + . - jlocation
values represent virtual machine - bytecode indices--that is, offsets into the +jlocation
values represent virtual machine + bytecode indices--that is, offsets into the virtual machine code for a method.@@ -11534,16 +11534,16 @@ myInit() { Every function returns a jvmtiError
error code. - It is the responsibility of the agent to callfunctions with + It is the responsibility of the agent to call functions with valid parameters and in the proper context (calling thread is attached, - phase is correct, etc.). - Detecting some error conditions may be difficult, inefficient, or + phase is correct, etc.). + Detecting some error conditions may be difficult, inefficient, or impossible for an implementation. - The errors listed in + The errors listed in Function Specific Required Errors must be detected by the implementation. All other errors represent the recommended response to the error - condition. + condition.@@ -11559,7 +11559,7 @@ myInit() { Pointer is unexpectedly NULL
.- The function attempted to allocate memory and no more memory was + The function attempted to allocate memory and no more memory was available for allocation. @@ -11651,7 +11651,7 @@ myInit() { The following errors are returned by some @@ -11726,7 +11726,7 @@ myInit() { declared in the old class version.functions. They are returned in the event of invalid parameters passed by the - agent or usage in an invalid context. + agent or usage in an invalid context. An implementation is not required to detect these errors. - The class name defined in the new class file is + The class name defined in the new class file is different from the name in the old class object. @@ -11745,33 +11745,33 @@ myInit() { programs. To handle events, designate a set of callback functions with - . - For each event the corresponding callback function will be + . + For each event the corresponding callback function will be called. Arguments to the callback function provide additional - information about the event. + information about the event. - The callback function is usually called from within an application - thread. The implementation does not + The callback function is usually called from within an application + thread. The implementation does not queue events in any way. This means - that event callback functions must be written - carefully. Here are some general guidelines. See + that event callback functions must be written + carefully. Here are some general guidelines. See the individual event descriptions for further suggestions. -
- Some- Any exception thrown during the execution of an event callback can +
- Any exception thrown during the execution of an event callback can overwrite any current pending exception in the current application thread. Care must be taken to preserve a pending exception when an event callback makes a JNI call that might generate an exception.
- Event callback functions must be re-entrant. The
implementation does - not queue events. If an agent needs to process events one at a time, it - can use a raw monitor inside the + not queue events. If an agent needs to process events one at a time, it + can use a raw monitor inside the event callback functions to serialize event processing. - Event callback functions that execute JNI's FindClass function to load - classes need to note that FindClass locates the class loader associated + classes need to note that FindClass locates the class loader associated with the current native method. For the purposes of class loading, an event callback that includes a JNI environment as a parameter to the callback will treated as if it is a native call, where the native method @@ -11779,8 +11779,8 @@ myInit() {
events identify objects with JNI references. - All references + Some events identify objects with JNI references. + All references in events are JNI local references and will become invalid after the event callback returns. Unless stated otherwise, memory referenced by pointers sent in event @@ -11791,13 +11791,13 @@ myInit() { Events are sent at the time they occur. The specification for each event includes the set of phases in which it can be sent; - if an event triggering activity occurs during another phase, no event - is sent. + if an event triggering activity occurs during another phase, no event + is sent. A thread that generates an event does not change its execution status (for example, the event does not cause the thread to be suspended). If an agent wishes the event to result in suspension, then the agent - is responsible for explicitly suspending the thread with + is responsible for explicitly suspending the thread with. If an event is enabled in multiple environments, the event will be sent @@ -11810,26 +11810,26 @@ myInit() {
- If the event requires a capability, that capability must - be added with + be added with
. - - A callback for the event must be set with + A callback for the event must be set with
. - The event must be enabled with -
. + . - In many situations it is possible for multiple events to occur - at the same location in one thread. When this happens, all the events + In many situations it is possible for multiple events to occur + at the same location in one thread. When this happens, all the events are reported through the event callbacks in the order specified in this section. - If the current location is at the entry point of a method, the + If the current location is at the entry point of a method, the event is reported before any other event at the current location in the same thread. @@ -11839,39 +11839,39 @@ myInit() { exceptionCatch
event is reported before any other event at the current location in the same thread. - If asingleStep
event or -breakpoint
event is triggered at the - current location, the event is defined to occur - immediately before the code at the current location is executed. - These events are reported before any events which are triggered - by the execution of code at the current location in the same - thread (specifically: + If asingleStep
event or +breakpoint
event is triggered at the + current location, the event is defined to occur + immediately before the code at the current location is executed. + These events are reported before any events which are triggered + by the execution of code at the current location in the same + thread (specifically:exception
,fieldAccess
, andfieldModification
). - If both a step and breakpoint event are triggered for the same thread and + If both a step and breakpoint event are triggered for the same thread and location, the step event is reported before the breakpoint event. If the current location is the exit point of a method (that is, the last - location before returning to the caller), the -event and + location before returning to the caller), the + event and the event (if requested) are reported after all other events at the current location in the same - thread. There is no specified ordering of these two events + thread. There is no specified ordering of these two events with respect to each other. Co-located events can be triggered during the processing of some other event by the agent at the same location in the same thread. - If such an event, of type y, is triggered during the processing of - an event of type x, and if x - precedes y in the ordering specified above, the co-located event + If such an event, of type y, is triggered during the processing of + an event of type x, and if x + precedes y in the ordering specified above, the co-located event y is reported for the current thread and location. If x does not precede y, y is not reported for the current thread and location. - For example, if a breakpoint is set at the current location + For example, if a breakpoint is set at the current location during the processing of , - that breakpoint will be reported before the thread moves off the current + that breakpoint will be reported before the thread moves off the current location. - The following events are never considered to be co-located with + The following events are never considered to be co-located with other events.
- @@ -11887,7 +11887,7 @@ myInit() {
The event callback structure below is used to specify the handler function for events. It is set with the - function. + function. Single step events allow the agent to trace thread execution at the finest granularity allowed by the VM. A single step event is - generated whenever a thread reaches a new location. - Typically, single step events represent the completion of one VM - instruction as defined in . However, some implementations - may define locations differently. In any case the + generated whenever a thread reaches a new location. + Typically, single step events represent the completion of one VM + instruction as defined in . However, some implementations + may define locations differently. In any case the method
andlocation
parameters uniquely identify the current location and allow - the mapping to source file and line number when that information is + the mapping to source file and line number when that information is available. No single step events are generated from within native methods. @@ -11910,7 +11910,7 @@ myInit() {- + JNIEnv @@ -11953,14 +11953,14 @@ myInit() { designated as a breakpoint with. The method
andlocation
parameters uniquely identify the current location and allow - the mapping to source file and line number when that information is + the mapping to source file and line number when that information is available.jvmdi - + JNIEnv @@ -12000,18 +12000,18 @@ myInit() { id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">Field access events are generated whenever a thread accesses - a field that was designated as a watchpoint + a field that was designated as a watchpoint with . - The method
andlocation
+ Themethod
andlocation
parameters uniquely identify the current location and allow - the mapping to source file and line number when that information is - available. + the mapping to source file and line number when that information is + available.jvmdi - + JNIEnv @@ -12070,18 +12070,18 @@ myInit() { id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">Field modification events are generated whenever a thread modifies - a field that was designated as a watchpoint + a field that was designated as a watchpoint with . - The method
andlocation
+ Themethod
andlocation
parameters uniquely identify the current location and allow - the mapping to source file and line number when that information is - available. + the mapping to source file and line number when that information is + available.jvmdi - + JNIEnv @@ -12151,25 +12151,25 @@ myInit() {- Frame pop events are generated upon exit from a single method + Frame pop events are generated upon exit from a single method in a single frame as specified in a call to . This is true whether termination is caused by executing its return instruction - or by throwing an exception to its caller + or by throwing an exception to its caller (see ). - However, frame pops caused by the + However, frame pops caused by the function are not reported. The location reported by - identifies the executable location in the returning method, - immediately prior to the return. + identifies the executable location in the returning method, + immediately prior to the return. jvmdi - + JNIEnv @@ -12209,24 +12209,24 @@ myInit() {- Method entry events are generated upon entry of Java + Method entry events are generated upon entry of Java programming language methods (including native methods). The location reported by identifies the initial executable location in - the method. + the method. Enabling method entry or exit events will significantly degrade performance on many platforms and is thus not advised for performance critical usage (such as profiling). - Bytecode instrumentation should be +Bytecode instrumentation should be used in these cases.jvmdi - + JNIEnv @@ -12259,25 +12259,25 @@ myInit() {- Method exit events are generated upon exit from Java + Method exit events are generated upon exit from Java programming language methods (including native methods). This is true whether termination is caused by executing its return instruction - or by throwing an exception to its caller + or by throwing an exception to its caller (see ). The method
field uniquely identifies the - method being entered or exited. Theframe
field provides + method being entered or exited. Theframe
field provides access to the stack frame for the method. The location reported by- identifies the executable location in the returning method - immediately prior to the return. + identifies the executable location in the returning method + immediately prior to the return. Enabling method entry or exit events will significantly degrade performance on many platforms and is thus not advised for performance critical usage (such as profiling). - Bytecode instrumentation should be +Bytecode instrumentation should be used in these cases.jvmdi @@ -12322,7 +12322,7 @@ myInit() {The return value of the method being exited. - Undefined and should not be used if + Undefined and should not be used if @@ -12333,18 +12333,18 @@ myInit() {is true. - A Native Method Bind event is sent when a VM binds a + A Native Method Bind event is sent when a VM binds a Java programming language native method - to the address of a function that implements the native method. + to the address of a function that implements the native method. This will occur when the native method is called for the first time and also occurs when the JNI function RegisterNatives
is called. This event allows the bind to be redirected to an agent-specified - proxy function. + proxy function. This event is not sent when the native method is unbound. - Typically, this proxy function will need to be specific to a + Typically, this proxy function will need to be specific to a particular method or, to handle the general case, automatically - generated assembly code, since after instrumentation code is - executed the function at the original binding + generated assembly code, since after instrumentation code is + executed the function at the original binding address will usually be invoked. The original binding can be restored or the redirection changed by use of the JNI functionRegisterNatives
. @@ -12363,7 +12363,7 @@ myInit() {The JNI environment of the event (current) thread - Will be @@ -12407,7 +12407,7 @@ myInit() { id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">NULL
if sent during the primordial + Will beNULL
if sent during the primordialphase .Exception events are generated whenever an exception is first detected - in a Java programming language method. + in a Java programming language method. Where "exception" means any @@ -12524,7 +12524,7 @@ myInit() {java.lang.Throwable
. The exception may have been thrown by a Java programming language or native method, but in the case of native methods, the event is not generated @@ -12416,20 +12416,20 @@ myInit() { no exception event is generated. Themethod
andlocation
- parameters uniquely identify the current location + parameters uniquely identify the current location (where the exception was detected) and allow - the mapping to source file and line number when that information is + the mapping to source file and line number when that information is available. Theexception
field identifies the thrown exception object. Thecatch_method
andcatch_location
identify the location of the catch clause, if any, that handles the thrown exception. If there is no such catch clause, each field is set to 0. There is no guarantee that the thread will ever reach this catch clause. If there are native methods on the call stack - between the throw location and the catch clause, the exception may + between the throw location and the catch clause, the exception may be reset by one of those native methods. Similarly, exceptions that are reported as uncaught (catch_klass
et al. set to 0) may in fact be caught by native code. - Agents can check for these occurrences by monitoring + Agents can check for these occurrences by monitoringevents. Note that finally clauses are implemented as catch and re-throw. Therefore they will be reported in the catch location. @@ -12438,7 +12438,7 @@ myInit() { - + JNIEnv @@ -12505,18 +12505,18 @@ myInit() { Where "exception" means anyjava.lang.Throwable
. If the exception is caught in a Java programming language method, the event is generated when the catch clause is reached. If the exception is caught in a native - method, the event is generated as soon as control is returned to a Java programming language + method, the event is generated as soon as control is returned to a Java programming language method. Exception catch events are generated for any exception for which a throw was detected in a Java programming language method. Note that finally clauses are implemented as catch and re-throw. Therefore they will generate exception catch events. Themethod
andlocation
- parameters uniquely identify the current location - and allow the mapping to source file and line number when that information is - available. For exceptions caught in a Java programming language method, the + parameters uniquely identify the current location + and allow the mapping to source file and line number when that information is + available. For exceptions caught in a Java programming language method, theexception
object identifies the exception object. Exceptions - caught in native methods are not necessarily available by the time the + caught in native methods are not necessarily available by the time the exception catch is reported, so theexception
field is set toNULL
.- + JNIEnv @@ -12570,11 +12570,11 @@ myInit() { id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">Thread start events are generated by a new thread before its initial - method executes. + method executes. A thread may be listed in the array returned by - before its thread start event is generated. + before its thread start event is generated. It is possible for other events to be generated on a thread before its thread start event. @@ -12583,7 +12583,7 @@ myInit() { jvmdi - + JNIEnv @@ -12602,14 +12602,14 @@ myInit() {+ id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start"> Thread end events are generated by a terminating thread - after its initial method has finished execution. + after its initial method has finished execution. A thread may be listed in the array returned by - after its thread end event is generated. + after its thread end event is generated. No events are generated on a thread after its thread end event. @@ -12618,7 +12618,7 @@ myInit() { jvmdi - + JNIEnv @@ -12641,15 +12641,15 @@ myInit() {A class load event is generated when a class is first loaded. The order of class load events generated by a particular thread are guaranteed - to match the order of class loading within that thread. + to match the order of class loading within that thread. Array class creation does not generate a class load event. - The creation of a primitive class (for example, java.lang.Integer.TYPE) + The creation of a primitive class (for example, java.lang.Integer.TYPE) does not generate a class load event. This event is sent at an early stage in loading the class. As a result the class should be used carefully. Note, for example, that methods and fields are not yet loaded, so queries for methods, - fields, subclasses, and so on will not give correct results. + fields, subclasses, and so on will not give correct results. See "Loading of Classes and Interfaces" in the Java Language Specification. For most purposes the event will @@ -12658,7 +12658,7 @@ myInit() { jvmdi - + JNIEnv @@ -12687,7 +12687,7 @@ myInit() { id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">A class unload event is generated when the class is about to be unloaded. - Class unload events take place during garbage collection and must be + Class unload events take place during garbage collection and must be handled extremely carefully. The garbage collector holds many locks and has suspended all other threads, so the event handler cannot depend on the ability to acquire any locks. The class unload event handler should @@ -12704,7 +12704,7 @@ myInit() { jvmdi - + JNIEnv @@ -12733,16 +12733,16 @@ myInit() { id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">A class prepare event is generated when class preparation is complete. - At this point, class fields, methods, and implemented interfaces are - available, and no code from the class has been executed. Since array - classes never have fields or methods, class prepare events are not - generated for them. Class prepare events are not generated for - primitive classes (for example, java.lang.Integer.TYPE
). + At this point, class fields, methods, and implemented interfaces are + available, and no code from the class has been executed. Since array + classes never have fields or methods, class prepare events are not + generated for them. Class prepare events are not generated for + primitive classes (for example,java.lang.Integer.TYPE
).jvmdi - + JNIEnv @@ -12771,14 +12771,14 @@ myInit() {This event is sent when the VM obtains class file data, but before it constructs - the in-memory representation for that class. - This event is also sent when the class is being modified by the + the in-memory representation for that class. + This event is also sent when the class is being modified by the function or the function, called in any environment. The agent can instrument the existing class file data sent by the VM to include profiling/debugging hooks. - See the description of + See the description of bytecode instrumentation for usage information. @@ -12788,28 +12788,28 @@ myInit() {are enabled then this event may be sent in the primordial phase. - Otherwise, this event may be sent before the VM is initialized (the start + Otherwise, this event may be sent before the VM is initialized (the start can_generate_all_class_hook_events
phase ). Some classes might not be compatible with the function (eg. ROMized classes or implementation defined classes) and this event will not be generated for these classes. - The agent must allocate the space for the modified + The agent must allocate the space for the modified class file data buffer - using the memory allocation function + using the memory allocation functionbecause the VM is responsible for freeing the new class file data buffer using . - If the agent wishes to modify the class file, it must set + If the agent wishes to modify the class file, it must set new_class_data
to point to the newly instrumented class file data buffer and set -new_class_data_len
to the length of that +new_class_data_len
to the length of that buffer before returning from this call. If no modification is desired, the agent simply does not setnew_class_data
. If multiple agents have enabled this event the results are chained. That is, if -new_class_data
has been set, it becomes the +new_class_data
has been set, it becomes theclass_data
for the next agent. When handling a class load in the live phase, then the @@ -12827,13 +12827,13 @@ myInit() {retransformation incapable - environments, in the + environments, in the order in which they were created- @@ -12869,7 +12869,7 @@ myInit() {
retransformation capable - environments, in the + environments, in the order in which they were created- The class loader loading the class. + The class loader loading the class. @@ -12972,7 +12972,7 @@ myInit() { with other events, but the preceding events should be handled carefully, if at all, because the VM has not completed its initialization. The thread start event for the - main application thread is guaranteed not to occur until after the + main application thread is guaranteed not to occur until after the handler for the VM initialization event returns. In the case of VM start-up failure, this event will not be sent. @@ -13001,7 +13001,7 @@ myInit() {NULL
if the bootstrap class loader.- The VM death event notifies the agent of the termination of the VM. + The VM death event notifies the agent of the termination of the VM. No events will occur after the VMDeath event. In the case of VM start-up failure, this event will not be sent. @@ -13032,7 +13032,7 @@ myInit() { followed by a new CompiledMethodLoad
event. Note that a single method may have multiple compiled forms, and that this event will be sent for each form. - Note also that several methods may be inlined into a single + Note also that several methods may be inlined into a single address range, and that this event will be sent for each method. These events can be sent after their initial occurrence with @@ -13049,7 +13049,7 @@ myInit() {- Corresponding location. See + Corresponding location. See @@ -13095,7 +13095,7 @@ myInit() {for the meaning of location. jvmtiAddrLocationMap Map from native addresses to location. - The native address range of each entry is from + The native address range of each entry is from to start_address-1
of the next entry.NULL
if mapping information cannot be supplied. @@ -13104,10 +13104,10 @@ myInit() {- VM-specific compilation information. + VM-specific compilation information. The referenced compile information is managed by the VM and must not depend on the agent for collection. - A VM implementation defines the content and lifetime + A VM implementation defines the content and lifetime of the information. @@ -13119,9 +13119,9 @@ myInit() {Sent when a compiled method is unloaded from memory. This event might not be sent on the thread which performed the unload. - This event may be sent sometime after the unload occurs, but + This event may be sent sometime after the unload occurs, but will be sent before the memory is reused - by a newly generated compiled method. This event may be sent after + by a newly generated compiled method. This event may be sent after the class is unloaded. jvmpi @@ -13139,7 +13139,7 @@ myInit() {Compiled method being unloaded. - For identification of the compiled method only -- the class + For identification of the compiled method only -- the class may be unloaded and therefore the method should not be used as an argument to further JNI or @@ -13148,7 +13148,7 @@ myInit() {functions. Address where compiled method code was loaded. - For identification of the compiled method only -- + For identification of the compiled method only -- the space may have been reclaimed. @@ -13236,7 +13236,7 @@ myInit() {- JNI local reference to the thread + JNI local reference to the thread attempting to enter the monitor @@ -13367,28 +13367,28 @@ myInit() { since="1.1">Sent when a VM resource needed by a running application has been exhausted. - Except as required by the optional capabilities, the set of resources + Except as required by the optional capabilities, the set of resources which report exhaustion is implementation dependent. The following bit flags define the properties of the resource exhaustion: - After this event returns, the VM will throw a +java.lang.OutOfMemoryError
. -- The VM was unable to allocate memory from the +Java + The VM was unable to allocate memory from theJava platform heap. The heap is the runtime data area from which memory for all class instances and arrays are allocated. -The VM was unable to create a thread. - +new @@ -13398,7 +13398,7 @@ myInit() {heap .- Can generate events when the VM is unable to + Can generate events when the VM is unable to @@ -13416,8 +13416,8 @@ myInit() {create a thread .Flags defining the properties of the of resource exhaustion - as specified by the - @@ -13440,16 +13440,16 @@ myInit() {Resource + as specified by the + Resource Exhaustion Flags .- Sent when a method causes the virtual machine to allocate an + Sent when a method causes the virtual machine to allocate an Object visible to Java programming language code and the allocation is not detectable by other intrumentation mechanisms. Generally object allocation should be detected by instrumenting the bytecodes of allocating methods. Object allocation generated in native code by JNI function - calls should be detected using + calls should be detected using @@ -13659,54 +13659,54 @@ myInit() {JNI function interception . - Some methods might not have associated bytecodes and are not - native methods, they instead are executed directly by the + Some methods might not have associated bytecodes and are not + native methods, they instead are executed directly by the VM. These methods should send this event. Virtual machines which are incapable of bytecode instrumentation for some or all of their methods can send this event. @@ -13539,7 +13539,7 @@ myInit() {- A Garbage Collection Start event is sent when a + A Garbage Collection Start event is sent when a garbage collection pause begins. Only stop-the-world collections are reported--that is, collections during which all threads cease to modify the state of the Java virtual machine. @@ -13550,8 +13550,8 @@ myInit() { specifically allow such use (see the raw monitor, memory management, and environment local storage functions). - This event is always sent as a matched pair with - @@ -13580,11 +13580,11 @@ myInit() { and the handler for the Garbage Collection Finish event simply notifies the raw monitor - This event is always sent as a matched pair with + This event is always sent as a matched pair with+ This event is always sent as a matched pair with + (assuming both events are enabled) and no garbage collection events will occur between them. (assuming both events are enabled). The most important use of this event is to provide timing information, - and thus additional information is not required. However, + and thus additional information is not required. However, information about the collection which is "free" should be included - what that information is needs to be determined. @@ -13613,7 +13613,7 @@ myInit() {- Though this seemed trivial to implement. + Though this seemed trivial to implement. In the RI it appears this will be quite complex. - Holds a Java programming language int
. + Holds a Java programming languageint
. Signed 32 bits.- Holds a Java programming language long
. + Holds a Java programming languagelong
. Signed 64 bits.- Holds a Java programming language float
. + Holds a Java programming languagefloat
. 32 bits.- Holds a Java programming language double
. + Holds a Java programming languagedouble
. 64 bits.- Holds a Java programming language object. + Holds a Java programming language object. - Holds a Java programming language class. + Holds a Java programming language class. - Is a union of all primitive types and jobject
. Thus, holds any Java - programming language value. + Is a union of all primitive types andjobject
. Thus, holds any Java + programming language value.- Identifies a Java programming language field. + Identifies a Java programming language field. jfieldID
s returned byfunctions and events may be safely stored. - Identifies a Java programming language method, initializer, or constructor. + Identifies a Java programming language method, initializer, or constructor. jmethodID
s returned byfunctions and events may be safely stored. However, if the class is unloaded, they become invalid and must not be used. @@ -13715,7 +13715,7 @@ myInit() { @@ -13723,9 +13723,9 @@ myInit() { Pointer to the JNI function table. Pointer to this ( JNIEnv *
) - is a JNI environment. + is a JNI environment.@@ -13744,8 +13744,8 @@ myInit() { - The environment pointer. + Theenvironment pointer. See theFunction Section . -jvmtiEnv
points to the +jvmtiEnv
points to thefunction table pointer.typedef jlong jlocation; - A 64 bit value, representing a monotonically increasing - executable position within a method. + A 64 bit value, representing a monotonically increasing + executable position within a method. @@ -13775,13 +13775,13 @@ typedef enum {-1
indicates a native method. Seefor the format on a given VM. @@ -13763,10 +13763,10 @@ typedef struct _jrawMonitorID *jrawMonitorID; Holds an error return code. See the Error section for possible values.-typedef enum { - JVMTI_ERROR_NONE = 0, +typedef enum { + JVMTI_ERROR_NONE = 0, JVMTI_ERROR_INVALID_THREAD = 10, - ... + ... } jvmtiError; An identifier for an event type. See the @@ -13793,16 +13793,16 @@ typedef enum { typedef struct { jvmtiEventVMInit VMInit; jvmtiEventVMDeath VMDeath; - ... + ... } jvmtiEventCallbacks; - SeeEvent section for possible values. - It is guaranteed that future versions of this specification will + It is guaranteed that future versions of this specification will never assign zero as an event type identifier.-typedef enum { - JVMTI_EVENT_SINGLE_STEP = 1, - JVMTI_EVENT_BREAKPOINT = 2, - ... +typedef enum { + JVMTI_EVENT_SINGLE_STEP = 1, + JVMTI_EVENT_BREAKPOINT = 2, + ... } jvmtiEvent; event callbacks + Seeevent callbacks for the complete structure. Where, for example, the VM initialization callback is defined:typedef void (JNICALL *jvmtiEventVMInit) - (jvmtiEnv *jvmti_env, + (jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread); @@ -13813,8 +13813,8 @@ typedef void (JNICALL *jvmtiEventVMInit)typedef struct JNINativeInterface_ jniNativeInterface; Typedef for the JNI function table @@ -13826,13 +13826,13 @@ typedef void (JNICALL *jvmtiEventVMInit)JNINativeInterface
- defined in the -+ defined in the + JNI Specification . The JNI reference implementation defines this with an underscore.JVMDI requires that the agent suspend threads before calling - certain sensitive functions. JVMPI requires garbage collection to be - disabled before calling certain sensitive functions. + certain sensitive functions. JVMPI requires garbage collection to be + disabled before calling certain sensitive functions. It was suggested that rather than have this requirement, that VM place itself in a suitable state before performing an operation. This makes considerable sense since each VM knows its requirements and can most easily arrange a - safe state. + safe state. The ability to externally suspend/resume threads will, of course, remain. The ability to enable/disable garbage collection will not. @@ -13840,19 +13840,19 @@ typedef void (JNICALL *jvmtiEventVMInit) This issue is resolved--suspend will not be required. The spec has been updated to reflect this. - +There are a variety of approaches to sampling call stacks. The biggest bifurcation is between VM controlled and agent - controlled. + controlled. This issue is resolved--agent controlled sampling will be the approach. - +JVMDI represents threads as jthread. JVMPI primarily - uses JNIEnv* to represent threads. + uses JNIEnv* to represent threads. The Expert Group has chosen jthread as the representation for threads in . @@ -13863,26 +13863,26 @@ typedef void (JNICALL *jvmtiEventVMInit) The JNI spec allows an implementation to depend on jclass/jmethodID - pairs, rather than simply a jmethodID, to reference a method. - JVMDI, for consistency, choose the same representation. + pairs, rather than simply a jmethodID, to reference a method. + JVMDI, for consistency, choose the same representation. JVMPI, however, specifies that a jmethodID alone maps to a method. Both of the Sun J2SE virtual machines (Classic andHotSpot ) store pointers in jmethodIDs, and as a result, a jmethodID is sufficient. In fact, any JVM implementation that supports JVMPI must have - such a representation. + such a representation.will use jmethodID as a unique representation of a method (no jclass is used). - There should be efficiency gains, particularly in + There should be efficiency gains, particularly in functionality like stack dumping, to this representation. Note that fields were not used in JVMPI and that the access profile - of fields differs from methods--for implementation efficiency - reasons, a jclass/jfieldID pair will still be needed for field + of fields differs from methods--for implementation efficiency + reasons, a jclass/jfieldID pair will still be needed for field reference. - Functions return local references. + Functions return local references. @@ -13900,37 +13900,37 @@ typedef void (JNICALL *jvmtiEventVMInit) - A hint of the percentage of objects that will be tagged would + A hint of the percentage of objects that will be tagged would help the VM pick a good implementation. - How difficult or easy would be to extend the monitor_info category to include + How difficult or easy would be to extend the monitor_info category to include - - current number of monitors - - enumeration of monitors - - enumeration of threads waiting on a given monitor + - current number of monitors + - enumeration of monitors + - enumeration of threads waiting on a given monitor- The reason for my question is the fact that current get_monitor_info support - requires the agent to specify a given thread to get the info which is probably - OK in the profiling/debugging space, while in the monitoring space the agent - could be watching the monitor list and then decide which thread to ask for - the info. You might ask why is this important for monitoring .... I think it + The reason for my question is the fact that current get_monitor_info support + requires the agent to specify a given thread to get the info which is probably + OK in the profiling/debugging space, while in the monitoring space the agent + could be watching the monitor list and then decide which thread to ask for + the info. You might ask why is this important for monitoring .... I think it can aid in the detection/prediction of application contention caused by hot-locks.- The specification is an evolving document with major, minor, + The specification is an evolving document with major, minor, and micro version numbers. A released version of the specification is uniquely identified by its major and minor version. - The functions, events, and capabilities in this specification + The functions, events, and capabilities in this specification indicate a "Since" value which is the major and minor version in which it was introduced. - The version of the specification implemented by the VM can - be retrieved at runtime with the + The version of the specification implemented by the VM can + be retrieved at runtime with the function. @@ -14024,9 +14024,9 @@ typedef void (JNICALL *jvmtiEventVMInit) get/set annotation, iterate live objects/heap. Add heap profiling functions place holder added: heap roots. - Heap profiling event added: object free. - Heap profiling event redesigned: vm object allocation. - Heap profiling event placeholders added: garbage collection start/finish. + Heap profiling event added: object free. + Heap profiling event redesigned: vm object allocation. + Heap profiling event placeholders added: garbage collection start/finish. Native method bind event added. @@ -14158,7 +14158,7 @@ typedef void (JNICALL *jvmtiEventVMInit) One character XML fix. - Change function parameter names to be consistent with + Change function parameter names to be consistent with event parameters (fooBarBaz becomes foo_bar_baz). @@ -14215,8 +14215,8 @@ typedef void (JNICALL *jvmtiEventVMInit) Define the data type jvmtiEventCallbacks
. - Zero length allocations return NULL. - Keep SetAllocationHooks in JVMDI, but remove from. + Zero length allocations return NULL. + Keep SetAllocationHooks in JVMDI, but remove from . Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED. @@ -14234,7 +14234,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Changes per June 11th Expert Group meeting -- - Overhaul Heap functionality: single callback, + Overhaul Heap functionality: single callback, remove GetHeapRoots, add reachable iterators, and rename "annotation" to "tag". NULL thread parameter on most functions is current @@ -14250,8 +14250,8 @@ typedef void (JNICALL *jvmtiEventVMInit) Clean up issues sections. Rename GetClassName back to GetClassSignature and fix description. - Add generic signature to GetClassSignature, - GetFieldSignature, GetMethodSignature, and + Add generic signature to GetClassSignature, + GetFieldSignature, GetMethodSignature, and GetLocalVariableTable. Elide EstimateCostOfCapabilities. Clarify that the system property functions operate @@ -14338,7 +14338,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Split can_get_source_info into can_get_source_file_name, can_get_line_numbers, and can_get_source_debug_extension. PopFrame cannot have a native calling method. - Removed incorrect statement in GetClassloaderClasses + Removed incorrect statement in GetClassloaderClasses (see ). @@ -14370,7 +14370,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT. - Steal java.lang.Runtime.availableProcessors() wording for + Steal java.lang.Runtime.availableProcessors() wording for AvailableProcessors(). Guarantee that zero will never be an event ID. Remove some issues which are no longer issues. @@ -14395,7 +14395,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Remove the ClassUnload event. - Heap reference iterator callbacks return an enum that + Heap reference iterator callbacks return an enum that allows outgoing object references to be ignored. Allow JNIEnv as a param type to extension events/functions. @@ -14403,23 +14403,23 @@ typedef void (JNICALL *jvmtiEventVMInit) Fix a typo.- Remove all metadata functions: GetClassMetadata, + Remove all metadata functions: GetClassMetadata, GetFieldMetadata, and GetMethodMetadata. - Mark the functions Allocate. Deallocate, RawMonitor*, - SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage + Mark the functions Allocate. Deallocate, RawMonitor*, + SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage as safe for use in heap callbacks and GC events. - Add pass through opaque user data pointer to heap iterate + Add pass through opaque user data pointer to heap iterate functions and callbacks. In the CompiledMethodUnload event, send the code address. Add GarbageCollectionOccurred event. Add constant pool reference kind. Mark the functions CreateRawMonitor and DestroyRawMonitor as safe for use in heap callbacks and GC events. - Clarify: VMDeath, GetCurrentThreadCpuTimerInfo, + Clarify: VMDeath, GetCurrentThreadCpuTimerInfo, GetThreadCpuTimerInfo, IterateOverReachableObjects, IterateOverObjectsReachableFromObject, GetTime and JVMTI_ERROR_NULL_POINTER. @@ -14434,8 +14434,8 @@ typedef void (JNICALL *jvmtiEventVMInit) SetEventNotificationMode, add: error attempted inappropriate thread level control. Remove jvmtiExceptionHandlerEntry. - Fix handling of native methods on the stack -- - location_ptr param of GetFrameLocation, remove + Fix handling of native methods on the stack -- + location_ptr param of GetFrameLocation, remove JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation, jvmtiFrameInfo.location, and jlocation. Remove typo (from JVMPI) implying that the MonitorWaited @@ -14456,7 +14456,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Remove MonitorContendedExit. Added JNIEnv parameter to VMObjectAlloc. - Clarified definition of class_tag and referrer_index + Clarified definition of class_tag and referrer_index parameters to heap callbacks. @@ -14483,13 +14483,13 @@ typedef void (JNICALL *jvmtiEventVMInit) Require NotifyFramePop to act on suspended threads. - Add capabilities + Add capabilities ( - and + and can_redefine_any_class
) - and an error ( can_generate_all_class_hook_events
) + > can_generate_all_class_hook_events
) which allow some classes to be unmodifiable. @@ -14573,11 +14573,11 @@ typedef void (JNICALL *jvmtiEventVMInit) Bump major.minor version numbers to "1.0". - Clarify interaction between ForceGarbageCollection + Clarify interaction between ForceGarbageCollection and ObjectFree. - Restrict AddToBootstrapClassLoaderSearch and + Restrict AddToBootstrapClassLoaderSearch and SetSystemProperty to the OnLoad phase only. @@ -14604,8 +14604,8 @@ typedef void (JNICALL *jvmtiEventVMInit) Add "since" version marker. Add AddToSystemClassLoaderSearch. Allow AddToBootstrapClassLoaderSearch be used in live phase. - Fix historic rubbish in the descriptions of the heap_object_callback - parameter of IterateOverHeap and IterateOverInstancesOfClass functions; + Fix historic rubbish in the descriptions of the heap_object_callback + parameter of IterateOverHeap and IterateOverInstancesOfClass functions; disallow NULL for this parameter. Clarify, correct and make consistent: wording about current thread, opaque frames and insufficient number of frames in PopFrame. @@ -14629,19 +14629,19 @@ typedef void (JNICALL *jvmtiEventVMInit) Allow agents be started in the live phase. - Added paragraph about deploying agents. + Added paragraph about deploying agents. Add specification description to SetNativeMethodPrefix(es). - Better define the conditions on GetConstantPool. + Better define the conditions on GetConstantPool. Break out the GetClassVersionNumber function from GetConstantPool. - Clean-up the references to the VM Spec. + Clean-up the references to the VM Spec. Allow SetNativeMethodPrefix(es) in any phase. - Add clarifications about the impact of redefinition on GetConstantPool. + Add clarifications about the impact of redefinition on GetConstantPool. Various clarifications to SetNativeMethodPrefix(es). @@ -14655,7 +14655,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Add . Revamp the bytecode instrumentation documentation. - Change to no longer + Change to no longer require the can_redefine_classes capability. @@ -14668,7 +14668,7 @@ typedef void (JNICALL *jvmtiEventVMInit) Add new heap functionity which supports reporting primitive values, allows setting the referrer tag, and has more powerful filtering: - FollowReferences, IterateThroughHeap, and their associated + FollowReferences, IterateThroughHeap, and their associated callbacks, structs, enums, and constants. @@ -14737,10 +14737,10 @@ typedef void (JNICALL *jvmtiEventVMInit) Better phrasing. - Match the referrer_index for static fields in Object Reference Callback + Match the referrer_index for static fields in Object Reference Callback with the Reference Implementation (and all other known implementations); that is, make it match the definition for instance fields. - In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover + In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover an invalid thread in the list; and specify that not started threads return empty stacks. @@ -14756,10 +14756,10 @@ typedef void (JNICALL *jvmtiEventVMInit)Changed spec to return -1 for monitor stack depth for the - implementation which can not determine stack depth. + implementation which can not determine stack depth. - Corrections for readability and accuracy courtesy of Alan Pratt of IBM. + Corrections for readability and accuracy courtesy of Alan Pratt of IBM. List the object relationships reported in FollowReferences. From d0649472fa9ded8775d35eed8f565c325afc4fd4 Mon Sep 17 00:00:00 2001 From: Bob Vandette Date: Fri, 2 Jun 2017 10:35:44 -0400 Subject: [PATCH 015/130] 8181093: assert(si->is_ldr_literal()) failed on arm64 test nsk/jdi/.../returnValue004 Reviewed-by: kvn, dlong --- hotspot/src/cpu/arm/vm/relocInfo_arm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/arm/vm/relocInfo_arm.cpp b/hotspot/src/cpu/arm/vm/relocInfo_arm.cpp index e17c5843cae..3eed9f846a2 100644 --- a/hotspot/src/cpu/arm/vm/relocInfo_arm.cpp +++ b/hotspot/src/cpu/arm/vm/relocInfo_arm.cpp @@ -139,7 +139,7 @@ void metadata_Relocation::pd_fix_value(address x) { #ifdef AARCH64 #ifdef COMPILER2 NativeMovConstReg* ni = nativeMovConstReg_at(addr()); - if (ni->is_movz()) { + if (ni->is_mov_slow()) { return; } #endif From 87be0f2e80f6fba87014068645291842bd3ea0ad Mon Sep 17 00:00:00 2001 From: Anton Litvinov Date: Fri, 2 Jun 2017 18:40:55 +0300 Subject: [PATCH 016/130] 8181192: [macos] javafx.print.PrinterJob.showPrintDialog() hangs on macOS Reviewed-by: prr, serb --- .../macosx/native/libawt_lwawt/awt/CPrinterJob.m | 4 ++-- .../share/classes/sun/print/RasterPrinterJob.java | 8 ++++++++ .../java/awt/print/PageFormat/WrongPaperPrintingTest.java | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m index db54e27faca..03a32ddd8e7 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m @@ -376,7 +376,7 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj static JNF_MEMBER_CACHE(jm_getMaxPage, sjc_CPrinterJob, "getMaxPageAttrib", "()I"); static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I"); static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I"); - static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormat", "(I)Ljava/awt/print/PageFormat;"); + static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormatFromAttributes", "()Ljava/awt/print/PageFormat;"); NSMutableDictionary* printingDictionary = [dst dictionary]; @@ -412,7 +412,7 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj [printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage]; [printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage]; - jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat, (jint)0); + jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat); if (page != NULL) { javaPageFormatToNSPrintInfo(env, NULL, page, dst); } diff --git a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java index b856b4aa1e7..018ac519d00 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java @@ -886,6 +886,14 @@ public abstract class RasterPrinterJob extends PrinterJob { } } + protected PageFormat getPageFormatFromAttributes() { + if (attributes == null || attributes.isEmpty()) { + return null; + } + return attributeToPageFormat(getPrintService(), this.attributes); + } + + /** * Presents the user a dialog for changing properties of the * print job interactively. diff --git a/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java b/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java index 79f07489e3f..2299015b25d 100644 --- a/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java +++ b/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java @@ -24,6 +24,7 @@ /* @test @bug 8167102 @summary PrintRequestAttributeSet breaks page size set using PageFormat + @ignore Exclude the test until 8167102 is resolved by a new reassessed fix @run main/manual WrongPaperPrintingTest */ From cc296e46f5ea9ea607e2173e70612bca1d4cd741 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Fri, 2 Jun 2017 18:32:39 +0100 Subject: [PATCH 017/130] 8180155: WebSocket secure connection get stuck after onOpen 8156518: WebSocket.Builder.connectTimeout(long timeout, TimeUnit unit) implicitly affect websocket connection timeout Reviewed-by: dfuchs --- .../jdk/incubator/http/MultiExchange.java | 5 +- .../jdk/incubator/http/SSLDelegate.java | 4 +- .../http/internal/websocket/Receiver.java | 117 ++++++++++-------- 3 files changed, 67 insertions(+), 59 deletions(-) diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java index 45f12aab1bc..44e34eef5b9 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java @@ -316,13 +316,14 @@ class MultiExchange { }) // 5. Handle errors and cancel any timer set .handle((response, ex) -> { - if (response != null) { + cancelTimer(); + if (ex == null) { + assert response != null; return MinimalFuture.completedFuture(response); } // all exceptions thrown are handled here CompletableFuture error = getExceptionalCF(ex); if (error == null) { - cancelTimer(); return responseAsyncImpl(); } else { return error; diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java index ec0f4d0e00f..34fed7e7166 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java @@ -274,9 +274,7 @@ class SSLDelegate { int x; do { if (needData) { - do { - x = chan.read (unwrap_src); - } while (x == 0); + x = chan.read (unwrap_src); if (x == -1) { throw new IOException ("connection closed for reading"); } diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java index 4168da9b52b..8812d442794 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Receiver.java @@ -28,7 +28,6 @@ package jdk.incubator.http.internal.websocket; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; -import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; /* @@ -58,23 +57,24 @@ final class Receiver { private final Frame.Reader reader = new Frame.Reader(); private final RawChannel.RawEvent event = createHandler(); private final AtomicLong demand = new AtomicLong(); - private final CooperativeHandler handler = - new CooperativeHandler(this::pushContinuously); - /* - * Used to ensure registering the channel event at most once (i.e. to avoid - * multiple registrations). - */ - private final AtomicBoolean readable = new AtomicBoolean(); + private final CooperativeHandler handler; + private ByteBuffer data; + private volatile int state; + + private static final int UNREGISTERED = 0; + private static final int AVAILABLE = 1; + private static final int WAITING = 2; Receiver(MessageStreamConsumer messageConsumer, RawChannel channel) { this.messageConsumer = messageConsumer; this.channel = channel; - this.data = channel.initialByteBuffer(); this.frameConsumer = new FrameConsumer(this.messageConsumer); - // To ensure the initial non-final `data` will be read correctly - // (happens-before) by reader after executing readable.get() - readable.set(true); + this.data = channel.initialByteBuffer(); + // To ensure the initial non-final `data` will be visible + // (happens-before) when `handler` invokes `pushContinuously` + // the following assignment is done last: + handler = new CooperativeHandler(this::pushContinuously); } private RawChannel.RawEvent createHandler() { @@ -87,7 +87,7 @@ final class Receiver { @Override public void handle() { - readable.set(true); + state = AVAILABLE; handler.handle(); } }; @@ -110,54 +110,63 @@ final class Receiver { /* * Stops the machinery from reading and delivering messages permanently, - * regardless of the current demand. + * regardless of the current demand and data availability. */ void close() { handler.stop(); } private void pushContinuously() { - while (readable.get() && demand.get() > 0 && !handler.isStopped()) { - pushOnce(); - } - } - - private void pushOnce() { - if (data == null && !readData()) { - return; - } - try { - reader.readFrame(data, frameConsumer); // Pushing frame parts to the consumer - } catch (FailWebSocketException e) { - messageConsumer.onError(e); - return; - } - if (!data.hasRemaining()) { - data = null; - } - } - - private boolean readData() { - try { - data = channel.read(); - } catch (IOException e) { - messageConsumer.onError(e); - return false; - } - if (data == null) { // EOF - messageConsumer.onComplete(); - return false; - } else if (!data.hasRemaining()) { // No data in the socket at the moment - data = null; - readable.set(false); - try { - channel.registerEvent(event); - } catch (IOException e) { - messageConsumer.onError(e); + while (!handler.isStopped()) { + if (data.hasRemaining()) { + if (demand.get() > 0) { + try { + int oldPos = data.position(); + reader.readFrame(data, frameConsumer); + int newPos = data.position(); + assert oldPos != newPos : data; // reader always consumes bytes + } catch (FailWebSocketException e) { + handler.stop(); + messageConsumer.onError(e); + } + continue; + } + break; + } + switch (state) { + case WAITING: + return; + case UNREGISTERED: + try { + state = WAITING; + channel.registerEvent(event); + } catch (IOException e) { + handler.stop(); + messageConsumer.onError(e); + } + return; + case AVAILABLE: + try { + data = channel.read(); + } catch (IOException e) { + handler.stop(); + messageConsumer.onError(e); + return; + } + if (data == null) { // EOF + handler.stop(); + messageConsumer.onComplete(); + return; + } else if (!data.hasRemaining()) { // No data at the moment + // Pretty much a "goto", reusing the existing code path + // for registration + state = UNREGISTERED; + } + continue; + default: + throw new InternalError(String.valueOf(state)); } - return false; } - assert data.hasRemaining(); - return true; } } + From 8031c134aa2c530413469cecda7dd33d052cb103 Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan Date: Fri, 2 Jun 2017 13:38:43 -0700 Subject: [PATCH 018/130] 8181441: Fix minor typo/link in the old standard doclet API documentation Reviewed-by: jjg --- .../share/classes/com/sun/tools/doclets/Taglet.java | 9 +++++---- .../classes/com/sun/tools/doclets/standard/Standard.java | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java index 9f71567becc..a1bf6c016ef 100644 --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ import com.sun.javadoc.*; * tag must implement this interface. * * - * Note: This interface has been superseded by one - * in the new package {@code jdk.javadoc.doclet.taglet}. + * Note: This interface has been superseded by its replacement, + * {@link jdk.javadoc.doclet.Taglet}. *
* * To be loaded and used by @@ -66,7 +66,8 @@ import com.sun.javadoc.*; * @author Jamie Ho * * @deprecated - * This interface has been superseded by one in the new package {@code jdk.javadoc.doclet.taglet}. + * This interface has been superseded by its replacement, + * {@link jdk.javadoc.doclet.Taglet}. */ @Deprecated public interface Taglet { diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java index e75ddc6924d..fbff58b81c5 100644 --- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java +++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java @@ -31,7 +31,7 @@ import com.sun.tools.doclets.formats.html.*; /** * This doclet generates HTML-formatted documentation for the specified packages and types. * @deprecated The doclet has been superseded by its replacement, - * {@code jdk.javadoc.doclets.StandardDoclet}. + * {@link jdk.javadoc.doclet.StandardDoclet}. */ @Deprecated(forRemoval=true, since="9") public class Standard { From c4d86b2455ba0dad12de2f7e35a67c91279385b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?=Date: Tue, 6 Jun 2017 13:31:34 -0400 Subject: [PATCH 019/130] 8161145: The min/max macros make hotspot tests fail to build with GCC 6 Change min/max macros to expand (once) to self. Reviewed-by: sgehwolf, pliden, andrew --- hotspot/src/share/vm/utilities/globalDefinitions.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index e07ed31678d..dbb080ef6e3 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1095,8 +1095,11 @@ inline intptr_t bitfield(intptr_t x, int start_bit_no, int field_length) { #undef min #endif -#define max(a,b) Do_not_use_max_use_MAX2_instead -#define min(a,b) Do_not_use_min_use_MIN2_instead +// The following defines serve the purpose of preventing use of accidentally +// included min max macros from compiling, while continuing to allow innocent +// min and max identifiers in the code to compile as intended. +#define max max +#define min min // It is necessary to use templates here. Having normal overloaded // functions does not work because it is necessary to provide both 32- From 061b09e8472d7d45c25d869aace8eb5fe5237e7b Mon Sep 17 00:00:00 2001 From: Ron Pressler Date: Mon, 5 Jun 2017 15:52:09 -0700 Subject: [PATCH 020/130] 8181292: Backport Rename internal Unsafe.compare methods from 10 to 9 Co-authored-by: Claes Redestad Reviewed-by: psandoz, dholmes, thartmann, kvn --- .../hotspot/test/CheckGraalIntrinsics.java | 56 ++++---- .../StandardGraphBuilderPlugins.java | 8 +- hotspot/src/share/vm/c1/c1_Compiler.cpp | 8 +- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 8 +- hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 8 +- hotspot/src/share/vm/classfile/vmSymbols.cpp | 35 ++--- hotspot/src/share/vm/classfile/vmSymbols.hpp | 130 +++++++++--------- hotspot/src/share/vm/opto/c2compiler.cpp | 72 +++++----- hotspot/src/share/vm/opto/library_call.cpp | 89 ++++++------ hotspot/src/share/vm/prims/unsafe.cpp | 22 +-- .../src/share/vm/shark/sharkIntrinsics.cpp | 10 +- .../src/share/vm/shark/sharkIntrinsics.hpp | 4 +- .../c2/cr8004867/TestIntUnsafeCAS.java | 108 +++++++-------- .../intrinsics/unsafe/TestCAEAntiDep.java | 3 +- .../intrinsics/unsafe/UnsafeTwoCASLong.java | 7 +- .../test/compiler/profiling/UnsafeAccess.java | 2 +- ...dkInternalMiscUnsafeAccessTestBoolean.java | 51 ++++--- .../JdkInternalMiscUnsafeAccessTestByte.java | 51 ++++--- .../JdkInternalMiscUnsafeAccessTestChar.java | 51 ++++--- ...JdkInternalMiscUnsafeAccessTestDouble.java | 51 ++++--- .../JdkInternalMiscUnsafeAccessTestFloat.java | 51 ++++--- .../JdkInternalMiscUnsafeAccessTestInt.java | 51 ++++--- .../JdkInternalMiscUnsafeAccessTestLong.java | 51 ++++--- ...JdkInternalMiscUnsafeAccessTestObject.java | 51 ++++--- .../JdkInternalMiscUnsafeAccessTestShort.java | 51 ++++--- .../SunMiscUnsafeAccessTestBoolean.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestByte.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestChar.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestDouble.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestFloat.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestInt.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestLong.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestObject.java | 3 +- .../unsafe/SunMiscUnsafeAccessTestShort.java | 3 +- .../unsafe/X-UnsafeAccessTest.java.template | 61 +++++--- 35 files changed, 566 insertions(+), 551 deletions(-) diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java index d070eb08fbc..9a73893a4f5 100644 --- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -246,21 +246,21 @@ public class CheckGraalIntrinsics extends GraalTest { "jdk/internal/misc/Unsafe.allocateUninitializedArray0(Ljava/lang/Class;I)Ljava/lang/Object;", "jdk/internal/misc/Unsafe.compareAndExchangeByteAcquire(Ljava/lang/Object;JBB)B", "jdk/internal/misc/Unsafe.compareAndExchangeByteRelease(Ljava/lang/Object;JBB)B", - "jdk/internal/misc/Unsafe.compareAndExchangeByteVolatile(Ljava/lang/Object;JBB)B", + "jdk/internal/misc/Unsafe.compareAndExchangeByte(Ljava/lang/Object;JBB)B", "jdk/internal/misc/Unsafe.compareAndExchangeIntAcquire(Ljava/lang/Object;JII)I", "jdk/internal/misc/Unsafe.compareAndExchangeIntRelease(Ljava/lang/Object;JII)I", - "jdk/internal/misc/Unsafe.compareAndExchangeIntVolatile(Ljava/lang/Object;JII)I", + "jdk/internal/misc/Unsafe.compareAndExchangeInt(Ljava/lang/Object;JII)I", "jdk/internal/misc/Unsafe.compareAndExchangeLongAcquire(Ljava/lang/Object;JJJ)J", "jdk/internal/misc/Unsafe.compareAndExchangeLongRelease(Ljava/lang/Object;JJJ)J", - "jdk/internal/misc/Unsafe.compareAndExchangeLongVolatile(Ljava/lang/Object;JJJ)J", + "jdk/internal/misc/Unsafe.compareAndExchangeLong(Ljava/lang/Object;JJJ)J", "jdk/internal/misc/Unsafe.compareAndExchangeObjectAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "jdk/internal/misc/Unsafe.compareAndExchangeObjectRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", - "jdk/internal/misc/Unsafe.compareAndExchangeObjectVolatile(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", + "jdk/internal/misc/Unsafe.compareAndExchangeObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "jdk/internal/misc/Unsafe.compareAndExchangeShortAcquire(Ljava/lang/Object;JSS)S", "jdk/internal/misc/Unsafe.compareAndExchangeShortRelease(Ljava/lang/Object;JSS)S", - "jdk/internal/misc/Unsafe.compareAndExchangeShortVolatile(Ljava/lang/Object;JSS)S", - "jdk/internal/misc/Unsafe.compareAndSwapByte(Ljava/lang/Object;JBB)Z", - "jdk/internal/misc/Unsafe.compareAndSwapShort(Ljava/lang/Object;JSS)Z", + "jdk/internal/misc/Unsafe.compareAndExchangeShort(Ljava/lang/Object;JSS)S", + "jdk/internal/misc/Unsafe.compareAndSetByte(Ljava/lang/Object;JBB)Z", + "jdk/internal/misc/Unsafe.compareAndSetShort(Ljava/lang/Object;JSS)Z", "jdk/internal/misc/Unsafe.copyMemory0(Ljava/lang/Object;JLjava/lang/Object;JJ)V", "jdk/internal/misc/Unsafe.getAndAddByte(Ljava/lang/Object;JB)B", "jdk/internal/misc/Unsafe.getAndAddShort(Ljava/lang/Object;JS)S", @@ -295,26 +295,26 @@ public class CheckGraalIntrinsics extends GraalTest { "jdk/internal/misc/Unsafe.putObjectOpaque(Ljava/lang/Object;JLjava/lang/Object;)V", "jdk/internal/misc/Unsafe.putShortOpaque(Ljava/lang/Object;JS)V", "jdk/internal/misc/Unsafe.unpark(Ljava/lang/Object;)V", - "jdk/internal/misc/Unsafe.weakCompareAndSwapByte(Ljava/lang/Object;JBB)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapByteAcquire(Ljava/lang/Object;JBB)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapByteRelease(Ljava/lang/Object;JBB)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapByteVolatile(Ljava/lang/Object;JBB)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapInt(Ljava/lang/Object;JII)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapIntAcquire(Ljava/lang/Object;JII)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapIntRelease(Ljava/lang/Object;JII)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapIntVolatile(Ljava/lang/Object;JII)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapLong(Ljava/lang/Object;JJJ)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapLongAcquire(Ljava/lang/Object;JJJ)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapLongRelease(Ljava/lang/Object;JJJ)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapLongVolatile(Ljava/lang/Object;JJJ)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapObjectAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapObjectRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapObjectVolatile(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapShort(Ljava/lang/Object;JSS)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapShortAcquire(Ljava/lang/Object;JSS)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapShortRelease(Ljava/lang/Object;JSS)Z", - "jdk/internal/misc/Unsafe.weakCompareAndSwapShortVolatile(Ljava/lang/Object;JSS)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetBytePlain(Ljava/lang/Object;JBB)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetByteAcquire(Ljava/lang/Object;JBB)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetByteRelease(Ljava/lang/Object;JBB)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetByte(Ljava/lang/Object;JBB)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetIntPlain(Ljava/lang/Object;JII)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetIntAcquire(Ljava/lang/Object;JII)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetIntRelease(Ljava/lang/Object;JII)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetInt(Ljava/lang/Object;JII)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetLongPlain(Ljava/lang/Object;JJJ)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetLongAcquire(Ljava/lang/Object;JJJ)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetLongRelease(Ljava/lang/Object;JJJ)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetLong(Ljava/lang/Object;JJJ)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetObjectPlain(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetObjectAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetObjectRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetShortPlain(Ljava/lang/Object;JSS)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetShortAcquire(Ljava/lang/Object;JSS)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetShortRelease(Ljava/lang/Object;JSS)Z", + "jdk/internal/misc/Unsafe.weakCompareAndSetShort(Ljava/lang/Object;JSS)Z", "jdk/internal/util/Preconditions.checkIndex(IILjava/util/function/BiFunction;)I", "jdk/jfr/internal/JVM.counterTime()J", "jdk/jfr/internal/JVM.getBufferWriter()Ljava/lang/Object;", diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java index 8a45e457eda..ccc89420c7a 100644 --- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java @@ -251,7 +251,13 @@ public class StandardGraphBuilderPlugins { for (JavaKind kind : new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}) { Class> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass(); - r.register5("compareAndSwap" + kind.name(), Receiver.class, Object.class, long.class, javaClass, javaClass, new InvocationPlugin() { + String casName; + if (Java8OrEarlier) { + casName = "compareAndSwap"; + } else { + casName = "compareAndSet"; + } + r.register5(casName + kind.name(), Receiver.class, Object.class, long.class, javaClass, javaClass, new InvocationPlugin() { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode expected, ValueNode x) { // Emits a null-check for the otherwise unused receiver diff --git a/hotspot/src/share/vm/c1/c1_Compiler.cpp b/hotspot/src/share/vm/c1/c1_Compiler.cpp index 731b9efc96c..416f0f38fc8 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.cpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -108,7 +108,7 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) { } switch (id) { - case vmIntrinsics::_compareAndSwapLong: + case vmIntrinsics::_compareAndSetLong: if (!VM_Version::supports_cx8()) return false; break; case vmIntrinsics::_getAndAddInt: @@ -217,8 +217,8 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) { case vmIntrinsics::_updateDirectByteBufferCRC32C: #endif case vmIntrinsics::_vectorizedMismatch: - case vmIntrinsics::_compareAndSwapInt: - case vmIntrinsics::_compareAndSwapObject: + case vmIntrinsics::_compareAndSetInt: + case vmIntrinsics::_compareAndSetObject: case vmIntrinsics::_getCharStringU: case vmIntrinsics::_putCharStringU: #ifdef TRACE_HAVE_INTRINSICS diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 200a3fc782d..d4400483912 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3500,9 +3500,9 @@ void GraphBuilder::build_graph_for_intrinsic(ciMethod* callee, bool ignore_retur case vmIntrinsics::_putLongVolatile : append_unsafe_put_obj(callee, T_LONG, true); return; case vmIntrinsics::_putFloatVolatile : append_unsafe_put_obj(callee, T_FLOAT, true); return; case vmIntrinsics::_putDoubleVolatile : append_unsafe_put_obj(callee, T_DOUBLE, true); return; - case vmIntrinsics::_compareAndSwapLong: - case vmIntrinsics::_compareAndSwapInt: - case vmIntrinsics::_compareAndSwapObject: append_unsafe_CAS(callee); return; + case vmIntrinsics::_compareAndSetLong: + case vmIntrinsics::_compareAndSetInt: + case vmIntrinsics::_compareAndSetObject: append_unsafe_CAS(callee); return; case vmIntrinsics::_getAndAddInt: case vmIntrinsics::_getAndAddLong : append_unsafe_get_and_set_obj(callee, true); return; case vmIntrinsics::_getAndSetInt : diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 8143eefb83d..68c959280d7 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3212,13 +3212,13 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { // java.nio.Buffer.checkIndex case vmIntrinsics::_checkIndex: do_NIOCheckIndex(x); break; - case vmIntrinsics::_compareAndSwapObject: + case vmIntrinsics::_compareAndSetObject: do_CompareAndSwap(x, objectType); break; - case vmIntrinsics::_compareAndSwapInt: + case vmIntrinsics::_compareAndSetInt: do_CompareAndSwap(x, intType); break; - case vmIntrinsics::_compareAndSwapLong: + case vmIntrinsics::_compareAndSetLong: do_CompareAndSwap(x, longType); break; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index ad17837fb0d..e56b4e95d6c 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -632,25 +632,28 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) { case vmIntrinsics::_loadFence: case vmIntrinsics::_storeFence: case vmIntrinsics::_fullFence: - case vmIntrinsics::_compareAndSwapLong: - case vmIntrinsics::_weakCompareAndSwapLong: - case vmIntrinsics::_weakCompareAndSwapLongAcquire: - case vmIntrinsics::_weakCompareAndSwapLongRelease: - case vmIntrinsics::_compareAndSwapInt: - case vmIntrinsics::_weakCompareAndSwapInt: - case vmIntrinsics::_weakCompareAndSwapIntAcquire: - case vmIntrinsics::_weakCompareAndSwapIntRelease: - case vmIntrinsics::_compareAndSwapObject: - case vmIntrinsics::_weakCompareAndSwapObject: - case vmIntrinsics::_weakCompareAndSwapObjectAcquire: - case vmIntrinsics::_weakCompareAndSwapObjectRelease: - case vmIntrinsics::_compareAndExchangeIntVolatile: + case vmIntrinsics::_compareAndSetLong: + case vmIntrinsics::_weakCompareAndSetLong: + case vmIntrinsics::_weakCompareAndSetLongPlain: + case vmIntrinsics::_weakCompareAndSetLongAcquire: + case vmIntrinsics::_weakCompareAndSetLongRelease: + case vmIntrinsics::_compareAndSetInt: + case vmIntrinsics::_weakCompareAndSetInt: + case vmIntrinsics::_weakCompareAndSetIntPlain: + case vmIntrinsics::_weakCompareAndSetIntAcquire: + case vmIntrinsics::_weakCompareAndSetIntRelease: + case vmIntrinsics::_compareAndSetObject: + case vmIntrinsics::_weakCompareAndSetObject: + case vmIntrinsics::_weakCompareAndSetObjectPlain: + case vmIntrinsics::_weakCompareAndSetObjectAcquire: + case vmIntrinsics::_weakCompareAndSetObjectRelease: + case vmIntrinsics::_compareAndExchangeInt: case vmIntrinsics::_compareAndExchangeIntAcquire: case vmIntrinsics::_compareAndExchangeIntRelease: - case vmIntrinsics::_compareAndExchangeLongVolatile: + case vmIntrinsics::_compareAndExchangeLong: case vmIntrinsics::_compareAndExchangeLongAcquire: case vmIntrinsics::_compareAndExchangeLongRelease: - case vmIntrinsics::_compareAndExchangeObjectVolatile: + case vmIntrinsics::_compareAndExchangeObject: case vmIntrinsics::_compareAndExchangeObjectAcquire: case vmIntrinsics::_compareAndExchangeObjectRelease: if (!InlineUnsafeOps) return true; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 13405609579..15aa3613422 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1244,100 +1244,100 @@ do_intrinsic(_putIntUnaligned, jdk_internal_misc_Unsafe, putIntUnaligned_name, putInt_signature, F_R) \ do_intrinsic(_putLongUnaligned, jdk_internal_misc_Unsafe, putLongUnaligned_name, putLong_signature, F_R) \ \ - do_signature(compareAndSwapObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \ + do_signature(compareAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \ do_signature(compareAndExchangeObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \ - do_signature(compareAndSwapLong_signature, "(Ljava/lang/Object;JJJ)Z") \ + do_signature(compareAndSetLong_signature, "(Ljava/lang/Object;JJJ)Z") \ do_signature(compareAndExchangeLong_signature, "(Ljava/lang/Object;JJJ)J") \ - do_signature(compareAndSwapInt_signature, "(Ljava/lang/Object;JII)Z") \ + do_signature(compareAndSetInt_signature, "(Ljava/lang/Object;JII)Z") \ do_signature(compareAndExchangeInt_signature, "(Ljava/lang/Object;JII)I") \ - do_signature(compareAndSwapByte_signature, "(Ljava/lang/Object;JBB)Z") \ + do_signature(compareAndSetByte_signature, "(Ljava/lang/Object;JBB)Z") \ do_signature(compareAndExchangeByte_signature, "(Ljava/lang/Object;JBB)B") \ - do_signature(compareAndSwapShort_signature, "(Ljava/lang/Object;JSS)Z") \ + do_signature(compareAndSetShort_signature, "(Ljava/lang/Object;JSS)Z") \ do_signature(compareAndExchangeShort_signature, "(Ljava/lang/Object;JSS)S") \ \ - do_name(compareAndSwapObject_name, "compareAndSwapObject") \ - do_name(compareAndExchangeObjectVolatile_name, "compareAndExchangeObjectVolatile") \ + do_name(compareAndSetObject_name, "compareAndSetObject") \ + do_name(compareAndExchangeObject_name, "compareAndExchangeObject") \ do_name(compareAndExchangeObjectAcquire_name, "compareAndExchangeObjectAcquire") \ do_name(compareAndExchangeObjectRelease_name, "compareAndExchangeObjectRelease") \ - do_name(compareAndSwapLong_name, "compareAndSwapLong") \ - do_name(compareAndExchangeLongVolatile_name, "compareAndExchangeLongVolatile") \ + do_name(compareAndSetLong_name, "compareAndSetLong") \ + do_name(compareAndExchangeLong_name, "compareAndExchangeLong") \ do_name(compareAndExchangeLongAcquire_name, "compareAndExchangeLongAcquire") \ do_name(compareAndExchangeLongRelease_name, "compareAndExchangeLongRelease") \ - do_name(compareAndSwapInt_name, "compareAndSwapInt") \ - do_name(compareAndExchangeIntVolatile_name, "compareAndExchangeIntVolatile") \ + do_name(compareAndSetInt_name, "compareAndSetInt") \ + do_name(compareAndExchangeInt_name, "compareAndExchangeInt") \ do_name(compareAndExchangeIntAcquire_name, "compareAndExchangeIntAcquire") \ do_name(compareAndExchangeIntRelease_name, "compareAndExchangeIntRelease") \ - do_name(compareAndSwapByte_name, "compareAndSwapByte") \ - do_name(compareAndExchangeByteVolatile_name, "compareAndExchangeByteVolatile") \ + do_name(compareAndSetByte_name, "compareAndSetByte") \ + do_name(compareAndExchangeByte_name, "compareAndExchangeByte") \ do_name(compareAndExchangeByteAcquire_name, "compareAndExchangeByteAcquire") \ do_name(compareAndExchangeByteRelease_name, "compareAndExchangeByteRelease") \ - do_name(compareAndSwapShort_name, "compareAndSwapShort") \ - do_name(compareAndExchangeShortVolatile_name, "compareAndExchangeShortVolatile") \ + do_name(compareAndSetShort_name, "compareAndSetShort") \ + do_name(compareAndExchangeShort_name, "compareAndExchangeShort") \ do_name(compareAndExchangeShortAcquire_name, "compareAndExchangeShortAcquire") \ do_name(compareAndExchangeShortRelease_name, "compareAndExchangeShortRelease") \ \ - do_name(weakCompareAndSwapObject_name, "weakCompareAndSwapObject") \ - do_name(weakCompareAndSwapObjectAcquire_name, "weakCompareAndSwapObjectAcquire") \ - do_name(weakCompareAndSwapObjectRelease_name, "weakCompareAndSwapObjectRelease") \ - do_name(weakCompareAndSwapObjectVolatile_name, "weakCompareAndSwapObjectVolatile") \ - do_name(weakCompareAndSwapLong_name, "weakCompareAndSwapLong") \ - do_name(weakCompareAndSwapLongAcquire_name, "weakCompareAndSwapLongAcquire") \ - do_name(weakCompareAndSwapLongRelease_name, "weakCompareAndSwapLongRelease") \ - do_name(weakCompareAndSwapLongVolatile_name, "weakCompareAndSwapLongVolatile") \ - do_name(weakCompareAndSwapInt_name, "weakCompareAndSwapInt") \ - do_name(weakCompareAndSwapIntAcquire_name, "weakCompareAndSwapIntAcquire") \ - do_name(weakCompareAndSwapIntRelease_name, "weakCompareAndSwapIntRelease") \ - do_name(weakCompareAndSwapIntVolatile_name, "weakCompareAndSwapIntVolatile") \ - do_name(weakCompareAndSwapByte_name, "weakCompareAndSwapByte") \ - do_name(weakCompareAndSwapByteAcquire_name, "weakCompareAndSwapByteAcquire") \ - do_name(weakCompareAndSwapByteRelease_name, "weakCompareAndSwapByteRelease") \ - do_name(weakCompareAndSwapByteVolatile_name, "weakCompareAndSwapByteVolatile") \ - do_name(weakCompareAndSwapShort_name, "weakCompareAndSwapShort") \ - do_name(weakCompareAndSwapShortAcquire_name, "weakCompareAndSwapShortAcquire") \ - do_name(weakCompareAndSwapShortRelease_name, "weakCompareAndSwapShortRelease") \ - do_name(weakCompareAndSwapShortVolatile_name, "weakCompareAndSwapShortVolatile") \ + do_name(weakCompareAndSetObjectPlain_name, "weakCompareAndSetObjectPlain") \ + do_name(weakCompareAndSetObjectAcquire_name, "weakCompareAndSetObjectAcquire") \ + do_name(weakCompareAndSetObjectRelease_name, "weakCompareAndSetObjectRelease") \ + do_name(weakCompareAndSetObject_name, "weakCompareAndSetObject") \ + do_name(weakCompareAndSetLongPlain_name, "weakCompareAndSetLongPlain") \ + do_name(weakCompareAndSetLongAcquire_name, "weakCompareAndSetLongAcquire") \ + do_name(weakCompareAndSetLongRelease_name, "weakCompareAndSetLongRelease") \ + do_name(weakCompareAndSetLong_name, "weakCompareAndSetLong") \ + do_name(weakCompareAndSetIntPlain_name, "weakCompareAndSetIntPlain") \ + do_name(weakCompareAndSetIntAcquire_name, "weakCompareAndSetIntAcquire") \ + do_name(weakCompareAndSetIntRelease_name, "weakCompareAndSetIntRelease") \ + do_name(weakCompareAndSetInt_name, "weakCompareAndSetInt") \ + do_name(weakCompareAndSetBytePlain_name, "weakCompareAndSetBytePlain") \ + do_name(weakCompareAndSetByteAcquire_name, "weakCompareAndSetByteAcquire") \ + do_name(weakCompareAndSetByteRelease_name, "weakCompareAndSetByteRelease") \ + do_name(weakCompareAndSetByte_name, "weakCompareAndSetByte") \ + do_name(weakCompareAndSetShortPlain_name, "weakCompareAndSetShortPlain") \ + do_name(weakCompareAndSetShortAcquire_name, "weakCompareAndSetShortAcquire") \ + do_name(weakCompareAndSetShortRelease_name, "weakCompareAndSetShortRelease") \ + do_name(weakCompareAndSetShort_name, "weakCompareAndSetShort") \ \ - do_intrinsic(_compareAndSwapObject, jdk_internal_misc_Unsafe, compareAndSwapObject_name, compareAndSwapObject_signature, F_RN) \ - do_intrinsic(_compareAndExchangeObjectVolatile, jdk_internal_misc_Unsafe, compareAndExchangeObjectVolatile_name, compareAndExchangeObject_signature, F_RN) \ + do_intrinsic(_compareAndSetObject, jdk_internal_misc_Unsafe, compareAndSetObject_name, compareAndSetObject_signature, F_RN) \ + do_intrinsic(_compareAndExchangeObject, jdk_internal_misc_Unsafe, compareAndExchangeObject_name, compareAndExchangeObject_signature, F_RN) \ do_intrinsic(_compareAndExchangeObjectAcquire, jdk_internal_misc_Unsafe, compareAndExchangeObjectAcquire_name, compareAndExchangeObject_signature, F_R) \ do_intrinsic(_compareAndExchangeObjectRelease, jdk_internal_misc_Unsafe, compareAndExchangeObjectRelease_name, compareAndExchangeObject_signature, F_R) \ - do_intrinsic(_compareAndSwapLong, jdk_internal_misc_Unsafe, compareAndSwapLong_name, compareAndSwapLong_signature, F_RN) \ - do_intrinsic(_compareAndExchangeLongVolatile, jdk_internal_misc_Unsafe, compareAndExchangeLongVolatile_name, compareAndExchangeLong_signature, F_RN) \ + do_intrinsic(_compareAndSetLong, jdk_internal_misc_Unsafe, compareAndSetLong_name, compareAndSetLong_signature, F_RN) \ + do_intrinsic(_compareAndExchangeLong, jdk_internal_misc_Unsafe, compareAndExchangeLong_name, compareAndExchangeLong_signature, F_RN) \ do_intrinsic(_compareAndExchangeLongAcquire, jdk_internal_misc_Unsafe, compareAndExchangeLongAcquire_name, compareAndExchangeLong_signature, F_R) \ do_intrinsic(_compareAndExchangeLongRelease, jdk_internal_misc_Unsafe, compareAndExchangeLongRelease_name, compareAndExchangeLong_signature, F_R) \ - do_intrinsic(_compareAndSwapInt, jdk_internal_misc_Unsafe, compareAndSwapInt_name, compareAndSwapInt_signature, F_RN) \ - do_intrinsic(_compareAndExchangeIntVolatile, jdk_internal_misc_Unsafe, compareAndExchangeIntVolatile_name, compareAndExchangeInt_signature, F_RN) \ + do_intrinsic(_compareAndSetInt, jdk_internal_misc_Unsafe, compareAndSetInt_name, compareAndSetInt_signature, F_RN) \ + do_intrinsic(_compareAndExchangeInt, jdk_internal_misc_Unsafe, compareAndExchangeInt_name, compareAndExchangeInt_signature, F_RN) \ do_intrinsic(_compareAndExchangeIntAcquire, jdk_internal_misc_Unsafe, compareAndExchangeIntAcquire_name, compareAndExchangeInt_signature, F_R) \ do_intrinsic(_compareAndExchangeIntRelease, jdk_internal_misc_Unsafe, compareAndExchangeIntRelease_name, compareAndExchangeInt_signature, F_R) \ - do_intrinsic(_compareAndSwapByte, jdk_internal_misc_Unsafe, compareAndSwapByte_name, compareAndSwapByte_signature, F_R) \ - do_intrinsic(_compareAndExchangeByteVolatile, jdk_internal_misc_Unsafe, compareAndExchangeByteVolatile_name, compareAndExchangeByte_signature, F_R) \ + do_intrinsic(_compareAndSetByte, jdk_internal_misc_Unsafe, compareAndSetByte_name, compareAndSetByte_signature, F_R) \ + do_intrinsic(_compareAndExchangeByte, jdk_internal_misc_Unsafe, compareAndExchangeByte_name, compareAndExchangeByte_signature, F_R) \ do_intrinsic(_compareAndExchangeByteAcquire, jdk_internal_misc_Unsafe, compareAndExchangeByteAcquire_name, compareAndExchangeByte_signature, F_R) \ do_intrinsic(_compareAndExchangeByteRelease, jdk_internal_misc_Unsafe, compareAndExchangeByteRelease_name, compareAndExchangeByte_signature, F_R) \ - do_intrinsic(_compareAndSwapShort, jdk_internal_misc_Unsafe, compareAndSwapShort_name, compareAndSwapShort_signature, F_R) \ - do_intrinsic(_compareAndExchangeShortVolatile, jdk_internal_misc_Unsafe, compareAndExchangeShortVolatile_name, compareAndExchangeShort_signature, F_R) \ + do_intrinsic(_compareAndSetShort, jdk_internal_misc_Unsafe, compareAndSetShort_name, compareAndSetShort_signature, F_R) \ + do_intrinsic(_compareAndExchangeShort, jdk_internal_misc_Unsafe, compareAndExchangeShort_name, compareAndExchangeShort_signature, F_R) \ do_intrinsic(_compareAndExchangeShortAcquire, jdk_internal_misc_Unsafe, compareAndExchangeShortAcquire_name, compareAndExchangeShort_signature, F_R) \ do_intrinsic(_compareAndExchangeShortRelease, jdk_internal_misc_Unsafe, compareAndExchangeShortRelease_name, compareAndExchangeShort_signature, F_R) \ \ - do_intrinsic(_weakCompareAndSwapObject, jdk_internal_misc_Unsafe, weakCompareAndSwapObject_name, compareAndSwapObject_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapObjectAcquire, jdk_internal_misc_Unsafe, weakCompareAndSwapObjectAcquire_name, compareAndSwapObject_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapObjectRelease, jdk_internal_misc_Unsafe, weakCompareAndSwapObjectRelease_name, compareAndSwapObject_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapObjectVolatile, jdk_internal_misc_Unsafe, weakCompareAndSwapObjectVolatile_name, compareAndSwapObject_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapLong, jdk_internal_misc_Unsafe, weakCompareAndSwapLong_name, compareAndSwapLong_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapLongAcquire, jdk_internal_misc_Unsafe, weakCompareAndSwapLongAcquire_name, compareAndSwapLong_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapLongRelease, jdk_internal_misc_Unsafe, weakCompareAndSwapLongRelease_name, compareAndSwapLong_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapLongVolatile, jdk_internal_misc_Unsafe, weakCompareAndSwapLongVolatile_name, compareAndSwapLong_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapInt, jdk_internal_misc_Unsafe, weakCompareAndSwapInt_name, compareAndSwapInt_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapIntAcquire, jdk_internal_misc_Unsafe, weakCompareAndSwapIntAcquire_name, compareAndSwapInt_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapIntRelease, jdk_internal_misc_Unsafe, weakCompareAndSwapIntRelease_name, compareAndSwapInt_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapIntVolatile, jdk_internal_misc_Unsafe, weakCompareAndSwapIntVolatile_name, compareAndSwapInt_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapByte, jdk_internal_misc_Unsafe, weakCompareAndSwapByte_name, compareAndSwapByte_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapByteAcquire, jdk_internal_misc_Unsafe, weakCompareAndSwapByteAcquire_name, compareAndSwapByte_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapByteRelease, jdk_internal_misc_Unsafe, weakCompareAndSwapByteRelease_name, compareAndSwapByte_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapByteVolatile, jdk_internal_misc_Unsafe, weakCompareAndSwapByteVolatile_name, compareAndSwapByte_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapShort, jdk_internal_misc_Unsafe, weakCompareAndSwapShort_name, compareAndSwapShort_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapShortAcquire, jdk_internal_misc_Unsafe, weakCompareAndSwapShortAcquire_name, compareAndSwapShort_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapShortRelease, jdk_internal_misc_Unsafe, weakCompareAndSwapShortRelease_name, compareAndSwapShort_signature, F_R) \ - do_intrinsic(_weakCompareAndSwapShortVolatile, jdk_internal_misc_Unsafe, weakCompareAndSwapShortVolatile_name, compareAndSwapShort_signature, F_R) \ + do_intrinsic(_weakCompareAndSetObjectPlain, jdk_internal_misc_Unsafe, weakCompareAndSetObjectPlain_name, compareAndSetObject_signature, F_R) \ + do_intrinsic(_weakCompareAndSetObjectAcquire, jdk_internal_misc_Unsafe, weakCompareAndSetObjectAcquire_name, compareAndSetObject_signature, F_R) \ + do_intrinsic(_weakCompareAndSetObjectRelease, jdk_internal_misc_Unsafe, weakCompareAndSetObjectRelease_name, compareAndSetObject_signature, F_R) \ + do_intrinsic(_weakCompareAndSetObject, jdk_internal_misc_Unsafe, weakCompareAndSetObject_name, compareAndSetObject_signature, F_R) \ + do_intrinsic(_weakCompareAndSetLongPlain, jdk_internal_misc_Unsafe, weakCompareAndSetLongPlain_name, compareAndSetLong_signature, F_R) \ + do_intrinsic(_weakCompareAndSetLongAcquire, jdk_internal_misc_Unsafe, weakCompareAndSetLongAcquire_name, compareAndSetLong_signature, F_R) \ + do_intrinsic(_weakCompareAndSetLongRelease, jdk_internal_misc_Unsafe, weakCompareAndSetLongRelease_name, compareAndSetLong_signature, F_R) \ + do_intrinsic(_weakCompareAndSetLong, jdk_internal_misc_Unsafe, weakCompareAndSetLong_name, compareAndSetLong_signature, F_R) \ + do_intrinsic(_weakCompareAndSetIntPlain, jdk_internal_misc_Unsafe, weakCompareAndSetIntPlain_name, compareAndSetInt_signature, F_R) \ + do_intrinsic(_weakCompareAndSetIntAcquire, jdk_internal_misc_Unsafe, weakCompareAndSetIntAcquire_name, compareAndSetInt_signature, F_R) \ + do_intrinsic(_weakCompareAndSetIntRelease, jdk_internal_misc_Unsafe, weakCompareAndSetIntRelease_name, compareAndSetInt_signature, F_R) \ + do_intrinsic(_weakCompareAndSetInt, jdk_internal_misc_Unsafe, weakCompareAndSetInt_name, compareAndSetInt_signature, F_R) \ + do_intrinsic(_weakCompareAndSetBytePlain, jdk_internal_misc_Unsafe, weakCompareAndSetBytePlain_name, compareAndSetByte_signature, F_R) \ + do_intrinsic(_weakCompareAndSetByteAcquire, jdk_internal_misc_Unsafe, weakCompareAndSetByteAcquire_name, compareAndSetByte_signature, F_R) \ + do_intrinsic(_weakCompareAndSetByteRelease, jdk_internal_misc_Unsafe, weakCompareAndSetByteRelease_name, compareAndSetByte_signature, F_R) \ + do_intrinsic(_weakCompareAndSetByte, jdk_internal_misc_Unsafe, weakCompareAndSetByte_name, compareAndSetByte_signature, F_R) \ + do_intrinsic(_weakCompareAndSetShortPlain, jdk_internal_misc_Unsafe, weakCompareAndSetShortPlain_name, compareAndSetShort_signature, F_R) \ + do_intrinsic(_weakCompareAndSetShortAcquire, jdk_internal_misc_Unsafe, weakCompareAndSetShortAcquire_name, compareAndSetShort_signature, F_R) \ + do_intrinsic(_weakCompareAndSetShortRelease, jdk_internal_misc_Unsafe, weakCompareAndSetShortRelease_name, compareAndSetShort_signature, F_R) \ + do_intrinsic(_weakCompareAndSetShort, jdk_internal_misc_Unsafe, weakCompareAndSetShort_name, compareAndSetShort_signature, F_R) \ \ do_intrinsic(_getAndAddInt, jdk_internal_misc_Unsafe, getAndAddInt_name, getAndAddInt_signature, F_R) \ do_name( getAndAddInt_name, "getAndAddInt") \ diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index ec7e03c5ff0..69106bbeaa2 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -244,8 +244,8 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return false; break; - /* CompareAndSwap, Object: */ - case vmIntrinsics::_compareAndSwapObject: + /* CompareAndSet, Object: */ + case vmIntrinsics::_compareAndSetObject: #ifdef _LP64 if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapN)) return false; if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return false; @@ -253,10 +253,10 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt if (!Matcher::match_rule_supported(Op_CompareAndSwapP)) return false; #endif break; - case vmIntrinsics::_weakCompareAndSwapObject: - case vmIntrinsics::_weakCompareAndSwapObjectAcquire: - case vmIntrinsics::_weakCompareAndSwapObjectRelease: - case vmIntrinsics::_weakCompareAndSwapObjectVolatile: + case vmIntrinsics::_weakCompareAndSetObjectPlain: + case vmIntrinsics::_weakCompareAndSetObjectAcquire: + case vmIntrinsics::_weakCompareAndSetObjectRelease: + case vmIntrinsics::_weakCompareAndSetObject: #ifdef _LP64 if ( UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapN)) return false; if (!UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false; @@ -264,52 +264,52 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false; #endif break; - /* CompareAndSwap, Long: */ - case vmIntrinsics::_compareAndSwapLong: + /* CompareAndSet, Long: */ + case vmIntrinsics::_compareAndSetLong: if (!Matcher::match_rule_supported(Op_CompareAndSwapL)) return false; break; - case vmIntrinsics::_weakCompareAndSwapLong: - case vmIntrinsics::_weakCompareAndSwapLongAcquire: - case vmIntrinsics::_weakCompareAndSwapLongRelease: - case vmIntrinsics::_weakCompareAndSwapLongVolatile: + case vmIntrinsics::_weakCompareAndSetLongPlain: + case vmIntrinsics::_weakCompareAndSetLongAcquire: + case vmIntrinsics::_weakCompareAndSetLongRelease: + case vmIntrinsics::_weakCompareAndSetLong: if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false; break; - /* CompareAndSwap, Int: */ - case vmIntrinsics::_compareAndSwapInt: + /* CompareAndSet, Int: */ + case vmIntrinsics::_compareAndSetInt: if (!Matcher::match_rule_supported(Op_CompareAndSwapI)) return false; break; - case vmIntrinsics::_weakCompareAndSwapInt: - case vmIntrinsics::_weakCompareAndSwapIntAcquire: - case vmIntrinsics::_weakCompareAndSwapIntRelease: - case vmIntrinsics::_weakCompareAndSwapIntVolatile: + case vmIntrinsics::_weakCompareAndSetIntPlain: + case vmIntrinsics::_weakCompareAndSetIntAcquire: + case vmIntrinsics::_weakCompareAndSetIntRelease: + case vmIntrinsics::_weakCompareAndSetInt: if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false; break; - /* CompareAndSwap, Byte: */ - case vmIntrinsics::_compareAndSwapByte: + /* CompareAndSet, Byte: */ + case vmIntrinsics::_compareAndSetByte: if (!Matcher::match_rule_supported(Op_CompareAndSwapB)) return false; break; - case vmIntrinsics::_weakCompareAndSwapByte: - case vmIntrinsics::_weakCompareAndSwapByteAcquire: - case vmIntrinsics::_weakCompareAndSwapByteRelease: - case vmIntrinsics::_weakCompareAndSwapByteVolatile: + case vmIntrinsics::_weakCompareAndSetBytePlain: + case vmIntrinsics::_weakCompareAndSetByteAcquire: + case vmIntrinsics::_weakCompareAndSetByteRelease: + case vmIntrinsics::_weakCompareAndSetByte: if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapB)) return false; break; - /* CompareAndSwap, Short: */ - case vmIntrinsics::_compareAndSwapShort: + /* CompareAndSet, Short: */ + case vmIntrinsics::_compareAndSetShort: if (!Matcher::match_rule_supported(Op_CompareAndSwapS)) return false; break; - case vmIntrinsics::_weakCompareAndSwapShort: - case vmIntrinsics::_weakCompareAndSwapShortAcquire: - case vmIntrinsics::_weakCompareAndSwapShortRelease: - case vmIntrinsics::_weakCompareAndSwapShortVolatile: + case vmIntrinsics::_weakCompareAndSetShortPlain: + case vmIntrinsics::_weakCompareAndSetShortAcquire: + case vmIntrinsics::_weakCompareAndSetShortRelease: + case vmIntrinsics::_weakCompareAndSetShort: if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapS)) return false; break; /* CompareAndExchange, Object: */ - case vmIntrinsics::_compareAndExchangeObjectVolatile: + case vmIntrinsics::_compareAndExchangeObject: case vmIntrinsics::_compareAndExchangeObjectAcquire: case vmIntrinsics::_compareAndExchangeObjectRelease: #ifdef _LP64 @@ -321,28 +321,28 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt break; /* CompareAndExchange, Long: */ - case vmIntrinsics::_compareAndExchangeLongVolatile: + case vmIntrinsics::_compareAndExchangeLong: case vmIntrinsics::_compareAndExchangeLongAcquire: case vmIntrinsics::_compareAndExchangeLongRelease: if (!Matcher::match_rule_supported(Op_CompareAndExchangeL)) return false; break; /* CompareAndExchange, Int: */ - case vmIntrinsics::_compareAndExchangeIntVolatile: + case vmIntrinsics::_compareAndExchangeInt: case vmIntrinsics::_compareAndExchangeIntAcquire: case vmIntrinsics::_compareAndExchangeIntRelease: if (!Matcher::match_rule_supported(Op_CompareAndExchangeI)) return false; break; /* CompareAndExchange, Byte: */ - case vmIntrinsics::_compareAndExchangeByteVolatile: + case vmIntrinsics::_compareAndExchangeByte: case vmIntrinsics::_compareAndExchangeByteAcquire: case vmIntrinsics::_compareAndExchangeByteRelease: if (!Matcher::match_rule_supported(Op_CompareAndExchangeB)) return false; break; /* CompareAndExchange, Short: */ - case vmIntrinsics::_compareAndExchangeShortVolatile: + case vmIntrinsics::_compareAndExchangeShort: case vmIntrinsics::_compareAndExchangeShortAcquire: case vmIntrinsics::_compareAndExchangeShortRelease: if (!Matcher::match_rule_supported(Op_CompareAndExchangeS)) return false; diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index e1e1c9f188f..4e5051ee01c 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -649,46 +649,46 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_putFloatOpaque: return inline_unsafe_access( is_store, T_FLOAT, Opaque, false); case vmIntrinsics::_putDoubleOpaque: return inline_unsafe_access( is_store, T_DOUBLE, Opaque, false); - case vmIntrinsics::_compareAndSwapObject: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap, Volatile); - case vmIntrinsics::_compareAndSwapByte: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap, Volatile); - case vmIntrinsics::_compareAndSwapShort: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap, Volatile); - case vmIntrinsics::_compareAndSwapInt: return inline_unsafe_load_store(T_INT, LS_cmp_swap, Volatile); - case vmIntrinsics::_compareAndSwapLong: return inline_unsafe_load_store(T_LONG, LS_cmp_swap, Volatile); + case vmIntrinsics::_compareAndSetObject: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap, Volatile); + case vmIntrinsics::_compareAndSetByte: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap, Volatile); + case vmIntrinsics::_compareAndSetShort: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap, Volatile); + case vmIntrinsics::_compareAndSetInt: return inline_unsafe_load_store(T_INT, LS_cmp_swap, Volatile); + case vmIntrinsics::_compareAndSetLong: return inline_unsafe_load_store(T_LONG, LS_cmp_swap, Volatile); - case vmIntrinsics::_weakCompareAndSwapObject: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Relaxed); - case vmIntrinsics::_weakCompareAndSwapObjectAcquire: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Acquire); - case vmIntrinsics::_weakCompareAndSwapObjectRelease: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Release); - case vmIntrinsics::_weakCompareAndSwapObjectVolatile: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Volatile); - case vmIntrinsics::_weakCompareAndSwapByte: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Relaxed); - case vmIntrinsics::_weakCompareAndSwapByteAcquire: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Acquire); - case vmIntrinsics::_weakCompareAndSwapByteRelease: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Release); - case vmIntrinsics::_weakCompareAndSwapByteVolatile: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Volatile); - case vmIntrinsics::_weakCompareAndSwapShort: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Relaxed); - case vmIntrinsics::_weakCompareAndSwapShortAcquire: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Acquire); - case vmIntrinsics::_weakCompareAndSwapShortRelease: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Release); - case vmIntrinsics::_weakCompareAndSwapShortVolatile: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Volatile); - case vmIntrinsics::_weakCompareAndSwapInt: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Relaxed); - case vmIntrinsics::_weakCompareAndSwapIntAcquire: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Acquire); - case vmIntrinsics::_weakCompareAndSwapIntRelease: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Release); - case vmIntrinsics::_weakCompareAndSwapIntVolatile: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Volatile); - case vmIntrinsics::_weakCompareAndSwapLong: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Relaxed); - case vmIntrinsics::_weakCompareAndSwapLongAcquire: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Acquire); - case vmIntrinsics::_weakCompareAndSwapLongRelease: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Release); - case vmIntrinsics::_weakCompareAndSwapLongVolatile: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Volatile); + case vmIntrinsics::_weakCompareAndSetObjectPlain: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Relaxed); + case vmIntrinsics::_weakCompareAndSetObjectAcquire: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Acquire); + case vmIntrinsics::_weakCompareAndSetObjectRelease: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Release); + case vmIntrinsics::_weakCompareAndSetObject: return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Volatile); + case vmIntrinsics::_weakCompareAndSetBytePlain: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Relaxed); + case vmIntrinsics::_weakCompareAndSetByteAcquire: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Acquire); + case vmIntrinsics::_weakCompareAndSetByteRelease: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Release); + case vmIntrinsics::_weakCompareAndSetByte: return inline_unsafe_load_store(T_BYTE, LS_cmp_swap_weak, Volatile); + case vmIntrinsics::_weakCompareAndSetShortPlain: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Relaxed); + case vmIntrinsics::_weakCompareAndSetShortAcquire: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Acquire); + case vmIntrinsics::_weakCompareAndSetShortRelease: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Release); + case vmIntrinsics::_weakCompareAndSetShort: return inline_unsafe_load_store(T_SHORT, LS_cmp_swap_weak, Volatile); + case vmIntrinsics::_weakCompareAndSetIntPlain: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Relaxed); + case vmIntrinsics::_weakCompareAndSetIntAcquire: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Acquire); + case vmIntrinsics::_weakCompareAndSetIntRelease: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Release); + case vmIntrinsics::_weakCompareAndSetInt: return inline_unsafe_load_store(T_INT, LS_cmp_swap_weak, Volatile); + case vmIntrinsics::_weakCompareAndSetLongPlain: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Relaxed); + case vmIntrinsics::_weakCompareAndSetLongAcquire: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Acquire); + case vmIntrinsics::_weakCompareAndSetLongRelease: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Release); + case vmIntrinsics::_weakCompareAndSetLong: return inline_unsafe_load_store(T_LONG, LS_cmp_swap_weak, Volatile); - case vmIntrinsics::_compareAndExchangeObjectVolatile: return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange, Volatile); + case vmIntrinsics::_compareAndExchangeObject: return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange, Volatile); case vmIntrinsics::_compareAndExchangeObjectAcquire: return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange, Acquire); case vmIntrinsics::_compareAndExchangeObjectRelease: return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange, Release); - case vmIntrinsics::_compareAndExchangeByteVolatile: return inline_unsafe_load_store(T_BYTE, LS_cmp_exchange, Volatile); + case vmIntrinsics::_compareAndExchangeByte: return inline_unsafe_load_store(T_BYTE, LS_cmp_exchange, Volatile); case vmIntrinsics::_compareAndExchangeByteAcquire: return inline_unsafe_load_store(T_BYTE, LS_cmp_exchange, Acquire); case vmIntrinsics::_compareAndExchangeByteRelease: return inline_unsafe_load_store(T_BYTE, LS_cmp_exchange, Release); - case vmIntrinsics::_compareAndExchangeShortVolatile: return inline_unsafe_load_store(T_SHORT, LS_cmp_exchange, Volatile); + case vmIntrinsics::_compareAndExchangeShort: return inline_unsafe_load_store(T_SHORT, LS_cmp_exchange, Volatile); case vmIntrinsics::_compareAndExchangeShortAcquire: return inline_unsafe_load_store(T_SHORT, LS_cmp_exchange, Acquire); case vmIntrinsics::_compareAndExchangeShortRelease: return inline_unsafe_load_store(T_SHORT, LS_cmp_exchange, Release); - case vmIntrinsics::_compareAndExchangeIntVolatile: return inline_unsafe_load_store(T_INT, LS_cmp_exchange, Volatile); + case vmIntrinsics::_compareAndExchangeInt: return inline_unsafe_load_store(T_INT, LS_cmp_exchange, Volatile); case vmIntrinsics::_compareAndExchangeIntAcquire: return inline_unsafe_load_store(T_INT, LS_cmp_exchange, Acquire); case vmIntrinsics::_compareAndExchangeIntRelease: return inline_unsafe_load_store(T_INT, LS_cmp_exchange, Release); - case vmIntrinsics::_compareAndExchangeLongVolatile: return inline_unsafe_load_store(T_LONG, LS_cmp_exchange, Volatile); + case vmIntrinsics::_compareAndExchangeLong: return inline_unsafe_load_store(T_LONG, LS_cmp_exchange, Volatile); case vmIntrinsics::_compareAndExchangeLongAcquire: return inline_unsafe_load_store(T_LONG, LS_cmp_exchange, Acquire); case vmIntrinsics::_compareAndExchangeLongRelease: return inline_unsafe_load_store(T_LONG, LS_cmp_exchange, Release); @@ -2587,23 +2587,26 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c // // LS_cmp_swap: // -// boolean compareAndSwapObject(Object o, long offset, Object expected, Object x); -// boolean compareAndSwapInt( Object o, long offset, int expected, int x); -// boolean compareAndSwapLong( Object o, long offset, long expected, long x); +// boolean compareAndSetObject(Object o, long offset, Object expected, Object x); +// boolean compareAndSetInt( Object o, long offset, int expected, int x); +// boolean compareAndSetLong( Object o, long offset, long expected, long x); // // LS_cmp_swap_weak: // -// boolean weakCompareAndSwapObject( Object o, long offset, Object expected, Object x); -// boolean weakCompareAndSwapObjectAcquire(Object o, long offset, Object expected, Object x); -// boolean weakCompareAndSwapObjectRelease(Object o, long offset, Object expected, Object x); +// boolean weakCompareAndSetObject( Object o, long offset, Object expected, Object x); +// boolean weakCompareAndSetObjectPlain( Object o, long offset, Object expected, Object x); +// boolean weakCompareAndSetObjectAcquire(Object o, long offset, Object expected, Object x); +// boolean weakCompareAndSetObjectRelease(Object o, long offset, Object expected, Object x); // -// boolean weakCompareAndSwapInt( Object o, long offset, int expected, int x); -// boolean weakCompareAndSwapIntAcquire( Object o, long offset, int expected, int x); -// boolean weakCompareAndSwapIntRelease( Object o, long offset, int expected, int x); +// boolean weakCompareAndSetInt( Object o, long offset, int expected, int x); +// boolean weakCompareAndSetIntPlain( Object o, long offset, int expected, int x); +// boolean weakCompareAndSetIntAcquire( Object o, long offset, int expected, int x); +// boolean weakCompareAndSetIntRelease( Object o, long offset, int expected, int x); // -// boolean weakCompareAndSwapLong( Object o, long offset, long expected, long x); -// boolean weakCompareAndSwapLongAcquire( Object o, long offset, long expected, long x); -// boolean weakCompareAndSwapLongRelease( Object o, long offset, long expected, long x); +// boolean weakCompareAndSetLong( Object o, long offset, long expected, long x); +// boolean weakCompareAndSetLongPlain( Object o, long offset, long expected, long x); +// boolean weakCompareAndSetLongAcquire( Object o, long offset, long expected, long x); +// boolean weakCompareAndSetLongRelease( Object o, long offset, long expected, long x); // // LS_cmp_exchange: // @@ -4965,7 +4968,7 @@ bool LibraryCallKit::inline_arraycopy() { // See arraycopy_restore_alloc_state() comment // if alloc == NULL we don't have to worry about a tightly coupled allocation so we can emit all needed guards // if saved_jvms != NULL (then alloc != NULL) then we can handle guards and a tightly coupled allocation - // if saved_jvms == NULL and alloc != NULL, we can’t emit any guards + // if saved_jvms == NULL and alloc != NULL, we can't emit any guards bool can_emit_guards = (alloc == NULL || saved_jvms != NULL); // The following tests must be performed diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 1c98add775b..2f096378201 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -378,7 +378,7 @@ UNSAFE_ENTRY(jobject, Unsafe_GetUncompressedObject(JNIEnv *env, jobject unsafe, // On platforms which do not support atomic compare-and-swap of jlong (8 byte) // values we have to use a lock-based scheme to enforce atomicity. This has to be // applied to all Unsafe operations that set the value of a jlong field. Even so -// the compareAndSwapLong operation will not be atomic with respect to direct stores +// the compareAndSetLong operation will not be atomic with respect to direct stores // to the field from Java code. It is important therefore that any Java code that // utilizes these Unsafe jlong operations does not perform direct stores. To permit // direct loads of the field from Java code we must also use Atomic::store within the @@ -1013,7 +1013,7 @@ UNSAFE_ENTRY(jlong, Unsafe_CompareAndExchangeLong(JNIEnv *env, jobject unsafe, j #endif } UNSAFE_END -UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) { +UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) { oop x = JNIHandles::resolve(x_h); oop e = JNIHandles::resolve(e_h); oop p = JNIHandles::resolve(obj); @@ -1028,14 +1028,14 @@ UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapObject(JNIEnv *env, jobject unsafe, return true; } UNSAFE_END -UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapInt(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jint e, jint x)) { +UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetInt(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jint e, jint x)) { oop p = JNIHandles::resolve(obj); jint* addr = (jint *)index_oop_from_field_offset_long(p, offset); return (jint)(Atomic::cmpxchg(x, addr, e)) == e; } UNSAFE_END -UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapLong(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jlong e, jlong x)) { +UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetLong(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jlong e, jlong x)) { Handle p(THREAD, JNIHandles::resolve(obj)); jlong* addr = (jlong*)index_oop_from_field_offset_long(p(), offset); @@ -1194,12 +1194,12 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { {CC "defineClass0", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass0)}, {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)}, {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)}, - {CC "compareAndSwapObject", CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSwapObject)}, - {CC "compareAndSwapInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)}, - {CC "compareAndSwapLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)}, - {CC "compareAndExchangeObjectVolatile", CC "(" OBJ "J" OBJ "" OBJ ")" OBJ, FN_PTR(Unsafe_CompareAndExchangeObject)}, - {CC "compareAndExchangeIntVolatile", CC "(" OBJ "J""I""I"")I", FN_PTR(Unsafe_CompareAndExchangeInt)}, - {CC "compareAndExchangeLongVolatile", CC "(" OBJ "J""J""J"")J", FN_PTR(Unsafe_CompareAndExchangeLong)}, + {CC "compareAndSetObject",CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSetObject)}, + {CC "compareAndSetInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSetInt)}, + {CC "compareAndSetLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSetLong)}, + {CC "compareAndExchangeObject", CC "(" OBJ "J" OBJ "" OBJ ")" OBJ, FN_PTR(Unsafe_CompareAndExchangeObject)}, + {CC "compareAndExchangeInt", CC "(" OBJ "J""I""I"")I", FN_PTR(Unsafe_CompareAndExchangeInt)}, + {CC "compareAndExchangeLong", CC "(" OBJ "J""J""J"")J", FN_PTR(Unsafe_CompareAndExchangeLong)}, {CC "park", CC "(ZJ)V", FN_PTR(Unsafe_Park)}, {CC "unpark", CC "(" OBJ ")V", FN_PTR(Unsafe_Unpark)}, diff --git a/hotspot/src/share/vm/shark/sharkIntrinsics.cpp b/hotspot/src/share/vm/shark/sharkIntrinsics.cpp index 51b813f4b8d..15b6679bf4e 100644 --- a/hotspot/src/share/vm/shark/sharkIntrinsics.cpp +++ b/hotspot/src/share/vm/shark/sharkIntrinsics.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -66,7 +66,7 @@ bool SharkIntrinsics::is_intrinsic(ciMethod *target) { return true; // Unsafe - case vmIntrinsics::_compareAndSwapInt: + case vmIntrinsics::_compareAndSetInt: return true; default: @@ -140,8 +140,8 @@ void SharkIntrinsics::do_intrinsic() { break; // Unsafe - case vmIntrinsics::_compareAndSwapInt: - do_Unsafe_compareAndSwapInt(); + case vmIntrinsics::_compareAndSetInt: + do_Unsafe_compareAndSetInt(); break; default: @@ -241,7 +241,7 @@ void SharkIntrinsics::do_Thread_currentThread() { true)); } -void SharkIntrinsics::do_Unsafe_compareAndSwapInt() { +void SharkIntrinsics::do_Unsafe_compareAndSetInt() { // Pop the arguments Value *x = state()->pop()->jint_value(); Value *e = state()->pop()->jint_value(); diff --git a/hotspot/src/share/vm/shark/sharkIntrinsics.hpp b/hotspot/src/share/vm/shark/sharkIntrinsics.hpp index f0699f8948e..8a5d60f17b9 100644 --- a/hotspot/src/share/vm/shark/sharkIntrinsics.hpp +++ b/hotspot/src/share/vm/shark/sharkIntrinsics.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -58,7 +58,7 @@ class SharkIntrinsics : public SharkTargetInvariants { void do_Object_getClass(); void do_System_currentTimeMillis(); void do_Thread_currentThread(); - void do_Unsafe_compareAndSwapInt(); + void do_Unsafe_compareAndSetInt(); }; #endif // SHARE_VM_SHARK_SHARKINTRINSICS_HPP diff --git a/hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java b/hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java index f7838dd6c97..e0c43b05529 100644 --- a/hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java +++ b/hotspot/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java @@ -773,221 +773,221 @@ public class TestIntUnsafeCAS { static void test_ci(int[] a) { for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -1, -123); + unsafe.compareAndSetInt(a, byte_offset(i), -1, -123); } } static void test_vi(int[] a, int b, int old) { for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), old, b); + unsafe.compareAndSetInt(a, byte_offset(i), old, b); } } static void test_cp(int[] a, int[] b) { for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -123, b[i]); + unsafe.compareAndSetInt(a, byte_offset(i), -123, b[i]); } } static void test_2ci(int[] a, int[] b) { for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), 123, -123); - unsafe.compareAndSwapInt(b, byte_offset(i), 123, -103); + unsafe.compareAndSetInt(a, byte_offset(i), 123, -123); + unsafe.compareAndSetInt(b, byte_offset(i), 123, -103); } } static void test_2vi(int[] a, int[] b, int c, int d) { for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -123, c); - unsafe.compareAndSwapInt(b, byte_offset(i), -103, d); + unsafe.compareAndSetInt(a, byte_offset(i), -123, c); + unsafe.compareAndSetInt(b, byte_offset(i), -103, d); } } static void test_ci_neg(int[] a, int old) { for (int i = ARRLEN-1; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), old, -123); + unsafe.compareAndSetInt(a, byte_offset(i), old, -123); } } static void test_vi_neg(int[] a, int b, int old) { for (int i = ARRLEN-1; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), old, b); + unsafe.compareAndSetInt(a, byte_offset(i), old, b); } } static void test_cp_neg(int[] a, int[] b) { for (int i = ARRLEN-1; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -123, b[i]); + unsafe.compareAndSetInt(a, byte_offset(i), -123, b[i]); } } static void test_2ci_neg(int[] a, int[] b) { for (int i = ARRLEN-1; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), 123, -123); - unsafe.compareAndSwapInt(b, byte_offset(i), 123, -103); + unsafe.compareAndSetInt(a, byte_offset(i), 123, -123); + unsafe.compareAndSetInt(b, byte_offset(i), 123, -103); } } static void test_2vi_neg(int[] a, int[] b, int c, int d) { for (int i = ARRLEN-1; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -123, c); - unsafe.compareAndSwapInt(b, byte_offset(i), -103, d); + unsafe.compareAndSetInt(a, byte_offset(i), -123, c); + unsafe.compareAndSetInt(b, byte_offset(i), -103, d); } } static void test_ci_oppos(int[] a, int old) { int limit = ARRLEN-1; for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(limit-i), old, -123); + unsafe.compareAndSetInt(a, byte_offset(limit-i), old, -123); } } static void test_vi_oppos(int[] a, int b, int old) { int limit = ARRLEN-1; for (int i = limit; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(limit-i), old, b); + unsafe.compareAndSetInt(a, byte_offset(limit-i), old, b); } } static void test_cp_oppos(int[] a, int[] b) { int limit = ARRLEN-1; for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -123, b[limit-i]); + unsafe.compareAndSetInt(a, byte_offset(i), -123, b[limit-i]); } } static void test_2ci_oppos(int[] a, int[] b) { int limit = ARRLEN-1; for (int i = 0; i < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(limit-i), 123, -123); - unsafe.compareAndSwapInt(b, byte_offset(i), 123, -103); + unsafe.compareAndSetInt(a, byte_offset(limit-i), 123, -123); + unsafe.compareAndSetInt(b, byte_offset(i), 123, -103); } } static void test_2vi_oppos(int[] a, int[] b, int c, int d) { int limit = ARRLEN-1; for (int i = limit; i >= 0; i-=1) { - unsafe.compareAndSwapInt(a, byte_offset(i), -123, c); - unsafe.compareAndSwapInt(b, byte_offset(limit-i), -103, d); + unsafe.compareAndSetInt(a, byte_offset(i), -123, c); + unsafe.compareAndSetInt(b, byte_offset(limit-i), -103, d); } } static void test_ci_off(int[] a, int old) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+OFFSET), old, -123); + unsafe.compareAndSetInt(a, byte_offset(i+OFFSET), old, -123); } } static void test_vi_off(int[] a, int b, int old) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+OFFSET), old, b); + unsafe.compareAndSetInt(a, byte_offset(i+OFFSET), old, b); } } static void test_cp_off(int[] a, int[] b) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+OFFSET), -123, b[i+OFFSET]); + unsafe.compareAndSetInt(a, byte_offset(i+OFFSET), -123, b[i+OFFSET]); } } static void test_2ci_off(int[] a, int[] b) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+OFFSET), 123, -123); - unsafe.compareAndSwapInt(b, byte_offset(i+OFFSET), 123, -103); + unsafe.compareAndSetInt(a, byte_offset(i+OFFSET), 123, -123); + unsafe.compareAndSetInt(b, byte_offset(i+OFFSET), 123, -103); } } static void test_2vi_off(int[] a, int[] b, int c, int d) { for (int i = 0; i < ARRLEN-OFFSET; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+OFFSET), -123, c); - unsafe.compareAndSwapInt(b, byte_offset(i+OFFSET), -103, d); + unsafe.compareAndSetInt(a, byte_offset(i+OFFSET), -123, c); + unsafe.compareAndSetInt(b, byte_offset(i+OFFSET), -103, d); } } static void test_ci_inv(int[] a, int k, int old) { for (int i = 0; i < ARRLEN-k; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+k), old, -123); + unsafe.compareAndSetInt(a, byte_offset(i+k), old, -123); } } static void test_vi_inv(int[] a, int b, int k, int old) { for (int i = 0; i < ARRLEN-k; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+k), old, b); + unsafe.compareAndSetInt(a, byte_offset(i+k), old, b); } } static void test_cp_inv(int[] a, int[] b, int k) { for (int i = 0; i < ARRLEN-k; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+k), -123, b[i+k]); + unsafe.compareAndSetInt(a, byte_offset(i+k), -123, b[i+k]); } } static void test_2ci_inv(int[] a, int[] b, int k) { for (int i = 0; i < ARRLEN-k; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+k), 123, -123); - unsafe.compareAndSwapInt(b, byte_offset(i+k), 123, -103); + unsafe.compareAndSetInt(a, byte_offset(i+k), 123, -123); + unsafe.compareAndSetInt(b, byte_offset(i+k), 123, -103); } } static void test_2vi_inv(int[] a, int[] b, int c, int d, int k) { for (int i = 0; i < ARRLEN-k; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+k), -123, c); - unsafe.compareAndSwapInt(b, byte_offset(i+k), -103, d); + unsafe.compareAndSetInt(a, byte_offset(i+k), -123, c); + unsafe.compareAndSetInt(b, byte_offset(i+k), -103, d); } } static void test_ci_scl(int[] a, int old) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i*SCALE), old, -123); + unsafe.compareAndSetInt(a, byte_offset(i*SCALE), old, -123); } } static void test_vi_scl(int[] a, int b, int old) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i*SCALE), old, b); + unsafe.compareAndSetInt(a, byte_offset(i*SCALE), old, b); } } static void test_cp_scl(int[] a, int[] b) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i*SCALE), -123, b[i*SCALE]); + unsafe.compareAndSetInt(a, byte_offset(i*SCALE), -123, b[i*SCALE]); } } static void test_2ci_scl(int[] a, int[] b) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i*SCALE), 123, -123); - unsafe.compareAndSwapInt(b, byte_offset(i*SCALE), 123, -103); + unsafe.compareAndSetInt(a, byte_offset(i*SCALE), 123, -123); + unsafe.compareAndSetInt(b, byte_offset(i*SCALE), 123, -103); } } static void test_2vi_scl(int[] a, int[] b, int c, int d) { for (int i = 0; i*SCALE < ARRLEN; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i*SCALE), -123, c); - unsafe.compareAndSwapInt(b, byte_offset(i*SCALE), -103, d); + unsafe.compareAndSetInt(a, byte_offset(i*SCALE), -123, c); + unsafe.compareAndSetInt(b, byte_offset(i*SCALE), -103, d); } } static void test_cp_alndst(int[] a, int[] b) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+ALIGN_OFF), -1, b[i]); + unsafe.compareAndSetInt(a, byte_offset(i+ALIGN_OFF), -1, b[i]); } } static void test_cp_alnsrc(int[] a, int[] b) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { int old = unsafe.getIntVolatile(a, byte_offset(i)); - unsafe.compareAndSwapInt(a, byte_offset(i), old, b[i+ALIGN_OFF]); + unsafe.compareAndSetInt(a, byte_offset(i), old, b[i+ALIGN_OFF]); } } static void test_2ci_aln(int[] a, int[] b) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+ALIGN_OFF), -1, -123); + unsafe.compareAndSetInt(a, byte_offset(i+ALIGN_OFF), -1, -123); int old = unsafe.getIntVolatile(b, byte_offset(i)); - unsafe.compareAndSwapInt(b, byte_offset(i), old, -103); + unsafe.compareAndSetInt(b, byte_offset(i), old, -103); } } static void test_2vi_aln(int[] a, int[] b, int c, int d) { for (int i = 0; i < ARRLEN-ALIGN_OFF; i+=1) { int old = unsafe.getIntVolatile(a, byte_offset(i)); - unsafe.compareAndSwapInt(a, byte_offset(i), old, c); + unsafe.compareAndSetInt(a, byte_offset(i), old, c); old = unsafe.getIntVolatile(b, byte_offset(i+ALIGN_OFF)); - unsafe.compareAndSwapInt(b, byte_offset(i+ALIGN_OFF), old, d); + unsafe.compareAndSetInt(b, byte_offset(i+ALIGN_OFF), old, d); } } static void test_cp_unalndst(int[] a, int[] b) { for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+UNALIGN_OFF), -1, b[i]); + unsafe.compareAndSetInt(a, byte_offset(i+UNALIGN_OFF), -1, b[i]); } } static void test_cp_unalnsrc(int[] a, int[] b) { for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) { int old = unsafe.getIntVolatile(a, byte_offset(i)); - unsafe.compareAndSwapInt(a, byte_offset(i), old, b[i+UNALIGN_OFF]); + unsafe.compareAndSetInt(a, byte_offset(i), old, b[i+UNALIGN_OFF]); } } static void test_2ci_unaln(int[] a, int[] b) { for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) { - unsafe.compareAndSwapInt(a, byte_offset(i+UNALIGN_OFF), -1, -123); + unsafe.compareAndSetInt(a, byte_offset(i+UNALIGN_OFF), -1, -123); int old = unsafe.getIntVolatile(b, byte_offset(i)); - unsafe.compareAndSwapInt(b, byte_offset(i), old, -103); + unsafe.compareAndSetInt(b, byte_offset(i), old, -103); } } static void test_2vi_unaln(int[] a, int[] b, int c, int d) { for (int i = 0; i < ARRLEN-UNALIGN_OFF; i+=1) { int old = unsafe.getIntVolatile(a, byte_offset(i)); - unsafe.compareAndSwapInt(a, byte_offset(i), old, c); + unsafe.compareAndSetInt(a, byte_offset(i), old, c); old = unsafe.getIntVolatile(b, byte_offset(i+UNALIGN_OFF)); - unsafe.compareAndSwapInt(b, byte_offset(i+UNALIGN_OFF), old, d); + unsafe.compareAndSetInt(b, byte_offset(i+UNALIGN_OFF), old, d); } } diff --git a/hotspot/test/compiler/intrinsics/unsafe/TestCAEAntiDep.java b/hotspot/test/compiler/intrinsics/unsafe/TestCAEAntiDep.java index 5bec829dddd..353c73e43ba 100644 --- a/hotspot/test/compiler/intrinsics/unsafe/TestCAEAntiDep.java +++ b/hotspot/test/compiler/intrinsics/unsafe/TestCAEAntiDep.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -53,7 +54,7 @@ public class TestCAEAntiDep { } static int m(TestCAEAntiDep test, Object expected, Object x) { - C old = (C)UNSAFE.compareAndExchangeObjectVolatile(test, O_OFFSET, expected, x); + C old = (C)UNSAFE.compareAndExchangeObject(test, O_OFFSET, expected, x); int res = old.f1; old.f1 = 0x42; return res; diff --git a/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java b/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java index 8f65f1d5e04..772b44b60e4 100644 --- a/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java +++ b/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 +72,8 @@ public class UnsafeTwoCASLong { } static void testAccess(Object base, long offset) { - UNSAFE.compareAndSwapLong(base, offset, 1L, 2L); - UNSAFE.compareAndSwapLong(base, offset, 2L, 1L); + UNSAFE.compareAndSetLong(base, offset, 1L, 2L); + UNSAFE.compareAndSetLong(base, offset, 2L, 1L); } } - diff --git a/hotspot/test/compiler/profiling/UnsafeAccess.java b/hotspot/test/compiler/profiling/UnsafeAccess.java index 5118101454b..eeda6d47241 100644 --- a/hotspot/test/compiler/profiling/UnsafeAccess.java +++ b/hotspot/test/compiler/profiling/UnsafeAccess.java @@ -64,7 +64,7 @@ public class UnsafeAccess { static Object helperUnsafeLoadStore(Object o, boolean isObjArray) { if (isObjArray) { Object o1 = U.getObject(o, off); - U.compareAndSwapObject(o, off, o1, new Object()); + U.compareAndSetObject(o, off, o1, new Object()); } return o; } diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java index 50e505bd840..75c33c9984c 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,32 +151,32 @@ public class JdkInternalMiscUnsafeAccessTestBoolean { // Compare { - boolean r = UNSAFE.compareAndSwapBoolean(base, offset, true, false); - assertEquals(r, true, "success compareAndSwap boolean"); + boolean r = UNSAFE.compareAndSetBoolean(base, offset, true, false); + assertEquals(r, true, "success compareAndSet boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, false, "success compareAndSwap boolean value"); + assertEquals(x, false, "success compareAndSet boolean value"); } { - boolean r = UNSAFE.compareAndSwapBoolean(base, offset, true, false); - assertEquals(r, false, "failing compareAndSwap boolean"); + boolean r = UNSAFE.compareAndSetBoolean(base, offset, true, false); + assertEquals(r, false, "failing compareAndSet boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, false, "failing compareAndSwap boolean value"); + assertEquals(x, false, "failing compareAndSet boolean value"); } // Advanced compare { - boolean r = UNSAFE.compareAndExchangeBooleanVolatile(base, offset, false, true); - assertEquals(r, false, "success compareAndExchangeVolatile boolean"); + boolean r = UNSAFE.compareAndExchangeBoolean(base, offset, false, true); + assertEquals(r, false, "success compareAndExchange boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, true, "success compareAndExchangeVolatile boolean value"); + assertEquals(x, true, "success compareAndExchange boolean value"); } { - boolean r = UNSAFE.compareAndExchangeBooleanVolatile(base, offset, false, false); - assertEquals(r, true, "failing compareAndExchangeVolatile boolean"); + boolean r = UNSAFE.compareAndExchangeBoolean(base, offset, false, false); + assertEquals(r, true, "failing compareAndExchange boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, true, "failing compareAndExchangeVolatile boolean value"); + assertEquals(x, true, "failing compareAndExchange boolean value"); } { @@ -210,41 +210,41 @@ public class JdkInternalMiscUnsafeAccessTestBoolean { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapBoolean(base, offset, true, false); + success = UNSAFE.weakCompareAndSetBooleanPlain(base, offset, true, false); } - assertEquals(success, true, "weakCompareAndSwap boolean"); + assertEquals(success, true, "weakCompareAndSetPlain boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, false, "weakCompareAndSwap boolean value"); + assertEquals(x, false, "weakCompareAndSetPlain boolean value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapBooleanAcquire(base, offset, false, true); + success = UNSAFE.weakCompareAndSetBooleanAcquire(base, offset, false, true); } - assertEquals(success, true, "weakCompareAndSwapAcquire boolean"); + assertEquals(success, true, "weakCompareAndSetAcquire boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, true, "weakCompareAndSwapAcquire boolean"); + assertEquals(x, true, "weakCompareAndSetAcquire boolean"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapBooleanRelease(base, offset, true, false); + success = UNSAFE.weakCompareAndSetBooleanRelease(base, offset, true, false); } - assertEquals(success, true, "weakCompareAndSwapRelease boolean"); + assertEquals(success, true, "weakCompareAndSetRelease boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, false, "weakCompareAndSwapRelease boolean"); + assertEquals(x, false, "weakCompareAndSetRelease boolean"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapBooleanVolatile(base, offset, false, true); + success = UNSAFE.weakCompareAndSetBoolean(base, offset, false, true); } - assertEquals(success, true, "weakCompareAndSwapVolatile boolean"); + assertEquals(success, true, "weakCompareAndSet boolean"); boolean x = UNSAFE.getBoolean(base, offset); - assertEquals(x, true, "weakCompareAndSwapVolatile boolean"); + assertEquals(x, true, "weakCompareAndSet boolean"); } UNSAFE.putBoolean(base, offset, false); @@ -260,4 +260,3 @@ public class JdkInternalMiscUnsafeAccessTestBoolean { } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java index e35e5904d93..30ffae395df 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,32 +180,32 @@ public class JdkInternalMiscUnsafeAccessTestByte { // Compare { - boolean r = UNSAFE.compareAndSwapByte(base, offset, (byte)0x01, (byte)0x23); - assertEquals(r, true, "success compareAndSwap byte"); + boolean r = UNSAFE.compareAndSetByte(base, offset, (byte)0x01, (byte)0x23); + assertEquals(r, true, "success compareAndSet byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x23, "success compareAndSwap byte value"); + assertEquals(x, (byte)0x23, "success compareAndSet byte value"); } { - boolean r = UNSAFE.compareAndSwapByte(base, offset, (byte)0x01, (byte)0x45); - assertEquals(r, false, "failing compareAndSwap byte"); + boolean r = UNSAFE.compareAndSetByte(base, offset, (byte)0x01, (byte)0x45); + assertEquals(r, false, "failing compareAndSet byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x23, "failing compareAndSwap byte value"); + assertEquals(x, (byte)0x23, "failing compareAndSet byte value"); } // Advanced compare { - byte r = UNSAFE.compareAndExchangeByteVolatile(base, offset, (byte)0x23, (byte)0x01); - assertEquals(r, (byte)0x23, "success compareAndExchangeVolatile byte"); + byte r = UNSAFE.compareAndExchangeByte(base, offset, (byte)0x23, (byte)0x01); + assertEquals(r, (byte)0x23, "success compareAndExchange byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x01, "success compareAndExchangeVolatile byte value"); + assertEquals(x, (byte)0x01, "success compareAndExchange byte value"); } { - byte r = UNSAFE.compareAndExchangeByteVolatile(base, offset, (byte)0x23, (byte)0x45); - assertEquals(r, (byte)0x01, "failing compareAndExchangeVolatile byte"); + byte r = UNSAFE.compareAndExchangeByte(base, offset, (byte)0x23, (byte)0x45); + assertEquals(r, (byte)0x01, "failing compareAndExchange byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x01, "failing compareAndExchangeVolatile byte value"); + assertEquals(x, (byte)0x01, "failing compareAndExchange byte value"); } { @@ -239,41 +239,41 @@ public class JdkInternalMiscUnsafeAccessTestByte { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapByte(base, offset, (byte)0x01, (byte)0x23); + success = UNSAFE.weakCompareAndSetBytePlain(base, offset, (byte)0x01, (byte)0x23); } - assertEquals(success, true, "weakCompareAndSwap byte"); + assertEquals(success, true, "weakCompareAndSetPlain byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x23, "weakCompareAndSwap byte value"); + assertEquals(x, (byte)0x23, "weakCompareAndSetPlain byte value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapByteAcquire(base, offset, (byte)0x23, (byte)0x01); + success = UNSAFE.weakCompareAndSetByteAcquire(base, offset, (byte)0x23, (byte)0x01); } - assertEquals(success, true, "weakCompareAndSwapAcquire byte"); + assertEquals(success, true, "weakCompareAndSetAcquire byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x01, "weakCompareAndSwapAcquire byte"); + assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapByteRelease(base, offset, (byte)0x01, (byte)0x23); + success = UNSAFE.weakCompareAndSetByteRelease(base, offset, (byte)0x01, (byte)0x23); } - assertEquals(success, true, "weakCompareAndSwapRelease byte"); + assertEquals(success, true, "weakCompareAndSetRelease byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x23, "weakCompareAndSwapRelease byte"); + assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapByteVolatile(base, offset, (byte)0x23, (byte)0x01); + success = UNSAFE.weakCompareAndSetByte(base, offset, (byte)0x23, (byte)0x01); } - assertEquals(success, true, "weakCompareAndSwapVolatile byte"); + assertEquals(success, true, "weakCompareAndSet byte"); byte x = UNSAFE.getByte(base, offset); - assertEquals(x, (byte)0x01, "weakCompareAndSwapVolatile byte"); + assertEquals(x, (byte)0x01, "weakCompareAndSet byte"); } UNSAFE.putByte(base, offset, (byte)0x23); @@ -306,4 +306,3 @@ public class JdkInternalMiscUnsafeAccessTestByte { } } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java index 0bb36c898bc..817af4b18c1 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,32 +198,32 @@ public class JdkInternalMiscUnsafeAccessTestChar { // Compare { - boolean r = UNSAFE.compareAndSwapChar(base, offset, '\u0123', '\u4567'); - assertEquals(r, true, "success compareAndSwap char"); + boolean r = UNSAFE.compareAndSetChar(base, offset, '\u0123', '\u4567'); + assertEquals(r, true, "success compareAndSet char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u4567', "success compareAndSwap char value"); + assertEquals(x, '\u4567', "success compareAndSet char value"); } { - boolean r = UNSAFE.compareAndSwapChar(base, offset, '\u0123', '\u89AB'); - assertEquals(r, false, "failing compareAndSwap char"); + boolean r = UNSAFE.compareAndSetChar(base, offset, '\u0123', '\u89AB'); + assertEquals(r, false, "failing compareAndSet char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u4567', "failing compareAndSwap char value"); + assertEquals(x, '\u4567', "failing compareAndSet char value"); } // Advanced compare { - char r = UNSAFE.compareAndExchangeCharVolatile(base, offset, '\u4567', '\u0123'); - assertEquals(r, '\u4567', "success compareAndExchangeVolatile char"); + char r = UNSAFE.compareAndExchangeChar(base, offset, '\u4567', '\u0123'); + assertEquals(r, '\u4567', "success compareAndExchange char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u0123', "success compareAndExchangeVolatile char value"); + assertEquals(x, '\u0123', "success compareAndExchange char value"); } { - char r = UNSAFE.compareAndExchangeCharVolatile(base, offset, '\u4567', '\u89AB'); - assertEquals(r, '\u0123', "failing compareAndExchangeVolatile char"); + char r = UNSAFE.compareAndExchangeChar(base, offset, '\u4567', '\u89AB'); + assertEquals(r, '\u0123', "failing compareAndExchange char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u0123', "failing compareAndExchangeVolatile char value"); + assertEquals(x, '\u0123', "failing compareAndExchange char value"); } { @@ -257,41 +257,41 @@ public class JdkInternalMiscUnsafeAccessTestChar { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapChar(base, offset, '\u0123', '\u4567'); + success = UNSAFE.weakCompareAndSetCharPlain(base, offset, '\u0123', '\u4567'); } - assertEquals(success, true, "weakCompareAndSwap char"); + assertEquals(success, true, "weakCompareAndSetPlain char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u4567', "weakCompareAndSwap char value"); + assertEquals(x, '\u4567', "weakCompareAndSetPlain char value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapCharAcquire(base, offset, '\u4567', '\u0123'); + success = UNSAFE.weakCompareAndSetCharAcquire(base, offset, '\u4567', '\u0123'); } - assertEquals(success, true, "weakCompareAndSwapAcquire char"); + assertEquals(success, true, "weakCompareAndSetAcquire char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u0123', "weakCompareAndSwapAcquire char"); + assertEquals(x, '\u0123', "weakCompareAndSetAcquire char"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapCharRelease(base, offset, '\u0123', '\u4567'); + success = UNSAFE.weakCompareAndSetCharRelease(base, offset, '\u0123', '\u4567'); } - assertEquals(success, true, "weakCompareAndSwapRelease char"); + assertEquals(success, true, "weakCompareAndSetRelease char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u4567', "weakCompareAndSwapRelease char"); + assertEquals(x, '\u4567', "weakCompareAndSetRelease char"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapCharVolatile(base, offset, '\u4567', '\u0123'); + success = UNSAFE.weakCompareAndSetChar(base, offset, '\u4567', '\u0123'); } - assertEquals(success, true, "weakCompareAndSwapVolatile char"); + assertEquals(success, true, "weakCompareAndSet char"); char x = UNSAFE.getChar(base, offset); - assertEquals(x, '\u0123', "weakCompareAndSwapVolatile char"); + assertEquals(x, '\u0123', "weakCompareAndSet char"); } UNSAFE.putChar(base, offset, '\u4567'); @@ -324,4 +324,3 @@ public class JdkInternalMiscUnsafeAccessTestChar { } } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java index 48a98c619fd..37c15e57a6a 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,32 +180,32 @@ public class JdkInternalMiscUnsafeAccessTestDouble { // Compare { - boolean r = UNSAFE.compareAndSwapDouble(base, offset, 1.0d, 2.0d); - assertEquals(r, true, "success compareAndSwap double"); + boolean r = UNSAFE.compareAndSetDouble(base, offset, 1.0d, 2.0d); + assertEquals(r, true, "success compareAndSet double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 2.0d, "success compareAndSwap double value"); + assertEquals(x, 2.0d, "success compareAndSet double value"); } { - boolean r = UNSAFE.compareAndSwapDouble(base, offset, 1.0d, 3.0d); - assertEquals(r, false, "failing compareAndSwap double"); + boolean r = UNSAFE.compareAndSetDouble(base, offset, 1.0d, 3.0d); + assertEquals(r, false, "failing compareAndSet double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 2.0d, "failing compareAndSwap double value"); + assertEquals(x, 2.0d, "failing compareAndSet double value"); } // Advanced compare { - double r = UNSAFE.compareAndExchangeDoubleVolatile(base, offset, 2.0d, 1.0d); - assertEquals(r, 2.0d, "success compareAndExchangeVolatile double"); + double r = UNSAFE.compareAndExchangeDouble(base, offset, 2.0d, 1.0d); + assertEquals(r, 2.0d, "success compareAndExchange double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 1.0d, "success compareAndExchangeVolatile double value"); + assertEquals(x, 1.0d, "success compareAndExchange double value"); } { - double r = UNSAFE.compareAndExchangeDoubleVolatile(base, offset, 2.0d, 3.0d); - assertEquals(r, 1.0d, "failing compareAndExchangeVolatile double"); + double r = UNSAFE.compareAndExchangeDouble(base, offset, 2.0d, 3.0d); + assertEquals(r, 1.0d, "failing compareAndExchange double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 1.0d, "failing compareAndExchangeVolatile double value"); + assertEquals(x, 1.0d, "failing compareAndExchange double value"); } { @@ -239,41 +239,41 @@ public class JdkInternalMiscUnsafeAccessTestDouble { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapDouble(base, offset, 1.0d, 2.0d); + success = UNSAFE.weakCompareAndSetDoublePlain(base, offset, 1.0d, 2.0d); } - assertEquals(success, true, "weakCompareAndSwap double"); + assertEquals(success, true, "weakCompareAndSetPlain double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 2.0d, "weakCompareAndSwap double value"); + assertEquals(x, 2.0d, "weakCompareAndSetPlain double value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapDoubleAcquire(base, offset, 2.0d, 1.0d); + success = UNSAFE.weakCompareAndSetDoubleAcquire(base, offset, 2.0d, 1.0d); } - assertEquals(success, true, "weakCompareAndSwapAcquire double"); + assertEquals(success, true, "weakCompareAndSetAcquire double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 1.0d, "weakCompareAndSwapAcquire double"); + assertEquals(x, 1.0d, "weakCompareAndSetAcquire double"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapDoubleRelease(base, offset, 1.0d, 2.0d); + success = UNSAFE.weakCompareAndSetDoubleRelease(base, offset, 1.0d, 2.0d); } - assertEquals(success, true, "weakCompareAndSwapRelease double"); + assertEquals(success, true, "weakCompareAndSetRelease double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 2.0d, "weakCompareAndSwapRelease double"); + assertEquals(x, 2.0d, "weakCompareAndSetRelease double"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapDoubleVolatile(base, offset, 2.0d, 1.0d); + success = UNSAFE.weakCompareAndSetDouble(base, offset, 2.0d, 1.0d); } - assertEquals(success, true, "weakCompareAndSwapVolatile double"); + assertEquals(success, true, "weakCompareAndSet double"); double x = UNSAFE.getDouble(base, offset); - assertEquals(x, 1.0d, "weakCompareAndSwapVolatile double"); + assertEquals(x, 1.0d, "weakCompareAndSet double"); } UNSAFE.putDouble(base, offset, 2.0d); @@ -306,4 +306,3 @@ public class JdkInternalMiscUnsafeAccessTestDouble { } } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java index 2a91a7c20c3..0ac9fa1e55a 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,32 +180,32 @@ public class JdkInternalMiscUnsafeAccessTestFloat { // Compare { - boolean r = UNSAFE.compareAndSwapFloat(base, offset, 1.0f, 2.0f); - assertEquals(r, true, "success compareAndSwap float"); + boolean r = UNSAFE.compareAndSetFloat(base, offset, 1.0f, 2.0f); + assertEquals(r, true, "success compareAndSet float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 2.0f, "success compareAndSwap float value"); + assertEquals(x, 2.0f, "success compareAndSet float value"); } { - boolean r = UNSAFE.compareAndSwapFloat(base, offset, 1.0f, 3.0f); - assertEquals(r, false, "failing compareAndSwap float"); + boolean r = UNSAFE.compareAndSetFloat(base, offset, 1.0f, 3.0f); + assertEquals(r, false, "failing compareAndSet float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 2.0f, "failing compareAndSwap float value"); + assertEquals(x, 2.0f, "failing compareAndSet float value"); } // Advanced compare { - float r = UNSAFE.compareAndExchangeFloatVolatile(base, offset, 2.0f, 1.0f); - assertEquals(r, 2.0f, "success compareAndExchangeVolatile float"); + float r = UNSAFE.compareAndExchangeFloat(base, offset, 2.0f, 1.0f); + assertEquals(r, 2.0f, "success compareAndExchange float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 1.0f, "success compareAndExchangeVolatile float value"); + assertEquals(x, 1.0f, "success compareAndExchange float value"); } { - float r = UNSAFE.compareAndExchangeFloatVolatile(base, offset, 2.0f, 3.0f); - assertEquals(r, 1.0f, "failing compareAndExchangeVolatile float"); + float r = UNSAFE.compareAndExchangeFloat(base, offset, 2.0f, 3.0f); + assertEquals(r, 1.0f, "failing compareAndExchange float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 1.0f, "failing compareAndExchangeVolatile float value"); + assertEquals(x, 1.0f, "failing compareAndExchange float value"); } { @@ -239,41 +239,41 @@ public class JdkInternalMiscUnsafeAccessTestFloat { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapFloat(base, offset, 1.0f, 2.0f); + success = UNSAFE.weakCompareAndSetFloatPlain(base, offset, 1.0f, 2.0f); } - assertEquals(success, true, "weakCompareAndSwap float"); + assertEquals(success, true, "weakCompareAndSetPlain float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 2.0f, "weakCompareAndSwap float value"); + assertEquals(x, 2.0f, "weakCompareAndSetPlain float value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapFloatAcquire(base, offset, 2.0f, 1.0f); + success = UNSAFE.weakCompareAndSetFloatAcquire(base, offset, 2.0f, 1.0f); } - assertEquals(success, true, "weakCompareAndSwapAcquire float"); + assertEquals(success, true, "weakCompareAndSetAcquire float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 1.0f, "weakCompareAndSwapAcquire float"); + assertEquals(x, 1.0f, "weakCompareAndSetAcquire float"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapFloatRelease(base, offset, 1.0f, 2.0f); + success = UNSAFE.weakCompareAndSetFloatRelease(base, offset, 1.0f, 2.0f); } - assertEquals(success, true, "weakCompareAndSwapRelease float"); + assertEquals(success, true, "weakCompareAndSetRelease float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 2.0f, "weakCompareAndSwapRelease float"); + assertEquals(x, 2.0f, "weakCompareAndSetRelease float"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapFloatVolatile(base, offset, 2.0f, 1.0f); + success = UNSAFE.weakCompareAndSetFloat(base, offset, 2.0f, 1.0f); } - assertEquals(success, true, "weakCompareAndSwapVolatile float"); + assertEquals(success, true, "weakCompareAndSet float"); float x = UNSAFE.getFloat(base, offset); - assertEquals(x, 1.0f, "weakCompareAndSwapVolatile float"); + assertEquals(x, 1.0f, "weakCompareAndSet float"); } UNSAFE.putFloat(base, offset, 2.0f); @@ -306,4 +306,3 @@ public class JdkInternalMiscUnsafeAccessTestFloat { } } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java index b55e3672427..0f0f1f101d3 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,32 +198,32 @@ public class JdkInternalMiscUnsafeAccessTestInt { // Compare { - boolean r = UNSAFE.compareAndSwapInt(base, offset, 0x01234567, 0x89ABCDEF); - assertEquals(r, true, "success compareAndSwap int"); + boolean r = UNSAFE.compareAndSetInt(base, offset, 0x01234567, 0x89ABCDEF); + assertEquals(r, true, "success compareAndSet int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x89ABCDEF, "success compareAndSwap int value"); + assertEquals(x, 0x89ABCDEF, "success compareAndSet int value"); } { - boolean r = UNSAFE.compareAndSwapInt(base, offset, 0x01234567, 0xCAFEBABE); - assertEquals(r, false, "failing compareAndSwap int"); + boolean r = UNSAFE.compareAndSetInt(base, offset, 0x01234567, 0xCAFEBABE); + assertEquals(r, false, "failing compareAndSet int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x89ABCDEF, "failing compareAndSwap int value"); + assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value"); } // Advanced compare { - int r = UNSAFE.compareAndExchangeIntVolatile(base, offset, 0x89ABCDEF, 0x01234567); - assertEquals(r, 0x89ABCDEF, "success compareAndExchangeVolatile int"); + int r = UNSAFE.compareAndExchangeInt(base, offset, 0x89ABCDEF, 0x01234567); + assertEquals(r, 0x89ABCDEF, "success compareAndExchange int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x01234567, "success compareAndExchangeVolatile int value"); + assertEquals(x, 0x01234567, "success compareAndExchange int value"); } { - int r = UNSAFE.compareAndExchangeIntVolatile(base, offset, 0x89ABCDEF, 0xCAFEBABE); - assertEquals(r, 0x01234567, "failing compareAndExchangeVolatile int"); + int r = UNSAFE.compareAndExchangeInt(base, offset, 0x89ABCDEF, 0xCAFEBABE); + assertEquals(r, 0x01234567, "failing compareAndExchange int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x01234567, "failing compareAndExchangeVolatile int value"); + assertEquals(x, 0x01234567, "failing compareAndExchange int value"); } { @@ -257,41 +257,41 @@ public class JdkInternalMiscUnsafeAccessTestInt { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapInt(base, offset, 0x01234567, 0x89ABCDEF); + success = UNSAFE.weakCompareAndSetIntPlain(base, offset, 0x01234567, 0x89ABCDEF); } - assertEquals(success, true, "weakCompareAndSwap int"); + assertEquals(success, true, "weakCompareAndSetPlain int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x89ABCDEF, "weakCompareAndSwap int value"); + assertEquals(x, 0x89ABCDEF, "weakCompareAndSetPlain int value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapIntAcquire(base, offset, 0x89ABCDEF, 0x01234567); + success = UNSAFE.weakCompareAndSetIntAcquire(base, offset, 0x89ABCDEF, 0x01234567); } - assertEquals(success, true, "weakCompareAndSwapAcquire int"); + assertEquals(success, true, "weakCompareAndSetAcquire int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x01234567, "weakCompareAndSwapAcquire int"); + assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapIntRelease(base, offset, 0x01234567, 0x89ABCDEF); + success = UNSAFE.weakCompareAndSetIntRelease(base, offset, 0x01234567, 0x89ABCDEF); } - assertEquals(success, true, "weakCompareAndSwapRelease int"); + assertEquals(success, true, "weakCompareAndSetRelease int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x89ABCDEF, "weakCompareAndSwapRelease int"); + assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapIntVolatile(base, offset, 0x89ABCDEF, 0x01234567); + success = UNSAFE.weakCompareAndSetInt(base, offset, 0x89ABCDEF, 0x01234567); } - assertEquals(success, true, "weakCompareAndSwapVolatile int"); + assertEquals(success, true, "weakCompareAndSet int"); int x = UNSAFE.getInt(base, offset); - assertEquals(x, 0x01234567, "weakCompareAndSwapVolatile int"); + assertEquals(x, 0x01234567, "weakCompareAndSet int"); } UNSAFE.putInt(base, offset, 0x89ABCDEF); @@ -324,4 +324,3 @@ public class JdkInternalMiscUnsafeAccessTestInt { } } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java index fc78b375071..69a51bb698b 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,32 +198,32 @@ public class JdkInternalMiscUnsafeAccessTestLong { // Compare { - boolean r = UNSAFE.compareAndSwapLong(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); - assertEquals(r, true, "success compareAndSwap long"); + boolean r = UNSAFE.compareAndSetLong(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + assertEquals(r, true, "success compareAndSet long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSwap long value"); + assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value"); } { - boolean r = UNSAFE.compareAndSwapLong(base, offset, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL); - assertEquals(r, false, "failing compareAndSwap long"); + boolean r = UNSAFE.compareAndSetLong(base, offset, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL); + assertEquals(r, false, "failing compareAndSet long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSwap long value"); + assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value"); } // Advanced compare { - long r = UNSAFE.compareAndExchangeLongVolatile(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); - assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeVolatile long"); + long r = UNSAFE.compareAndExchangeLong(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeVolatile long value"); + assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value"); } { - long r = UNSAFE.compareAndExchangeLongVolatile(base, offset, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL); - assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long"); + long r = UNSAFE.compareAndExchangeLong(base, offset, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL); + assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeVolatile long value"); + assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value"); } { @@ -257,41 +257,41 @@ public class JdkInternalMiscUnsafeAccessTestLong { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapLong(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = UNSAFE.weakCompareAndSetLongPlain(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); } - assertEquals(success, true, "weakCompareAndSwap long"); + assertEquals(success, true, "weakCompareAndSetPlain long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSwap long value"); + assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetPlain long value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapLongAcquire(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = UNSAFE.weakCompareAndSetLongAcquire(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); } - assertEquals(success, true, "weakCompareAndSwapAcquire long"); + assertEquals(success, true, "weakCompareAndSetAcquire long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSwapAcquire long"); + assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapLongRelease(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); + success = UNSAFE.weakCompareAndSetLongRelease(base, offset, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL); } - assertEquals(success, true, "weakCompareAndSwapRelease long"); + assertEquals(success, true, "weakCompareAndSetRelease long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSwapRelease long"); + assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapLongVolatile(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); + success = UNSAFE.weakCompareAndSetLong(base, offset, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL); } - assertEquals(success, true, "weakCompareAndSwapVolatile long"); + assertEquals(success, true, "weakCompareAndSet long"); long x = UNSAFE.getLong(base, offset); - assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSwapVolatile long"); + assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSet long"); } UNSAFE.putLong(base, offset, 0xCAFEBABECAFEBABEL); @@ -324,4 +324,3 @@ public class JdkInternalMiscUnsafeAccessTestLong { } } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java index 039b472ccf7..b2e5fc57e1e 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -151,32 +151,32 @@ public class JdkInternalMiscUnsafeAccessTestObject { // Compare { - boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "bar"); - assertEquals(r, true, "success compareAndSwap Object"); + boolean r = UNSAFE.compareAndSetObject(base, offset, "foo", "bar"); + assertEquals(r, true, "success compareAndSet Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "bar", "success compareAndSwap Object value"); + assertEquals(x, "bar", "success compareAndSet Object value"); } { - boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "baz"); - assertEquals(r, false, "failing compareAndSwap Object"); + boolean r = UNSAFE.compareAndSetObject(base, offset, "foo", "baz"); + assertEquals(r, false, "failing compareAndSet Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "bar", "failing compareAndSwap Object value"); + assertEquals(x, "bar", "failing compareAndSet Object value"); } // Advanced compare { - Object r = UNSAFE.compareAndExchangeObjectVolatile(base, offset, "bar", "foo"); - assertEquals(r, "bar", "success compareAndExchangeVolatile Object"); + Object r = UNSAFE.compareAndExchangeObject(base, offset, "bar", "foo"); + assertEquals(r, "bar", "success compareAndExchange Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "foo", "success compareAndExchangeVolatile Object value"); + assertEquals(x, "foo", "success compareAndExchange Object value"); } { - Object r = UNSAFE.compareAndExchangeObjectVolatile(base, offset, "bar", "baz"); - assertEquals(r, "foo", "failing compareAndExchangeVolatile Object"); + Object r = UNSAFE.compareAndExchangeObject(base, offset, "bar", "baz"); + assertEquals(r, "foo", "failing compareAndExchange Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "foo", "failing compareAndExchangeVolatile Object value"); + assertEquals(x, "foo", "failing compareAndExchange Object value"); } { @@ -210,41 +210,41 @@ public class JdkInternalMiscUnsafeAccessTestObject { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapObject(base, offset, "foo", "bar"); + success = UNSAFE.weakCompareAndSetObjectPlain(base, offset, "foo", "bar"); } - assertEquals(success, true, "weakCompareAndSwap Object"); + assertEquals(success, true, "weakCompareAndSetPlain Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "bar", "weakCompareAndSwap Object value"); + assertEquals(x, "bar", "weakCompareAndSetPlain Object value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapObjectAcquire(base, offset, "bar", "foo"); + success = UNSAFE.weakCompareAndSetObjectAcquire(base, offset, "bar", "foo"); } - assertEquals(success, true, "weakCompareAndSwapAcquire Object"); + assertEquals(success, true, "weakCompareAndSetAcquire Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "foo", "weakCompareAndSwapAcquire Object"); + assertEquals(x, "foo", "weakCompareAndSetAcquire Object"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapObjectRelease(base, offset, "foo", "bar"); + success = UNSAFE.weakCompareAndSetObjectRelease(base, offset, "foo", "bar"); } - assertEquals(success, true, "weakCompareAndSwapRelease Object"); + assertEquals(success, true, "weakCompareAndSetRelease Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "bar", "weakCompareAndSwapRelease Object"); + assertEquals(x, "bar", "weakCompareAndSetRelease Object"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapObjectVolatile(base, offset, "bar", "foo"); + success = UNSAFE.weakCompareAndSetObject(base, offset, "bar", "foo"); } - assertEquals(success, true, "weakCompareAndSwapVolatile Object"); + assertEquals(success, true, "weakCompareAndSet Object"); Object x = UNSAFE.getObject(base, offset); - assertEquals(x, "foo", "weakCompareAndSwapVolatile Object"); + assertEquals(x, "foo", "weakCompareAndSet Object"); } UNSAFE.putObject(base, offset, "bar"); @@ -260,4 +260,3 @@ public class JdkInternalMiscUnsafeAccessTestObject { } } - diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java index f854979c73f..a6b845eec6b 100644 --- a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,32 +198,32 @@ public class JdkInternalMiscUnsafeAccessTestShort { // Compare { - boolean r = UNSAFE.compareAndSwapShort(base, offset, (short)0x0123, (short)0x4567); - assertEquals(r, true, "success compareAndSwap short"); + boolean r = UNSAFE.compareAndSetShort(base, offset, (short)0x0123, (short)0x4567); + assertEquals(r, true, "success compareAndSet short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x4567, "success compareAndSwap short value"); + assertEquals(x, (short)0x4567, "success compareAndSet short value"); } { - boolean r = UNSAFE.compareAndSwapShort(base, offset, (short)0x0123, (short)0x89AB); - assertEquals(r, false, "failing compareAndSwap short"); + boolean r = UNSAFE.compareAndSetShort(base, offset, (short)0x0123, (short)0x89AB); + assertEquals(r, false, "failing compareAndSet short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x4567, "failing compareAndSwap short value"); + assertEquals(x, (short)0x4567, "failing compareAndSet short value"); } // Advanced compare { - short r = UNSAFE.compareAndExchangeShortVolatile(base, offset, (short)0x4567, (short)0x0123); - assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short"); + short r = UNSAFE.compareAndExchangeShort(base, offset, (short)0x4567, (short)0x0123); + assertEquals(r, (short)0x4567, "success compareAndExchange short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value"); + assertEquals(x, (short)0x0123, "success compareAndExchange short value"); } { - short r = UNSAFE.compareAndExchangeShortVolatile(base, offset, (short)0x4567, (short)0x89AB); - assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short"); + short r = UNSAFE.compareAndExchangeShort(base, offset, (short)0x4567, (short)0x89AB); + assertEquals(r, (short)0x0123, "failing compareAndExchange short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value"); + assertEquals(x, (short)0x0123, "failing compareAndExchange short value"); } { @@ -257,41 +257,41 @@ public class JdkInternalMiscUnsafeAccessTestShort { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapShort(base, offset, (short)0x0123, (short)0x4567); + success = UNSAFE.weakCompareAndSetShortPlain(base, offset, (short)0x0123, (short)0x4567); } - assertEquals(success, true, "weakCompareAndSwap short"); + assertEquals(success, true, "weakCompareAndSetPlain short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x4567, "weakCompareAndSwap short value"); + assertEquals(x, (short)0x4567, "weakCompareAndSetPlain short value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapShortAcquire(base, offset, (short)0x4567, (short)0x0123); + success = UNSAFE.weakCompareAndSetShortAcquire(base, offset, (short)0x4567, (short)0x0123); } - assertEquals(success, true, "weakCompareAndSwapAcquire short"); + assertEquals(success, true, "weakCompareAndSetAcquire short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x0123, "weakCompareAndSwapAcquire short"); + assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapShortRelease(base, offset, (short)0x0123, (short)0x4567); + success = UNSAFE.weakCompareAndSetShortRelease(base, offset, (short)0x0123, (short)0x4567); } - assertEquals(success, true, "weakCompareAndSwapRelease short"); + assertEquals(success, true, "weakCompareAndSetRelease short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x4567, "weakCompareAndSwapRelease short"); + assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwapShortVolatile(base, offset, (short)0x4567, (short)0x0123); + success = UNSAFE.weakCompareAndSetShort(base, offset, (short)0x4567, (short)0x0123); } - assertEquals(success, true, "weakCompareAndSwapVolatile short"); + assertEquals(success, true, "weakCompareAndSet short"); short x = UNSAFE.getShort(base, offset); - assertEquals(x, (short)0x0123, "weakCompareAndSwapVolatile short"); + assertEquals(x, (short)0x0123, "weakCompareAndSet short"); } UNSAFE.putShort(base, offset, (short)0x4567); @@ -324,4 +324,3 @@ public class JdkInternalMiscUnsafeAccessTestShort { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java index 7200bf754c8..a1b68c7305d 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,4 +138,3 @@ public class SunMiscUnsafeAccessTestBoolean { } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java index a30c01ff0f6..c086315cb8a 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,4 +175,3 @@ public class SunMiscUnsafeAccessTestByte { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java index 12dbb25030b..3a55939826d 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,4 +175,3 @@ public class SunMiscUnsafeAccessTestChar { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java index 5fedde71510..52bde3f08d6 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,4 +175,3 @@ public class SunMiscUnsafeAccessTestDouble { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java index 621e4ae3863..478efa4dbc3 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,4 +175,3 @@ public class SunMiscUnsafeAccessTestFloat { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java index 1e49aacb287..0bf8b641066 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -216,4 +216,3 @@ public class SunMiscUnsafeAccessTestInt { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java index e484bcec291..64014df3340 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -216,4 +216,3 @@ public class SunMiscUnsafeAccessTestLong { } } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java index 1241f0fbcd4..0145124c7bd 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,4 +170,3 @@ public class SunMiscUnsafeAccessTestObject { } } - diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java index d1d7b632389..9a815670595 100644 --- a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,4 +175,3 @@ public class SunMiscUnsafeAccessTestShort { } } } - diff --git a/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template b/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template index 55ed81fc059..f28791765a1 100644 --- a/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template +++ b/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,11 @@ * @bug 8143628 * @summary Test unsafe access for $type$ * +#if[JdkInternalMisc] + * @modules $module$/$package$:+open +#else[JdkInternalMisc] * @modules $module$/$package$ +#end[JdkInternalMisc] * @run testng/othervm -Diters=100 -Xint compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ @@ -219,33 +223,51 @@ public class $Qualifier$UnsafeAccessTest$Type$ { // Compare { +#if[JdkInternalMisc] + boolean r = UNSAFE.compareAndSet$Type$(base, offset, $value1$, $value2$); + assertEquals(r, true, "success compareAndSet $type$"); +#else[JdkInternalMisc] boolean r = UNSAFE.compareAndSwap$Type$(base, offset, $value1$, $value2$); assertEquals(r, true, "success compareAndSwap $type$"); +#end[JdkInternalMisc] $type$ x = UNSAFE.get$Type$(base, offset); +#if[JdkInternalMisc] + assertEquals(x, $value2$, "success compareAndSet $type$ value"); +#else[JdkInternalMisc] assertEquals(x, $value2$, "success compareAndSwap $type$ value"); +#end[JdkInternalMisc] } { +#if[JdkInternalMisc] + boolean r = UNSAFE.compareAndSet$Type$(base, offset, $value1$, $value3$); + assertEquals(r, false, "failing compareAndSet $type$"); +#else[JdkInternalMisc] boolean r = UNSAFE.compareAndSwap$Type$(base, offset, $value1$, $value3$); assertEquals(r, false, "failing compareAndSwap $type$"); +#end[JdkInternalMisc] $type$ x = UNSAFE.get$Type$(base, offset); +#if[JdkInternalMisc] + assertEquals(x, $value2$, "failing compareAndSet $type$ value"); +#else[JdkInternalMisc] assertEquals(x, $value2$, "failing compareAndSwap $type$ value"); +#end[JdkInternalMisc] } #if[JdkInternalMisc] // Advanced compare { - $type$ r = UNSAFE.compareAndExchange$Type$Volatile(base, offset, $value2$, $value1$); - assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$"); + $type$ r = UNSAFE.compareAndExchange$Type$(base, offset, $value2$, $value1$); + assertEquals(r, $value2$, "success compareAndExchange $type$"); $type$ x = UNSAFE.get$Type$(base, offset); - assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value"); + assertEquals(x, $value1$, "success compareAndExchange $type$ value"); } { - $type$ r = UNSAFE.compareAndExchange$Type$Volatile(base, offset, $value2$, $value3$); - assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$"); + $type$ r = UNSAFE.compareAndExchange$Type$(base, offset, $value2$, $value3$); + assertEquals(r, $value1$, "failing compareAndExchange $type$"); $type$ x = UNSAFE.get$Type$(base, offset); - assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value"); + assertEquals(x, $value1$, "failing compareAndExchange $type$ value"); } { @@ -279,41 +301,41 @@ public class $Qualifier$UnsafeAccessTest$Type$ { { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwap$Type$(base, offset, $value1$, $value2$); + success = UNSAFE.weakCompareAndSet$Type$Plain(base, offset, $value1$, $value2$); } - assertEquals(success, true, "weakCompareAndSwap $type$"); + assertEquals(success, true, "weakCompareAndSetPlain $type$"); $type$ x = UNSAFE.get$Type$(base, offset); - assertEquals(x, $value2$, "weakCompareAndSwap $type$ value"); + assertEquals(x, $value2$, "weakCompareAndSetPlain $type$ value"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwap$Type$Acquire(base, offset, $value2$, $value1$); + success = UNSAFE.weakCompareAndSet$Type$Acquire(base, offset, $value2$, $value1$); } - assertEquals(success, true, "weakCompareAndSwapAcquire $type$"); + assertEquals(success, true, "weakCompareAndSetAcquire $type$"); $type$ x = UNSAFE.get$Type$(base, offset); - assertEquals(x, $value1$, "weakCompareAndSwapAcquire $type$"); + assertEquals(x, $value1$, "weakCompareAndSetAcquire $type$"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwap$Type$Release(base, offset, $value1$, $value2$); + success = UNSAFE.weakCompareAndSet$Type$Release(base, offset, $value1$, $value2$); } - assertEquals(success, true, "weakCompareAndSwapRelease $type$"); + assertEquals(success, true, "weakCompareAndSetRelease $type$"); $type$ x = UNSAFE.get$Type$(base, offset); - assertEquals(x, $value2$, "weakCompareAndSwapRelease $type$"); + assertEquals(x, $value2$, "weakCompareAndSetRelease $type$"); } { boolean success = false; for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) { - success = UNSAFE.weakCompareAndSwap$Type$Volatile(base, offset, $value2$, $value1$); + success = UNSAFE.weakCompareAndSet$Type$(base, offset, $value2$, $value1$); } - assertEquals(success, true, "weakCompareAndSwapVolatile $type$"); + assertEquals(success, true, "weakCompareAndSet $type$"); $type$ x = UNSAFE.get$Type$(base, offset); - assertEquals(x, $value1$, "weakCompareAndSwapVolatile $type$"); + assertEquals(x, $value1$, "weakCompareAndSet $type$"); } #end[JdkInternalMisc] @@ -354,4 +376,3 @@ public class $Qualifier$UnsafeAccessTest$Type$ { #end[!boolean] #end[!Object] } - From ac0bf2d4015a98426cb99d33af484b6e6d937fc1 Mon Sep 17 00:00:00 2001 From: Ron Pressler Date: Mon, 5 Jun 2017 16:05:24 -0700 Subject: [PATCH 021/130] 8181292: Backport Rename internal Unsafe.compare methods from 10 to 9 Reviewed-by: psandoz, dholmes, mchung --- .../share/classes/java/lang/Class.java | 6 +- .../share/classes/java/lang/ClassLoader.java | 2 +- .../lang/invoke/X-VarHandle.java.template | 42 +- .../X-VarHandleByteArrayView.java.template | 46 +- .../util/concurrent/ConcurrentHashMap.java | 40 +- .../util/concurrent/atomic/AtomicInteger.java | 14 +- .../atomic/AtomicIntegerFieldUpdater.java | 4 +- .../util/concurrent/atomic/AtomicLong.java | 18 +- .../atomic/AtomicLongFieldUpdater.java | 4 +- .../atomic/AtomicReferenceFieldUpdater.java | 4 +- .../classes/jdk/internal/misc/Unsafe.java | 608 +++++++++--------- .../share/classes/sun/misc/Unsafe.java | 8 +- 12 files changed, 398 insertions(+), 398 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java index 4251a6963b4..e6962ac45ec 100644 --- a/jdk/src/java.base/share/classes/java/lang/Class.java +++ b/jdk/src/java.base/share/classes/java/lang/Class.java @@ -2880,19 +2880,19 @@ public final class Class implements java.io.Serializable, static boolean casReflectionData(Class> clazz, SoftReference > oldData, SoftReference > newData) { - return unsafe.compareAndSwapObject(clazz, reflectionDataOffset, oldData, newData); + return unsafe.compareAndSetObject(clazz, reflectionDataOffset, oldData, newData); } static boolean casAnnotationType(Class> clazz, AnnotationType oldType, AnnotationType newType) { - return unsafe.compareAndSwapObject(clazz, annotationTypeOffset, oldType, newType); + return unsafe.compareAndSetObject(clazz, annotationTypeOffset, oldType, newType); } static boolean casAnnotationData(Class> clazz, AnnotationData oldData, AnnotationData newData) { - return unsafe.compareAndSwapObject(clazz, annotationDataOffset, oldData, newData); + return unsafe.compareAndSetObject(clazz, annotationDataOffset, oldData, newData); } } diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java index fb9660f6072..9aee833e141 100644 --- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java @@ -2884,7 +2884,7 @@ public abstract class ClassLoader { } catch (NoSuchFieldException e) { throw new InternalError(e); } - return unsafe.compareAndSwapObject(this, offset, null, obj); + return unsafe.compareAndSetObject(this, offset, null, obj); } } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template index 634d64d8327..71419c36548 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template +++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ final class VarHandle$Type$s { @ForceInline static boolean compareAndSet(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) { - return UNSAFE.compareAndSwap$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), + return UNSAFE.compareAndSet$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -133,7 +133,7 @@ final class VarHandle$Type$s { @ForceInline static $type$ compareAndExchange(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) { - return UNSAFE.compareAndExchange$Type$Volatile(Objects.requireNonNull(handle.receiverType.cast(holder)), + return UNSAFE.compareAndExchange$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -157,7 +157,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSetPlain(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), + return UNSAFE.weakCompareAndSet$Type$Plain(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -165,7 +165,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSet(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$Volatile(Objects.requireNonNull(handle.receiverType.cast(holder)), + return UNSAFE.weakCompareAndSet$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -173,7 +173,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSetAcquire(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$Acquire(Objects.requireNonNull(handle.receiverType.cast(holder)), + return UNSAFE.weakCompareAndSet$Type$Acquire(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -181,7 +181,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSetRelease(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$Release(Objects.requireNonNull(handle.receiverType.cast(holder)), + return UNSAFE.weakCompareAndSet$Type$Release(Objects.requireNonNull(handle.receiverType.cast(holder)), handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -275,7 +275,7 @@ final class VarHandle$Type$s { handle.fieldOffset, value); } - + @ForceInline static $type$ getAndBitwiseXor(FieldInstanceReadWrite handle, Object holder, $type$ value) { return UNSAFE.getAndBitwiseXor$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)), @@ -392,7 +392,7 @@ final class VarHandle$Type$s { @ForceInline static boolean compareAndSet(FieldStaticReadWrite handle, $type$ expected, $type$ value) { - return UNSAFE.compareAndSwap$Type$(handle.base, + return UNSAFE.compareAndSet$Type$(handle.base, handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -401,7 +401,7 @@ final class VarHandle$Type$s { @ForceInline static $type$ compareAndExchange(FieldStaticReadWrite handle, $type$ expected, $type$ value) { - return UNSAFE.compareAndExchange$Type$Volatile(handle.base, + return UNSAFE.compareAndExchange$Type$(handle.base, handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -425,7 +425,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSetPlain(FieldStaticReadWrite handle, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$(handle.base, + return UNSAFE.weakCompareAndSet$Type$Plain(handle.base, handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -433,7 +433,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSet(FieldStaticReadWrite handle, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$Volatile(handle.base, + return UNSAFE.weakCompareAndSet$Type$(handle.base, handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -441,7 +441,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSetAcquire(FieldStaticReadWrite handle, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$Acquire(handle.base, + return UNSAFE.weakCompareAndSet$Type$Acquire(handle.base, handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -449,7 +449,7 @@ final class VarHandle$Type$s { @ForceInline static boolean weakCompareAndSetRelease(FieldStaticReadWrite handle, $type$ expected, $type$ value) { - return UNSAFE.weakCompareAndSwap$Type$Release(handle.base, + return UNSAFE.weakCompareAndSet$Type$Release(handle.base, handle.fieldOffset, {#if[Object]?handle.fieldType.cast(expected):expected}, {#if[Object]?handle.fieldType.cast(value):value}); @@ -689,7 +689,7 @@ final class VarHandle$Type$s { #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] - return UNSAFE.compareAndSwap$Type$(array, + return UNSAFE.compareAndSet$Type$(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, {#if[Object]?handle.componentType.cast(expected):expected}, {#if[Object]?handle.componentType.cast(value):value}); @@ -702,7 +702,7 @@ final class VarHandle$Type$s { #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] - return UNSAFE.compareAndExchange$Type$Volatile(array, + return UNSAFE.compareAndExchange$Type$(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, {#if[Object]?handle.componentType.cast(expected):expected}, {#if[Object]?handle.componentType.cast(value):value}); @@ -741,7 +741,7 @@ final class VarHandle$Type$s { #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] - return UNSAFE.weakCompareAndSwap$Type$(array, + return UNSAFE.weakCompareAndSet$Type$Plain(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, {#if[Object]?handle.componentType.cast(expected):expected}, {#if[Object]?handle.componentType.cast(value):value}); @@ -754,7 +754,7 @@ final class VarHandle$Type$s { #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] - return UNSAFE.weakCompareAndSwap$Type$Volatile(array, + return UNSAFE.weakCompareAndSet$Type$(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, {#if[Object]?handle.componentType.cast(expected):expected}, {#if[Object]?handle.componentType.cast(value):value}); @@ -767,7 +767,7 @@ final class VarHandle$Type$s { #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] - return UNSAFE.weakCompareAndSwap$Type$Acquire(array, + return UNSAFE.weakCompareAndSet$Type$Acquire(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, {#if[Object]?handle.componentType.cast(expected):expected}, {#if[Object]?handle.componentType.cast(value):value}); @@ -780,7 +780,7 @@ final class VarHandle$Type$s { #else[Object] $type$[] array = ($type$[]) oarray; #end[Object] - return UNSAFE.weakCompareAndSwap$Type$Release(array, + return UNSAFE.weakCompareAndSet$Type$Release(array, (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, {#if[Object]?handle.componentType.cast(expected):expected}, {#if[Object]?handle.componentType.cast(value):value}); @@ -897,7 +897,7 @@ final class VarHandle$Type$s { (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase, value); } - + @ForceInline static $type$ getAndBitwiseXor(Array handle, Object oarray, int index, $type$ value) { $type$[] array = ($type$[]) oarray; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template index da57311e39d..e85fd913406 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template +++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,7 +186,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean compareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { byte[] ba = (byte[]) oba; - return UNSAFE.compareAndSwap$RawType$( + return UNSAFE.compareAndSet$RawType$( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -196,7 +196,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { static $type$ compareAndExchange(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { byte[] ba = (byte[]) oba; return convEndian(handle.be, - UNSAFE.compareAndExchange$RawType$Volatile( + UNSAFE.compareAndExchange$RawType$( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); @@ -225,7 +225,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSetPlain(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { byte[] ba = (byte[]) oba; - return UNSAFE.weakCompareAndSwap$RawType$( + return UNSAFE.weakCompareAndSet$RawType$Plain( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -234,7 +234,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { byte[] ba = (byte[]) oba; - return UNSAFE.weakCompareAndSwap$RawType$Volatile( + return UNSAFE.weakCompareAndSet$RawType$( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -243,7 +243,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSetAcquire(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { byte[] ba = (byte[]) oba; - return UNSAFE.weakCompareAndSwap$RawType$Acquire( + return UNSAFE.weakCompareAndSet$RawType$Acquire( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -252,7 +252,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSetRelease(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { byte[] ba = (byte[]) oba; - return UNSAFE.weakCompareAndSwap$RawType$Release( + return UNSAFE.weakCompareAndSet$RawType$Release( ba, address(ba, index(ba, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -336,7 +336,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(ba, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue + delta))); return expectedValue; } @@ -389,7 +389,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(ba, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue | value))); return expectedValue; } @@ -440,7 +440,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(ba, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue & value))); return expectedValue; } @@ -491,7 +491,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(ba, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue ^ value))); return expectedValue; } @@ -625,7 +625,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean compareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; - return UNSAFE.compareAndSwap$RawType$( + return UNSAFE.compareAndSet$RawType$( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -635,7 +635,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { static $type$ compareAndExchange(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; return convEndian(handle.be, - UNSAFE.compareAndExchange$RawType$Volatile( + UNSAFE.compareAndExchange$RawType$( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value))); @@ -664,7 +664,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; - return UNSAFE.weakCompareAndSwap$RawType$( + return UNSAFE.weakCompareAndSet$RawType$Plain( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -673,7 +673,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; - return UNSAFE.weakCompareAndSwap$RawType$Volatile( + return UNSAFE.weakCompareAndSet$RawType$( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -682,7 +682,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; - return UNSAFE.weakCompareAndSwap$RawType$Acquire( + return UNSAFE.weakCompareAndSet$RawType$Acquire( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -691,7 +691,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { @ForceInline static boolean weakCompareAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; - return UNSAFE.weakCompareAndSwap$RawType$Release( + return UNSAFE.weakCompareAndSet$RawType$Release( UNSAFE.getObject(bb, BYTE_BUFFER_HB), address(bb, indexRO(bb, index)), convEndian(handle.be, expected), convEndian(handle.be, value)); @@ -776,7 +776,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(base, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue + delta))); return expectedValue; } @@ -830,7 +830,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(base, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue | value))); return expectedValue; } @@ -882,12 +882,12 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(base, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue & value))); return expectedValue; } - - + + @ForceInline static $type$ getAndBitwiseXor(ByteBufferHandle handle, Object obb, int index, $type$ value) { ByteBuffer bb = (ByteBuffer) obb; @@ -935,7 +935,7 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { do { nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); - } while (!UNSAFE.weakCompareAndSwap$RawType$Volatile(base, offset, + } while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue ^ value))); return expectedValue; } diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java index 77c42efd6fd..aec44a2d4c7 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -768,7 +768,7 @@ public class ConcurrentHashMap extends AbstractMap static final boolean casTabAt(Node [] tab, int i, Node c, Node v) { - return U.compareAndSwapObject(tab, ((long)i << ASHIFT) + ABASE, c, v); + return U.compareAndSetObject(tab, ((long)i << ASHIFT) + ABASE, c, v); } static final void setTabAt(Node [] tab, int i, Node v) { @@ -2299,7 +2299,7 @@ public class ConcurrentHashMap extends AbstractMap while ((tab = table) == null || tab.length == 0) { if ((sc = sizeCtl) < 0) Thread.yield(); // lost initialization race; just spin - else if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) { + else if (U.compareAndSetInt(this, SIZECTL, sc, -1)) { try { if ((tab = table) == null || tab.length == 0) { int n = (sc > 0) ? sc : DEFAULT_CAPACITY; @@ -2330,13 +2330,13 @@ public class ConcurrentHashMap extends AbstractMap private final void addCount(long x, int check) { CounterCell[] as; long b, s; if ((as = counterCells) != null || - !U.compareAndSwapLong(this, BASECOUNT, b = baseCount, s = b + x)) { + !U.compareAndSetLong(this, BASECOUNT, b = baseCount, s = b + x)) { CounterCell a; long v; int m; boolean uncontended = true; if (as == null || (m = as.length - 1) < 0 || (a = as[ThreadLocalRandom.getProbe() & m]) == null || !(uncontended = - U.compareAndSwapLong(a, CELLVALUE, v = a.value, v + x))) { + U.compareAndSetLong(a, CELLVALUE, v = a.value, v + x))) { fullAddCount(x, uncontended); return; } @@ -2354,10 +2354,10 @@ public class ConcurrentHashMap extends AbstractMap sc == rs + MAX_RESIZERS || (nt = nextTable) == null || transferIndex <= 0) break; - if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1)) + if (U.compareAndSetInt(this, SIZECTL, sc, sc + 1)) transfer(tab, nt); } - else if (U.compareAndSwapInt(this, SIZECTL, sc, + else if (U.compareAndSetInt(this, SIZECTL, sc, (rs << RESIZE_STAMP_SHIFT) + 2)) transfer(tab, null); s = sumCount(); @@ -2378,7 +2378,7 @@ public class ConcurrentHashMap extends AbstractMap if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 || sc == rs + MAX_RESIZERS || transferIndex <= 0) break; - if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1)) { + if (U.compareAndSetInt(this, SIZECTL, sc, sc + 1)) { transfer(tab, nextTab); break; } @@ -2401,7 +2401,7 @@ public class ConcurrentHashMap extends AbstractMap Node [] tab = table; int n; if (tab == null || (n = tab.length) == 0) { n = (sc > c) ? sc : c; - if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) { + if (U.compareAndSetInt(this, SIZECTL, sc, -1)) { try { if (table == tab) { @SuppressWarnings("unchecked") @@ -2418,7 +2418,7 @@ public class ConcurrentHashMap extends AbstractMap break; else if (tab == table) { int rs = resizeStamp(n); - if (U.compareAndSwapInt(this, SIZECTL, sc, + if (U.compareAndSetInt(this, SIZECTL, sc, (rs << RESIZE_STAMP_SHIFT) + 2)) transfer(tab, null); } @@ -2459,7 +2459,7 @@ public class ConcurrentHashMap extends AbstractMap i = -1; advance = false; } - else if (U.compareAndSwapInt + else if (U.compareAndSetInt (this, TRANSFERINDEX, nextIndex, nextBound = (nextIndex > stride ? nextIndex - stride : 0))) { @@ -2476,7 +2476,7 @@ public class ConcurrentHashMap extends AbstractMap sizeCtl = (n << 1) - (n >>> 1); return; } - if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, sc - 1)) { + if (U.compareAndSetInt(this, SIZECTL, sc = sizeCtl, sc - 1)) { if ((sc - 2) != resizeStamp(n) << RESIZE_STAMP_SHIFT) return; finishing = advance = true; @@ -2601,7 +2601,7 @@ public class ConcurrentHashMap extends AbstractMap if (cellsBusy == 0) { // Try to attach new Cell CounterCell r = new CounterCell(x); // Optimistic create if (cellsBusy == 0 && - U.compareAndSwapInt(this, CELLSBUSY, 0, 1)) { + U.compareAndSetInt(this, CELLSBUSY, 0, 1)) { boolean created = false; try { // Recheck under lock CounterCell[] rs; int m, j; @@ -2623,14 +2623,14 @@ public class ConcurrentHashMap extends AbstractMap } else if (!wasUncontended) // CAS already known to fail wasUncontended = true; // Continue after rehash - else if (U.compareAndSwapLong(a, CELLVALUE, v = a.value, v + x)) + else if (U.compareAndSetLong(a, CELLVALUE, v = a.value, v + x)) break; else if (counterCells != as || n >= NCPU) collide = false; // At max size or stale else if (!collide) collide = true; else if (cellsBusy == 0 && - U.compareAndSwapInt(this, CELLSBUSY, 0, 1)) { + U.compareAndSetInt(this, CELLSBUSY, 0, 1)) { try { if (counterCells == as) {// Expand table unless stale CounterCell[] rs = new CounterCell[n << 1]; @@ -2647,7 +2647,7 @@ public class ConcurrentHashMap extends AbstractMap h = ThreadLocalRandom.advanceProbe(h); } else if (cellsBusy == 0 && counterCells == as && - U.compareAndSwapInt(this, CELLSBUSY, 0, 1)) { + U.compareAndSetInt(this, CELLSBUSY, 0, 1)) { boolean init = false; try { // Initialize table if (counterCells == as) { @@ -2662,7 +2662,7 @@ public class ConcurrentHashMap extends AbstractMap if (init) break; } - else if (U.compareAndSwapLong(this, BASECOUNT, v = baseCount, v + x)) + else if (U.compareAndSetLong(this, BASECOUNT, v = baseCount, v + x)) break; // Fall back on using base } } @@ -2858,7 +2858,7 @@ public class ConcurrentHashMap extends AbstractMap * Acquires write lock for tree restructuring. */ private final void lockRoot() { - if (!U.compareAndSwapInt(this, LOCKSTATE, 0, WRITER)) + if (!U.compareAndSetInt(this, LOCKSTATE, 0, WRITER)) contendedLock(); // offload to separate method } @@ -2876,14 +2876,14 @@ public class ConcurrentHashMap extends AbstractMap boolean waiting = false; for (int s;;) { if (((s = lockState) & ~WAITER) == 0) { - if (U.compareAndSwapInt(this, LOCKSTATE, s, WRITER)) { + if (U.compareAndSetInt(this, LOCKSTATE, s, WRITER)) { if (waiting) waiter = null; return; } } else if ((s & WAITER) == 0) { - if (U.compareAndSwapInt(this, LOCKSTATE, s, s | WAITER)) { + if (U.compareAndSetInt(this, LOCKSTATE, s, s | WAITER)) { waiting = true; waiter = Thread.currentThread(); } @@ -2908,7 +2908,7 @@ public class ConcurrentHashMap extends AbstractMap return e; e = e.next; } - else if (U.compareAndSwapInt(this, LOCKSTATE, s, + else if (U.compareAndSetInt(this, LOCKSTATE, s, s + READER)) { TreeNode r, p; try { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java index f2184aaeebd..22850e6dab7 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java @@ -140,7 +140,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int expectedValue, int newValue) { - return U.compareAndSwapInt(this, VALUE, expectedValue, newValue); + return U.compareAndSetInt(this, VALUE, expectedValue, newValue); } /** @@ -161,7 +161,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { */ @Deprecated(since="9") public final boolean weakCompareAndSet(int expectedValue, int newValue) { - return U.weakCompareAndSwapInt(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetIntPlain(this, VALUE, expectedValue, newValue); } /** @@ -175,7 +175,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetPlain(int expectedValue, int newValue) { - return U.weakCompareAndSwapInt(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetIntPlain(this, VALUE, expectedValue, newValue); } /** @@ -473,7 +473,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @since 9 */ public final int compareAndExchange(int expectedValue, int newValue) { - return U.compareAndExchangeIntVolatile(this, VALUE, expectedValue, newValue); + return U.compareAndExchangeInt(this, VALUE, expectedValue, newValue); } /** @@ -520,7 +520,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetVolatile(int expectedValue, int newValue) { - return U.weakCompareAndSwapIntVolatile(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetInt(this, VALUE, expectedValue, newValue); } /** @@ -535,7 +535,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetAcquire(int expectedValue, int newValue) { - return U.weakCompareAndSwapIntAcquire(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetIntAcquire(this, VALUE, expectedValue, newValue); } /** @@ -550,7 +550,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetRelease(int expectedValue, int newValue) { - return U.weakCompareAndSwapIntRelease(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetIntRelease(this, VALUE, expectedValue, newValue); } } diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java index 1de994f06ec..826a0557b5f 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java @@ -481,12 +481,12 @@ public abstract class AtomicIntegerFieldUpdater { public final boolean compareAndSet(T obj, int expect, int update) { accessCheck(obj); - return U.compareAndSwapInt(obj, offset, expect, update); + return U.compareAndSetInt(obj, offset, expect, update); } public final boolean weakCompareAndSet(T obj, int expect, int update) { accessCheck(obj); - return U.compareAndSwapInt(obj, offset, expect, update); + return U.compareAndSetInt(obj, offset, expect, update); } public final void set(T obj, int newValue) { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java index a0670eeac8f..940f67c1bf3 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java @@ -56,7 +56,7 @@ public class AtomicLong extends Number implements java.io.Serializable { /** * Records whether the underlying JVM supports lockless - * compareAndSwap for longs. While the intrinsic compareAndSwapLong + * compareAndSet for longs. While the intrinsic compareAndSetLong * method works in either case, some constructions should be * handled at Java level to avoid locking user-visible locks. */ @@ -119,7 +119,7 @@ public class AtomicLong extends Number implements java.io.Serializable { */ public final void set(long newValue) { // Use putLongVolatile instead of ordinary volatile store when - // using compareAndSwapLong, for sake of some 32bit systems. + // using compareAndSetLong, for sake of some 32bit systems. U.putLongVolatile(this, VALUE, newValue); } @@ -156,7 +156,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * the actual value was not equal to the expected value. */ public final boolean compareAndSet(long expectedValue, long newValue) { - return U.compareAndSwapLong(this, VALUE, expectedValue, newValue); + return U.compareAndSetLong(this, VALUE, expectedValue, newValue); } /** @@ -177,7 +177,7 @@ public class AtomicLong extends Number implements java.io.Serializable { */ @Deprecated(since="9") public final boolean weakCompareAndSet(long expectedValue, long newValue) { - return U.weakCompareAndSwapLong(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetLongPlain(this, VALUE, expectedValue, newValue); } /** @@ -191,7 +191,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetPlain(long expectedValue, long newValue) { - return U.weakCompareAndSwapLong(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetLongPlain(this, VALUE, expectedValue, newValue); } /** @@ -487,7 +487,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @since 9 */ public final long compareAndExchange(long expectedValue, long newValue) { - return U.compareAndExchangeLongVolatile(this, VALUE, expectedValue, newValue); + return U.compareAndExchangeLong(this, VALUE, expectedValue, newValue); } /** @@ -534,7 +534,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetVolatile(long expectedValue, long newValue) { - return U.weakCompareAndSwapLongVolatile(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetLong(this, VALUE, expectedValue, newValue); } /** @@ -549,7 +549,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetAcquire(long expectedValue, long newValue) { - return U.weakCompareAndSwapLongAcquire(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetLongAcquire(this, VALUE, expectedValue, newValue); } /** @@ -564,7 +564,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @since 9 */ public final boolean weakCompareAndSetRelease(long expectedValue, long newValue) { - return U.weakCompareAndSwapLongRelease(this, VALUE, expectedValue, newValue); + return U.weakCompareAndSetLongRelease(this, VALUE, expectedValue, newValue); } } diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java index bd60f0bdcbb..ee0447a8b88 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java @@ -454,12 +454,12 @@ public abstract class AtomicLongFieldUpdater { public final boolean compareAndSet(T obj, long expect, long update) { accessCheck(obj); - return U.compareAndSwapLong(obj, offset, expect, update); + return U.compareAndSetLong(obj, offset, expect, update); } public final boolean weakCompareAndSet(T obj, long expect, long update) { accessCheck(obj); - return U.compareAndSwapLong(obj, offset, expect, update); + return U.compareAndSetLong(obj, offset, expect, update); } public final void set(T obj, long newValue) { diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java index 56f6751b9f0..a469abb98cc 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java @@ -432,14 +432,14 @@ public abstract class AtomicReferenceFieldUpdater { public final boolean compareAndSet(T obj, V expect, V update) { accessCheck(obj); valueCheck(update); - return U.compareAndSwapObject(obj, offset, expect, update); + return U.compareAndSetObject(obj, offset, expect, update); } public final boolean weakCompareAndSet(T obj, V expect, V update) { // same implementation as strong form for now accessCheck(obj); valueCheck(update); - return U.compareAndSwapObject(obj, offset, expect, update); + return U.compareAndSetObject(obj, offset, expect, update); } public final void set(T obj, V newValue) { diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java index f4de0ea0c47..f9d7e3e22b0 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1278,55 +1278,55 @@ public final class Unsafe { * @return {@code true} if successful */ @HotSpotIntrinsicCandidate - public final native boolean compareAndSwapObject(Object o, long offset, - Object expected, - Object x); + public final native boolean compareAndSetObject(Object o, long offset, + Object expected, + Object x); @HotSpotIntrinsicCandidate - public final native Object compareAndExchangeObjectVolatile(Object o, long offset, - Object expected, - Object x); + public final native Object compareAndExchangeObject(Object o, long offset, + Object expected, + Object x); @HotSpotIntrinsicCandidate public final Object compareAndExchangeObjectAcquire(Object o, long offset, Object expected, Object x) { - return compareAndExchangeObjectVolatile(o, offset, expected, x); + return compareAndExchangeObject(o, offset, expected, x); } @HotSpotIntrinsicCandidate public final Object compareAndExchangeObjectRelease(Object o, long offset, Object expected, Object x) { - return compareAndExchangeObjectVolatile(o, offset, expected, x); + return compareAndExchangeObject(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapObject(Object o, long offset, - Object expected, - Object x) { - return compareAndSwapObject(o, offset, expected, x); + public final boolean weakCompareAndSetObjectPlain(Object o, long offset, + Object expected, + Object x) { + return compareAndSetObject(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapObjectAcquire(Object o, long offset, - Object expected, - Object x) { - return compareAndSwapObject(o, offset, expected, x); + public final boolean weakCompareAndSetObjectAcquire(Object o, long offset, + Object expected, + Object x) { + return compareAndSetObject(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapObjectRelease(Object o, long offset, - Object expected, - Object x) { - return compareAndSwapObject(o, offset, expected, x); + public final boolean weakCompareAndSetObjectRelease(Object o, long offset, + Object expected, + Object x) { + return compareAndSetObject(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapObjectVolatile(Object o, long offset, - Object expected, - Object x) { - return compareAndSwapObject(o, offset, expected, x); + public final boolean weakCompareAndSetObject(Object o, long offset, + Object expected, + Object x) { + return compareAndSetObject(o, offset, expected, x); } /** @@ -1339,61 +1339,61 @@ public final class Unsafe { * @return {@code true} if successful */ @HotSpotIntrinsicCandidate - public final native boolean compareAndSwapInt(Object o, long offset, - int expected, - int x); + public final native boolean compareAndSetInt(Object o, long offset, + int expected, + int x); @HotSpotIntrinsicCandidate - public final native int compareAndExchangeIntVolatile(Object o, long offset, - int expected, - int x); + public final native int compareAndExchangeInt(Object o, long offset, + int expected, + int x); @HotSpotIntrinsicCandidate public final int compareAndExchangeIntAcquire(Object o, long offset, int expected, int x) { - return compareAndExchangeIntVolatile(o, offset, expected, x); + return compareAndExchangeInt(o, offset, expected, x); } @HotSpotIntrinsicCandidate public final int compareAndExchangeIntRelease(Object o, long offset, int expected, int x) { - return compareAndExchangeIntVolatile(o, offset, expected, x); + return compareAndExchangeInt(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapInt(Object o, long offset, - int expected, - int x) { - return compareAndSwapInt(o, offset, expected, x); + public final boolean weakCompareAndSetIntPlain(Object o, long offset, + int expected, + int x) { + return compareAndSetInt(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapIntAcquire(Object o, long offset, - int expected, - int x) { - return compareAndSwapInt(o, offset, expected, x); + public final boolean weakCompareAndSetIntAcquire(Object o, long offset, + int expected, + int x) { + return compareAndSetInt(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapIntRelease(Object o, long offset, - int expected, - int x) { - return compareAndSwapInt(o, offset, expected, x); + public final boolean weakCompareAndSetIntRelease(Object o, long offset, + int expected, + int x) { + return compareAndSetInt(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapIntVolatile(Object o, long offset, - int expected, - int x) { - return compareAndSwapInt(o, offset, expected, x); + public final boolean weakCompareAndSetInt(Object o, long offset, + int expected, + int x) { + return compareAndSetInt(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final byte compareAndExchangeByteVolatile(Object o, long offset, - byte expected, - byte x) { + public final byte compareAndExchangeByte(Object o, long offset, + byte expected, + byte x) { long wordOffset = offset & ~3; int shift = (int) (offset & 3) << 3; if (BE) { @@ -1407,64 +1407,64 @@ public final class Unsafe { fullWord = getIntVolatile(o, wordOffset); if ((fullWord & mask) != maskedExpected) return (byte) ((fullWord & mask) >> shift); - } while (!weakCompareAndSwapIntVolatile(o, wordOffset, + } while (!weakCompareAndSetInt(o, wordOffset, fullWord, (fullWord & ~mask) | maskedX)); return expected; } @HotSpotIntrinsicCandidate - public final boolean compareAndSwapByte(Object o, long offset, - byte expected, - byte x) { - return compareAndExchangeByteVolatile(o, offset, expected, x) == expected; + public final boolean compareAndSetByte(Object o, long offset, + byte expected, + byte x) { + return compareAndExchangeByte(o, offset, expected, x) == expected; } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapByteVolatile(Object o, long offset, - byte expected, - byte x) { - return compareAndSwapByte(o, offset, expected, x); + public final boolean weakCompareAndSetByte(Object o, long offset, + byte expected, + byte x) { + return compareAndSetByte(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapByteAcquire(Object o, long offset, - byte expected, - byte x) { - return weakCompareAndSwapByteVolatile(o, offset, expected, x); + public final boolean weakCompareAndSetByteAcquire(Object o, long offset, + byte expected, + byte x) { + return weakCompareAndSetByte(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapByteRelease(Object o, long offset, - byte expected, - byte x) { - return weakCompareAndSwapByteVolatile(o, offset, expected, x); + public final boolean weakCompareAndSetByteRelease(Object o, long offset, + byte expected, + byte x) { + return weakCompareAndSetByte(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapByte(Object o, long offset, - byte expected, - byte x) { - return weakCompareAndSwapByteVolatile(o, offset, expected, x); + public final boolean weakCompareAndSetBytePlain(Object o, long offset, + byte expected, + byte x) { + return weakCompareAndSetByte(o, offset, expected, x); } @HotSpotIntrinsicCandidate public final byte compareAndExchangeByteAcquire(Object o, long offset, byte expected, byte x) { - return compareAndExchangeByteVolatile(o, offset, expected, x); + return compareAndExchangeByte(o, offset, expected, x); } @HotSpotIntrinsicCandidate public final byte compareAndExchangeByteRelease(Object o, long offset, byte expected, byte x) { - return compareAndExchangeByteVolatile(o, offset, expected, x); + return compareAndExchangeByte(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final short compareAndExchangeShortVolatile(Object o, long offset, - short expected, - short x) { + public final short compareAndExchangeShort(Object o, long offset, + short expected, + short x) { if ((offset & 3) == 3) { throw new IllegalArgumentException("Update spans the word, not supported"); } @@ -1482,44 +1482,44 @@ public final class Unsafe { if ((fullWord & mask) != maskedExpected) { return (short) ((fullWord & mask) >> shift); } - } while (!weakCompareAndSwapIntVolatile(o, wordOffset, + } while (!weakCompareAndSetInt(o, wordOffset, fullWord, (fullWord & ~mask) | maskedX)); return expected; } @HotSpotIntrinsicCandidate - public final boolean compareAndSwapShort(Object o, long offset, - short expected, - short x) { - return compareAndExchangeShortVolatile(o, offset, expected, x) == expected; + public final boolean compareAndSetShort(Object o, long offset, + short expected, + short x) { + return compareAndExchangeShort(o, offset, expected, x) == expected; } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapShortVolatile(Object o, long offset, - short expected, - short x) { - return compareAndSwapShort(o, offset, expected, x); + public final boolean weakCompareAndSetShort(Object o, long offset, + short expected, + short x) { + return compareAndSetShort(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapShortAcquire(Object o, long offset, - short expected, - short x) { - return weakCompareAndSwapShortVolatile(o, offset, expected, x); + public final boolean weakCompareAndSetShortAcquire(Object o, long offset, + short expected, + short x) { + return weakCompareAndSetShort(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapShortRelease(Object o, long offset, - short expected, - short x) { - return weakCompareAndSwapShortVolatile(o, offset, expected, x); + public final boolean weakCompareAndSetShortRelease(Object o, long offset, + short expected, + short x) { + return weakCompareAndSetShort(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapShort(Object o, long offset, - short expected, - short x) { - return weakCompareAndSwapShortVolatile(o, offset, expected, x); + public final boolean weakCompareAndSetShortPlain(Object o, long offset, + short expected, + short x) { + return weakCompareAndSetShort(o, offset, expected, x); } @@ -1527,14 +1527,14 @@ public final class Unsafe { public final short compareAndExchangeShortAcquire(Object o, long offset, short expected, short x) { - return compareAndExchangeShortVolatile(o, offset, expected, x); + return compareAndExchangeShort(o, offset, expected, x); } @HotSpotIntrinsicCandidate public final short compareAndExchangeShortRelease(Object o, long offset, short expected, short x) { - return compareAndExchangeShortVolatile(o, offset, expected, x); + return compareAndExchangeShort(o, offset, expected, x); } @ForceInline @@ -1548,17 +1548,17 @@ public final class Unsafe { } @ForceInline - public final boolean compareAndSwapChar(Object o, long offset, - char expected, - char x) { - return compareAndSwapShort(o, offset, c2s(expected), c2s(x)); + public final boolean compareAndSetChar(Object o, long offset, + char expected, + char x) { + return compareAndSetShort(o, offset, c2s(expected), c2s(x)); } @ForceInline - public final char compareAndExchangeCharVolatile(Object o, long offset, - char expected, - char x) { - return s2c(compareAndExchangeShortVolatile(o, offset, c2s(expected), c2s(x))); + public final char compareAndExchangeChar(Object o, long offset, + char expected, + char x) { + return s2c(compareAndExchangeShort(o, offset, c2s(expected), c2s(x))); } @ForceInline @@ -1576,31 +1576,31 @@ public final class Unsafe { } @ForceInline - public final boolean weakCompareAndSwapCharVolatile(Object o, long offset, - char expected, - char x) { - return weakCompareAndSwapShortVolatile(o, offset, c2s(expected), c2s(x)); + public final boolean weakCompareAndSetChar(Object o, long offset, + char expected, + char x) { + return weakCompareAndSetShort(o, offset, c2s(expected), c2s(x)); } @ForceInline - public final boolean weakCompareAndSwapCharAcquire(Object o, long offset, - char expected, - char x) { - return weakCompareAndSwapShortAcquire(o, offset, c2s(expected), c2s(x)); + public final boolean weakCompareAndSetCharAcquire(Object o, long offset, + char expected, + char x) { + return weakCompareAndSetShortAcquire(o, offset, c2s(expected), c2s(x)); } @ForceInline - public final boolean weakCompareAndSwapCharRelease(Object o, long offset, - char expected, - char x) { - return weakCompareAndSwapShortRelease(o, offset, c2s(expected), c2s(x)); + public final boolean weakCompareAndSetCharRelease(Object o, long offset, + char expected, + char x) { + return weakCompareAndSetShortRelease(o, offset, c2s(expected), c2s(x)); } @ForceInline - public final boolean weakCompareAndSwapChar(Object o, long offset, - char expected, - char x) { - return weakCompareAndSwapShort(o, offset, c2s(expected), c2s(x)); + public final boolean weakCompareAndSetCharPlain(Object o, long offset, + char expected, + char x) { + return weakCompareAndSetShortPlain(o, offset, c2s(expected), c2s(x)); } /** @@ -1653,17 +1653,17 @@ public final class Unsafe { } @ForceInline - public final boolean compareAndSwapBoolean(Object o, long offset, - boolean expected, - boolean x) { - return compareAndSwapByte(o, offset, bool2byte(expected), bool2byte(x)); + public final boolean compareAndSetBoolean(Object o, long offset, + boolean expected, + boolean x) { + return compareAndSetByte(o, offset, bool2byte(expected), bool2byte(x)); } @ForceInline - public final boolean compareAndExchangeBooleanVolatile(Object o, long offset, - boolean expected, - boolean x) { - return byte2bool(compareAndExchangeByteVolatile(o, offset, bool2byte(expected), bool2byte(x))); + public final boolean compareAndExchangeBoolean(Object o, long offset, + boolean expected, + boolean x) { + return byte2bool(compareAndExchangeByte(o, offset, bool2byte(expected), bool2byte(x))); } @ForceInline @@ -1681,31 +1681,31 @@ public final class Unsafe { } @ForceInline - public final boolean weakCompareAndSwapBooleanVolatile(Object o, long offset, - boolean expected, - boolean x) { - return weakCompareAndSwapByteVolatile(o, offset, bool2byte(expected), bool2byte(x)); + public final boolean weakCompareAndSetBoolean(Object o, long offset, + boolean expected, + boolean x) { + return weakCompareAndSetByte(o, offset, bool2byte(expected), bool2byte(x)); } @ForceInline - public final boolean weakCompareAndSwapBooleanAcquire(Object o, long offset, - boolean expected, - boolean x) { - return weakCompareAndSwapByteAcquire(o, offset, bool2byte(expected), bool2byte(x)); + public final boolean weakCompareAndSetBooleanAcquire(Object o, long offset, + boolean expected, + boolean x) { + return weakCompareAndSetByteAcquire(o, offset, bool2byte(expected), bool2byte(x)); } @ForceInline - public final boolean weakCompareAndSwapBooleanRelease(Object o, long offset, - boolean expected, - boolean x) { - return weakCompareAndSwapByteRelease(o, offset, bool2byte(expected), bool2byte(x)); + public final boolean weakCompareAndSetBooleanRelease(Object o, long offset, + boolean expected, + boolean x) { + return weakCompareAndSetByteRelease(o, offset, bool2byte(expected), bool2byte(x)); } @ForceInline - public final boolean weakCompareAndSwapBoolean(Object o, long offset, - boolean expected, - boolean x) { - return weakCompareAndSwapByte(o, offset, bool2byte(expected), bool2byte(x)); + public final boolean weakCompareAndSetBooleanPlain(Object o, long offset, + boolean expected, + boolean x) { + return weakCompareAndSetBytePlain(o, offset, bool2byte(expected), bool2byte(x)); } /** @@ -1718,21 +1718,21 @@ public final class Unsafe { * @return {@code true} if successful */ @ForceInline - public final boolean compareAndSwapFloat(Object o, long offset, - float expected, - float x) { - return compareAndSwapInt(o, offset, + public final boolean compareAndSetFloat(Object o, long offset, + float expected, + float x) { + return compareAndSetInt(o, offset, Float.floatToRawIntBits(expected), Float.floatToRawIntBits(x)); } @ForceInline - public final float compareAndExchangeFloatVolatile(Object o, long offset, - float expected, - float x) { - int w = compareAndExchangeIntVolatile(o, offset, - Float.floatToRawIntBits(expected), - Float.floatToRawIntBits(x)); + public final float compareAndExchangeFloat(Object o, long offset, + float expected, + float x) { + int w = compareAndExchangeInt(o, offset, + Float.floatToRawIntBits(expected), + Float.floatToRawIntBits(x)); return Float.intBitsToFloat(w); } @@ -1757,37 +1757,37 @@ public final class Unsafe { } @ForceInline - public final boolean weakCompareAndSwapFloat(Object o, long offset, - float expected, - float x) { - return weakCompareAndSwapInt(o, offset, + public final boolean weakCompareAndSetFloatPlain(Object o, long offset, + float expected, + float x) { + return weakCompareAndSetIntPlain(o, offset, Float.floatToRawIntBits(expected), Float.floatToRawIntBits(x)); } @ForceInline - public final boolean weakCompareAndSwapFloatAcquire(Object o, long offset, - float expected, - float x) { - return weakCompareAndSwapIntAcquire(o, offset, - Float.floatToRawIntBits(expected), - Float.floatToRawIntBits(x)); - } - - @ForceInline - public final boolean weakCompareAndSwapFloatRelease(Object o, long offset, - float expected, - float x) { - return weakCompareAndSwapIntRelease(o, offset, - Float.floatToRawIntBits(expected), - Float.floatToRawIntBits(x)); - } - - @ForceInline - public final boolean weakCompareAndSwapFloatVolatile(Object o, long offset, + public final boolean weakCompareAndSetFloatAcquire(Object o, long offset, float expected, float x) { - return weakCompareAndSwapIntVolatile(o, offset, + return weakCompareAndSetIntAcquire(o, offset, + Float.floatToRawIntBits(expected), + Float.floatToRawIntBits(x)); + } + + @ForceInline + public final boolean weakCompareAndSetFloatRelease(Object o, long offset, + float expected, + float x) { + return weakCompareAndSetIntRelease(o, offset, + Float.floatToRawIntBits(expected), + Float.floatToRawIntBits(x)); + } + + @ForceInline + public final boolean weakCompareAndSetFloat(Object o, long offset, + float expected, + float x) { + return weakCompareAndSetInt(o, offset, Float.floatToRawIntBits(expected), Float.floatToRawIntBits(x)); } @@ -1802,21 +1802,21 @@ public final class Unsafe { * @return {@code true} if successful */ @ForceInline - public final boolean compareAndSwapDouble(Object o, long offset, - double expected, - double x) { - return compareAndSwapLong(o, offset, - Double.doubleToRawLongBits(expected), - Double.doubleToRawLongBits(x)); + public final boolean compareAndSetDouble(Object o, long offset, + double expected, + double x) { + return compareAndSetLong(o, offset, + Double.doubleToRawLongBits(expected), + Double.doubleToRawLongBits(x)); } @ForceInline - public final double compareAndExchangeDoubleVolatile(Object o, long offset, - double expected, - double x) { - long w = compareAndExchangeLongVolatile(o, offset, - Double.doubleToRawLongBits(expected), - Double.doubleToRawLongBits(x)); + public final double compareAndExchangeDouble(Object o, long offset, + double expected, + double x) { + long w = compareAndExchangeLong(o, offset, + Double.doubleToRawLongBits(expected), + Double.doubleToRawLongBits(x)); return Double.longBitsToDouble(w); } @@ -1841,37 +1841,37 @@ public final class Unsafe { } @ForceInline - public final boolean weakCompareAndSwapDouble(Object o, long offset, - double expected, - double x) { - return weakCompareAndSwapLong(o, offset, + public final boolean weakCompareAndSetDoublePlain(Object o, long offset, + double expected, + double x) { + return weakCompareAndSetLongPlain(o, offset, Double.doubleToRawLongBits(expected), Double.doubleToRawLongBits(x)); } @ForceInline - public final boolean weakCompareAndSwapDoubleAcquire(Object o, long offset, - double expected, - double x) { - return weakCompareAndSwapLongAcquire(o, offset, + public final boolean weakCompareAndSetDoubleAcquire(Object o, long offset, + double expected, + double x) { + return weakCompareAndSetLongAcquire(o, offset, Double.doubleToRawLongBits(expected), Double.doubleToRawLongBits(x)); } @ForceInline - public final boolean weakCompareAndSwapDoubleRelease(Object o, long offset, - double expected, - double x) { - return weakCompareAndSwapLongRelease(o, offset, + public final boolean weakCompareAndSetDoubleRelease(Object o, long offset, + double expected, + double x) { + return weakCompareAndSetLongRelease(o, offset, Double.doubleToRawLongBits(expected), Double.doubleToRawLongBits(x)); } @ForceInline - public final boolean weakCompareAndSwapDoubleVolatile(Object o, long offset, - double expected, - double x) { - return weakCompareAndSwapLongVolatile(o, offset, + public final boolean weakCompareAndSetDouble(Object o, long offset, + double expected, + double x) { + return weakCompareAndSetLong(o, offset, Double.doubleToRawLongBits(expected), Double.doubleToRawLongBits(x)); } @@ -1886,55 +1886,55 @@ public final class Unsafe { * @return {@code true} if successful */ @HotSpotIntrinsicCandidate - public final native boolean compareAndSwapLong(Object o, long offset, - long expected, - long x); + public final native boolean compareAndSetLong(Object o, long offset, + long expected, + long x); @HotSpotIntrinsicCandidate - public final native long compareAndExchangeLongVolatile(Object o, long offset, - long expected, - long x); + public final native long compareAndExchangeLong(Object o, long offset, + long expected, + long x); @HotSpotIntrinsicCandidate public final long compareAndExchangeLongAcquire(Object o, long offset, long expected, long x) { - return compareAndExchangeLongVolatile(o, offset, expected, x); + return compareAndExchangeLong(o, offset, expected, x); } @HotSpotIntrinsicCandidate public final long compareAndExchangeLongRelease(Object o, long offset, long expected, long x) { - return compareAndExchangeLongVolatile(o, offset, expected, x); + return compareAndExchangeLong(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapLong(Object o, long offset, - long expected, - long x) { - return compareAndSwapLong(o, offset, expected, x); + public final boolean weakCompareAndSetLongPlain(Object o, long offset, + long expected, + long x) { + return compareAndSetLong(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapLongAcquire(Object o, long offset, - long expected, - long x) { - return compareAndSwapLong(o, offset, expected, x); + public final boolean weakCompareAndSetLongAcquire(Object o, long offset, + long expected, + long x) { + return compareAndSetLong(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapLongRelease(Object o, long offset, - long expected, - long x) { - return compareAndSwapLong(o, offset, expected, x); + public final boolean weakCompareAndSetLongRelease(Object o, long offset, + long expected, + long x) { + return compareAndSetLong(o, offset, expected, x); } @HotSpotIntrinsicCandidate - public final boolean weakCompareAndSwapLongVolatile(Object o, long offset, - long expected, - long x) { - return compareAndSwapLong(o, offset, expected, x); + public final boolean weakCompareAndSetLong(Object o, long offset, + long expected, + long x) { + return compareAndSetLong(o, offset, expected, x); } /** @@ -2316,7 +2316,7 @@ public final class Unsafe { int v; do { v = getIntVolatile(o, offset); - } while (!weakCompareAndSwapIntVolatile(o, offset, v, v + delta)); + } while (!weakCompareAndSetInt(o, offset, v, v + delta)); return v; } @@ -2325,7 +2325,7 @@ public final class Unsafe { int v; do { v = getInt(o, offset); - } while (!weakCompareAndSwapIntRelease(o, offset, v, v + delta)); + } while (!weakCompareAndSetIntRelease(o, offset, v, v + delta)); return v; } @@ -2334,7 +2334,7 @@ public final class Unsafe { int v; do { v = getIntAcquire(o, offset); - } while (!weakCompareAndSwapIntAcquire(o, offset, v, v + delta)); + } while (!weakCompareAndSetIntAcquire(o, offset, v, v + delta)); return v; } @@ -2354,7 +2354,7 @@ public final class Unsafe { long v; do { v = getLongVolatile(o, offset); - } while (!weakCompareAndSwapLongVolatile(o, offset, v, v + delta)); + } while (!weakCompareAndSetLong(o, offset, v, v + delta)); return v; } @@ -2363,7 +2363,7 @@ public final class Unsafe { long v; do { v = getLong(o, offset); - } while (!weakCompareAndSwapLongRelease(o, offset, v, v + delta)); + } while (!weakCompareAndSetLongRelease(o, offset, v, v + delta)); return v; } @@ -2372,7 +2372,7 @@ public final class Unsafe { long v; do { v = getLongAcquire(o, offset); - } while (!weakCompareAndSwapLongAcquire(o, offset, v, v + delta)); + } while (!weakCompareAndSetLongAcquire(o, offset, v, v + delta)); return v; } @@ -2381,7 +2381,7 @@ public final class Unsafe { byte v; do { v = getByteVolatile(o, offset); - } while (!weakCompareAndSwapByteVolatile(o, offset, v, (byte) (v + delta))); + } while (!weakCompareAndSetByte(o, offset, v, (byte) (v + delta))); return v; } @@ -2390,7 +2390,7 @@ public final class Unsafe { byte v; do { v = getByte(o, offset); - } while (!weakCompareAndSwapByteRelease(o, offset, v, (byte) (v + delta))); + } while (!weakCompareAndSetByteRelease(o, offset, v, (byte) (v + delta))); return v; } @@ -2399,7 +2399,7 @@ public final class Unsafe { byte v; do { v = getByteAcquire(o, offset); - } while (!weakCompareAndSwapByteAcquire(o, offset, v, (byte) (v + delta))); + } while (!weakCompareAndSetByteAcquire(o, offset, v, (byte) (v + delta))); return v; } @@ -2408,7 +2408,7 @@ public final class Unsafe { short v; do { v = getShortVolatile(o, offset); - } while (!weakCompareAndSwapShortVolatile(o, offset, v, (short) (v + delta))); + } while (!weakCompareAndSetShort(o, offset, v, (short) (v + delta))); return v; } @@ -2417,7 +2417,7 @@ public final class Unsafe { short v; do { v = getShort(o, offset); - } while (!weakCompareAndSwapShortRelease(o, offset, v, (short) (v + delta))); + } while (!weakCompareAndSetShortRelease(o, offset, v, (short) (v + delta))); return v; } @@ -2426,7 +2426,7 @@ public final class Unsafe { short v; do { v = getShortAcquire(o, offset); - } while (!weakCompareAndSwapShortAcquire(o, offset, v, (short) (v + delta))); + } while (!weakCompareAndSetShortAcquire(o, offset, v, (short) (v + delta))); return v; } @@ -2455,7 +2455,7 @@ public final class Unsafe { // may result in the loop not terminating. expectedBits = getIntVolatile(o, offset); v = Float.intBitsToFloat(expectedBits); - } while (!weakCompareAndSwapIntVolatile(o, offset, + } while (!weakCompareAndSetInt(o, offset, expectedBits, Float.floatToRawIntBits(v + delta))); return v; } @@ -2470,7 +2470,7 @@ public final class Unsafe { // may result in the loop not terminating. expectedBits = getInt(o, offset); v = Float.intBitsToFloat(expectedBits); - } while (!weakCompareAndSwapIntRelease(o, offset, + } while (!weakCompareAndSetIntRelease(o, offset, expectedBits, Float.floatToRawIntBits(v + delta))); return v; } @@ -2485,7 +2485,7 @@ public final class Unsafe { // may result in the loop not terminating. expectedBits = getIntAcquire(o, offset); v = Float.intBitsToFloat(expectedBits); - } while (!weakCompareAndSwapIntAcquire(o, offset, + } while (!weakCompareAndSetIntAcquire(o, offset, expectedBits, Float.floatToRawIntBits(v + delta))); return v; } @@ -2500,7 +2500,7 @@ public final class Unsafe { // may result in the loop not terminating. expectedBits = getLongVolatile(o, offset); v = Double.longBitsToDouble(expectedBits); - } while (!weakCompareAndSwapLongVolatile(o, offset, + } while (!weakCompareAndSetLong(o, offset, expectedBits, Double.doubleToRawLongBits(v + delta))); return v; } @@ -2515,7 +2515,7 @@ public final class Unsafe { // may result in the loop not terminating. expectedBits = getLong(o, offset); v = Double.longBitsToDouble(expectedBits); - } while (!weakCompareAndSwapLongRelease(o, offset, + } while (!weakCompareAndSetLongRelease(o, offset, expectedBits, Double.doubleToRawLongBits(v + delta))); return v; } @@ -2530,7 +2530,7 @@ public final class Unsafe { // may result in the loop not terminating. expectedBits = getLongAcquire(o, offset); v = Double.longBitsToDouble(expectedBits); - } while (!weakCompareAndSwapLongAcquire(o, offset, + } while (!weakCompareAndSetLongAcquire(o, offset, expectedBits, Double.doubleToRawLongBits(v + delta))); return v; } @@ -2551,7 +2551,7 @@ public final class Unsafe { int v; do { v = getIntVolatile(o, offset); - } while (!weakCompareAndSwapIntVolatile(o, offset, v, newValue)); + } while (!weakCompareAndSetInt(o, offset, v, newValue)); return v; } @@ -2560,7 +2560,7 @@ public final class Unsafe { int v; do { v = getInt(o, offset); - } while (!weakCompareAndSwapIntRelease(o, offset, v, newValue)); + } while (!weakCompareAndSetIntRelease(o, offset, v, newValue)); return v; } @@ -2569,7 +2569,7 @@ public final class Unsafe { int v; do { v = getIntAcquire(o, offset); - } while (!weakCompareAndSwapIntAcquire(o, offset, v, newValue)); + } while (!weakCompareAndSetIntAcquire(o, offset, v, newValue)); return v; } @@ -2589,7 +2589,7 @@ public final class Unsafe { long v; do { v = getLongVolatile(o, offset); - } while (!weakCompareAndSwapLongVolatile(o, offset, v, newValue)); + } while (!weakCompareAndSetLong(o, offset, v, newValue)); return v; } @@ -2598,7 +2598,7 @@ public final class Unsafe { long v; do { v = getLong(o, offset); - } while (!weakCompareAndSwapLongRelease(o, offset, v, newValue)); + } while (!weakCompareAndSetLongRelease(o, offset, v, newValue)); return v; } @@ -2607,7 +2607,7 @@ public final class Unsafe { long v; do { v = getLongAcquire(o, offset); - } while (!weakCompareAndSwapLongAcquire(o, offset, v, newValue)); + } while (!weakCompareAndSetLongAcquire(o, offset, v, newValue)); return v; } @@ -2627,7 +2627,7 @@ public final class Unsafe { Object v; do { v = getObjectVolatile(o, offset); - } while (!weakCompareAndSwapObjectVolatile(o, offset, v, newValue)); + } while (!weakCompareAndSetObject(o, offset, v, newValue)); return v; } @@ -2636,7 +2636,7 @@ public final class Unsafe { Object v; do { v = getObject(o, offset); - } while (!weakCompareAndSwapObjectRelease(o, offset, v, newValue)); + } while (!weakCompareAndSetObjectRelease(o, offset, v, newValue)); return v; } @@ -2645,7 +2645,7 @@ public final class Unsafe { Object v; do { v = getObjectAcquire(o, offset); - } while (!weakCompareAndSwapObjectAcquire(o, offset, v, newValue)); + } while (!weakCompareAndSetObjectAcquire(o, offset, v, newValue)); return v; } @@ -2654,7 +2654,7 @@ public final class Unsafe { byte v; do { v = getByteVolatile(o, offset); - } while (!weakCompareAndSwapByteVolatile(o, offset, v, newValue)); + } while (!weakCompareAndSetByte(o, offset, v, newValue)); return v; } @@ -2663,7 +2663,7 @@ public final class Unsafe { byte v; do { v = getByte(o, offset); - } while (!weakCompareAndSwapByteRelease(o, offset, v, newValue)); + } while (!weakCompareAndSetByteRelease(o, offset, v, newValue)); return v; } @@ -2672,7 +2672,7 @@ public final class Unsafe { byte v; do { v = getByteAcquire(o, offset); - } while (!weakCompareAndSwapByteAcquire(o, offset, v, newValue)); + } while (!weakCompareAndSetByteAcquire(o, offset, v, newValue)); return v; } @@ -2696,7 +2696,7 @@ public final class Unsafe { short v; do { v = getShortVolatile(o, offset); - } while (!weakCompareAndSwapShortVolatile(o, offset, v, newValue)); + } while (!weakCompareAndSetShort(o, offset, v, newValue)); return v; } @@ -2705,7 +2705,7 @@ public final class Unsafe { short v; do { v = getShort(o, offset); - } while (!weakCompareAndSwapShortRelease(o, offset, v, newValue)); + } while (!weakCompareAndSetShortRelease(o, offset, v, newValue)); return v; } @@ -2714,7 +2714,7 @@ public final class Unsafe { short v; do { v = getShortAcquire(o, offset); - } while (!weakCompareAndSwapShortAcquire(o, offset, v, newValue)); + } while (!weakCompareAndSetShortAcquire(o, offset, v, newValue)); return v; } @@ -2824,7 +2824,7 @@ public final class Unsafe { byte current; do { current = getByteVolatile(o, offset); - } while (!weakCompareAndSwapByteVolatile(o, offset, + } while (!weakCompareAndSetByte(o, offset, current, (byte) (current | mask))); return current; } @@ -2834,7 +2834,7 @@ public final class Unsafe { byte current; do { current = getByte(o, offset); - } while (!weakCompareAndSwapByteRelease(o, offset, + } while (!weakCompareAndSetByteRelease(o, offset, current, (byte) (current | mask))); return current; } @@ -2845,7 +2845,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getByte(o, offset); - } while (!weakCompareAndSwapByteAcquire(o, offset, + } while (!weakCompareAndSetByteAcquire(o, offset, current, (byte) (current | mask))); return current; } @@ -2855,7 +2855,7 @@ public final class Unsafe { byte current; do { current = getByteVolatile(o, offset); - } while (!weakCompareAndSwapByteVolatile(o, offset, + } while (!weakCompareAndSetByte(o, offset, current, (byte) (current & mask))); return current; } @@ -2865,7 +2865,7 @@ public final class Unsafe { byte current; do { current = getByte(o, offset); - } while (!weakCompareAndSwapByteRelease(o, offset, + } while (!weakCompareAndSetByteRelease(o, offset, current, (byte) (current & mask))); return current; } @@ -2876,7 +2876,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getByte(o, offset); - } while (!weakCompareAndSwapByteAcquire(o, offset, + } while (!weakCompareAndSetByteAcquire(o, offset, current, (byte) (current & mask))); return current; } @@ -2886,7 +2886,7 @@ public final class Unsafe { byte current; do { current = getByteVolatile(o, offset); - } while (!weakCompareAndSwapByteVolatile(o, offset, + } while (!weakCompareAndSetByte(o, offset, current, (byte) (current ^ mask))); return current; } @@ -2896,7 +2896,7 @@ public final class Unsafe { byte current; do { current = getByte(o, offset); - } while (!weakCompareAndSwapByteRelease(o, offset, + } while (!weakCompareAndSetByteRelease(o, offset, current, (byte) (current ^ mask))); return current; } @@ -2907,7 +2907,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getByte(o, offset); - } while (!weakCompareAndSwapByteAcquire(o, offset, + } while (!weakCompareAndSetByteAcquire(o, offset, current, (byte) (current ^ mask))); return current; } @@ -2964,7 +2964,7 @@ public final class Unsafe { short current; do { current = getShortVolatile(o, offset); - } while (!weakCompareAndSwapShortVolatile(o, offset, + } while (!weakCompareAndSetShort(o, offset, current, (short) (current | mask))); return current; } @@ -2974,7 +2974,7 @@ public final class Unsafe { short current; do { current = getShort(o, offset); - } while (!weakCompareAndSwapShortRelease(o, offset, + } while (!weakCompareAndSetShortRelease(o, offset, current, (short) (current | mask))); return current; } @@ -2985,7 +2985,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getShort(o, offset); - } while (!weakCompareAndSwapShortAcquire(o, offset, + } while (!weakCompareAndSetShortAcquire(o, offset, current, (short) (current | mask))); return current; } @@ -2995,7 +2995,7 @@ public final class Unsafe { short current; do { current = getShortVolatile(o, offset); - } while (!weakCompareAndSwapShortVolatile(o, offset, + } while (!weakCompareAndSetShort(o, offset, current, (short) (current & mask))); return current; } @@ -3005,7 +3005,7 @@ public final class Unsafe { short current; do { current = getShort(o, offset); - } while (!weakCompareAndSwapShortRelease(o, offset, + } while (!weakCompareAndSetShortRelease(o, offset, current, (short) (current & mask))); return current; } @@ -3016,7 +3016,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getShort(o, offset); - } while (!weakCompareAndSwapShortAcquire(o, offset, + } while (!weakCompareAndSetShortAcquire(o, offset, current, (short) (current & mask))); return current; } @@ -3026,7 +3026,7 @@ public final class Unsafe { short current; do { current = getShortVolatile(o, offset); - } while (!weakCompareAndSwapShortVolatile(o, offset, + } while (!weakCompareAndSetShort(o, offset, current, (short) (current ^ mask))); return current; } @@ -3036,7 +3036,7 @@ public final class Unsafe { short current; do { current = getShort(o, offset); - } while (!weakCompareAndSwapShortRelease(o, offset, + } while (!weakCompareAndSetShortRelease(o, offset, current, (short) (current ^ mask))); return current; } @@ -3047,7 +3047,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getShort(o, offset); - } while (!weakCompareAndSwapShortAcquire(o, offset, + } while (!weakCompareAndSetShortAcquire(o, offset, current, (short) (current ^ mask))); return current; } @@ -3058,7 +3058,7 @@ public final class Unsafe { int current; do { current = getIntVolatile(o, offset); - } while (!weakCompareAndSwapIntVolatile(o, offset, + } while (!weakCompareAndSetInt(o, offset, current, current | mask)); return current; } @@ -3068,7 +3068,7 @@ public final class Unsafe { int current; do { current = getInt(o, offset); - } while (!weakCompareAndSwapIntRelease(o, offset, + } while (!weakCompareAndSetIntRelease(o, offset, current, current | mask)); return current; } @@ -3079,7 +3079,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getInt(o, offset); - } while (!weakCompareAndSwapIntAcquire(o, offset, + } while (!weakCompareAndSetIntAcquire(o, offset, current, current | mask)); return current; } @@ -3100,7 +3100,7 @@ public final class Unsafe { int current; do { current = getIntVolatile(o, offset); - } while (!weakCompareAndSwapIntVolatile(o, offset, + } while (!weakCompareAndSetInt(o, offset, current, current & mask)); return current; } @@ -3110,7 +3110,7 @@ public final class Unsafe { int current; do { current = getInt(o, offset); - } while (!weakCompareAndSwapIntRelease(o, offset, + } while (!weakCompareAndSetIntRelease(o, offset, current, current & mask)); return current; } @@ -3121,7 +3121,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getInt(o, offset); - } while (!weakCompareAndSwapIntAcquire(o, offset, + } while (!weakCompareAndSetIntAcquire(o, offset, current, current & mask)); return current; } @@ -3131,7 +3131,7 @@ public final class Unsafe { int current; do { current = getIntVolatile(o, offset); - } while (!weakCompareAndSwapIntVolatile(o, offset, + } while (!weakCompareAndSetInt(o, offset, current, current ^ mask)); return current; } @@ -3141,7 +3141,7 @@ public final class Unsafe { int current; do { current = getInt(o, offset); - } while (!weakCompareAndSwapIntRelease(o, offset, + } while (!weakCompareAndSetIntRelease(o, offset, current, current ^ mask)); return current; } @@ -3152,7 +3152,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getInt(o, offset); - } while (!weakCompareAndSwapIntAcquire(o, offset, + } while (!weakCompareAndSetIntAcquire(o, offset, current, current ^ mask)); return current; } @@ -3163,7 +3163,7 @@ public final class Unsafe { long current; do { current = getLongVolatile(o, offset); - } while (!weakCompareAndSwapLongVolatile(o, offset, + } while (!weakCompareAndSetLong(o, offset, current, current | mask)); return current; } @@ -3173,7 +3173,7 @@ public final class Unsafe { long current; do { current = getLong(o, offset); - } while (!weakCompareAndSwapLongRelease(o, offset, + } while (!weakCompareAndSetLongRelease(o, offset, current, current | mask)); return current; } @@ -3184,7 +3184,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getLong(o, offset); - } while (!weakCompareAndSwapLongAcquire(o, offset, + } while (!weakCompareAndSetLongAcquire(o, offset, current, current | mask)); return current; } @@ -3194,7 +3194,7 @@ public final class Unsafe { long current; do { current = getLongVolatile(o, offset); - } while (!weakCompareAndSwapLongVolatile(o, offset, + } while (!weakCompareAndSetLong(o, offset, current, current & mask)); return current; } @@ -3204,7 +3204,7 @@ public final class Unsafe { long current; do { current = getLong(o, offset); - } while (!weakCompareAndSwapLongRelease(o, offset, + } while (!weakCompareAndSetLongRelease(o, offset, current, current & mask)); return current; } @@ -3215,7 +3215,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getLong(o, offset); - } while (!weakCompareAndSwapLongAcquire(o, offset, + } while (!weakCompareAndSetLongAcquire(o, offset, current, current & mask)); return current; } @@ -3225,7 +3225,7 @@ public final class Unsafe { long current; do { current = getLongVolatile(o, offset); - } while (!weakCompareAndSwapLongVolatile(o, offset, + } while (!weakCompareAndSetLong(o, offset, current, current ^ mask)); return current; } @@ -3235,7 +3235,7 @@ public final class Unsafe { long current; do { current = getLong(o, offset); - } while (!weakCompareAndSwapLongRelease(o, offset, + } while (!weakCompareAndSetLongRelease(o, offset, current, current ^ mask)); return current; } @@ -3246,7 +3246,7 @@ public final class Unsafe { do { // Plain read, the value is a hint, the acquire CAS does the work current = getLong(o, offset); - } while (!weakCompareAndSwapLongAcquire(o, offset, + } while (!weakCompareAndSetLongAcquire(o, offset, current, current ^ mask)); return current; } diff --git a/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java index a77109ce49c..c4fe1d90e3a 100644 --- a/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java +++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -872,7 +872,7 @@ public final class Unsafe { public final boolean compareAndSwapObject(Object o, long offset, Object expected, Object x) { - return theInternalUnsafe.compareAndSwapObject(o, offset, expected, x); + return theInternalUnsafe.compareAndSetObject(o, offset, expected, x); } /** @@ -888,7 +888,7 @@ public final class Unsafe { public final boolean compareAndSwapInt(Object o, long offset, int expected, int x) { - return theInternalUnsafe.compareAndSwapInt(o, offset, expected, x); + return theInternalUnsafe.compareAndSetInt(o, offset, expected, x); } /** @@ -904,7 +904,7 @@ public final class Unsafe { public final boolean compareAndSwapLong(Object o, long offset, long expected, long x) { - return theInternalUnsafe.compareAndSwapLong(o, offset, expected, x); + return theInternalUnsafe.compareAndSetLong(o, offset, expected, x); } /** From 8f060891682e2a97e253fc4639be8053ec106e17 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 6 Jun 2017 11:11:12 +0530 Subject: [PATCH 022/130] 8181401: Error in Javadoc for JTabbedPane getAccessibleName() Reviewed-by: serb, ssadetsky --- jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java index 184ca2c2d0b..b6d50b4ade4 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java @@ -1900,7 +1900,7 @@ public class JTabbedPane extends JComponent * Returns the accessible name of this object, or {@code null} if * there is no accessible name. * - * @return the accessible name of this object, nor {@code null}. + * @return the accessible name of this object, or {@code null}. * @since 1.6 */ public String getAccessibleName() { From 7034b5747396ce834bb7524bec1b20a926a7806d Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Tue, 6 Jun 2017 11:56:01 +0530 Subject: [PATCH 023/130] 8181640: Spelling mistake in javadoc javax.swing.JEditorPane.scrollToReference(String) Reviewed-by: serb --- jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java index 9fdafb65e0a..f80c41f1f98 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JEditorPane.java @@ -812,7 +812,7 @@ public class JEditorPane extends JTextComponent { /** * Scrolls the view to the given reference location - * (that is, the value returned by the UL.getRef
+ * (that is, the value returned by theURL.getRef
* method for the URL being displayed). By default, this * method only knows how to locate a reference in an * HTMLDocument. The implementation calls the From 77532f2533ebe5f99587c7eddc41fedd2bc41bdc Mon Sep 17 00:00:00 2001 From: Manajit HalderDate: Tue, 6 Jun 2017 14:38:19 +0530 Subject: [PATCH 024/130] 8172510: This test fails for me on OS X consistently with result: Expected : 01230123 Actual : 001122303011223 Reviewed-by: serb, prr --- jdk/test/java/awt/List/ItemEventTest/ItemEventTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/awt/List/ItemEventTest/ItemEventTest.java b/jdk/test/java/awt/List/ItemEventTest/ItemEventTest.java index 65cbc5f9c9d..c5d45379905 100644 --- a/jdk/test/java/awt/List/ItemEventTest/ItemEventTest.java +++ b/jdk/test/java/awt/List/ItemEventTest/ItemEventTest.java @@ -24,7 +24,7 @@ /* * @test * @key headful - * @bug 8033936 + * @bug 8033936 8172510 * @summary Verify that correct ItemEvent is received while selection & * deselection of multi select List items. */ @@ -109,14 +109,16 @@ public class ItemEventTest extends Frame boolean isMac = osName.contains("Mac") || osName.contains("mac"); if(isMac) { robot.keyPress(KeyEvent.VK_META); + robot.waitForIdle(); } // First loop to select & Second loop to deselect the list items. for (int j = 0; j < 2; ++j) { for (int i = 0; i < list.getItemCount(); ++i) { robot.mouseMove(loc.x, loc.y + i * dY); + robot.waitForIdle(); robot.mousePress(InputEvent.BUTTON1_MASK); - robot.delay(100); + robot.waitForIdle(); robot.mouseRelease(InputEvent.BUTTON1_MASK); robot.waitForIdle(); } From fc92cc69ef02e50899ca8120d06fe8001921faa2 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 7 Jun 2017 10:03:41 +0800 Subject: [PATCH 025/130] 8181461: sun/security/krb5/auto/KdcPolicy.java fails with java.lang.Exception: Does not match Reviewed-by: xuelei --- jdk/test/sun/security/krb5/auto/KdcPolicy.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/test/sun/security/krb5/auto/KdcPolicy.java b/jdk/test/sun/security/krb5/auto/KdcPolicy.java index f4501a5779b..6eca564b96f 100644 --- a/jdk/test/sun/security/krb5/auto/KdcPolicy.java +++ b/jdk/test/sun/security/krb5/auto/KdcPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import sun.security.krb5.Config; /* * @test - * @bug 8164656 + * @bug 8164656 8181461 * @run main/othervm KdcPolicy udp * @run main/othervm KdcPolicy tcp * @summary krb5.kdc.bad.policy test @@ -110,7 +110,7 @@ public class KdcPolicy { // It is possible the real KDC cannot fulfil the request // in 3s, so it might fail (either 1st time or 2nd time). writeConf(1, 3000, p1, p3); - test("a3000c3000c3000|a3000c3000-|a3000c3000c3000-"); + test("a3000c3000c3000|a3000c3000-|a3000c3000c3000a3000-"); // If a test case won't use a real KDC, it can be sped up. writeConf(3, 5, p1, p2); From 2efb1f9e9fd630bfd2a2a1bcd1c4ba4381909e30 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 7 Jun 2017 08:58:19 -0700 Subject: [PATCH 026/130] 8180386: remove jdk.testlibrary.TimeLimitedRunner Reviewed-by: rriggs, mchung --- jdk/test/TEST.ROOT | 2 +- .../LFCaching/LFMultiThreadCachingTest.java | 2 +- .../LFCaching/LFSingleThreadCachingTest.java | 2 +- .../invoke/LFCaching/LambdaFormTestCase.java | 2 +- .../MethodHandles/CatchExceptionTest.java | 4 +- .../jdk/testlibrary/TimeLimitedRunner.java | 86 ------------------- 6 files changed, 6 insertions(+), 92 deletions(-) delete mode 100644 jdk/test/lib/testlibrary/jdk/testlibrary/TimeLimitedRunner.java diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index b9cb4a27a3f..3df693aa1e1 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -10,7 +10,7 @@ # randomness tests. # # A "headful" test requires a graphical environment to meaningfully -# run. Tests that are not headful are "headless." +# run. Tests that are not headful are "headless." keys=2d dnd i18n intermittent randomness headful diff --git a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java index 3a4310a4319..a3608f91705 100644 --- a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java +++ b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java @@ -27,7 +27,7 @@ * @key randomness * @summary Test verifies that lambda forms are cached when run with multiple threads * @author kshefov - * @library /lib/testlibrary /java/lang/invoke/common + * @library /lib/testlibrary /java/lang/invoke/common /test/lib * @modules java.base/java.lang.invoke:open * java.base/java.lang.ref:open * java.management diff --git a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java index 5ca5eb91a11..828f85fa4fe 100644 --- a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java +++ b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java @@ -27,7 +27,7 @@ * @key randomness * @summary Test verifies that lambda forms are cached when run with single thread * @author kshefov - * @library /lib/testlibrary /java/lang/invoke/common + * @library /lib/testlibrary /java/lang/invoke/common /test/lib * @modules java.base/java.lang.ref:open * java.base/java.lang.invoke:open * java.management diff --git a/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java b/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java index 33a08ecd9bf..1bce3484110 100644 --- a/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java +++ b/jdk/test/java/lang/invoke/LFCaching/LambdaFormTestCase.java @@ -21,7 +21,7 @@ * questions. */ -import jdk.testlibrary.TimeLimitedRunner; +import jdk.test.lib.TimeLimitedRunner; import jdk.testlibrary.Utils; import test.java.lang.invoke.lib.CodeCacheOverflowProcessor; import test.java.lang.invoke.lib.Helper; diff --git a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java index 747c8bb8e4a..e01235bd2d3 100644 --- a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java +++ b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java @@ -23,8 +23,8 @@ package test.java.lang.invoke.MethodHandles; +import jdk.test.lib.TimeLimitedRunner; import jdk.testlibrary.Asserts; -import jdk.testlibrary.TimeLimitedRunner; import jdk.testlibrary.Utils; import test.java.lang.invoke.lib.CodeCacheOverflowProcessor; import test.java.lang.invoke.lib.Helper; @@ -43,7 +43,7 @@ import java.util.function.Function; import java.util.function.Supplier; /* @test - * @library /lib/testlibrary /java/lang/invoke/common + * @library /lib/testlibrary /java/lang/invoke/common /test/lib * @compile CatchExceptionTest.java * @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest * @key intermittent randomness diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/TimeLimitedRunner.java b/jdk/test/lib/testlibrary/jdk/testlibrary/TimeLimitedRunner.java deleted file mode 100644 index 5cc98ea8f8a..00000000000 --- a/jdk/test/lib/testlibrary/jdk/testlibrary/TimeLimitedRunner.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package jdk.testlibrary; - -import java.util.Objects; -import java.util.concurrent.Callable; - -/** - * Auxiliary class to run target w/ given timeout. - */ -public class TimeLimitedRunner implements Callable { - private final long stoptime; - private final long timeout; - private final double factor; - private final Callable target; - - /** - * @param timeout a timeout. zero means no time limitation - * @param factor a multiplier used to estimate next iteration time - * @param target a target to run - * @throws NullPointerException if target is null - * @throws IllegalArgumentException if timeout is negative or - factor isn't positive - */ - public TimeLimitedRunner(long timeout, double factor, - Callable target) { - Objects.requireNonNull(target, "target must not be null"); - if (timeout < 0) { - throw new IllegalArgumentException("timeout[" + timeout + "] < 0"); - } - if (factor <= 0d) { - throw new IllegalArgumentException("factor[" + factor + "] <= 0"); - } - this.stoptime = System.currentTimeMillis() + timeout; - this.timeout = timeout; - this.factor = factor; - this.target = target; - } - - /** - * Runs @{linkplan target} while it returns true and timeout isn't exceeded - */ - @Override - public Void call() throws Exception { - long maxDuration = 0L; - long iterStart = System.currentTimeMillis(); - if (timeout != 0 && iterStart > stoptime) { - return null; - } - while (target.call()) { - if (timeout != 0) { - long iterDuration = System.currentTimeMillis() - iterStart; - maxDuration = Math.max(maxDuration, iterDuration); - iterStart = System.currentTimeMillis(); - if (iterStart + (maxDuration * factor) > stoptime) { - System.out.println("Not enough time to continue execution. " - + "Interrupted."); - break; - } - } - } - return null; - } - -} From 644aec52123fb47e0e4523b1f2fcb60c52661467 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Wed, 7 Jun 2017 15:05:35 -0400 Subject: [PATCH 027/130] 8181195: Mark java.se.ee aggregator module deprecated and for removal Reviewed-by: joehw, alanb, mchung --- jdk/src/java.se.ee/share/classes/module-info.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/java.se.ee/share/classes/module-info.java b/jdk/src/java.se.ee/share/classes/module-info.java index 983a4c7c71d..3a77d4e94c5 100644 --- a/jdk/src/java.se.ee/share/classes/module-info.java +++ b/jdk/src/java.se.ee/share/classes/module-info.java @@ -34,6 +34,7 @@ */ @SuppressWarnings({"deprecation", "removal"}) // java.corba and other modules +@Deprecated(since="9", forRemoval=true) module java.se.ee { requires transitive java.se; From 0e7374e99c2ff812959d353ef10ddf3a3d8b8d8f Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Wed, 7 Jun 2017 18:47:54 -0400 Subject: [PATCH 028/130] 8181702: Mark jdk.xml.bind and jdk.xml.ws modules deprecated and for removal Reviewed-by: alanb, mchung --- jaxws/src/jdk.xml.bind/share/classes/module-info.java | 8 ++++++++ jaxws/src/jdk.xml.ws/share/classes/module-info.java | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/jaxws/src/jdk.xml.bind/share/classes/module-info.java b/jaxws/src/jdk.xml.bind/share/classes/module-info.java index 8757ce45f33..2f1896cd970 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/module-info.java +++ b/jaxws/src/jdk.xml.bind/share/classes/module-info.java @@ -23,6 +23,14 @@ * questions. */ +/** + * Defines tools for JAXB classes and XML schema generation. + * + * @moduleGraph + * @since 9 + * + */ +@Deprecated(since="9", forRemoval=true) module jdk.xml.bind { requires java.activation; requires java.compiler; diff --git a/jaxws/src/jdk.xml.ws/share/classes/module-info.java b/jaxws/src/jdk.xml.ws/share/classes/module-info.java index dbec9c537b0..31aaee681e6 100644 --- a/jaxws/src/jdk.xml.ws/share/classes/module-info.java +++ b/jaxws/src/jdk.xml.ws/share/classes/module-info.java @@ -23,6 +23,13 @@ * questions. */ +/** + * Defines tools for JAXWS classes and WSDL generation + * + * @moduleGraph + * @since 9 + */ +@Deprecated(since="9", forRemoval=true) module jdk.xml.ws { requires java.compiler; requires java.logging; From fd73998610c7514f808c47064290089fb50607fd Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Wed, 7 Jun 2017 18:54:45 -0700 Subject: [PATCH 029/130] 8181696: Package versioning link does not exist in JAR file specification Reviewed-by: alanb --- .../java.base/share/classes/java/lang/ClassLoader.java | 2 -- jdk/src/java.base/share/classes/java/lang/Package.java | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java index 9aee833e141..0dbccf5d7d8 100644 --- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java @@ -2146,8 +2146,6 @@ public abstract class ClassLoader { * @revised 9 * @spec JPMS * - * @see - * The JAR File Specification: Package Versioning * @see * The JAR File Specification: Package Sealing */ diff --git a/jdk/src/java.base/share/classes/java/lang/Package.java b/jdk/src/java.base/share/classes/java/lang/Package.java index 25bf4a751fd..39760af1a24 100644 --- a/jdk/src/java.base/share/classes/java/lang/Package.java +++ b/jdk/src/java.base/share/classes/java/lang/Package.java @@ -102,9 +102,13 @@ import jdk.internal.reflect.Reflection; * with the {@link Package#getPackages Package.getPackages()} and * {@link ClassLoader#getDefinedPackages} methods. * + * @implNote + * The builtin class loaders + * do not explicitly define {@code Package} objects for packages in + * named modules. Instead those packages are automatically defined + * and have no specification and implementation versioning information. + * * @jvms 5.3 Run-time package - * @see - * The JAR File Specification: Package Versioning * @see * The JAR File Specification: Package Sealing * @see ClassLoader#definePackage(String, String, String, String, String, String, String, URL) From 0369442aa03b18d72256dca9b3b98f9a3e4da1b8 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Wed, 7 Jun 2017 18:57:24 -0700 Subject: [PATCH 030/130] 8181639: Add tool and services information to module summary Reviewed-by: alanb, psandoz, lancea --- .../share/classes/module-info.java | 3 + .../share/classes/module-info.java | 11 +- .../share/classes/module-info.java | 175 +++++++++++------- 3 files changed, 124 insertions(+), 65 deletions(-) diff --git a/nashorn/src/jdk.dynalink/share/classes/module-info.java b/nashorn/src/jdk.dynalink/share/classes/module-info.java index 3faffbd7f7a..fe534406e17 100644 --- a/nashorn/src/jdk.dynalink/share/classes/module-info.java +++ b/nashorn/src/jdk.dynalink/share/classes/module-info.java @@ -24,6 +24,7 @@ */ /** + * Defines the API for dynamic linking of high-level operations on objects. * * Dynalink is a library for dynamic linking of high-level operations on objects. * These operations include "read a property", @@ -217,6 +218,8 @@ * from B will get a chance to link the call site in A when it encounters the * object from B. * + * @uses jdk.dynalink.linker.GuardingDynamicLinkerExporter + * * @moduleGraph * @since 9 */ diff --git a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java index 2ed4857862b..94ce60e239f 100644 --- a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java +++ b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java @@ -24,8 +24,17 @@ */ /** - * Nashorn shell module + * Defines Nashorn shell module. * + *
This module includes the command line tool {@index jjs jjs tool} + * to invoke the Nashorn engine. + * + *
+ *
+ * + * @moduleGraph * @since 9 */ module jdk.scripting.nashorn.shell { diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java b/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java index 00aeab11923..dbe121fcd94 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java @@ -24,74 +24,121 @@ */ /** -- Tool Guides: + *
- {@extLink jjs_tool_reference jjs} + *
-Nashorn is a runtime environment for programs written in ECMAScript 5.1. -
-Usage
-The recommended way to use Nashorn is through the JSR-223 -"Scripting for the Java Platform" APIs found in the {@link javax.script} package. Usually, you'll obtain a -{@link javax.script.ScriptEngine} instance for Nashorn using: -+ * Provides the implementation of Nashorn script engine and + * the runtime environment for programs written in ECMAScript 5.1. + ** - * You can use language tag with '-' in locale field like this:+ * Nashorn is a runtime environment for programs written in ECMAScript 5.1. + *
+ * + *Usage
+ * + * The recommended way to use Nashorn is through the + * JSR-223 + * "Scripting for the Java Platform" APIs found in the + * {@link javax.script} package. Usually, you'll obtain a + * {@link javax.script.ScriptEngine} instance for Nashorn using: + *import javax.script.*; ... ScriptEngine nashornEngine = new ScriptEngineManager().getEngineByName("nashorn");-and then use it just as you would any other JSR-223 script engine. See -{@code jdk.nashorn.api.scripting} package -for details. -Compatibility
-Nashorn is 100% compliant with the ECMA-262 Standard, Edition 5.1. It requires a Java Virtual Machine that implements the -JSR-292 "Supporting Dynamically Typed Languages on the Java -Platform" specification (often referred to as "invokedynamic"), as well as the already mentioned JSR-223. -Interoperability with the Java platform
-In addition to being a 100% ECMAScript 5.1 runtime, Nashorn provides features for interoperability of the ECMAScript -programs with the Java platform. In general, any Java object put into the script engine's context will be visible from -the script. In terms of the standard, such Java objects are not considered "native objects", but rather "host objects", -as defined in section 4.3.8. This distinction allows certain semantical differences in handling them compared to native -objects. For most purposes, Java objects behave just as native objects do: you can invoke their methods, get and set -their properties. In most cases, though, you can't add arbitrary properties to them, nor can you remove existing -properties. -Java collection handling
-Native Java arrays and {@link java.util.List}s support indexed access to their elements through the property accessors, -and {@link java.util.Map}s support both property and element access through both dot and square-bracket property -accessors, with the difference being that dot operator gives precedence to object properties (its fields and properties -defined as {@code getXxx} and {@code setXxx} methods) while the square bracket operator gives precedence to map -elements. Native Java arrays expose the {@code length} property. -ECMAScript primitive types
-ECMAScript primitive types for number, string, and boolean are represented with {@link java.lang.Number}, -{@link java.lang.CharSequence}, and {@link java.lang.Boolean} objects. While the most often used number type is -{@link java.lang.Double} and the most often used string type is {@link java.lang.String}, don't rely on it as various -internal optimizations cause other subclasses of {@code Number} and internal implementations of {@code CharSequence} to -be used. -Type conversions
-When a method on a Java object is invoked, the arguments are converted to the formal parameter types of the Java method -using all allowed ECMAScript conversions. This can be surprising, as in general, conversions from string to number will -succeed according to Standard's section 9.3 "ToNumber" and so on; string to boolean, number to boolean, Object to -number, Object to string all work. Note that if the Java method's declared parameter type is {@code java.lang.Object}, -Nashorn objects are passed without any conversion whatsoever; specifically if the JavaScript value being passed is of -primitive string type, you can only rely on it being a {@code java.lang.CharSequence}, and if the value is a number, you -can only rely on it being a {@code java.lang.Number}. If the Java method declared parameter type is more specific (e.g. -{@code java.lang.String} or {@code java.lang.Double}), then Nashorn will of course ensure the required type is passed. -SAM types
-As a special extension when invoking Java methods, ECMAScript function objects can be passed in place of an argument -whose Java type is so-called "single abstract method" or "SAM" type. While this name usually covers single-method -interfaces, Nashorn is a bit more versatile, and it recognizes a type as a SAM type if all its abstract methods are -overloads of the same name, and it is either an interface, or it is an abstract class with -a no-arg constructor. The type itself must be public, while the constructor and the methods can be either public or -protected. If there are multiple abstract overloads of the same name, the single function will serve as the shared -implementation for all of them, and additionally it will also override any non-abstract methods of the same name. -This is done to be consistent with the fact that ECMAScript does not have the concept of overloaded methods. -The {@code Java} object
-Nashorn exposes a non-standard global object named {@code Java} that is the primary API entry point into Java -platform-specific functionality. You can use it to create instances of Java classes, convert from Java arrays to native -arrays and back, and so on. -Other non-standard built-in objects
-In addition to {@code Java}, Nashorn also exposes some other non-standard built-in objects: -{@code JSAdapter}, {@code JavaImporter}, {@code Packages} - -@moduleGraph -@since 9 + * + * and then use it just as you would any other JSR-223 script engine. See + * + * {@code jdk.nashorn.api.scripting} package for details. + *Compatibility
+ * Nashorn is 100% compliant with the + * ECMA-262 Standard, Edition 5.1. + * It requires a Java Virtual Machine that implements the + * + * JSR-292 "Supporting Dynamically Typed Languages on the Java Platform" + * specification (often referred to as "invokedynamic"), as well as + * the already mentioned JSR-223. + * + *Interoperability with the Java platform
+ * + * In addition to being a 100% ECMAScript 5.1 runtime, Nashorn provides features + * for interoperability of the ECMAScript programs with the Java platform. + * In general, any Java object put into the script engine's context will be + * visible from the script. In terms of the standard, such Java objects are not + * considered "native objects", but rather "host objects", as defined in + * section 4.3.8. This distinction allows certain semantical differences + * in handling them compared to native objects. For most purposes, Java objects + * behave just as native objects do: you can invoke their methods, get and set + * their properties. In most cases, though, you can't add arbitrary properties + * to them, nor can you remove existing properties. + * + *Java collection handling
+ * + * Native Java arrays and {@link java.util.List}s support indexed access to + * their elements through the property accessors, and {@link java.util.Map}s + * support both property and element access through both dot and square-bracket + * property accessors, with the difference being that dot operator gives + * precedence to object properties (its fields and properties defined as + * {@code getXxx} and {@code setXxx} methods) while the square bracket + * operator gives precedence to map elements. Native Java arrays expose + * the {@code length} property. + * + *ECMAScript primitive types
+ * + * ECMAScript primitive types for number, string, and boolean are represented + * with {@link java.lang.Number}, {@link java.lang.CharSequence}, and + * {@link java.lang.Boolean} objects. While the most often used number type + * is {@link java.lang.Double} and the most often used string type is + * {@link java.lang.String}, don't rely on it as various internal optimizations + * cause other subclasses of {@code Number} and internal implementations of + * {@code CharSequence} to be used. + * + *Type conversions
+ * + * When a method on a Java object is invoked, the arguments are converted to + * the formal parameter types of the Java method using all allowed ECMAScript + * conversions. This can be surprising, as in general, conversions from string + * to number will succeed according to Standard's section 9.3 "ToNumber" + * and so on; string to boolean, number to boolean, Object to number, + * Object to string all work. Note that if the Java method's declared parameter + * type is {@code java.lang.Object}, Nashorn objects are passed without any + * conversion whatsoever; specifically if the JavaScript value being passed + * is of primitive string type, you can only rely on it being a + * {@code java.lang.CharSequence}, and if the value is a number, you can only + * rely on it being a {@code java.lang.Number}. If the Java method declared + * parameter type is more specific (e.g. {@code java.lang.String} or + * {@code java.lang.Double}), then Nashorn will of course ensure + * the required type is passed. + * + *SAM types
+ * + * As a special extension when invoking Java methods, ECMAScript function + * objects can be passed in place of an argument whose Java type is so-called + * "single abstract method" or "SAM" type. While this name usually covers + * single-method interfaces, Nashorn is a bit more versatile, and it + * recognizes a type as a SAM type if all its abstract methods are + * overloads of the same name, and it is either an interface, or it is an + * abstract class with a no-arg constructor. The type itself must be public, + * while the constructor and the methods can be either public or protected. + * If there are multiple abstract overloads of the same name, the single + * function will serve as the shared implementation for all of them, + * and additionally it will also override any non-abstract methods of + * the same name. This is done to be consistent with the fact that + * ECMAScript does not have the concept of overloaded methods. + * + *The {@code Java} object
+ * + * Nashorn exposes a non-standard global object named {@code Java} that is + * the primary API entry point into Java platform-specific functionality. + * You can use it to create instances of Java classes, convert from Java arrays + * to native arrays and back, and so on. + * + *Other non-standard built-in objects
+ * + * In addition to {@code Java}, Nashorn also exposes some other + * non-standard built-in objects: + * {@code JSAdapter}, {@code JavaImporter}, {@code Packages} + * + * @provides javax.script.ScriptEngineFactory + * @moduleGraph + * @since 9 */ module jdk.scripting.nashorn { requires java.logging; From 848c1f69fb64c4e3311a59d0f93f1b318ebc982d Mon Sep 17 00:00:00 2001 From: Mandy ChungDate: Wed, 7 Jun 2017 18:57:35 -0700 Subject: [PATCH 031/130] 8181639: Add tool and services information to module summary Reviewed-by: alanb, psandoz, lancea --- .../src/jdk.hotspot.agent/share/classes/module-info.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/module-info.java b/hotspot/src/jdk.hotspot.agent/share/classes/module-info.java index a5308d46ea2..2c9f4f26da5 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/module-info.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/module-info.java @@ -26,6 +26,15 @@ /** * Defines the implementation of the HotSpot Serviceability Agent. * + * This module includes the {@index jhsdb jhsdb tool} tool to + * attach to a running Java Virtual Machine (JVM) or launch a postmortem + * debugger to analyze the content of a core-dump from a crashed JVM. + * + *
+ *
+ * * @moduleGraph * @since 9 */ From 5e82a2de08a9565e55d54daf4e0bb31592a109c3 Mon Sep 17 00:00:00 2001 From: Mandy Chung- Tool Guides:
+ *- {@extLink jhsdb_tool_reference jhsdb}
+ *Date: Wed, 7 Jun 2017 21:08:37 -0700 Subject: [PATCH 032/130] 8181639: Add tool and services information to module summary Reviewed-by: alanb, psandoz, lancea --- jaxp/src/java.xml/share/classes/module-info.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jaxp/src/java.xml/share/classes/module-info.java b/jaxp/src/java.xml/share/classes/module-info.java index af2e5d6daf8..683c524c87f 100644 --- a/jaxp/src/java.xml/share/classes/module-info.java +++ b/jaxp/src/java.xml/share/classes/module-info.java @@ -27,6 +27,17 @@ * Defines the Java API for XML Processing (JAXP), the Streaming API for XML (StAX), * the Simple API for XML (SAX), and the W3C Document Object Model (DOM) API. * + * @uses javax.xml.datatype.DatatypeFactory + * @uses javax.xml.parsers.DocumentBuilderFactory + * @uses javax.xml.parsers.SAXParserFactory + * @uses javax.xml.stream.XMLEventFactory + * @uses javax.xml.stream.XMLInputFactory + * @uses javax.xml.stream.XMLOutputFactory + * @uses javax.xml.transform.TransformerFactory + * @uses javax.xml.validation.SchemaFactory + * @uses javax.xml.xpath.XPathFactory + * @uses org.xml.sax.XMLReader + * * @moduleGraph * @since 9 */ From 76800fef736593e36316033077790f487ae79e98 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Wed, 7 Jun 2017 21:14:58 -0700 Subject: [PATCH 033/130] 8181639: Add tool and services information to module summary Reviewed-by: alanb, psandoz, lancea --- .../src/java.xml.bind/share/classes/module-info.java | 2 ++ jaxws/src/java.xml.ws/share/classes/module-info.java | 6 ++++++ jaxws/src/jdk.xml.bind/share/classes/module-info.java | 11 +++++++++-- jaxws/src/jdk.xml.ws/share/classes/module-info.java | 10 +++++++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/jaxws/src/java.xml.bind/share/classes/module-info.java b/jaxws/src/java.xml.bind/share/classes/module-info.java index c871b6f0d47..61f80413966 100644 --- a/jaxws/src/java.xml.bind/share/classes/module-info.java +++ b/jaxws/src/java.xml.bind/share/classes/module-info.java @@ -26,6 +26,8 @@ /** * Defines the Java Architecture for XML Binding (JAXB) API. * + * @uses javax.xml.bind.JAXBContextFactory + * * @moduleGraph * @since 9 */ diff --git a/jaxws/src/java.xml.ws/share/classes/module-info.java b/jaxws/src/java.xml.ws/share/classes/module-info.java index a1f9cfb66bb..67ab3d18f0b 100644 --- a/jaxws/src/java.xml.ws/share/classes/module-info.java +++ b/jaxws/src/java.xml.ws/share/classes/module-info.java @@ -27,6 +27,12 @@ * Defines the Java API for XML-Based Web Services (JAX-WS), and * the Web Services Metadata API. * + * @uses javax.xml.soap.MessageFactory + * @uses javax.xml.soap.SAAJMetaFactory + * @uses javax.xml.soap.SOAPConnectionFactory + * @uses javax.xml.soap.SOAPFactory + * @uses javax.xml.ws.spi.Provider + * * @moduleGraph * @since 9 */ diff --git a/jaxws/src/jdk.xml.bind/share/classes/module-info.java b/jaxws/src/jdk.xml.bind/share/classes/module-info.java index 2f1896cd970..3f33b76c05f 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/module-info.java +++ b/jaxws/src/jdk.xml.bind/share/classes/module-info.java @@ -24,11 +24,18 @@ */ /** - * Defines tools for JAXB classes and XML schema generation. + * Defines tools for JAXB classes and XML schema generation, + * including the {@index schemagen schemagen tool} + * and {@index xjc xjc tool} tools. + * + * + *
* * @moduleGraph * @since 9 - * */ @Deprecated(since="9", forRemoval=true) module jdk.xml.bind { diff --git a/jaxws/src/jdk.xml.ws/share/classes/module-info.java b/jaxws/src/jdk.xml.ws/share/classes/module-info.java index 31aaee681e6..81a6d04e44f 100644 --- a/jaxws/src/jdk.xml.ws/share/classes/module-info.java +++ b/jaxws/src/jdk.xml.ws/share/classes/module-info.java @@ -24,7 +24,15 @@ */ /** - * Defines tools for JAXWS classes and WSDL generation + * Defines tools for JAX-WS classes and WSDL generation, + * including the {@index wsgen wsgen tool} + * and {@index wsimport wsimport tool} tools. + * + *- Tool Guides: + *
- {@extLink schemagen_tool_reference schemagen}, + * {@extLink xjc_tool_reference xjc} + *
+ *
* * @moduleGraph * @since 9 From 08c80bdefc7d92e2f4302782bb96f8f7590b3b16 Mon Sep 17 00:00:00 2001 From: Mandy Chung- Tool Guides: + *
- {@extLink wsgen_tool_reference wsgen}, + * {@extLink wsimport_tool_reference wsimport} + *
Date: Wed, 7 Jun 2017 21:15:06 -0700 Subject: [PATCH 034/130] 8181639: Add tool and services information to module summary Reviewed-by: alanb, psandoz, lancea --- .../tools/docs/docs-module-groups.properties | 4 +- .../java.base/share/classes/module-info.java | 45 +++++++++++++++++++ .../share/classes/module-info.java | 18 ++++++++ .../share/classes/module-info.java | 36 +++++++-------- .../share/classes/module-info.java | 3 ++ .../java.prefs/share/classes/module-info.java | 3 +- .../java.rmi/share/classes/module-info.java | 15 +++++++ .../share/classes/module-info.java | 14 +++++- .../java.se/share/classes/module-info.java | 9 ++++ .../share/classes/module-info.java | 3 +- .../java.sql/share/classes/module-info.java | 3 +- .../jdk.attach/share/classes/module-info.java | 3 +- .../share/classes/module-info.java | 5 ++- .../share/classes/module-info.java | 5 ++- .../share/classes/module-info.java | 5 ++- .../windows/classes/module-info.java | 3 +- .../solaris/classes/module-info.java | 3 +- .../share/classes/module-info.java | 2 +- .../share/classes/module-info.java | 3 +- .../share/classes/module-info.java | 17 ++++++- .../jdk.jcmd/share/classes/module-info.java | 16 ++++++- .../share/classes/module-info.java | 12 ++++- .../jdk.jdi/share/classes/module-info.java | 19 ++++++-- .../share/classes/module-info.java | 5 ++- .../jdk.jlink/share/classes/module-info.java | 26 ++++++++++- .../jdk.jstatd/share/classes/module-info.java | 9 +++- .../share/classes/module-info.java | 2 +- .../share/classes/module-info.java | 7 ++- .../share/classes/module-info.java | 4 +- .../share/classes/module-info.java | 4 +- .../jdk.pack/share/classes/module-info.java | 11 ++++- .../share/classes/module-info.java | 9 +++- .../jdk.rmic/share/classes/module-info.java | 9 +++- .../share/classes/module-info.java | 6 +-- .../jdk.zipfs/share/classes/module-info.java | 9 +++- 35 files changed, 282 insertions(+), 65 deletions(-) diff --git a/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties b/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties index 98a34b91e2e..093a294a505 100644 --- a/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties +++ b/jdk/make/src/classes/build/tools/docs/docs-module-groups.properties @@ -10,7 +10,9 @@ java.corba \ java.transaction \ java.xml.bind \ java.xml.ws \ -java.xml.ws.annotation +java.xml.ws.annotation \ +jdk.xml.bind \ +jdk.xml.ws aggregator_modules=\ java.se \ diff --git a/jdk/src/java.base/share/classes/module-info.java b/jdk/src/java.base/share/classes/module-info.java index e637bc34d7d..1880e1c8cdb 100644 --- a/jdk/src/java.base/share/classes/module-info.java +++ b/jdk/src/java.base/share/classes/module-info.java @@ -26,6 +26,51 @@ /** * Defines the foundational APIs of the Java SE Platform. * + * + *
+ * + * @provides java.nio.file.spi.FileSystemProvider + * + * @uses java.lang.System.LoggerFinder + * @uses java.net.ContentHandlerFactory + * @uses java.net.spi.URLStreamHandlerProvider + * @uses java.nio.channels.spi.AsynchronousChannelProvider + * @uses java.nio.channels.spi.SelectorProvider + * @uses java.nio.charset.spi.CharsetProvider + * @uses java.nio.file.spi.FileSystemProvider + * @uses java.nio.file.spi.FileTypeDetector + * @uses java.security.Provider + * @uses java.text.spi.BreakIteratorProvider + * @uses java.text.spi.CollatorProvider + * @uses java.text.spi.DateFormatProvider + * @uses java.text.spi.DateFormatSymbolsProvider + * @uses java.text.spi.DecimalFormatSymbolsProvider + * @uses java.text.spi.NumberFormatProvider + * @uses java.time.chrono.AbstractChronology + * @uses java.time.chrono.Chronology + * @uses java.time.zone.ZoneRulesProvider + * @uses java.util.spi.CalendarDataProvider + * @uses java.util.spi.CalendarNameProvider + * @uses java.util.spi.CurrencyNameProvider + * @uses java.util.spi.LocaleNameProvider + * @uses java.util.spi.ResourceBundleControlProvider + * @uses java.util.spi.ResourceBundleProvider + * @uses java.util.spi.TimeZoneNameProvider + * @uses java.util.spi.ToolProvider + * @uses javax.security.auth.spi.LoginModule + * * @moduleGraph * @since 9 */ diff --git a/jdk/src/java.desktop/share/classes/module-info.java b/jdk/src/java.desktop/share/classes/module-info.java index 658becc98c3..7670c7148a1 100644 --- a/jdk/src/java.desktop/share/classes/module-info.java +++ b/jdk/src/java.desktop/share/classes/module-info.java @@ -27,6 +27,24 @@ * Defines the AWT and Swing user interface toolkits, plus APIs for * accessibility, audio, imaging, printing, and JavaBeans. * + * @uses java.awt.im.spi.InputMethodDescriptor + * @uses javax.accessibility.AccessibilityProvider + * @uses javax.imageio.spi.ImageInputStreamSpi + * @uses javax.imageio.spi.ImageOutputStreamSpi + * @uses javax.imageio.spi.ImageReaderSpi + * @uses javax.imageio.spi.ImageTranscoderSpi + * @uses javax.imageio.spi.ImageWriterSpi + * @uses javax.print.PrintServiceLookup + * @uses javax.print.StreamPrintServiceFactory + * @uses javax.sound.midi.spi.MidiDeviceProvider + * @uses javax.sound.midi.spi.MidiFileReader + * @uses javax.sound.midi.spi.MidiFileWriter + * @uses javax.sound.midi.spi.SoundbankReader + * @uses javax.sound.sampled.spi.AudioFileReader + * @uses javax.sound.sampled.spi.AudioFileWriter + * @uses javax.sound.sampled.spi.FormatConversionProvider + * @uses javax.sound.sampled.spi.MixerProvider + * * @moduleGraph * @since 9 */ diff --git a/jdk/src/java.management.rmi/share/classes/module-info.java b/jdk/src/java.management.rmi/share/classes/module-info.java index ac6eabc83e3..57ef45396ed 100644 --- a/jdk/src/java.management.rmi/share/classes/module-info.java +++ b/jdk/src/java.management.rmi/share/classes/module-info.java @@ -24,27 +24,27 @@ */ /** - * Defines the RMI Connector for the Java Management Extensions (JMX) Remote API. - *- Providers:
+ *- The JDK implementation of this module provides an implementation of + * the {@index jrt jrt} {@linkplain java.nio.file.spi.FileSystemProvider + * file system provider} to enumerate and read the class and resource + * files in a run-time image. + * The jrt file system can be created by calling + * {@link java.nio.file.FileSystems#newFileSystem + * FileSystems.newFileSystem(URI.create("jrt:/"))}. + *
+ *- Tool Guides:
+ *- {@extLink java_tool_reference java launcher}, + * {@extLink keytool_tool_reference keytool}
+ *- * The {@linkplain javax.management.remote.rmi RMI connector} is a connector - * for the JMX Remote API that uses RMI to transmit client requests to a remote - * MBean server. + * Defines the {@linkplain javax.management.remote.rmi RMI connector} + * for the Java Management Extensions (JMX) Remote API. + * + *
+ *
* * @provides javax.management.remote.JMXConnectorProvider - * A provider of {@code JMXConnector} for the RMI protocol.- Providers:
+ *- This module provides + * {@link javax.management.remote.JMXConnectorProvider} service + * that creates the JMX connector clients using RMI protocol. + * Instances of {@code JMXConnector} can be obtained via the + * {@link javax.management.remote.JMXConnectorFactory#newJMXConnector + * JMXConnectorFactory.newJMXConnector} factory method. + * It also provides {@link javax.management.remote.JMXConnectorServerProvider} service + * that creates the JMX connector servers using RMI protocol. + * Instances of {@code JMXConnectorServer} can be obtained via the + * {@link javax.management.remote.JMXConnectorServerFactory#newJMXConnectorServer + * JMXConnectorServerFactory.newJMXConnectorServer} factory method. + *
+ *
- * Instances of {@code JMXConnector} using the RMI protocol - * are usually created by the {@link - * javax.management.remote.JMXConnectorFactory} which will locate - * and load the appropriate {@code JMXConnectorProvider} service - * implementation for the given protocol. - * * @provides javax.management.remote.JMXConnectorServerProvider - * A provider of {@code JMXConnectorServer} for the RMI protocol.
- * Instances of {@code JMXConnectorServer} using the RMI protocol - * are usually created by the {@link - * javax.management.remote.JMXConnectorServerFactory} which will locate - * and load the appropriate {@code JMXConnectorServerProvider} service - * implementation for the given protocol. * * @moduleGraph * @since 9 diff --git a/jdk/src/java.management/share/classes/module-info.java b/jdk/src/java.management/share/classes/module-info.java index c407821e505..bd9a74946c2 100644 --- a/jdk/src/java.management/share/classes/module-info.java +++ b/jdk/src/java.management/share/classes/module-info.java @@ -29,6 +29,9 @@ * The JMX API consists of interfaces for monitoring and management of the * JVM and other components in the Java runtime. * + * @uses javax.management.remote.JMXConnectorProvider + * @uses javax.management.remote.JMXConnectorServerProvider + * * @moduleGraph * @since 9 */ diff --git a/jdk/src/java.prefs/share/classes/module-info.java b/jdk/src/java.prefs/share/classes/module-info.java index b20d962967c..45c4449b64d 100644 --- a/jdk/src/java.prefs/share/classes/module-info.java +++ b/jdk/src/java.prefs/share/classes/module-info.java @@ -26,6 +26,8 @@ /** * Defines the Preferences API. * + * @uses java.util.prefs.PreferencesFactory + * * @moduleGraph * @since 9 */ @@ -35,4 +37,3 @@ module java.prefs { exports java.util.prefs; uses java.util.prefs.PreferencesFactory; } - diff --git a/jdk/src/java.rmi/share/classes/module-info.java b/jdk/src/java.rmi/share/classes/module-info.java index 6509952de9a..3b097bde0aa 100644 --- a/jdk/src/java.rmi/share/classes/module-info.java +++ b/jdk/src/java.rmi/share/classes/module-info.java @@ -26,6 +26,21 @@ /** * Defines the Remote Method Invocation (RMI) API. * + *The JDK implementation of this module includes + * the {@index rmiregistry rmiregistry tool} tool to start a remote + * object registry, and the {@index rmid rmid tool} tool to start + * the activation system daemon. + * + *
+ *
+ *
+ * + * @uses java.rmi.server.RMIClassLoaderSpi + * * @moduleGraph * @since 9 */ diff --git a/jdk/src/java.scripting/share/classes/module-info.java b/jdk/src/java.scripting/share/classes/module-info.java index 42854afc437..c0ad091c4d4 100644 --- a/jdk/src/java.scripting/share/classes/module-info.java +++ b/jdk/src/java.scripting/share/classes/module-info.java @@ -26,6 +26,19 @@ /** * Defines the Scripting API. * + *- Tool Guides:
+ *- {@extLink rmiregistry_tool_reference rmiregistry}, + * {@extLink rmid_tool_reference rmid} + *
+ *The JDK implementation of this module includes a language-independent + * command-line script shell, {@index jrunscript jrunscript tool}, + * that supports executing JavaScript and other languages if its corresponding + * script engine is installed. + * + *
+ *
+ *
+ * + * @uses javax.script.ScriptEngineFactory + * * @moduleGraph * @since 9 */ @@ -33,4 +46,3 @@ module java.scripting { exports javax.script; uses javax.script.ScriptEngineFactory; } - diff --git a/jdk/src/java.se/share/classes/module-info.java b/jdk/src/java.se/share/classes/module-info.java index 33b99b1c13c..4ff78b70454 100644 --- a/jdk/src/java.se/share/classes/module-info.java +++ b/jdk/src/java.se/share/classes/module-info.java @@ -29,6 +29,15 @@ * The modules defining CORBA and Java EE APIs are not required by * this module, but they are required by {@code java.se.ee}. * + *- Tool Guides: + *
- {@extLink jrunscript_tool_reference jrunscript}
+ *+ *
+ * * @moduleGraph * @since 9 */ diff --git a/jdk/src/java.sql.rowset/share/classes/module-info.java b/jdk/src/java.sql.rowset/share/classes/module-info.java index 02413903f9c..fe9689aca6c 100644 --- a/jdk/src/java.sql.rowset/share/classes/module-info.java +++ b/jdk/src/java.sql.rowset/share/classes/module-info.java @@ -26,6 +26,8 @@ /** * Defines the JDBC RowSet API. * + * @uses javax.sql.rowset.RowSetFactory + * * @moduleGraph * @since 9 */ @@ -39,4 +41,3 @@ module java.sql.rowset { exports javax.sql.rowset.spi; uses javax.sql.rowset.RowSetFactory; } - diff --git a/jdk/src/java.sql/share/classes/module-info.java b/jdk/src/java.sql/share/classes/module-info.java index 1e232ec122e..f9531f5f4a8 100644 --- a/jdk/src/java.sql/share/classes/module-info.java +++ b/jdk/src/java.sql/share/classes/module-info.java @@ -26,6 +26,8 @@ /** * Defines the JDBC API. * + * @uses java.sql.Driver + * * @moduleGraph * @since 9 */ @@ -38,4 +40,3 @@ module java.sql { exports javax.transaction.xa; uses java.sql.Driver; } - diff --git a/jdk/src/jdk.attach/share/classes/module-info.java b/jdk/src/jdk.attach/share/classes/module-info.java index 29f0cd67a7f..2a320d0e91b 100644 --- a/jdk/src/jdk.attach/share/classes/module-info.java +++ b/jdk/src/jdk.attach/share/classes/module-info.java @@ -26,6 +26,8 @@ /** * Defines the attach API. * + * @uses com.sun.tools.attach.spi.AttachProvider + * * @moduleGraph * @since 9 */ @@ -39,4 +41,3 @@ module jdk.attach { uses com.sun.tools.attach.spi.AttachProvider; provides com.sun.tools.attach.spi.AttachProvider with sun.tools.attach.AttachProviderImpl; } - diff --git a/jdk/src/jdk.charsets/share/classes/module-info.java b/jdk/src/jdk.charsets/share/classes/module-info.java index 8d40e575d30..336ed77a2ab 100644 --- a/jdk/src/jdk.charsets/share/classes/module-info.java +++ b/jdk/src/jdk.charsets/share/classes/module-info.java @@ -24,9 +24,11 @@ */ /** - * {@link java.nio.charset.Charset Charset} provider for the charsets that + * Provides {@link java.nio.charset.Charset charsets} that * are not in {@code java.base} (mostly double byte and IBM charsets). * + * @provides java.nio.charset.spi.CharsetProvider + * * @moduleGraph * @since 9 */ @@ -34,4 +36,3 @@ module jdk.charsets { provides java.nio.charset.spi.CharsetProvider with sun.nio.cs.ext.ExtendedCharsets; } - diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java b/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java index 82c2cde442e..0e79fdcb6c7 100644 --- a/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java +++ b/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java @@ -24,7 +24,9 @@ */ /** - * The SunPKCS11 security provider. + * Provides the implementation of the SunPKCS11 security provider. + * + * @provides java.security.Provider * * @moduleGraph * @since 9 @@ -34,4 +36,3 @@ module jdk.crypto.cryptoki { requires jdk.crypto.ec; provides java.security.Provider with sun.security.pkcs11.SunPKCS11; } - diff --git a/jdk/src/jdk.crypto.ec/share/classes/module-info.java b/jdk/src/jdk.crypto.ec/share/classes/module-info.java index 54f22b68609..9ba6e6195e3 100644 --- a/jdk/src/jdk.crypto.ec/share/classes/module-info.java +++ b/jdk/src/jdk.crypto.ec/share/classes/module-info.java @@ -24,7 +24,9 @@ */ /** - * The SunEC security provider. + * Provides the implementation of the SunEC security provider. + * + * @provides java.security.Provider * * @moduleGraph * @since 9 @@ -32,4 +34,3 @@ module jdk.crypto.ec { provides java.security.Provider with sun.security.ec.SunEC; } - diff --git a/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java b/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java index 0121f613e5e..6bbad56ca09 100644 --- a/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java +++ b/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java @@ -24,8 +24,9 @@ */ /** - * The SunMSCAPI security provider. + * Provides the implementation of the SunMSCAPI security provider. * + * @provides java.security.Provider * @moduleGraph * @since 9 */ diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java index 3d96987b3c5..e79f76bfb1e 100644 --- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java +++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java @@ -24,8 +24,9 @@ */ /** - * The OracleUCrypto security provider. + * Provides the implementation of the OracleUCrypto security provider. * + * @provides java.security.Provider * @moduleGraph * @since 9 */ diff --git a/jdk/src/jdk.editpad/share/classes/module-info.java b/jdk/src/jdk.editpad/share/classes/module-info.java index 57077ed9008..78645303f78 100644 --- a/jdk/src/jdk.editpad/share/classes/module-info.java +++ b/jdk/src/jdk.editpad/share/classes/module-info.java @@ -24,7 +24,7 @@ */ /** - * Implementation of the edit pad service. + * Provides the implementation of the edit pad service used by {@link jdk.jshell}. * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.httpserver/share/classes/module-info.java b/jdk/src/jdk.httpserver/share/classes/module-info.java index e6c7173e8db..c58aa6ef2e6 100644 --- a/jdk/src/jdk.httpserver/share/classes/module-info.java +++ b/jdk/src/jdk.httpserver/share/classes/module-info.java @@ -26,6 +26,8 @@ /** * Defines the JDK-specific API for HTTP server. * + * @uses com.sun.net.httpserver.spi.HttpServerProvider + * * @moduleGraph * @since 9 */ @@ -35,4 +37,3 @@ module jdk.httpserver { exports com.sun.net.httpserver.spi; uses com.sun.net.httpserver.spi.HttpServerProvider; } - diff --git a/jdk/src/jdk.jartool/share/classes/module-info.java b/jdk/src/jdk.jartool/share/classes/module-info.java index d852ee780d3..e866b74c418 100644 --- a/jdk/src/jdk.jartool/share/classes/module-info.java +++ b/jdk/src/jdk.jartool/share/classes/module-info.java @@ -25,7 +25,21 @@ /** * Defines tools for manipulating Java Archive (JAR) files, - * including the jar and jarsigner tools. + * including the {@index jar jar tool} and + * {@index jarsigner jarsigner tool} tools. + * + *- Optional for Java SE Platform:
+ *- + * Java Native Interface (JNI)
+ *
+ * Java Virtual Machine Tool Interface (JVM TI)
+ * Java Debug Wire Protocol (JDWP)
+ *This module provides the equivalent of command-line access to + * jar via the {@link java.util.spi.ToolProvider ToolProvider} SPI. + * Instances of the tool can be obtained by calling + * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} + * or the {@link java.util.ServiceLoader service loader} with the name + * {@code "jar"}. + * + *
+ *
* * @moduleGraph * @since 9 @@ -36,4 +50,3 @@ module jdk.jartool { provides java.util.spi.ToolProvider with sun.tools.jar.JarToolProvider; } - diff --git a/jdk/src/jdk.jcmd/share/classes/module-info.java b/jdk/src/jdk.jcmd/share/classes/module-info.java index 4cda0283f1b..9a5df56cdb5 100644 --- a/jdk/src/jdk.jcmd/share/classes/module-info.java +++ b/jdk/src/jdk.jcmd/share/classes/module-info.java @@ -24,8 +24,20 @@ */ /** - * Defines tools for diagnostics and troubleshooting a JVM, - * including the jcmd, jps, jstat and other diagnostics tools. + * Defines tools for diagnostics and troubleshooting a JVM + * such as the {@index jcmd jcmd tool}, {@index jps jps tool}, + * {@index jstat jstat tool} tools. + * + *- Tool Guides: + *
- {@extLink jar_tool_reference jar}, + * {@extLink jarsigner_tool_reference jarsigner} + *
+ *
* * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.jconsole/share/classes/module-info.java b/jdk/src/jdk.jconsole/share/classes/module-info.java index 7e1841a9bea..dd7671d04df 100644 --- a/jdk/src/jdk.jconsole/share/classes/module-info.java +++ b/jdk/src/jdk.jconsole/share/classes/module-info.java @@ -24,8 +24,16 @@ */ /** - * Defines the JMX graphical tool, jconsole, for monitoring and managing - * a running application. + * Defines the JMX graphical tool, {@index jconsole jconsole}, + * for monitoring and managing a running application. + * + *- Tool Guides: + *
- + * {@extLink jcmd_tool_reference jcmd}, + * {@extLink jinfo_tool_reference jinfo}, + * {@extLink jmap_tool_reference jmap}, + * {@extLink jps_tool_reference jps}, + * {@extLink jstack_tool_reference jstack}, + * {@extLink jstat_tool_reference jstat} + *
+ *
+ * + * @uses com.sun.tools.jconsole.JConsolePlugin * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.jdi/share/classes/module-info.java b/jdk/src/jdk.jdi/share/classes/module-info.java index e778655cf37..e7c45f37064 100644 --- a/jdk/src/jdk.jdi/share/classes/module-info.java +++ b/jdk/src/jdk.jdi/share/classes/module-info.java @@ -45,8 +45,7 @@ * Platform Debugger Architecture documentation for this release and the Java Platform Debugger Architecture * website. - *- Tool Guides: + *
- {@extLink jconsole_tool_reference jconsole}, + * {@extLink using_jconsole Using JConsole} + *
- * Global Exceptions: + *
Global Exceptions
** This section documents exceptions which apply to the entire API and are thus * not documented on individual methods. @@ -103,6 +102,21 @@ * unloaded. * * + *
jdb
+ * + * {@index jdb jdb tool} is a simple command-line debugger provided + * in this module. + * + *+ *
+ * + * @provides com.sun.jdi.connect.Connector + * + * @uses com.sun.jdi.connect.Connector + * @uses com.sun.jdi.connect.spi.TransportService + * * @moduleGraph * @since 9 */ @@ -127,4 +141,3 @@ module jdk.jdi { com.sun.tools.jdi.SocketListeningConnector, com.sun.tools.jdi.SunCommandLineLauncher; } - diff --git a/jdk/src/jdk.jdwp.agent/share/classes/module-info.java b/jdk/src/jdk.jdwp.agent/share/classes/module-info.java index 82d4c86056a..c4f683ff801 100644 --- a/jdk/src/jdk.jdwp.agent/share/classes/module-info.java +++ b/jdk/src/jdk.jdwp.agent/share/classes/module-info.java @@ -24,11 +24,12 @@ */ /** - * Java Debug Wire Protocol. + * Provides the implementation of the Java Debug Wire Protocol (JDWP) agent. * * @moduleGraph * @since 9 + * @see JDWP Specification + * @see JDWP Transport Specification */ module jdk.jdwp.agent { } - diff --git a/jdk/src/jdk.jlink/share/classes/module-info.java b/jdk/src/jdk.jlink/share/classes/module-info.java index 510b4ac0bb1..140a7619d6f 100644 --- a/jdk/src/jdk.jlink/share/classes/module-info.java +++ b/jdk/src/jdk.jlink/share/classes/module-info.java @@ -24,7 +24,31 @@ */ /** - * Defines the Java linker tool, jlink. + * Defines the {@index jlink jlink tool} tool for creating run-time + * images, the {@index jmod jmod tool} tool for creating and manipulating + * JMOD files, and the {@index jimage jimage tool} tool for inspecting + * the JDK implementation-specific container file for classes and resources. + * + *- Tool Guides: + *
- {@extLink jdb_tool_reference jdb} + *
This module provides the equivalent of command-line access to the + * {@extLink jlink_tool_reference jlink} and + * {@extLink jmod_tool_reference jmod} tools via the + * {@link java.util.spi.ToolProvider ToolProvider} SPI. + * Instances of the tools can be obtained by calling + * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} + * or the {@link java.util.ServiceLoader service loader} with the name + * {@code "jlink"} or {@code "jmod"} as appropriate. + * + *
{@extLink jimage_tool_reference jimage} only exists + * as a command-line tool, and does not provide any direct API. + * + *
+ *
+ * + * @provides java.util.spi.ToolProvider * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.jstatd/share/classes/module-info.java b/jdk/src/jdk.jstatd/share/classes/module-info.java index b3e3195c262..a56a45f036d 100644 --- a/jdk/src/jdk.jstatd/share/classes/module-info.java +++ b/jdk/src/jdk.jstatd/share/classes/module-info.java @@ -24,8 +24,13 @@ */ /** - * Defines the tool for starting a daemon for the jstat tool to monitor - * JVM statistics remotely. + * Defines the {@index jstatd jstatd tool} tool for starting a daemon + * for the jstat tool to monitor JVM statistics remotely. + * + *- Tool Guides: + *
- {@extLink jlink_tool_reference jlink}, + * {@extLink jmod_tool_reference jmod}, + * {@extLink jimage_tool_reference jimage} + *
+ *
* * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.localedata/share/classes/module-info.java b/jdk/src/jdk.localedata/share/classes/module-info.java index ac27dc329c5..fadb091a92f 100644 --- a/jdk/src/jdk.localedata/share/classes/module-info.java +++ b/jdk/src/jdk.localedata/share/classes/module-info.java @@ -24,7 +24,7 @@ */ /** - * Locale data provider for locales other than {@linkplain java.util.Locale#US US locale}. + * Provides the locale data for locales other than {@linkplain java.util.Locale#US US locale}. * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.management.agent/share/classes/module-info.java b/jdk/src/jdk.management.agent/share/classes/module-info.java index 81bccdb0e2b..921744822b6 100644 --- a/jdk/src/jdk.management.agent/share/classes/module-info.java +++ b/jdk/src/jdk.management.agent/share/classes/module-info.java @@ -24,7 +24,12 @@ */ /** - * Define the JMX management agent. + * Defines the JMX management agent. + * + *- Tool Guides: + *
- {@extLink jstatd_tool_reference jstatd} + *
This module allows a Java Virtual Machine to be monitored and managed + * via JMX API. See more information from the + * {@extLink monitoring_and_management_using_jmx_technology + * Monitoring and Management Using JMX} guide. * * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.naming.dns/share/classes/module-info.java b/jdk/src/jdk.naming.dns/share/classes/module-info.java index 71d3725440a..b1deb8aa8c7 100644 --- a/jdk/src/jdk.naming.dns/share/classes/module-info.java +++ b/jdk/src/jdk.naming.dns/share/classes/module-info.java @@ -24,8 +24,9 @@ */ /** - * DNS Java Naming provider. + * Provides the implementation of the DNS Java Naming provider. * + * @provides javax.naming.spi.InitialContextFactory * @moduleGraph * @since 9 */ @@ -38,4 +39,3 @@ module jdk.naming.dns { provides javax.naming.spi.InitialContextFactory with com.sun.jndi.dns.DnsContextFactory; } - diff --git a/jdk/src/jdk.naming.rmi/share/classes/module-info.java b/jdk/src/jdk.naming.rmi/share/classes/module-info.java index bba4557c935..289654c7c80 100644 --- a/jdk/src/jdk.naming.rmi/share/classes/module-info.java +++ b/jdk/src/jdk.naming.rmi/share/classes/module-info.java @@ -24,8 +24,9 @@ */ /** - * RMI Java Naming provider. + * Provides the implementation of the RMI Java Naming provider. * + * @provides javax.naming.spi.InitialContextFactory * @moduleGraph * @since 9 */ @@ -39,4 +40,3 @@ module jdk.naming.rmi { exports com.sun.jndi.url.rmi to java.naming; exports com.sun.jndi.rmi.registry to java.rmi; } - diff --git a/jdk/src/jdk.pack/share/classes/module-info.java b/jdk/src/jdk.pack/share/classes/module-info.java index f65a5ca61b7..cd04808ec2e 100644 --- a/jdk/src/jdk.pack/share/classes/module-info.java +++ b/jdk/src/jdk.pack/share/classes/module-info.java @@ -25,8 +25,15 @@ /** * Defines tools for transforming a JAR file into a compressed pack200 file - * and transforming a packed file into a JAR file, including the pack200, - * and unpack200 tools. + * and transforming a packed file into a JAR file, including the + * {@index pack200 pack200 tool} and + * {@index unpack200 unpack200 tool} tools. + * + *
+ *
* * @moduleGraph * @since 9 diff --git a/jdk/src/jdk.policytool/share/classes/module-info.java b/jdk/src/jdk.policytool/share/classes/module-info.java index 9a3818692f0..30117263f83 100644 --- a/jdk/src/jdk.policytool/share/classes/module-info.java +++ b/jdk/src/jdk.policytool/share/classes/module-info.java @@ -24,7 +24,13 @@ */ /** - * GUI tool for managing policy files. + * Defines the GUI tool for managing policy files + * called {@index policytool policytool}. + * + *- Tool Guides: + *
- {@extLink pack200_tool_reference pack200}, + * {@extLink unpack200_tool_reference unpack200} + *
+ *
* * @since 9 * @deprecated @@ -39,4 +45,3 @@ module jdk.policytool { requires java.security.jgss; requires jdk.security.jgss; } - diff --git a/jdk/src/jdk.rmic/share/classes/module-info.java b/jdk/src/jdk.rmic/share/classes/module-info.java index 03806a6bced..ba6ac3db30c 100644 --- a/jdk/src/jdk.rmic/share/classes/module-info.java +++ b/jdk/src/jdk.rmic/share/classes/module-info.java @@ -24,10 +24,15 @@ */ /** - * Defines the rmic compiler for generating stubs and skeletons using - * the Java Remote Method Protocol (JRMP) and + * Defines the {@index rmic rmic} compiler for generating stubs and + * skeletons using the Java Remote Method Protocol (JRMP) and * stubs and tie class files (IIOP protocol) for remote objects. * + *- Tool Guides: + *
- {@extLink policytool_tool_reference policytool} + *
+ *
+ * * @moduleGraph * @since 9 */ diff --git a/jdk/src/jdk.security.auth/share/classes/module-info.java b/jdk/src/jdk.security.auth/share/classes/module-info.java index 59e9f996aaf..e1d322fb730 100644 --- a/jdk/src/jdk.security.auth/share/classes/module-info.java +++ b/jdk/src/jdk.security.auth/share/classes/module-info.java @@ -24,9 +24,10 @@ */ /** - * Contains the implementation of the javax.security.auth.* interfaces and - * various authentication modules. + * Provides the implementation of the {@code javax.security.auth.*} + * interfaces and various authentication modules. * + * @provides javax.security.auth.spi.LoginModule * @moduleGraph * @since 9 */ @@ -47,4 +48,3 @@ module jdk.security.auth { com.sun.security.auth.module.LdapLoginModule, com.sun.security.auth.module.NTLoginModule; } - diff --git a/jdk/src/jdk.zipfs/share/classes/module-info.java b/jdk/src/jdk.zipfs/share/classes/module-info.java index bcd281f459a..9c9503a7360 100644 --- a/jdk/src/jdk.zipfs/share/classes/module-info.java +++ b/jdk/src/jdk.zipfs/share/classes/module-info.java @@ -24,12 +24,17 @@ */ /** - * Zip file system provider. + * Provides the implementation of the zip file system provider. * + *- Tool Guides: + *
- {@extLink rmic_tool_reference rmic} + *
The zip file system provider treats a zip or JAR file as a file system + * and provides the ability to manipulate the contents of the file. + * The zip file system provider can be created by + * {@link java.nio.file.FileSystems#newFileSystem} if installed. + * + * @provides java.nio.file.spi.FileSystemProvider * @moduleGraph * @since 9 */ module jdk.zipfs { provides java.nio.file.spi.FileSystemProvider with jdk.nio.zipfs.ZipFileSystemProvider; } - From 57cdb9b6426992c176b76c7726c1401228b29fe6 Mon Sep 17 00:00:00 2001 From: Mandy Chung
Date: Wed, 7 Jun 2017 21:15:31 -0700 Subject: [PATCH 035/130] 8181639: Add tool and services information to module summary Reviewed-by: alanb, psandoz, lancea --- make/common/Modules.gmk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index d65adcd6aef..de979bc3b83 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -175,10 +175,13 @@ DOCS_MODULES += \ jdk.policytool \ jdk.rmic \ jdk.scripting.nashorn \ + jdk.scripting.nashorn.shell \ jdk.sctp \ jdk.security.auth \ jdk.security.jgss \ + jdk.xml.bind \ jdk.xml.dom \ + jdk.xml.ws \ jdk.zipfs \ # From 13625f3e7dee52be194f8019f8b60bd3bf28bd85 Mon Sep 17 00:00:00 2001 From: Bhavesh Patel Date: Wed, 7 Jun 2017 22:58:37 -0700 Subject: [PATCH 036/130] 8147881: Javadoc search box watermark text issue Reviewed-by: jjg, ksrini --- .../internal/doclets/formats/html/resources/search.js | 2 +- .../test/jdk/javadoc/doclet/testSearch/TestSearch.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js index 7ce99044a75..37a49862690 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js @@ -86,7 +86,7 @@ $(function() { $(this).val(watermark).addClass('watermark'); } }); - $("#search").keydown(function() { + $("#search").on('click keydown', function() { if ($(this).val() == watermark) { $(this).val('').removeClass('watermark'); } diff --git a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java index 5be26d2e972..94c4866197b 100644 --- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java +++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 + * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881 * @summary Test the search feature of javadoc. * @author bpatel * @library ../lib @@ -491,6 +491,11 @@ public class TestSearch extends JavadocTester { "function nestedName(e) {", "function sortAndConcatResults(a1, a2) {", "if (exactMatcher.test(item.l)) {\n" - + " presult.unshift(item);"); + + " presult.unshift(item);", + "$(\"#search\").on('click keydown', function() {\n" + + " if ($(this).val() == watermark) {\n" + + " $(this).val('').removeClass('watermark');\n" + + " }\n" + + " });"); } } From 784dd679dad0b768d843d0b6396478dba7426696 Mon Sep 17 00:00:00 2001 From: Rachna Goel Date: Thu, 8 Jun 2017 12:15:54 +0530 Subject: [PATCH 037/130] 8178872: Decimal form is inconsistent between CLDR and Java in some special locales Reviewed-by: naoto --- .../tools/cldrconverter/LDMLParseHandler.java | 14 +++++-- jdk/test/sun/text/resources/LocaleData.cldr | 26 +++++++++++++ .../sun/text/resources/LocaleDataTest.java | 38 +++++++++++++------ 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/jdk/make/src/classes/build/tools/cldrconverter/LDMLParseHandler.java b/jdk/make/src/classes/build/tools/cldrconverter/LDMLParseHandler.java index 8683f282581..b229c91731f 100644 --- a/jdk/make/src/classes/build/tools/cldrconverter/LDMLParseHandler.java +++ b/jdk/make/src/classes/build/tools/cldrconverter/LDMLParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -549,12 +549,20 @@ class LDMLParseHandler extends AbstractLDMLHandler - * LocaleNames/sr-Latn/SR=Surinam + * Second field which designates locale is in the form of: + * 1) Legacy locale notation using '_' as a locale component(language/country/variant) separator. + * language is a mandatory component. country and variant are optional, however, + * variant cannot exist without country. So for example, while "ja"/"ja_JP"/"ja_JP_JP" are valid, + * "_JP"/"ja__JP" are invalid. + * + * 2) BCP47 language tag notation in which we can specify language tag with '-' as a subtag + * separator. Language tag can be specified with '-' in locale field like this: + *LocaleNames/sr-Latn/SR=Surinam * FormatData/sr-Latn-BA/DayNames/2=utorak* * The command-line syntax of this test is @@ -276,16 +283,25 @@ public class LocaleDataTest throw new Exception("Malformed input file: \"" + key + "\" is missing locale name"); localeName = key.substring(oldIndex, index); boolean use_tag = localeName.indexOf("-") != -1; - if (use_tag == false && localeName.length() > 0) { - language = localeName.substring(0, 2); - if (localeName.length() > 3) { - country = localeName.substring(3, 5); - if (localeName.length() > 5) - variant = localeName.substring(6); + String[] locDetails = localeName.split("_"); + switch (locDetails.length) { + case 1: + language = locDetails[0]; + break; + case 2: + language = locDetails[0]; + country = locDetails[1]; + break; + case 3: + language = locDetails[0]; + country = locDetails[1]; + variant = locDetails[2]; + break; + default: + throw new Exception("locale not specified properly " + locDetails); } } - oldIndex = index + 1; index = key.indexOf("/", oldIndex); if (index == -1) From 5262fc661218ae1c595b14b6e779383ec234e916 Mon Sep 17 00:00:00 2001 From: Bhavesh PatelDate: Thu, 8 Jun 2017 00:11:29 -0700 Subject: [PATCH 038/130] 8181215: Links incorrectly appear bold in some javadoc generated tables Reviewed-by: jjg, ksrini --- .../doclets/toolkit/resources/stylesheet.css | 1 - .../doclet/testStylesheet/TestStylesheet.java | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index 073dc84bf63..03a59487f8c 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -576,7 +576,6 @@ td.colSecond a:link, td.colSecond a:visited, th.colFirst a:link, th.colFirst a:visited, th.colSecond a:link, th.colSecond a:visited, th.colConstructorName a:link, th.colConstructorName a:visited, -td.colLast a:link, td.colLast a:visited, .constantValuesContainer td a:link, .constantValuesContainer td a:visited { font-weight:bold; } diff --git a/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java b/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java index ea481660293..6c6d4bc7236 100644 --- a/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java +++ b/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java @@ -24,7 +24,7 @@ /* * @test * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417 - * 8175218 8176452 + * 8175218 8176452 8181215 * @summary Run tests on doclet stylesheet. * @author jamieh * @library ../lib @@ -183,7 +183,6 @@ public class TestStylesheet extends JavadocTester { + "th.colFirst a:link, th.colFirst a:visited,\n" + "th.colSecond a:link, th.colSecond a:visited,\n" + "th.colConstructorName a:link, th.colConstructorName a:visited,\n" - + "td.colLast a:link, td.colLast a:visited,\n" + ".constantValuesContainer td a:link, .constantValuesContainer td a:visited {\n" + " font-weight:bold;\n" + "}"); @@ -219,6 +218,15 @@ public class TestStylesheet extends JavadocTester { "a[name]:hover {\n" + " text-decoration:none;\n" + " color:#353833;\n" + + "}", + "td.colFirst a:link, td.colFirst a:visited,\n" + + "td.colSecond a:link, td.colSecond a:visited,\n" + + "th.colFirst a:link, th.colFirst a:visited,\n" + + "th.colSecond a:link, th.colSecond a:visited,\n" + + "th.colConstructorName a:link, th.colConstructorName a:visited,\n" + + "td.colLast a:link, td.colLast a:visited,\n" + + ".constantValuesContainer td a:link, .constantValuesContainer td a:visited {\n" + + " font-weight:bold;\n" + "}"); } } From a171cafd32541674ea53751320c82c55cff5c792 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 8 Jun 2017 11:24:46 +0200 Subject: [PATCH 039/130] 8181776: Move back specs to closed Reviewed-by: erikj --- .../share/specs/serialization/class.md | 362 -- .../share/specs/serialization/examples.md | 111 - .../share/specs/serialization/exceptions.md | 97 - .../specs/serialization/images/version.gif | Bin 3325 -> 0 bytes .../share/specs/serialization/index.md | 132 - .../share/specs/serialization/input.md | 672 ---- .../share/specs/serialization/output.md | 514 --- .../share/specs/serialization/protocol.md | 504 --- .../share/specs/serialization/security.md | 38 - .../share/specs/serialization/serial-arch.md | 575 --- .../share/specs/serialization/version.md | 304 -- .../share/specs/AWT_Native_Interface.html | 776 ---- .../share/specs/JVM-MANAGEMENT-MIB.mib | 3266 ----------------- 13 files changed, 7351 deletions(-) delete mode 100644 jdk/src/java.base/share/specs/serialization/class.md delete mode 100644 jdk/src/java.base/share/specs/serialization/examples.md delete mode 100644 jdk/src/java.base/share/specs/serialization/exceptions.md delete mode 100644 jdk/src/java.base/share/specs/serialization/images/version.gif delete mode 100644 jdk/src/java.base/share/specs/serialization/index.md delete mode 100644 jdk/src/java.base/share/specs/serialization/input.md delete mode 100644 jdk/src/java.base/share/specs/serialization/output.md delete mode 100644 jdk/src/java.base/share/specs/serialization/protocol.md delete mode 100644 jdk/src/java.base/share/specs/serialization/security.md delete mode 100644 jdk/src/java.base/share/specs/serialization/serial-arch.md delete mode 100644 jdk/src/java.base/share/specs/serialization/version.md delete mode 100644 jdk/src/java.desktop/share/specs/AWT_Native_Interface.html delete mode 100644 jdk/src/java.management/share/specs/JVM-MANAGEMENT-MIB.mib diff --git a/jdk/src/java.base/share/specs/serialization/class.md b/jdk/src/java.base/share/specs/serialization/class.md deleted file mode 100644 index 03b94b7d099..00000000000 --- a/jdk/src/java.base/share/specs/serialization/class.md +++ /dev/null @@ -1,362 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](input.html) | [NEXT](version.html)' -include-after: '[CONTENTS](index.html) | [PREV](input.html) | [NEXT](version.html)' - -title: 'Java Object Serialization Specification: 4 - Class Descriptors' ---- - -- [The ObjectStreamClass Class](#the-objectstreamclass-class) -- [Dynamic Proxy Class Descriptors](#dynamic-proxy-class-descriptors) -- [Serialized Form](#serialized-form) -- [The ObjectStreamField Class](#the-objectstreamfield-class) -- [Inspecting Serializable Classes](#inspecting-serializable-classes) -- [Stream Unique Identifiers](#stream-unique-identifiers) - -------------------------------------------------------------------------------- - -## 4.1 The ObjectStreamClass Class - -The `ObjectStreamClass` provides information about classes that are saved in a -Serialization stream. The descriptor provides the fully-qualified name of the -class and its serialization version UID. A `SerialVersionUID` identifies the -unique original class version for which this class is capable of writing -streams and from which it can read. - -``` -package java.io; - -public class ObjectStreamClass -{ - public static ObjectStreamClass lookup(Class cl); - - public static ObjectStreamClass lookupAny(Class cl); - - public String getName(); - - public Class forClass(); - - public ObjectStreamField[] getFields(); - - public long getSerialVersionUID(); - - public String toString(); -} -``` - -The `lookup` method returns the `ObjectStreamClass` descriptor for the -specified class in the virtual machine. If the class has defined -`serialVersionUID` it is retrieved from the class. If the `serialVersionUID` is -not defined by the class, it is computed from the definition of the class in -the virtual machine. *I*f the specified class is not serializable or -externalizable, *null* is returned. - -The `lookupAny` method behaves like the `lookup` method, except that it returns -the descriptor for any class, regardless of whether it implements -`Serializable`. The `serialVersionUID` of a class that does not implement -`Serializable` is *0L.* - -The `getName` method returns the name of the class, in the same format that is -used by the `Class.getName` method. - -The `forClass` method returns the `Class` in the local virtual machine if one -was found by `ObjectInputStream.resolveClass` method. Otherwise, it returns -*null*. - -The `getFields` method returns an array of `ObjectStreamField` objects that -represent the serializable fields of this class. - -The `getSerialVersionUID` method returns the `serialVersionUID` of this class. -Refer to [Section 4.6, "Stream Unique -Identifiers"](#stream-unique-identifiers). If not specified by the class, the -value returned is a hash computed from the class's name, interfaces, methods, -and fields using the Secure Hash Algorithm (SHA) as defined by the National -Institute of Standards. - -The `toString` method returns a printable representation of the class -descriptor including the name of the class and the `serialVersionUID`. - -## 4.2 Dynamic Proxy Class Descriptors - -ObjectStreamClass descriptors are also used to provide information about -dynamic proxy classes (e.g., classes obtained via calls to the getProxyClass -method of java.lang.reflect.Proxy) saved in a serialization stream. A dynamic -proxy class itself has no serializable fields and a serialVersionUID of 0L. In -other words, when the Class object for a dynamic proxy class is passed to the -static lookup method of ObjectStreamClass, the returned ObjectStreamClass -instance will have the following properties: - -- Invoking its getSerialVersionUID method will return 0L. -- Invoking its getFields method will return an array of length zero. -- Invoking its getField method with any String argument will return null. - -## 4.3 Serialized Form - -The serialized form of an ObjectStreamClass instance depends on whether or not -the Class object it represents is serializable, externalizable, or a dynamic -proxy class. - -When an `ObjectStreamClass` instance that does not represent a dynamic proxy -class is written to the stream, it writes the class name and -`serialVersionUID`, flags, and the number of fields. Depending on the class, -additional information may be written: - -- For non-serializable classes, the number of fields is always zero. Neither - the `SC_SERIALIZABLE` nor the `SC_EXTERNALIZABLE` flag bits are set. - -- For serializable classes, the `SC_SERIALIZABLE` flag is set, the number of - fields counts the number of serializable fields and is followed by a - descriptor for each serializable field. The descriptors are written in - canonical order. The descriptors for primitive typed fields are written - first sorted by field name followed by descriptors for the object typed - fields sorted by field name. The names are sorted using `String.compareTo`. - For details of the format, refer to [Section 6.4, "Grammar for the Stream - Format"](protocol.html#grammar-for-the-stream-format). - -- For externalizable classes, flags includes the `SC_EXTERNALIZABLE` flag, - and the number of fields is always zero. - -- For enum types, flags includes the `SC_ENUM` flag, and the number of fields - is always zero. - -When an ObjectOutputStream serializes the ObjectStreamClass descriptor for a -dynamic proxy class, as determined by passing its Class object to the -isProxyClass method of java.lang.reflect.Proxy, it writes the number of -interfaces that the dynamic proxy class implements, followed by the interface -names. Interfaces are listed in the order that they are returned by invoking -the getInterfaces method on the Class object of the dynamic proxy class. - -The serialized representations of ObjectStreamClass descriptors for dynamic -proxy classes and non-dynamic proxy classes are differentiated through the use -of different typecodes (`TC_PROXYCLASSDESC` and `TC_CLASSDESC`, respectively); -for a more detailed specification of the grammar, see [Section 6.4, "Grammar -for the Stream Format"](protocol.html#grammar-for-the-stream-format). - -## 4.4 The ObjectStreamField Class - -An `ObjectStreamField` represents a serializable field of a serializable class. -The serializable fields of a class can be retrieved from the -`ObjectStreamClass`. - -The special static serializable field, `serialPersistentFields`, is an array of -`ObjectStreamField` components that is used to override the default -serializable fields. - -``` -package java.io; - -public class ObjectStreamField implements Comparable { - - public ObjectStreamField(String fieldName, - Class fieldType); - - public ObjectStreamField(String fieldName, - Class fieldType, - boolean unshared); - - public String getName(); - - public Class getType(); - - public String getTypeString(); - - public char getTypeCode(); - - public boolean isPrimitive(); - - public boolean isUnshared(); - - public int getOffset(); - - protected void setOffset(int offset); - - public int compareTo(Object obj); - - public String toString(); -} -``` - -`ObjectStreamField` objects are used to specify the serializable fields of a -class or to describe the fields present in a stream. Its constructors accept -arguments describing the field to represent: a string specifying the name of -the field, a `Class` object specifying the type of the field, and a `boolean` -flag (implicitly `false` for the two-argument constructor) indicating whether -or not values of the represented field should be read and written as "unshared" -objects if default serialization/deserialization is in use (see the -descriptions of the `ObjectInputStream.readUnshared` and -`ObjectOutputStream.writeUnshared` methods in [Section 3.1, "The -ObjectInputStream Class"](input.html#the-objectinputstream-class) and [Section -2.1, "The ObjectOutputStream Class"](output.html#the-objectoutputstream-class), -respectively). - -The `getName` method returns the name of the serializable field. - -The `getType` method returns the type of the field. - -The `getTypeString` method returns the type signature of the field. - -The `getTypeCode` method returns a character encoding of the field type ('`B`' -for `byte`, '`C`' for `char`, '`D`' for `double`, '`F`' for `float`, '`I`' for -`int`, '`J`' for `long`, '`L`' for non-array object types, '`S`' for `short`, -'`Z`' for `boolean`, and '`[`' for arrays). - -The `isPrimitive` method returns `true` if the field is of primitive type, or -`false` otherwise. - -The `isUnshared` method returns `true` if values of the field should be written -as "unshared" objects, or `false` otherwise. - -The `getOffset` method returns the offset of the field's value within instance -data of the class defining the field. - -The `setOffset` method allows `ObjectStreamField` subclasses to modify the -offset value returned by the `getOffset` method. - -The `compareTo` method compares `ObjectStreamFields` for use in sorting. -Primitive fields are ranked as "smaller" than non-primitive fields; fields -otherwise equal are ranked alphabetically. - -The `toString` method returns a printable representation with name and type. - -## 4.5 Inspecting Serializable Classes - -The program *serialver* can be used to find out if a class is serializable and -to get its `serialVersionUID`. - -When invoked on the command line with one or more class names, serialver prints -the `serialVersionUID` for each class in a form suitable for copying into an -evolving class. When invoked with no arguments, it prints a usage line. - -## 4.6 Stream Unique Identifiers - -Each versioned class must identify the original class version for which it is -capable of writing streams and from which it can read. For example, a versioned -class must declare: - -``` -private static final long serialVersionUID = 3487495895819393L; -``` - -The stream-unique identifier is a 64-bit hash of the class name, interface -class names, methods, and fields. The value must be declared in all versions of -a class except the first. It may be declared in the original class but is not -required. The value is fixed for all compatible classes. If the SUID is not -declared for a class, the value defaults to the hash for that class. The -`serialVersionUID` for dynamic proxy classes and enum types always have the -value *0L*. Array classes cannot declare an explicit `serialVersionUID`, so -they always have the default computed value, but the requirement for matching -`serialVersionUID` values is waived for array classes. - -**Note:** It is strongly recommended that all serializable classes explicitly -declare `serialVersionUID` values, since the default `serialVersionUID` -computation is highly sensitive to class details that may vary depending on -compiler implementations, and can thus result in unexpected `serialVersionUID` -conflicts during deserialization, causing deserialization to fail. - -The initial version of an `Externalizable` class must output a stream data -format that is extensible in the future. The initial version of the method -`readExternal` has to be able to read the output format of all future versions -of the method `writeExternal`. - -The `serialVersionUID` is computed using the signature of a stream of bytes -that reflect the class definition. The National Institute of Standards and -Technology (NIST) Secure Hash Algorithm (SHA-1) is used to compute a signature -for the stream. The first two 32-bit quantities are used to form a 64-bit hash. -A `java.lang.DataOutputStream` is used to convert primitive data types to a -sequence of bytes. The values input to the stream are defined by the Java -Virtual Machine (VM) specification for classes. Class modifiers may include the -`ACC_PUBLIC`, `ACC_FINAL`, `ACC_INTERFACE`, and `ACC_ABSTRACT` flags; other -flags are ignored and do not affect `serialVersionUID` computation. Similarly, -for field modifiers, only the `ACC_PUBLIC`, `ACC_PRIVATE`, `ACC_PROTECTED`, -`ACC_STATIC`, `ACC_FINAL`, `ACC_VOLATILE`, and `ACC_TRANSIENT` flags are used -when computing `serialVersionUID` values. For constructor and method modifiers, -only the `ACC_PUBLIC`, `ACC_PRIVATE`, `ACC_PROTECTED`, `ACC_STATIC`, -`ACC_FINAL`, `ACC_SYNCHRONIZED`, `ACC_NATIVE`, `ACC_ABSTRACT` and `ACC_STRICT` -flags are used. Names and descriptors are written in the format used by the -`java.io.DataOutputStream.writeUTF` method. - -The sequence of items in the stream is as follows: - -1. The class name. - -2. The class modifiers written as a 32-bit integer. - -3. The name of each interface sorted by name. - -4. For each field of the class sorted by field name (except `private static` - and `private transient` fields: - - a. The name of the field. - - b. The modifiers of the field written as a 32-bit integer. - - c. The descriptor of the field. - -5. If a class initializer exists, write out the following: - - a. The name of the method, ` `. - - b. The modifier of the method, `java.lang.reflect.Modifier.STATIC`, - written as a 32-bit integer. - - c. The descriptor of the method, `()V`. - -6. For each non-`private` constructor sorted by method name and signature: - - a. The name of the method, ` `. - - b. The modifiers of the method written as a 32-bit integer. - - c. The descriptor of the method. - -7. For each non-`private` method sorted by method name and signature: - - a. The name of the method. - - b. The modifiers of the method written as a 32-bit integer. - - c. The descriptor of the method. - -8. The SHA-1 algorithm is executed on the stream of bytes produced by - `DataOutputStream` and produces five 32-bit values `sha[0..4]`. - -9. The hash value is assembled from the first and second 32-bit values of the - SHA-1 message digest. If the result of the message digest, the five 32-bit - words `H0 H1 H2 H3 H4`, is in an array of five `int` values named `sha`, - the hash value would be computed as follows: - -``` - long hash = ((sha[0] >>> 24) & 0xFF) | - ((sha[0] >>> 16) & 0xFF) << 8 | - ((sha[0] >>> 8) & 0xFF) << 16 | - ((sha[0] >>> 0) & 0xFF) << 24 | - ((sha[1] >>> 24) & 0xFF) << 32 | - ((sha[1] >>> 16) & 0xFF) << 40 | - ((sha[1] >>> 8) & 0xFF) << 48 | - ((sha[1] >>> 0) & 0xFF) << 56; -``` - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/examples.md b/jdk/src/java.base/share/specs/serialization/examples.md deleted file mode 100644 index 3817fca2889..00000000000 --- a/jdk/src/java.base/share/specs/serialization/examples.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](exceptions.html) | NEXT' -include-after: '[CONTENTS](index.html) | [PREV](exceptions.html) | NEXT' - -title: 'Java Object Serialization Specification: C - Example of Serializable Fields' ---- - -- [Example Alternate Implementation of - java.io.File](#c.1-example-alternate-implementation-of-java.io.file) - -------------------------------------------------------------------------------- - -## C.1 Example Alternate Implementation of java.io.File - -This appendix provides a brief example of how an existing class could be -specified and implemented to interoperate with the existing implementation but -without requiring the same assumptions about the representation of the file -name as a *String*. - -The system class `java.io.File` represents a filename and has methods for -parsing, manipulating files and directories by name. It has a single private -field that contains the current file name. The semantics of the methods that -parse paths depend on the current path separator which is held in a static -field. This path separator is part of the serialized state of a file so that -file name can be adjusted when read. - -The serialized state of a `File` object is defined as the serializable fields -and the sequence of data values for the file. In this case, there is one of -each. - -``` -Serializable Fields: - String path; // path name with embedded separators -Serializable Data: - char // path name separator for path name -``` - -An alternate implementation might be defined as follows: - -``` -class File implements java.io.Serializable { - ... - private String[] pathcomponents; - // Define serializable fields with the ObjectStreamClass - - /** - * @serialField path String - * Path components separated by separator. - */ - - private static final ObjectStreamField[] serialPersistentFields - = { new ObjectStreamField("path", String.class) }; - ... - /** - * @serialData Default fields followed by separator character. - */ - - private void writeObject(ObjectOutputStream s) - throws IOException - { - ObjectOutputStream.PutField fields = s.putFields(); - StringBuffer str = new StringBuffer(); - for(int i = 0; i < pathcomponents; i++) { - str.append(separator); - str.append(pathcomponents[i]); - } - fields.put("path", str.toString()); - s.writeFields(); - s.writeChar(separatorChar); // Add the separator character - } - ... - - private void readObject(ObjectInputStream s) - throws IOException - { - ObjectInputStream.GetField fields = s.readFields(); - String path = (String)fields.get("path", null); - ... - char sep = s.readChar(); // read the previous separator char - - // parse path into components using the separator - // and store into pathcomponents array. - } -} -``` - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/exceptions.md b/jdk/src/java.base/share/specs/serialization/exceptions.md deleted file mode 100644 index a476d62c8a8..00000000000 --- a/jdk/src/java.base/share/specs/serialization/exceptions.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](security.html) | [NEXT](examples.html)' -include-after: '[CONTENTS](index.html) | [PREV](security.html) | [NEXT](examples.html)' - -title: 'Java Object Serialization Specification: B - Exceptions In Object Serialization' ---- - -------------------------------------------------------------------------------- - -All exceptions thrown by serialization classes are subclasses of -`ObjectStreamException` which is a subclass of `IOException`. - -### `ObjectStreamException` - -Superclass of all serialization exceptions. - -### `InvalidClassException` - -Thrown when a class cannot be used to restore objects for any of these reasons: - -- The class does not match the serial version of the class in the stream. -- The class contains fields with invalid primitive data types. -- The `Externalizable` class does not have a public no-arg constructor. -- The `Serializable` class can not access the no-arg constructor of its - closest non-Serializable superclass. - -### `NotSerializableException` - -Thrown by a `readObject` or `writeObject` method to terminate serialization or -deserialization. - -### `StreamCorruptedException` - -Thrown: - -- If the stream header is invalid. -- If control information not found. -- If control information is invalid. -- JDK 1.1.5 or less attempts to call `readExternal` on a `PROTOCOL_VERSION_2` - stream. - -### `NotActiveException` - -Thrown if `writeObject` state is invalid within the following -`ObjectOutputStream` methods: - -- `defaultWriteObject` -- `putFields` -- `writeFields` - -Thrown if `readObject` state is invalid within the following -`ObjectInputStream` methods: - -- `defaultReadObject` -- `readFields` -- `registerValidation` - -### `InvalidObjectException` - -Thrown when a restored object cannot be made valid. - -### `OptionalDataException` - -Thrown by `readObject` when there is primitive data in the stream and an object -is expected. The length field of the exception indicates the number of bytes -that are available in the current block. - -### `WriteAbortedException` - -Thrown when reading a stream terminated by an exception that occurred while the -stream was being written. - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/images/version.gif b/jdk/src/java.base/share/specs/serialization/images/version.gif deleted file mode 100644 index 79be14380d4fdb47fe961bd8cadb207aa73f5cdb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3325 zcmeH``8yQ;7RNs`s;`tK6_QjWhLEz8x)R1($ub&S_NB39tjSVLls!usCHppGW|)~Q zQ@&)Mv2Ph6l`UgQh?vXwKF|FR?r-<}aGvM$`Mf``_c`ZzjvicBRmCA6A_iFpd% f!bVE232o{~)iG!|IG z0DVOO{S2NZfx1QjhydUK!0z$>1N(6USn2E@g#mB@2WJ3?1^!8py+_sm%Ao+NE@9-f ztAZHqCJyRu5etAj0thIA%ym$s2n1*#asgOH0KfsL|FC$$Of>*m0K{`Zcp5?Zo-qdp z-~>PhfU}-J2mlxW?f@L#WeI>Y09*n<2?)~w<_Gw*1ca3UrWXt+?RF_73<<+Pzz2W< zY#~4k06%U5YS ^gJw^_PZR#aav4~fY2Ht*7KCPPoQ`j#HWHykoFYzG2qXjm za1-pA>{dPjz;Ce2+8ymbO@o;j0Db}qRRER%q!rMhV95?#EZ@~OE&<{NfLj7U${T=# zKn#F<@c;OqPvF9y!`?0c&K
uxqUG6sZJt_Xzp1u6GIs@@WqD51AzD|D-_NQt?<=?* zt&6etnD4)3r <5MQk3=pWaf{MvRQX?^th zkc4hmXn+P{)Q_+ei#Ng6&8=|Xni`;L uDG2 zeoh
-M-s2REMlGo~UV{I~A*(vw=*~_(IK3Q9c0s zdgo_})YNkstyT$)jUVj$WBZ*Tag6X>QAUub@alMmL-Rq`Z0Ab|N373Vm{?RN_w2b8 zTj{5gnT|PXMQL}*t;rz)1hpY;Z>~*A*GL03$y}LBPbJ@Gp+mmK^JUFC6=w2mI!8pJ ztV@a*PlPk_c18k%>@%OX!>0?1Kb4eXpVYLvVyGS^^96Cr!Dn-?Bz#H^h#(Akg+J_t zd6YJ-#fiV5+#9uj*#|Lnt{7j@cXYTc7MfY$$TOUe?{ucxR}Dp-#8W4sYH#1E&&^C% z4-*fSMoBysmX0%WR!jK+@J(k;2KOT` ^^G0Vlyb|%%Gm(4bdl*Hb}HgiQXQ&3`t zbJ7iMxzl!D(zUaQj=F>cKO4vB$Q45sl9v@@|IZ&Ok)+>sgzg)V1>qi@6JsxW)6U8s z?X&+^J*iIxq4q0Kbll?WAX3G^YREno`>PXn%NX74Dvu?5dU`6MNA>HuReWxDZKpEP zLl%KMpEW1xf!^Wl1+$4L!TSM|fu|ETZgt7!s7@yEeh&KjP{t$}m1?J@`1PeXDtOwo zg==#vD^WCLwlH)jcuqW?QDcIqvEIxRy;W@&uC^r9F4QdId=_bzr! $V0O-`D=> z>9ecdrcbeJc0QG{>)Fzic60kwHK7TN2-0=m;1GbDvVzm9&bFJ!Ja*U|LM*B%c zPIaCgdh|;UhtE3tYWxiPV^028T<^%Qj@MM`lua_-oiGLU1>G^I>$ySbLZy#0-Qqi{ z`$XKL^i@{*e5LgM81TPXY5X}`?reN`WF%bZhUB1EoN3jF<6z9+(r;y*k!c7a{4kko zpXi5*Prj_SHge4)a=&50lJfaX~rbX;z+>&);6GwHFDnSh4cX7HW$|Zco~9# z7|aU~sBnGgdE1i95)SPue^4Q#_{$nj T@zXkt$ZJ^TJx!A$`-Eig+Wdhr) z{Hnwu#H>C#`FX_;K3FJX-G@wSLYBK!Y$Ccv*9e8&&4@ap$$UgpJq~X=4FR9OAvMt>=D~_;~CNF zSzNMoU?udkcS!%7(K`nDJ>sk6-BWcFbuktVEQy>0ydy?I=#7SVW_;VCuy*}8#hSQ% zgjGHf#y-k$lIe}*%aeL1|C9)Znrio5Dv_R2>QQZReOaJ!P+971OLYsZkZ@^#(3Bf= zjxwOR9J?IUI~cXn*7{K*Jam@s{kK9A1NzezkF2mn1%I?b744Y9>Rh;L 77w} zo9%zHnuA2D`|^wBGIHqdVoHYZ$VZ&ZR<_8w>nid%6wBAuc;0$+bCAlY#s$*nZMQau zKJbt$V~u~@JGnL7YC jj$kgJM}7d-B6eHvzv$rSnmDs*dff`>wFF=qL_ z+G5U_P-=$gEOhPG7)#e?t$*LQLzcKvv)hE%3Zoa_1cgL|@Hn4j3tzkT<&_b#x<7&y zfUmrVK>ogzTF*~f@-OMQw#MbxIRAr?Fdsi^xVcfagLalpiD%vszuHf=5be3`l6?pM zMX-Z(_`Vc(*-b$Ms{ZSjxDJsxteReWrq*Ry+k@NF*YSaLbHh>-2yE6T%&H(qPV&s@ z`WXp9i}(bTOfmaaiPn1h+jF#lVm+*RzcsO^9`_65fL-vh)1W`qFcQGWG0Z8MReU&! zG(+ZBg`usw-s2n6#xS@VUg;^VPCnkX+VC(%MzW{c2iJ_ccz9g(yT3Uuw_UU4h{{O0 zxjO}~(w!c5d3)=8hO6Og^^x^kSL$3%w?2*TtWmq_S%FJF3w%h%vV~e+ZK6F#0-wYl{D>weC7GBZCMBACZ;R7nG*bPc|J#RBI9>WLN$z3 zCjH&oG`M?9qB84{=+|wYg#q{UpzMtLxsNO7?q>vF5e(cXg+hG~1H%urdIQ{w{8$wK z1H&?bEfG9IDA)m`7prJwOGN*)WP)p?4&{;l^n;fxk9spg!W@DvfB8mFM><-bcPg@W zca3c56_<03Qb-Lq(7S(P#%Et|@NvoTWLE<*E4ic7!6*KDl>No`OO;9anpcIMN3?R_ z_*zKn0oi@TFoOp=gp4SpP|Q8m7$>V3m!KH8%oq=9jMs1sY9q!+DArFk_JLI_Iw&^C K4F!P!jei3m3YZ4~ diff --git a/jdk/src/java.base/share/specs/serialization/index.md b/jdk/src/java.base/share/specs/serialization/index.md deleted file mode 100644 index 1ad49f7cbdc..00000000000 --- a/jdk/src/java.base/share/specs/serialization/index.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: 'CONTENTS | PREV | [NEXT](serial-arch.html)' -include-after: 'CONTENTS | PREV | [NEXT](serial-arch.html)' - -title: 'Java Object Serialization Specification: Contents' ---- - -------------------------------------------------------------------------------- - -## Table of Contents - -### 1 [System Architecture](serial-arch.html) - -- 1.1 [Overview](serial-arch.html#overview) -- 1.2 [Writing to an Object - Stream](serial-arch.html#writing-to-an-object-stream) -- 1.3 [Reading from an Object - Stream](serial-arch.html#reading-from-an-object-stream) -- 1.4 [Object Streams as - Containers](serial-arch.html#object-streams-as-containers) -- 1.5 [Defining Serializable Fields for a - Class](serial-arch.html#defining-serializable-fields-for-a-class) -- 1.6 [Documenting Serializable Fields and Data for a - Class](serial-arch.html#documenting-serializable-fields-and-data-for-a-class) -- 1.7 [Accessing Serializable Fields of a - Class](serial-arch.html#accessing-serializable-fields-of-a-class) -- 1.8 [The ObjectOutput - Interface](serial-arch.html#the-objectoutput-interface) -- 1.9 [The ObjectInput Interface](serial-arch.html#the-objectinput-interface) -- 1.10 [The Serializable - Interface](serial-arch.html#the-serializable-interface) -- 1.11 [The Externalizable - Interface](serial-arch.html#the-externalizable-interface) -- 1.12 [Serialization of Enum - Constants](serial-arch.html#serialization-of-enum-constants) -- 1.13 [Protecting Sensitive - Information](serial-arch.html#protecting-sensitive-information) - -### 2 [Object Output Classes](output.html) - -- 2.1 [The ObjectOutputStream - Class](output.html#the-objectoutputstream-class) -- 2.2 [The ObjectOutputStream.PutField - Class](output.html#the-objectoutputstream.putfield-class) -- 2.3 [The writeObject Method](output.html#the-writeobject-method) -- 2.4 [The writeExternal Method](output.html#the-writeexternal-method) -- 2.5 [The writeReplace Method](output.html#the-writereplace-method) -- 2.6 [The useProtocolVersion - Method](output.html#the-useprotocolversion-method) - -### 3 [Object Input Classes](input.html) - -- 3.1 [The ObjectInputStream Class](input.html#the-objectinputstream-class) -- 3.2 [The ObjectInputStream.GetField - Class](input.html#the-objectinputstream.getfield-class) -- 3.3 [The ObjectInputValidation - Interface](input.html#the-objectinputvalidation-interface) -- 3.4 [The readObject Method](input.html#the-readobject-method) -- 3.5 [The readObjectNoData Method](input.html#the-readobjectnodata-method) -- 3.6 [The readExternal Method](input.html#the-readexternal-method) -- 3.7 [The readResolve Method](input.html#the-readresolve-method) - -### 4 [Class Descriptors](class.html) - -- 4.1 [The ObjectStreamClass Class](class.html#the-objectstreamclass-class) -- 4.2 [Dynamic Proxy Class - Descriptors](class.html#dynamic-proxy-class-descriptors) -- 4.3 [Serialized Form](class.html#serialized-form) -- 4.4 [The ObjectStreamField Class](class.html#the-objectstreamfield-class) -- 4.5 [Inspecting Serializable - Classes](class.html#inspecting-serializable-classes) -- 4.6 [Stream Unique Identifiers](class.html#stream-unique-identifiers) - -### 5 [Versioning of Serializable Objects](version.html) - -- 5.1 [Overview](version.html#overview) -- 5.2 [Goals](version.html#goals) -- 5.3 [Assumptions](version.html#assumptions) -- 5.4 [Who's Responsible for Versioning of - Streams](version.html#whos-responsible-for-versioning-of-streams) -- 5.5 [Compatible Java Type - Evolution](version.html#compatible-java-type-evolution) -- 5.6 [Type Changes Affecting - Serialization](version.html#type-changes-affecting-serialization) - - 5.6.1 [Incompatible Changes](version.html#incompatible-changes) - - 5.6.2 [Compatible Changes](version.html#compatible-changes) - -### 6 [Object Serialization Stream Protocol](protocol.html) - -- 6.1 [Overview](protocol.html#overview) -- 6.2 [Stream Elements](protocol.html#stream-elements) -- 6.3 [Stream Protocol Versions](protocol.html#stream-protocol-versions) -- 6.4 [Grammar for the Stream - Format](protocol.html#grammar-for-the-stream-format) - - 6.4.1 [Rules of the Grammar](protocol.html#rules-of-the-grammar) - - 6.4.2 [Terminal Symbols and - Constants](protocol.html#terminal-symbols-and-constants) - -### A [Security in Object Serialization](security.html) - -### B [Exceptions In Object Serialization](exceptions.html) - -### C [Example of Serializable Fields](examples.html) - -- [C.1 Example Alternate Implementation of - `java.io.File`](examples.html#c.1-example-alternate-implementation-of-java.io.file) - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/input.md b/jdk/src/java.base/share/specs/serialization/input.md deleted file mode 100644 index dd3e2b21a35..00000000000 --- a/jdk/src/java.base/share/specs/serialization/input.md +++ /dev/null @@ -1,672 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](output.html) | [NEXT](class.html)' -include-after: '[CONTENTS](index.html) | [PREV](output.html) | [NEXT](class.html)' - -title: 'Java Object Serialization Specification: 3 - Object Input Classes' ---- - -- [The ObjectInputStream Class](#the-objectinputstream-class) -- [The ObjectInputStream.GetField - Class](#the-objectinputstream.getfield-class) -- [The ObjectInputValidation Interface](#the-objectinputvalidation-interface) -- [The readObject Method](#the-readobject-method) -- [The readExternal Method](#the-readexternal-method) -- [The readResolve Method](#the-readresolve-method) - -------------------------------------------------------------------------------- - -## 3.1 The ObjectInputStream Class - -Class `ObjectInputStream` implements object deserialization. It maintains the -state of the stream including the set of objects already deserialized. Its -methods allow primitive types and objects to be read from a stream written by -`ObjectOutputStream`. It manages restoration of the object and the objects that -it refers to from the stream. - -``` -package java.io; - -public class ObjectInputStream - extends InputStream - implements ObjectInput, ObjectStreamConstants -{ - public ObjectInputStream(InputStream in) - throws StreamCorruptedException, IOException; - - public final Object readObject() - throws OptionalDataException, ClassNotFoundException, - IOException; - - public Object readUnshared() - throws OptionalDataException, ClassNotFoundException, - IOException; - - public void defaultReadObject() - throws IOException, ClassNotFoundException, - NotActiveException; - - public GetField readFields() - throws IOException; - - public synchronized void registerValidation( - ObjectInputValidation obj, int prio) - throws NotActiveException, InvalidObjectException; - - protected ObjectStreamClass readClassDescriptor() - throws IOException, ClassNotFoundException; - - protected Class resolveClass(ObjectStreamClass v) - throws IOException, ClassNotFoundException; - - protected Object resolveObject(Object obj) - throws IOException; - - protected boolean enableResolveObject(boolean enable) - throws SecurityException; - - protected void readStreamHeader() - throws IOException, StreamCorruptedException; - - public int read() throws IOException; - - public int read(byte[] data, int offset, int length) - throws IOException - - public int available() throws IOException; - - public void close() throws IOException; - - public boolean readBoolean() throws IOException; - - public byte readByte() throws IOException; - - public int readUnsignedByte() throws IOException; - - public short readShort() throws IOException; - - public int readUnsignedShort() throws IOException; - - public char readChar() throws IOException; - - public int readInt() throws IOException; - - public long readLong() throws IOException; - - public float readFloat() throws IOException; - - public double readDouble() throws IOException; - - public void readFully(byte[] data) throws IOException; - - public void readFully(byte[] data, int offset, int size) - throws IOException; - - public int skipBytes(int len) throws IOException; - - public String readLine() throws IOException; - - public String readUTF() throws IOException; - - // Class to provide access to serializable fields. - static abstract public class GetField - { - public ObjectStreamClass getObjectStreamClass(); - - public boolean defaulted(String name) - throws IOException, IllegalArgumentException; - - public char get(String name, char default) - throws IOException, IllegalArgumentException; - - public boolean get(String name, boolean default) - throws IOException, IllegalArgumentException; - - public byte get(String name, byte default) - throws IOException, IllegalArgumentException; - - public short get(String name, short default) - throws IOException, IllegalArgumentException; - - public int get(String name, int default) - throws IOException, IllegalArgumentException; - - public long get(String name, long default) - throws IOException, IllegalArgumentException; - - public float get(String name, float default) - throws IOException, IllegalArgumentException; - - public double get(String name, double default) - throws IOException, IllegalArgumentException; - - public Object get(String name, Object default) - throws IOException, IllegalArgumentException; - } - - protected ObjectInputStream() - throws StreamCorruptedException, IOException; - - protected readObjectOverride() - throws OptionalDataException, ClassNotFoundException, - IOException; -} -``` - -The single-argument `ObjectInputStream` constructor requires an `InputStream`. -The constructor calls `readStreamHeader` to read and verifies the header and -version written by the corresponding `ObjectOutputStream.writeStreamHeader` -method. If a security manager is installed, this constructor checks for the -`"enableSubclassImplementation"` `SerializablePermission` when invoked directly -or indirectly by the constructor of a subclass which overrides the `readFields` -and/or `readUnshared` methods. - -**Note:** The `ObjectInputStream` constructor blocks until it completes reading -the serialization stream header. Code which waits for an `ObjectInputStream` to -be constructed before creating the corresponding `ObjectOutputStream` for that -stream will deadlock, since the `ObjectInputStream` constructor will block -until a header is written to the stream, and the header will not be written to -the stream until the `ObjectOutputStream` constructor executes. This problem -can be resolved by creating the `ObjectOutputStream` before the -`ObjectInputStream`, or otherwise removing the timing dependency between -completion of `ObjectInputStream` construction and the creation of the -`ObjectOutputStream`. - -The `readObject` method is used to deserialize an object from the stream. It -reads from the stream to reconstruct an object. - -1. If the `ObjectInputStream` subclass is overriding the implementation, call - the `readObjectOverride` method and return. Reimplementation is described - at the end of this section. - -2. If a block data record occurs in the stream, throw a `BlockDataException` - with the number of available bytes. - -3. If the object in the stream is null, return null. - -4. If the object in the stream is a handle to a previous object, return the - object. - -5. If the object in the stream is a `Class`, read its `ObjectStreamClass` - descriptor, add it and its handle to the set of known objects, and return - the corresponding `Class` object. - -6. If the object in the stream is an `ObjectStreamClass`, read in its data - according to the formats described in [Section 4.3, "Serialized - Form"](class.html#serialized-form). Add it and its handle to the set of - known objects. In versions 1.3 and later of the Java 2 SDK, Standard - Edition, the `readClassDescriptor` method is called to read in the - `ObjectStreamClass` if it represents a class that is not a dynamic proxy - class, as indicated in the stream data. If the class descriptor represents - a dynamic proxy class, call the `resolveProxyClass` method on the stream to - get the local class for the descriptor; otherwise, call the `resolveClass` - method on the stream to get the local class. If the class cannot be - resolved, throw a ClassNotFoundException. Return the resulting - `ObjectStreamClass` object. - -7. If the object in the stream is a `String`, read its length information - followed by the contents of the string encoded in modified UTF-8. For - details, refer to [Section 6.2, "Stream - Elements"](protocol.html#stream-elements). Add the `String` and its handle - to the set of known objects, and proceed to Step 12. - -8. If the object in the stream is an array, read its `ObjectStreamClass` and - the length of the array. Allocate the array, and add it and its handle in - the set of known objects. Read each element using the appropriate method - for its type and assign it to the array. Proceed to Step 12. - -9. If the object in the stream is an enum constant, read its - `ObjectStreamClass` and the enum constant name. If the `ObjectStreamClass` - represents a class that is not an enum type, an `InvalidClassException` is - thrown. Obtain a reference to the enum constant by calling the - `java.lang.Enum.valueOf` method, passing the enum type bound to the - received `ObjectStreamClass` along with the received name as arguments. If - the `valueOf` method throws an `IllegalArgumentException`, an - `InvalidObjectException` is thrown with the `IllegalArgumentException` as - its cause. Add the enum constant and its handle in the set of known - objects, and proceed to Step 12. - -10. For all other objects, the `ObjectStreamClass` of the object is read from - the stream. The local class for that `ObjectStreamClass` is retrieved. The - class must be serializable or externalizable, and must not be an enum type. - If the class does not satisfy these criteria, an `InvalidClassException` is - thrown. - -11. An instance of the class is allocated. The instance and its handle are - added to the set of known objects. The contents restored appropriately: - - a. For serializable objects, the no-arg constructor for the first - non-serializable supertype is run. For serializable classes, the fields - are initialized to the default value appropriate for its type. Then the - fields of each class are restored by calling class-specific - `readObject` methods, or if these are not defined, by calling the - `defaultReadObject` method. Note that field initializers and - constructors are not executed for serializable classes during - deserialization. In the normal case, the version of the class that - wrote the stream will be the same as the class reading the stream. In - this case, all of the supertypes of the object in the stream will match - the supertypes in the currently-loaded class. If the version of the - class that wrote the stream had different supertypes than the loaded - class, the `ObjectInputStream` must be more careful about restoring or - initializing the state of the differing classes. It must step through - the classes, matching the available data in the stream with the classes - of the object being restored. Data for classes that occur in the - stream, but do not occur in the object, is discarded. For classes that - occur in the object, but not in the stream, the class fields are set to - default values by default serialization. - - b. For externalizable objects, the no-arg constructor for the class is run - and then the `readExternal` method is called to restore the contents of - the object. - -12. Process potential substitutions by the class of the object and/or by a - subclass of `ObjectInputStream`: - - a. If the class of the object is not an enum type and defines the - appropriate `readResolve` method, the method is called to allow the - object to replace itself. - - b. Then if previously enabled by `enableResolveObject,` the - `resolveObject` method is called to allow subclasses of the stream to - examine and replace the object. If the previous step did replace the - original object, the `resolveObject` method is called with the - replacement object. If a replacement took place, the table of known - objects is updated so the replacement object is associated with the - handle. The replacement object is then returned from `readObject`. - -All of the methods for reading primitives types only consume bytes from the -block data records in the stream. If a read for primitive data occurs when the -next item in the stream is an object, the read methods return *-1* or the -`EOFException` as appropriate. The value of a primitive type is read by a -`DataInputStream` from the block data record. - -The exceptions thrown reflect errors during the traversal or exceptions that -occur on the underlying stream. If any exception is thrown, the underlying -stream is left in an unknown and unusable state. - -When the reset token occurs in the stream, all of the state of the stream is -discarded. The set of known objects is cleared. - -When the exception token occurs in the stream, the exception is read and a new -`WriteAbortedException` is thrown with the terminating exception as an -argument. The stream context is reset as described earlier. - -The `readUnshared` method is used to read "unshared" objects from the stream. -This method is identical to `readObject`, except that it prevents subsequent -calls to `readObject` and `readUnshared` from returning additional references -to the deserialized instance returned by the original call to `readUnshared`. -Specifically: - -- If `readUnshared` is called to deserialize a back-reference (the stream - representation of an object which has been written previously to the - stream), an `ObjectStreamException` will be thrown. - -- If `readUnshared` returns successfully, then any subsequent attempts to - deserialize back-references to the stream handle deserialized by - `readUnshared` will cause an `ObjectStreamException` to be thrown. - -Deserializing an object via `readUnshared` invalidates the stream handle -associated with the returned object. Note that this in itself does not always -guarantee that the reference returned by `readUnshared` is unique; the -deserialized object may define a `readResolve` method which returns an object -visible to other parties, or `readUnshared` may return a `Class` object or enum -constant obtainable elsewhere in the stream or through external means. If the -deserialized object defines a `readResolve` method and the invocation of that -method returns an array, then `readUnshared` returns a shallow clone of that -array; this guarantees that the returned array object is unique and cannot be -obtained a second time from an invocation of `readObject` or `readUnshared` on -the `ObjectInputStream`, even if the underlying data stream has been -manipulated. - -The `defaultReadObject` method is used to read the fields and object from the -stream. It uses the class descriptor in the stream to read the fields in the -canonical order by name and type from the stream. The values are assigned to -the matching fields by name in the current class. Details of the versioning -mechanism can be found in [Section 5.5, "Compatible Java Type -Evolution"](version.html#compatible-java-type-evolution). Any field of the -object that does not appear in the stream is set to its default value. Values -that appear in the stream, but not in the object, are discarded. This occurs -primarily when a later version of a class has written additional fields that do -not occur in the earlier version. This method may only be called from the -`readObject` method while restoring the fields of a class. When called at any -other time, the `NotActiveException` is thrown. - -The `readFields` method reads the values of the serializable fields from the -stream and makes them available via the `GetField` class. The `readFields` -method is only callable from within the `readObject` method of a serializable -class. It cannot be called more than once or if `defaultReadObject` has been -called. The `GetFields` object uses the current object's `ObjectStreamClass` to -verify the fields that can be retrieved for this class. The `GetFields` object -returned by `readFields` is only valid during this call to the classes -`readObject` method. The fields may be retrieved in any order. Additional data -may only be read directly from stream after `readFields` has been called. - -The `registerValidation` method can be called to request a callback when the -entire graph has been restored but before the object is returned to the -original caller of `readObject`. The order of validate callbacks can be -controlled using the priority. Callbacks registered with higher values are -called before those with lower values. The object to be validated must support -the `ObjectInputValidation` interface and implement the `validateObject` -method. It is only correct to register validations during a call to a class's -`readObject` method. Otherwise, a `NotActiveException` is thrown. If the -callback object supplied to `registerValidation` is null, an -`InvalidObjectException` is thrown. - -Starting with the Java SDK, Standard Edition, v1.3, the `readClassDescriptor` -method is used to read in all `ObjectStreamClass` objects. -`readClassDescriptor` is called when the `ObjectInputStream` expects a class -descriptor as the next item in the serialization stream. Subclasses of -`ObjectInputStream` may override this method to read in class descriptors that -have been written in non-standard formats (by subclasses of -`ObjectOutputStream` which have overridden the `writeClassDescriptor` method). -By default, this method reads class descriptors according to the format -described in [Section 6.4, "Grammar for the Stream -Format"](protocol.html#grammar-for-the-stream-format). - -The `resolveClass` method is called while a class is being deserialized, and -after the class descriptor has been read. Subclasses may extend this method to -read other information about the class written by the corresponding subclass of -`ObjectOutputStream`. The method must find and return the class with the given -name and `serialVersionUID`. The default implementation locates the class by -calling the class loader of the closest caller of `readObject` that has a class -loader. If the class cannot be found `ClassNotFoundException` should be thrown. -Prior to JDK 1.1.6, the `resolveClass` method was required to return the same -fully qualified class name as the class name in the stream. In order to -accommodate package renaming across releases, `method` `resolveClass` only -needs to return a class with the same base class name and `SerialVersionUID` in -JDK 1.1.6 and later versions. - -The `resolveObject` method is used by trusted subclasses to monitor or -substitute one object for another during deserialization. Resolving objects -must be enabled explicitly by calling `enableResolveObject` before calling -`readObject` for the first object to be resolved. Once enabled, `resolveObject` -is called once for each serializable object just prior to the first time it is -being returned from `readObject`. Note that the `resolveObject` method is not -called for objects of the specially handled classes, `Class`, -`ObjectStreamClass`, `String`, and arrays. A subclass's implementation of -`resolveObject` may return a substitute object that will be assigned or -returned instead of the original. The object returned must be of a type that is -consistent and assignable to every reference of the original object or else a -`ClassCastException` will be thrown. All assignments are type-checked. All -references in the stream to the original object will be replaced by references -to the substitute object. - -The `enableResolveObject` method is called by trusted subclasses of -`ObjectOutputStream` to enable the monitoring or substitution of one object for -another during deserialization. Replacing objects is disabled until -`enableResolveObject` is called with a `true` value. It may thereafter be -disabled by setting it to `false`. The previous setting is returned. The -`enableResolveObject` method checks if the stream has permission to request -substitution during serialization. To ensure that the private state of objects -is not unintentionally exposed, only trusted streams may use `resolveObject`. -Trusted classes are those classes with a class loader equal to null or belong -to a security protection domain that provides permission to enable -substitution. - -If the subclass of `ObjectInputStream` is not considered part of the system -domain, a line has to be added to the security policy file to provide to a -subclass of `ObjectInputStream` permission to call `enableResolveObject`. The -`SerializablePermission` to add is `"enableSubstitution"`. -`AccessControlException` is thrown if the protection domain of the subclass of -`ObjectStreamClass` does not have permission to `"enableSubstitution"` by -calling `enableResolveObject`. See the document Java Security Architecture (JDK -1.2) for additional information about the security model. - -The `readStreamHeader` method reads and verifies the magic number and version -of the stream. If they do not match, the `StreamCorruptedMismatch` is thrown. - -To override the implementation of deserialization, a subclass of -`ObjectInputStream` should call the protected no-arg `ObjectInputStream`, -constructor. There is a security check within the no-arg constructor for -`SerializablePermission "enableSubclassImplementation"` to ensure that only -trusted classes are allowed to override the default implementation. This -constructor does not allocate any private data for `ObjectInputStream` and sets -a flag that indicates that the final `readObject` method should invoke the -`readObjectOverride` method and return. All other `ObjectInputStream` methods -are not final and can be directly overridden by the subclass. - -## 3.2 The ObjectInputStream.GetField Class - -The class `ObjectInputStream.GetField` provides the API for getting the values -of serializable fields. The protocol of the stream is the same as used by -`defaultReadObject.` Using `readFields` to access the serializable fields does -not change the format of the stream. It only provides an alternate API to -access the values which does not require the class to have the corresponding -non-transient and non-static fields for each named serializable field. The -serializable fields are those declared using `serialPersistentFields` or if it -is not declared the non-transient and non-static fields of the object. When the -stream is read the available serializable fields are those written to the -stream when the object was serialized. If the class that wrote the stream is a -different version not all fields will correspond to the serializable fields of -the current class. The available fields can be retrieved from the -`ObjectStreamClass` of the `GetField` object. - -The `getObjectStreamClass` method returns an `ObjectStreamClass` object -representing the class in the stream. It contains the list of serializable -fields. - -The `defaulted` method returns *true* if the field is not present in the -stream. An `IllegalArgumentException` is thrown if the requested field is not a -serializable field of the current class. - -Each `get` method returns the specified serializable field from the stream. I/O -exceptions will be thrown if the underlying stream throws an exception. An -`IllegalArgumentException` is thrown if the name or type does not match the -name and type of an field serializable field of the current class. The default -value is returned if the stream does not contain an explicit value for the -field. - -## 3.3 The ObjectInputValidation Interface - -This interface allows an object to be called when a complete graph of objects -has been deserialized. If the object cannot be made valid, it should throw the -`ObjectInvalidException`. Any exception that occurs during a call to -`validateObject` will terminate the validation process, and the -`InvalidObjectException` will be thrown. - -``` -package java.io; - -public interface ObjectInputValidation -{ - public void validateObject() - throws InvalidObjectException; -} -``` - -## 3.4 The readObject Method - -For serializable objects, the `readObject` method allows a class to control the -deserialization of its own fields. Here is its signature: - -``` -private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException; -``` - -Each subclass of a serializable object may define its own `readObject` method. -If a class does not implement the method, the default serialization provided by -`defaultReadObject` will be used. When implemented, the class is only -responsible for restoring its own fields, not those of its supertypes or -subtypes. - -The `readObject` method of the class, if implemented, is responsible for -restoring the state of the class. The values of every field of the object -whether transient or not, static or not are set to the default value for the -fields type. Either `ObjectInputStream`'s `defaultReadObject` or `readFields` -method must be called once (and only once) before reading any optional data -written by the corresponding `writeObject` method; even if no optional data is -read, `defaultReadObject` or `readFields` must still be invoked once. If the -`readObject` method of the class attempts to read more data than is present in -the optional part of the stream for this class, the stream will return `-1` for -bytewise reads, throw an `EOFException` for primitive data reads (e.g., -`readInt`, `readFloat`), or throw an `OptionalDataException` with the `eof` -field set to `true` for object reads. - -The responsibility for the format, structure, and versioning of the optional -data lies completely with the class. The `@serialData` javadoc tag within the -javadoc comment for the `readObject` method should be used to document the -format and structure of the optional data. - -If the class being restored is not present in the stream being read, then its -`readObjectNoData` method, if defined, is invoked (instead of `readObject`); -otherwise, its fields are initialized to the appropriate default values. For -further detail, see [Section 3.5, "The readObjectNoData -Method"](#the-readobjectnodata-method). - -Reading an object from the `ObjectInputStream` is analogous to creating a new -object. Just as a new object's constructors are invoked in the order from the -superclass to the subclass, an object being read from a stream is deserialized -from superclass to subclass. The `readObject` or `readObjectNoData` method is -called instead of the constructor for each `Serializable` subclass during -deserialization. - -One last similarity between a constructor and a `readObject` method is that -both provide the opportunity to invoke a method on an object that is not fully -constructed. Any overridable (neither private, static nor final) method called -while an object is being constructed can potentially be overridden by a -subclass. Methods called during the construction phase of an object are -resolved by the actual type of the object, not the type currently being -initialized by either its constructor or `readObject`/`readObjectNoData` -method. Therefore, calling an overridable method from within a `readObject` or -`readObjectNoData` method may result in the unintentional invocation of a -subclass method before the superclass has been fully initialized. - -## 3.5 The readObjectNoData Method - -For serializable objects, the `readObjectNoData` method allows a class to -control the initialization of its own fields in the event that a subclass -instance is deserialized and the serialization stream does not list the class -in question as a superclass of the deserialized object. This may occur in cases -where the receiving party uses a different version of the deserialized -instance's class than the sending party, and the receiver's version extends -classes that are not extended by the sender's version. This may also occur if -the serialization stream has been tampered; hence, `readObjectNoData` is useful -for initializing deserialized objects properly despite a "hostile" or -incomplete source stream. - -``` -private void readObjectNoData() throws ObjectStreamException; -``` - -Each serializable class may define its own `readObjectNoData` method. If a -serializable class does not define a `readObjectNoData` method, then in the -circumstances listed above the fields of the class will be initialized to their -default values (as listed in The Java Language Specification); this behavior is -consistent with that of `ObjectInputStream` prior to version 1.4 of the Java 2 -SDK, Standard Edition, when support for `readObjectNoData` methods was -introduced. If a serializable class does define a `readObjectNoData` method and -the aforementioned conditions arise, then `readObjectNoData` will be invoked at -the point during deserialization when a class-defined `readObject` method would -otherwise be called had the class in question been listed by the stream as a -superclass of the instance being deserialized. - -## 3.6 The readExternal Method - -Objects implementing `java.io.Externalizable` must implement the `readExternal` -method to restore the entire state of the object. It must coordinate with its -superclasses to restore their state. All of the methods of `ObjectInput` are -available to restore the object's primitive typed fields and object fields. - -``` -public void readExternal(ObjectInput stream) - throws IOException; -``` - -**Note:** The `readExternal` method is public, and it raises the risk of a -client being able to overwrite an existing object from a stream. The class may -add its own checks to insure that this is only called when appropriate. - -A new stream protocol version has been introduced in JDK 1.2 to correct a -problem with `Externalizable` objects. The old definition of `Externalizable` -objects required the local virtual machine to find a `readExternal` method to -be able to properly read an `Externalizable` object from the stream. The new -format adds enough information to the stream protocol so serialization can skip -an `Externalizable` object when the local `readExternal` method is not -available. Due to class evolution rules, serialization must be able to skip an -`Externalizable` object in the input stream if there is not a mapping for the -object using the local classes. - -An additional benefit of the new `Externalizable` stream format is that -`ObjectInputStream` can detect attempts to read more External data than is -available, and can also skip by any data that is left unconsumed by a -`readExternal` method. The behavior of `ObjectInputStream` in response to a -read past the end of External data is the same as the behavior when a -class-defined `readObject` method attempts to read past the end of its optional -data: bytewise reads will return `-1`, primitive reads will throw -`EOFException`s, and object reads will throw `OptionalDataException`s with the -`eof` field set to `true`. - -Due to the format change, JDK 1.1.6 and earlier releases are not able to read -the new format. `StreamCorruptedException` is thrown when JDK 1.1.6 or earlier -attempts to read an `Externalizable` object from a stream written in -`PROTOCOL_VERSION_2`. Compatibility issues are discussed in more detail in -[Section 6.3, "Stream Protocol -Versions"](protocol.html#stream-protocol-versions). - -## 3.7 The readResolve Method - -For Serializable and Externalizable classes, the `readResolve` method allows a -class to replace/resolve the object read from the stream before it is returned -to the caller. By implementing the `readResolve` method, a class can directly -control the types and instances of its own instances being deserialized. The -method is defined as follows: - -``` -ANY-ACCESS-MODIFIER Object readResolve() - throws ObjectStreamException; -``` - -The `readResolve` method is called when `ObjectInputStream` has read an object -from the stream and is preparing to return it to the caller. -`ObjectInputStream` checks whether the class of the object defines the -`readResolve` method. If the method is defined, the `readResolve` method is -called to allow the object in the stream to designate the object to be -returned. The object returned should be of a type that is compatible with all -uses. If it is not compatible, a `ClassCastException` will be thrown when the -type mismatch is discovered. - -For example, a `Symbol` class could be created for which only a single instance -of each symbol binding existed within a virtual machine. The `readResolve` -method would be implemented to determine if that symbol was already defined and -substitute the preexisting equivalent `Symbol` object to maintain the identity -constraint. In this way the uniqueness of `Symbol` objects can be maintained -across serialization. - -**Note:** The `readResolve` method is not invoked on the object until the -object is fully constructed, so any references to this object in its object -graph will not be updated to the new object nominated by `readResolve`. -However, during the serialization of an object with the `writeReplace` method, -all references to the original object in the replacement object's object graph -are replaced with references to the replacement object. Therefore in cases -where an object being serialized nominates a replacement object whose object -graph has a reference to the original object, deserialization will result in an -incorrect graph of objects. Furthermore, if the reference types of the object -being read (nominated by `writeReplace`) and the original object are not -compatible, the construction of the object graph will raise a -`ClassCastException`. - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/output.md b/jdk/src/java.base/share/specs/serialization/output.md deleted file mode 100644 index 46b47cc45e6..00000000000 --- a/jdk/src/java.base/share/specs/serialization/output.md +++ /dev/null @@ -1,514 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](serial-arch.html) | [NEXT](input.html)' -include-after: '[CONTENTS](index.html) | [PREV](serial-arch.html) | [NEXT](input.html)' - -title: 'Java Object Serialization Specification: 2 - Object Output Classes' ---- - -- [The ObjectOutputStream Class](#the-objectoutputstream-class) -- [The ObjectOutputStream.PutField - Class](#the-objectoutputstream.putfield-class) -- [The writeObject Method](#the-writeobject-method) -- [The writeExternal Method](#the-writeexternal-method) -- [The writeReplace Method](#the-writereplace-method) -- [The useProtocolVersion Method](#the-useprotocolversion-method) - -------------------------------------------------------------------------------- - -## 2.1 The ObjectOutputStream Class - -Class `ObjectOutputStream` implements object serialization. It maintains the -state of the stream including the set of objects already serialized. Its -methods control the traversal of objects to be serialized to save the specified -objects and the objects to which they refer. - -``` -package java.io; - -public class ObjectOutputStream - extends OutputStream - implements ObjectOutput, ObjectStreamConstants -{ - public ObjectOutputStream(OutputStream out) - throws IOException; - - public final void writeObject(Object obj) - throws IOException; - - public void writeUnshared(Object obj) - throws IOException; - - public void defaultWriteObject() - throws IOException, NotActiveException; - - public PutField putFields() - throws IOException; - - public writeFields() - throws IOException; - - public void reset() throws IOException; - - protected void annotateClass(Class cl) throws IOException; - - protected void writeClassDescriptor(ObjectStreamClass desc) - throws IOException; - - protected Object replaceObject(Object obj) throws IOException; - - protected boolean enableReplaceObject(boolean enable) - throws SecurityException; - - protected void writeStreamHeader() throws IOException; - - public void write(int data) throws IOException; - - public void write(byte b[]) throws IOException; - - public void write(byte b[], int off, int len) throws IOException; - - public void flush() throws IOException; - - protected void drain() throws IOException; - - public void close() throws IOException; - - public void writeBoolean(boolean data) throws IOException; - - public void writeByte(int data) throws IOException; - - public void writeShort(int data) throws IOException; - - public void writeChar(int data) throws IOException; - - public void writeInt(int data) throws IOException; - - public void writeLong(long data) throws IOException; - - public void writeFloat(float data) throws IOException; - - public void writeDouble(double data) throws IOException; - - public void writeBytes(String data) throws IOException; - - public void writeChars(String data) throws IOException; - - public void writeUTF(String data) throws IOException; - - // Inner class to provide access to serializable fields. - abstract static public class PutField - { - public void put(String name, boolean value) - throws IOException, IllegalArgumentException; - - public void put(String name, char data) - throws IOException, IllegalArgumentException; - - public void put(String name, byte data) - throws IOException, IllegalArgumentException; - - public void put(String name, short data) - throws IOException, IllegalArgumentException; - - public void put(String name, int data) - throws IOException, IllegalArgumentException; - - public void put(String name, long data) - throws IOException, IllegalArgumentException; - - public void put(String name, float data) - throws IOException, IllegalArgumentException; - - public void put(String name, double data) - throws IOException, IllegalArgumentException; - - public void put(String name, Object data) - throws IOException, IllegalArgumentException; - } - - public void useProtocolVersion(int version) throws IOException; - - protected ObjectOutputStream() - throws IOException; - - protected writeObjectOverride() - throws NotActiveException, IOException; -} -``` - -The single-argument `ObjectOutputStream` constructor creates an -`ObjectOutputStream` that serializes objects to the given `OutputStream`. The -constructor calls `writeStreamHeader` to write a magic number and version to -the stream that will be read and verified by a corresponding call to -`readStreamHeader` in the single-argument `ObjectInputStream` constructor. If a -security manager is installed, this constructor checks for the -`"enableSubclassImplementation"` `SerializablePermission` when invoked directly -or indirectly by the constructor of a subclass which overrides the `putFields` -and/or `writeUnshared` methods. - -The `writeObject` method is used to serialize an object to the stream. An -object is serialized as follows: - -1. If a subclass is overriding the implementation, call the - `writeObjectOverride` method and return. Overriding the implementation is - described at the end of this section. - -2. If there is data in the block-data buffer, the data is written to the - stream and the buffer is reset. - -3. If the object is null, null is put in the stream and `writeObject` returns. - -4. If the object has been previously replaced, as described in Step 8, write - the handle of the replacement to the stream and `writeObject` returns. - -5. If the object has already been written to the stream, its handle is written - to the stream and `writeObject` returns. - -6. If the object is a `Class`, the corresponding `ObjectStreamClass` is - written to the stream, a handle is assigned for the class, and - `writeObject` returns. - -7. If the object is an `ObjectStreamClass`, a handle is assigned to the - object, after which it is written to the stream using one of the class - descriptor formats described in [Section 4.3, "Serialized - Form"](class.html#serialized-form). In versions 1.3 and later of the Java 2 - SDK, Standard Edition, the `writeClassDescriptor` method is called to - output the `ObjectStreamClass` if it represents a class that is not a - dynamic proxy class, as determined by passing the associated `Class` object - to the `isProxyClass` method of `java.lang.reflect.Proxy`. Afterwards, an - annotation for the represented class is written: if the class is a dynamic - proxy class, then the `annotateProxyClass` method is called; otherwise, the - `annotateClass` method is called. The `writeObject` method then returns. - -8. Process potential substitutions by the class of the object and/or by a - subclass of `ObjectInputStream`. - - a. If the class of an object is not an enum type and defines the - appropriate `writeReplace` method, the method is called. Optionally, it - can return a substitute object to be serialized. - - b. Then, if enabled by calling the `enableReplaceObject` method, the - `replaceObject` method is called to allow subclasses of - `ObjectOutputStream` to substitute for the object being serialized. If - the original object was replaced in the previous step, the - `replaceObject` method is called with the replacement object. - - If the original object was replaced by either one or both steps above, the - mapping from the original object to the replacement is recorded for later - use in Step 4. Then, Steps 3 through 7 are repeated on the new object. - - If the replacement object is not one of the types covered by Steps 3 - through 7, processing resumes using the replacement object at Step 10. - -9. - If the object is a `java.lang.String,` the string is written as length - information followed by the contents of the string encoded in modified - UTF-8. For details, refer to [Section 6.2, "Stream - Elements"](protocol.html#stream-elements). A handle is assigned to the - string, and `writeObject` returns. - -10. If the object is an array, `writeObject` is called recursively to write the - `ObjectStreamClass` of the array. The handle for the array is assigned. It - is followed by the length of the array. Each element of the array is then - written to the stream, after which `writeObject` returns. - -11. If the object is an enum constant, the `ObjectStreamClass` for the enum - type of the constant is written by recursively calling `writeObject`. It - will appear in the stream only the first time it is referenced. A handle is - assigned for the enum constant. Next, the value returned by the `name` - method of the enum constant is written as a `String` object, as described - in step 9. Note that if the same name string has appeared previously in the - stream, a back reference to it will be written. The `writeObject` method - then returns. - -12. For regular objects, the `ObjectStreamClass` for the class of the object is - written by recursively calling `writeObject`. It will appear in the stream - only the first time it is referenced. A handle is assigned for the object. - -13. The contents of the object are written to the stream. - - a. If the object is serializable, the highest serializable class is - located. For that class, and each derived class, that class's fields - are written. If the class does not have a `writeObject` method, the - `defaultWriteObject` method is called to write the serializable fields - to the stream. If the class does have a `writeObject` method, it is - called. It may call `defaultWriteObject` or `putFields` and - `writeFields` to save the state of the object, and then it can write - other information to the stream. - - b. If the object is externalizable, the `writeExternal` method of the - object is called. - - c. If the object is neither serializable or externalizable, the - `NotSerializableException` is thrown. - -Exceptions may occur during the traversal or may occur in the underlying -stream. For any subclass of `IOException`, the exception is written to the -stream using the exception protocol and the stream state is discarded. If a -second `IOException` is thrown while attempting to write the first exception -into the stream, the stream is left in an unknown state and -`StreamCorruptedException` is thrown from `writeObject`. For other exceptions, -the stream is aborted and left in an unknown and unusable state. - -The `writeUnshared` method writes an "unshared" object to the -`ObjectOutputStream`. This method is identical to `writeObject`, except that it -always writes the given object as a new, unique object in the stream (as -opposed to a back-reference pointing to a previously serialized instance). -Specifically: - -- An object written via `writeUnshared` is always serialized in the same - manner as a newly appearing object (an object that has not been written to - the stream yet), regardless of whether or not the object has been written - previously. - -- If `writeObject` is used to write an object that has been previously - written with `writeUnshared`, the previous `writeUnshared` operation is - treated as if it were a write of a separate object. In other words, - `ObjectOutputStream` will never generate back-references to object data - written by calls to `writeUnshared`. - -While writing an object via `writeUnshared` does not in itself guarantee a -unique reference to the object when it is deserialized, it allows a single -object to be defined multiple times in a stream, so that multiple calls to the -`ObjectInputStream.readUnshared` method (see [Section 3.1, "The -ObjectInputStream Class"](input.html#the-objectinputstream-class)) by the -receiver will not conflict. Note that the rules described above only apply to -the base-level object written with `writeUnshared`, and not to any transitively -referenced sub-objects in the object graph to be serialized. - -The `defaultWriteObject` method implements the default serialization mechanism -for the current class. This method may be called only from a class's -`writeObject` method. The method writes all of the serializable fields of the -current class to the stream. If called from outside the `writeObject` method, -the `NotActiveException` is thrown. - -The `putFields` method returns a `PutField` object the caller uses to set the -values of the serializable fields in the stream. The fields may be set in any -order. After all of the fields have been set, `writeFields` must be called to -write the field values in the canonical order to the stream. If a field is not -set, the default value appropriate for its type will be written to the stream. -This method may only be called from within the `writeObject` method of a -serializable class. It may not be called more than once or if -`defaultWriteObject` has been called. Only after `writeFields` has been called -can other data be written to the stream. - -The `reset` method resets the stream state to be the same as if it had just -been constructed. `Reset` will discard the state of any objects already written -to the stream. The current point in the stream is marked as reset, so the -corresponding `ObjectInputStream` will reset at the same point. Objects -previously written to the stream will not be remembered as already having been -written to the stream. They will be written to the stream again. This is useful -when the contents of an object or objects must be sent again. `Reset` may not -be called while objects are being serialized. If called inappropriately, an -`IOException` is thrown. - -Starting with the Java 2 SDK, Standard Edition, v1.3, the -`writeClassDescriptor` method is called when an `ObjectStreamClass` needs to be -serialized. `writeClassDescriptor` is responsible for writing a representation -of the `ObjectStreamClass` to the serialization stream. Subclasses may override -this method to customize the way in which class descriptors are written to the -serialization stream. If this method is overridden, then the corresponding -`readClassDescriptor` method in `ObjectInputStream` should also be overridden -to reconstitute the class descriptor from its custom stream representation. By -default, `writeClassDescriptor` writes class descriptors according to the -format specified in [Section 6.4, "Grammar for the Stream -Format"](protocol.html#grammar-for-the-stream-format). Note that this method -will only be called if the `ObjectOutputStream` is not using the old -serialization stream format (see [Section 6.3, "Stream Protocol -Versions"](protocol.html#stream-protocol-versions)). If the serialization -stream is using the old format (`ObjectStreamConstants.PROTOCOL_VERSION_1`), -the class descriptor will be written internally in a manner that cannot be -overridden or customized. - -The `annotateClass` method is called while a `Class` is being serialized, and -after the class descriptor has been written to the stream. Subclasses may -extend this method and write other information to the stream about the class. -This information must be read by the `resolveClass` method in a corresponding -`ObjectInputStream` subclass. - -An `ObjectOutputStream` subclass can implement the `replaceObject` method to -monitor or replace objects during serialization. Replacing objects must be -enabled explicitly by calling `enableReplaceObject` before calling -`writeObject` with the first object to be replaced. Once enabled, -`replaceObject` is called for each object just prior to serializing the object -for the first time. Note that the `replaceObject` method is not called for -objects of the specially handled classes, `Class` and `ObjectStreamClass`. An -implementation of a subclass may return a substitute object that will be -serialized instead of the original. The substitute object must be serializable. -All references in the stream to the original object will be replaced by the -substitute object. - -When objects are being replaced, the subclass must ensure that the substituted -object is compatible with every field where the reference will be stored, or -that a complementary substitution will be made during deserialization. Objects, -whose type is not a subclass of the type of the field or array element, will -later abort the deserialization by raising a `ClassCastException` and the -reference will not be stored. - -The `enableReplaceObject` method can be called by trusted subclasses of -`ObjectOutputStream` to enable the substitution of one object for another -during serialization. Replacing objects is disabled until `enableReplaceObject` -is called with a `true` value. It may thereafter be disabled by setting it to -`false`. The previous setting is returned. The `enableReplaceObject` method -checks that the stream requesting the replacement can be trusted. To ensure -that the private state of objects is not unintentionally exposed, only trusted -stream subclasses may use `replaceObject`. Trusted classes are those classes -that belong to a security protection domain with permission to enable -Serializable substitution. - -If the subclass of `ObjectOutputStream` is not considered part of the system -domain, `SerializablePermission "enableSubstitution"` must be added to the -security policy file. `AccessControlException` is thrown if the protection -domain of the subclass of `ObjectInputStream` does not have permission to -`"enableSubstitution"` by calling `enableReplaceObject`. See the document Java -Security Architecture (JDK1.2) for additional information about the security -model. - -The `writeStreamHeader` method writes the magic number and version to the -stream. This information must be read by the `readStreamHeader` method of -`ObjectInputStream`. Subclasses may need to implement this method to identify -the stream's unique format. - -The `flush` method is used to empty any buffers being held by the stream and to -forward the flush to the underlying stream. The `drain` method may be used by -subclassers to empty only the `ObjectOutputStream`'s buffers without forcing -the underlying stream to be flushed. - -All of the write methods for primitive types encode their values using a -`DataOutputStream` to put them in the standard stream format. The bytes are -buffered into block data records so they can be distinguished from the encoding -of objects. This buffering allows primitive data to be skipped if necessary for -class versioning. It also allows the stream to be parsed without invoking -class-specific methods. - -To override the implementation of serialization, the subclass of -`ObjectOutputStream` should call the protected no-arg `ObjectOutputStream`, -constructor. There is a security check within the no-arg constructor for -`SerializablePermission "enableSubclassImplementation"` to ensure that only -trusted classes are allowed to override the default implementation. This -constructor does not allocate any private data for `ObjectOutputStream` and -sets a flag that indicates that the final `writeObject` method should invoke -the `writeObjectOverride` method and return. All other `ObjectOutputStream` -methods are not final and can be directly overridden by the subclass. - -## 2.2 The ObjectOutputStream.PutField Class - -Class `PutField` provides the API for setting values of the serializable fields -for a class when the class does not use default serialization. Each method puts -the specified named value into the stream. An `IllegalArgumentException` is -thrown if `name` does not match the name of a serializable field for the class -whose fields are being written, or if the type of the named field does not -match the second parameter type of the specific `put` method invoked. - -## 2.3 The writeObject Method - -For serializable objects, the `writeObject` method allows a class to control -the serialization of its own fields. Here is its signature: - -``` -private void writeObject(ObjectOutputStream stream) - throws IOException; -``` - -Each subclass of a serializable object may define its own `writeObject` method. -If a class does not implement the method, the default serialization provided by -`defaultWriteObject` will be used. When implemented, the class is only -responsible for writing its own fields, not those of its supertypes or -subtypes. - -The class's `writeObject` method, if implemented, is responsible for saving the -state of the class. Either `ObjectOutputStream`'s `defaultWriteObject` or -`writeFields` method must be called once (and only once) before writing any -optional data that will be needed by the corresponding `readObject` method to -restore the state of the object; even if no optional data is written, -`defaultWriteObject` or `writeFields` must still be invoked once. If -`defaultWriteObject` or `writeFields` is not invoked once prior to the writing -of optional data (if any), then the behavior of instance deserialization is -undefined in cases where the `ObjectInputStream` cannot resolve the class which -defined the `writeObject` method in question. - -The responsibility for the format, structure, and versioning of the optional -data lies completely with the class. - -## 2.4 The writeExternal Method - -Objects implementing `java.io.Externalizable` must implement the -`writeExternal` method to save the entire state of the object. It must -coordinate with its superclasses to save their state. All of the methods of -`ObjectOutput` are available to save the object's primitive typed fields and -object fields. - -``` -public void writeExternal(ObjectOutput stream) - throws IOException; -``` - -A new default format for writing Externalizable data has been introduced in JDK -1.2. The new format specifies that primitive data will be written in block data -mode by `writeExternal` methods. Additionally, a tag denoting the end of the -External object is appended to the stream after the `writeExternal` method -returns. The benefits of this format change are discussed in [Section 3.6, "The -readExternal Method"](input.html#the-readexternal-method). Compatibility issues -caused by this change are discussed in [Section 2.6, "The useProtocolVersion -Method"](#the-useprotocolversion-method). - -## 2.5 The writeReplace Method - -For Serializable and Externalizable classes, the `writeReplace` method allows a -class of an object to nominate its own replacement in the stream before the -object is written. By implementing the `writeReplace` method, a class can -directly control the types and instances of its own instances being serialized. - -The method is defined as follows: - -``` -ANY-ACCESS-MODIFIER Object writeReplace() - throws ObjectStreamException; -``` - -The `writeReplace` method is called when `ObjectOutputStream` is preparing to -write the object to the stream. The `ObjectOutputStream` checks whether the -class defines the `writeReplace` method. If the method is defined, the -`writeReplace` method is called to allow the object to designate its -replacement in the stream. The object returned should be either of the same -type as the object passed in or an object that when read and resolved will -result in an object of a type that is compatible with all references to the -object. If it is not, a `ClassCastException` will occur when the type mismatch -is discovered. - -## 2.6 The useProtocolVersion Method - -Due to a stream protocol change that was not backwards compatible, a mechanism -has been added to enable the current Virtual Machine to write a serialization -stream that is readable by a previous release. Of course, the problems that are -corrected by the new stream format will exist when using the backwards -compatible protocol. - -Stream protocol versions are discussed in [Section 6.3, "Stream Protocol -Versions"](protocol.html#stream-protocol-versions). - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/protocol.md b/jdk/src/java.base/share/specs/serialization/protocol.md deleted file mode 100644 index affc6886f98..00000000000 --- a/jdk/src/java.base/share/specs/serialization/protocol.md +++ /dev/null @@ -1,504 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](version.html) | [NEXT](security.html)' -include-after: '[CONTENTS](index.html) | [PREV](version.html) | [NEXT](security.html)' - -title: 'Java Object Serialization Specification: 6 - Object Serialization Stream Protocol' ---- - -- [Overview](#overview) -- [Stream Elements](#stream-elements) -- [Stream Protocol Versions](#stream-protocol-versions) -- [Grammar for the Stream Format](#grammar-for-the-stream-format) -- [Example](#example) - -------------------------------------------------------------------------------- - -## 6.1 Overview - -The stream format satisfies the following design goals: - -- Is compact and is structured for efficient reading. -- Allows skipping through the stream using only the knowledge of the - structure and format of the stream. Does not require invoking any per class - code. -- Requires only stream access to the data. - -## 6.2 Stream Elements - -A basic structure is needed to represent objects in a stream. Each attribute of -the object needs to be represented: its classes, its fields, and data written -and later read by class-specific methods. The representation of objects in the -stream can be described with a grammar. There are special representations for -null objects, new objects, classes, arrays, strings, and back references to any -object already in the stream. Each object written to the stream is assigned a -handle that is used to refer back to the object. Handles are assigned -sequentially starting from 0x7E0000. The handles restart at 0x7E0000 when the -stream is reset. - -A class object is represented by the following: - -- Its `ObjectStreamClass` object. - -An `ObjectStreamClass` object for a Class that is not a dynamic proxy class is -represented by the following: - -- The Stream Unique Identifier (SUID) of compatible classes. - -- A set of flags indicating various properties of the class, such as whether - the class defines a `writeObject` method, and whether the class is - serializable, externalizable, or an enum type - -- The number of serializable fields - -- The array of fields of the class that are serialized by the default - mechanismFor arrays and object fields, the type of the field is included as - a string which must be in "field descriptor" format (e.g., - "`Ljava/lang/Object;`") as specified in The Java Virtual Machine - Specification. - -- Optional block-data records or objects written by the `annotateClass` - method - -- The `ObjectStreamClass` of its supertype (null if the superclass is not - serializable) - -An `ObjectStreamClass` object for a dynamic proxy class is represented by the -following: - -- The number of interfaces that the dynamic proxy class implements - -- The names of all of the interfaces implemented by the dynamic proxy class, - listed in the order that they are returned by invoking the `getInterfaces` - method on the Class object. - -- Optional block-data records or objects written by the `annotateProxyClass` - method. - -- The ObjectStreamClass of its supertype, `java.lang.reflect.Proxy`. - -The representation of `String` objects consists of length information followed -by the contents of the string encoded in modified UTF-8. The modified UTF-8 -encoding is the same as used in the Java Virtual Machine and in the -`java.io.DataInput` and `DataOutput` interfaces; it differs from standard UTF-8 -in the representation of supplementary characters and of the null character. -The form of the length information depends on the length of the string in -modified UTF-8 encoding. If the modified UTF-8 encoding of the given `String` -is less than 65536 bytes in length, the length is written as 2 bytes -representing an unsigned 16-bit integer. Starting with the Java 2 platform, -Standard Edition, v1.3, if the length of the string in modified UTF-8 encoding -is 65536 bytes or more, the length is written in 8 bytes representing a signed -64-bit integer. The typecode preceding the `String` in the serialization stream -indicates which format was used to write the `String`. - -Arrays are represented by the following: - -- Their `ObjectStreamClass` object. - -- The number of elements. - -- The sequence of values. The type of the values is implicit in the type of - the array. for example the values of a byte array are of type byte. - -Enum constants are represented by the following: - -- The `ObjectStreamClass` object of the constant's base enum type. - -- The constant's name string. - -New objects in the stream are represented by the following: - -- The most derived class of the object. - -- Data for each serializable class of the object, with the highest superclass - first. For each class the stream contains the following: - - - The serializable fields.See [Section 1.5, "Defining Serializable Fields - for a - Class"](serial-arch.html#defining-serializable-fields-for-a-class). - - - If the class has `writeObject`/`readObject` methods, there may be - optional objects and/or block-data records of primitive types written - by the `writeObject` method followed by an `endBlockData` code. - -All primitive data written by classes is buffered and wrapped in block-data -records, regardless if the data is written to the stream within a `writeObject` -method or written directly to the stream from outside a `writeObject` method. -This data can only be read by the corresponding `readObject` methods or be read -directly from the stream. Objects written by the `writeObject` method terminate -any previous block-data record and are written either as regular objects or -null or back references, as appropriate. The block-data records allow error -recovery to discard any optional data. When called from within a class, the -stream can discard any data or objects until the `endBlockData`. - -## 6.3 Stream Protocol Versions - -It was necessary to make a change to the serialization stream format in JDK 1.2 -that is not backwards compatible to all minor releases of JDK 1.1. To provide -for cases where backwards compatibility is required, a capability has been -added to indicate what `PROTOCOL_VERSION` to use when writing a serialization -stream. The method `ObjectOutputStream.useProtocolVersion` takes as a parameter -the protocol version to use to write the serialization stream. - -The Stream Protocol Versions are as follows: - -- `ObjectStreamConstants.PROTOCOL_VERSION_1`: Indicates the initial stream - format. - -- `ObjectStreamConstants.PROTOCOL_VERSION_2`: Indicates the new external data - format. Primitive data is written in block data mode and is terminated with - `TC_ENDBLOCKDATA`. - - Block data boundaries have been standardized. Primitive data written in - block data mode is normalized to not exceed 1024 byte chunks. The benefit - of this change was to tighten the specification of serialized data format - within the stream. This change is fully backward and forward compatible. - -JDK 1.2 defaults to writing `PROTOCOL_VERSION_2`. - -JDK 1.1 defaults to writing `PROTOCOL_VERSION_1`. - -JDK 1.1.7 and greater can read both versions. - -Releases prior to JDK 1.1.7 can only read `PROTOCOL_VERSION_1`. - -## 6.4 Grammar for the Stream Format - -The table below contains the grammar for the stream format. Nonterminal symbols -are shown in italics. Terminal symbols in a *fixed width font*. Definitions of -nonterminals are followed by a ":". The definition is followed by one or more -alternatives, each on a separate line. The following table describes the -notation: - - ------------- -------------------------------------------------------------- - **Notation** **Meaning** - ------------- -------------------------------------------------------------- - (*datatype*) This token has the data type specified, such as byte. - - *token*\[n\] A predefined number of occurrences of the token, that is an - array. - - *x0001* A literal value expressed in hexadecimal. The number of hex - digits reflects the size of the value. - - <*xxx*> A value read from the stream used to indicate the length of an - array. - ------------- -------------------------------------------------------------- - -Note that the symbol (utf) is used to designate a string written using 2-byte -length information, and (long-utf) is used to designate a string written using -8-byte length information. For details, refer to [Section 6.2, "Stream -Elements"](#stream-elements). - -### 6.4.1 Rules of the Grammar - -A Serialized stream is represented by any stream satisfying the *stream* rule. - -``` -stream: - magic version contents - -contents: - content - contents content - -content: - object - blockdata - -object: - newObject - newClass - newArray - newString - newEnum - newClassDesc - prevObject - nullReference - exception - TC_RESET - -newClass: - TC_CLASS classDesc newHandle - -classDesc: - newClassDesc - nullReference - (ClassDesc)prevObject // an object required to be of type ClassDesc - -superClassDesc: - classDesc - -newClassDesc: - TC_CLASSDESC className serialVersionUID newHandle classDescInfo - TC_PROXYCLASSDESC newHandle proxyClassDescInfo - -classDescInfo: - classDescFlags fields classAnnotation superClassDesc - -className: - (utf) - -serialVersionUID: - (long) - -classDescFlags: - (byte) // Defined in Terminal Symbols and Constants - -proxyClassDescInfo: - (int) proxyInterfaceName[count] classAnnotation - superClassDesc - -proxyInterfaceName: - (utf) - -fields: - (short) fieldDesc[count] - -fieldDesc: - primitiveDesc - objectDesc - -primitiveDesc: - prim_typecode fieldName - -objectDesc: - obj_typecode fieldName className1 - -fieldName: - (utf) - -className1: - (String)object // String containing the field's type, - // in field descriptor format - -classAnnotation: - endBlockData - contents endBlockData // contents written by annotateClass - -prim_typecode: - 'B' // byte - 'C' // char - 'D' // double - 'F' // float - 'I' // integer - 'J' // long - 'S' // short - 'Z' // boolean - -obj_typecode: - '[' // array - 'L' // object - -newArray: - TC_ARRAY classDesc newHandle (int) values[size] - -newObject: - TC_OBJECT classDesc newHandle classdata[] // data for each class - -classdata: - nowrclass // SC_SERIALIZABLE & classDescFlag && - // !(SC_WRITE_METHOD & classDescFlags) - wrclass objectAnnotation // SC_SERIALIZABLE & classDescFlag && - // SC_WRITE_METHOD & classDescFlags - externalContents // SC_EXTERNALIZABLE & classDescFlag && - // !(SC_BLOCKDATA & classDescFlags - objectAnnotation // SC_EXTERNALIZABLE & classDescFlag&& - // SC_BLOCKDATA & classDescFlags - -nowrclass: - values // fields in order of class descriptor - -wrclass: - nowrclass - -objectAnnotation: - endBlockData - contents endBlockData // contents written by writeObject - // or writeExternal PROTOCOL_VERSION_2. - -blockdata: - blockdatashort - blockdatalong - -blockdatashort: - TC_BLOCKDATA (unsigned byte) (byte)[size] - -blockdatalong: - TC_BLOCKDATALONG (int) (byte)[size] - -endBlockData: - TC_ENDBLOCKDATA - -externalContent: // Only parseable by readExternal - (bytes) // primitive data - object - -externalContents: // externalContent written by - externalContent // writeExternal in PROTOCOL_VERSION_1. - externalContents externalContent - -newString: - TC_STRING newHandle (utf) - TC_LONGSTRING newHandle (long-utf) - -newEnum: - TC_ENUM classDesc newHandle enumConstantName - -enumConstantName: - (String)object - -prevObject: - TC_REFERENCE (int)handle - -nullReference: - TC_NULL - -exception: - TC_EXCEPTION reset (Throwable)object reset - -magic: - STREAM_MAGIC - -version: - STREAM_VERSION - -values: // The size and types are described by the - // classDesc for the current object - -newHandle: // The next number in sequence is assigned - // to the object being serialized or deserialized - -reset: // The set of known objects is discarded - // so the objects of the exception do not - // overlap with the previously sent objects - // or with objects that may be sent after - // the exception -``` - -### 6.4.2 Terminal Symbols and Constants - -The following symbols in `java.io.ObjectStreamConstants` define the terminal -and constant values expected in a stream. - -``` -final static short STREAM_MAGIC = (short)0xaced; -final static short STREAM_VERSION = 5; -final static byte TC_NULL = (byte)0x70; -final static byte TC_REFERENCE = (byte)0x71; -final static byte TC_CLASSDESC = (byte)0x72; -final static byte TC_OBJECT = (byte)0x73; -final static byte TC_STRING = (byte)0x74; -final static byte TC_ARRAY = (byte)0x75; -final static byte TC_CLASS = (byte)0x76; -final static byte TC_BLOCKDATA = (byte)0x77; -final static byte TC_ENDBLOCKDATA = (byte)0x78; -final static byte TC_RESET = (byte)0x79; -final static byte TC_BLOCKDATALONG = (byte)0x7A; -final static byte TC_EXCEPTION = (byte)0x7B; -final static byte TC_LONGSTRING = (byte) 0x7C; -final static byte TC_PROXYCLASSDESC = (byte) 0x7D; -final static byte TC_ENUM = (byte) 0x7E; -final static int baseWireHandle = 0x7E0000; -``` - -The flag byte *classDescFlags* may include values of - -``` -final static byte SC_WRITE_METHOD = 0x01; //if SC_SERIALIZABLE -final static byte SC_BLOCK_DATA = 0x08; //if SC_EXTERNALIZABLE -final static byte SC_SERIALIZABLE = 0x02; -final static byte SC_EXTERNALIZABLE = 0x04; -final static byte SC_ENUM = 0x10; -``` - -The flag `SC_WRITE_METHOD` is set if the Serializable class writing the stream -had a `writeObject` method that may have written additional data to the stream. -In this case a `TC_ENDBLOCKDATA` marker is always expected to terminate the -data for that class. - -The flag `SC_BLOCKDATA` is set if the `Externalizable` class is written into -the stream using `STREAM_PROTOCOL_2`. By default, this is the protocol used to -write `Externalizable` objects into the stream in JDK 1.2. JDK 1.1 writes -`STREAM_PROTOCOL_1`. - -The flag `SC_SERIALIZABLE` is set if the class that wrote the stream extended -`java.io.Serializable` but not `java.io.Externalizable`, the class reading the -stream must also extend `java.io.Serializable` and the default serialization -mechanism is to be used. - -The flag `SC_EXTERNALIZABLE` is set if the class that wrote the stream extended -`java.io.Externalizable`, the class reading the data must also extend -`Externalizable` and the data will be read using its `writeExternal` and -`readExternal` methods. - -The flag `SC_ENUM` is set if the class that wrote the stream was an enum type. -The receiver's corresponding class must also be an enum type. Data for -constants of the enum type will be written and read as described in [Section -1.12, "Serialization of Enum -Constants"](serial-arch.html#serialization-of-enum-constants). - -#### Example - -Consider the case of an original class and two instances in a linked list: - -``` -class List implements java.io.Serializable { - int value; - List next; - public static void main(String[] args) { - try { - List list1 = new List(); - List list2 = new List(); - list1.value = 17; - list1.next = list2; - list2.value = 19; - list2.next = null; - - ByteArrayOutputStream o = new ByteArrayOutputStream(); - ObjectOutputStream out = new ObjectOutputStream(o); - out.writeObject(list1); - out.writeObject(list2); - out.flush(); - ... - } catch (Exception ex) { - ex.printStackTrace(); - } - } -} -``` - -The resulting stream contains: - -``` - 00: ac ed 00 05 73 72 00 04 4c 69 73 74 69 c8 8a 15 >....sr..Listi...< - 10: 40 16 ae 68 02 00 02 49 00 05 76 61 6c 75 65 4c >Z......I..valueL< - 20: 00 04 6e 65 78 74 74 00 06 4c 4c 69 73 74 3b 78 >..nextt..LList;x< - 30: 70 00 00 00 11 73 71 00 7e 00 00 00 00 00 13 70 >p....sq.~......p< - 40: 71 00 7e 00 03 >q.~..< -``` - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/security.md b/jdk/src/java.base/share/specs/serialization/security.md deleted file mode 100644 index 9f26748daa9..00000000000 --- a/jdk/src/java.base/share/specs/serialization/security.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](protocol.html) | [NEXT](exceptions.html)' -include-after: '[CONTENTS](index.html) | [PREV](protocol.html) | [NEXT](exceptions.html)' - -title: 'Java Object Serialization Specification: A - Security in Object Serialization' ---- - -------------------------------------------------------------------------------- - -Refer to the [Secure Coding Guidelines for the Java Programming -Language](http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=secure_coding_guidelines_javase) -for information about security in object serialization. - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/serial-arch.md b/jdk/src/java.base/share/specs/serialization/serial-arch.md deleted file mode 100644 index 4ff54731688..00000000000 --- a/jdk/src/java.base/share/specs/serialization/serial-arch.md +++ /dev/null @@ -1,575 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](index.html) | [NEXT](output.html)' -include-after: '[CONTENTS](index.html) | [PREV](index.html) | [NEXT](output.html)' - -title: 'Java Object Serialization Specification: 1 - System Architecture' ---- - -- [Overview](#overview) -- [Writing to an Object Stream](#writing-to-an-object-stream) -- [Reading from an Object Stream](#reading-from-an-object-stream) -- [Object Streams as Containers](#object-streams-as-containers) -- [Defining Serializable Fields for a - Class](#defining-serializable-fields-for-a-class) -- [Documenting Serializable Fields and Data for a - Class](#documenting-serializable-fields-and-data-for-a-class) -- [Accessing Serializable Fields of a - Class](#accessing-serializable-fields-of-a-class) -- [The ObjectOutput Interface](#the-objectoutput-interface) -- [The ObjectInput Interface](#the-objectinput-interface) -- [The Serializable Interface](#the-serializable-interface) -- [The Externalizable Interface](#the-externalizable-interface) -- [Serialization of Enum Constants](#serialization-of-enum-constants) -- [Protecting Sensitive Information](#protecting-sensitive-information) - -------------------------------------------------------------------------------- - -## 1.1 Overview - -The ability to store and retrieve Java^TM^ objects is essential to building all -but the most transient applications. The key to storing and retrieving objects -in a serialized form is representing the state of objects sufficient to -reconstruct the object(s). Objects to be saved in the stream may support either -the `Serializable` or the `Externalizable` interface. For Java^TM^ objects, the -serialized form must be able to identify and verify the Java^TM^ class from -which the contents of the object were saved and to restore the contents to a -new instance. For serializable objects, the stream includes sufficient -information to restore the fields in the stream to a compatible version of the -class. For Externalizable objects, the class is solely responsible for the -external format of its contents. - -Objects to be stored and retrieved frequently refer to other objects. Those -other objects must be stored and retrieved at the same time to maintain the -relationships between the objects. When an object is stored, all of the objects -that are reachable from that object are stored as well. - -The goals for serializing Java^TM^ objects are to: - -- Have a simple yet extensible mechanism. -- Maintain the Java^TM^ object type and safety properties in the serialized - form. -- Be extensible to support marshaling and unmarshaling as needed for remote - objects. -- Be extensible to support simple persistence of Java^TM^ objects. -- Require per class implementation only for customization. -- Allow the object to define its external format. - -## 1.2 Writing to an Object Stream - -Writing objects and primitives to a stream is a straightforward process. For -example: - -``` -// Serialize today's date to a file. - FileOutputStream f = new FileOutputStream("tmp"); - ObjectOutput s = new ObjectOutputStream(f); - s.writeObject("Today"); - s.writeObject(new Date()); - s.flush(); -``` - -First an `OutputStream`, in this case a `FileOutputStream`, is needed to -receive the bytes. Then an `ObjectOutputStream` is created that writes to the -`FileOutputStream`. Next, the string "Today" and a Date object are written to -the stream. More generally, objects are written with the `writeObject` method -and primitives are written to the stream with the methods of `DataOutput`. - -The `writeObject` method (see [Section 2.3, "The writeObject -Method"](output.html#the-writeobject-method)) serializes the specified object -and traverses its references to other objects in the object graph recursively -to create a complete serialized representation of the graph. Within a stream, -the first reference to any object results in the object being serialized or -externalized and the assignment of a handle for that object. Subsequent -references to that object are encoded as the handle. Using object handles -preserves sharing and circular references that occur naturally in object -graphs. Subsequent references to an object use only the handle allowing a very -compact representation. - -Special handling is required for arrays, enum constants, and objects of type -`Class`, `ObjectStreamClass`, and `String`. Other objects must implement either -the `Serializable` or the `Externalizable` interface to be saved in or restored -from a stream. - -Primitive data types are written to the stream with the methods in the -`DataOutput` interface, such as `writeInt`, `writeFloat`, or `writeUTF`. -Individual bytes and arrays of bytes are written with the methods of -`OutputStream`. Except for serializable fields, primitive data is written to -the stream in block-data records, with each record prefixed by a marker and an -indication of the number of bytes in the record. - -`ObjectOutputStream` can be extended to customize the information about classes -in the stream or to replace objects to be serialized. Refer to the -`annotateClass` and `replaceObject` method descriptions for details. - -## 1.3 Reading from an Object Stream - -Reading an object from a stream, like writing, is straightforward: - -``` -// Deserialize a string and date from a file. - FileInputStream in = new FileInputStream("tmp"); - ObjectInputStream s = new ObjectInputStream(in); - String today = (String)s.readObject(); - Date date = (Date)s.readObject(); -``` - -First an `InputStream`, in this case a `FileInputStream`, is needed as the -source stream. Then an `ObjectInputStream` is created that reads from the -`InputStream`. Next, the string "Today" and a Date object are read from the -stream. Generally, objects are read with the `readObject` method and primitives -are read from the stream with the methods of `DataInput`. - -The `readObject` method deserializes the next object in the stream and -traverses its references to other objects recursively to create the complete -graph of objects serialized. - -Primitive data types are read from the stream with the methods in the -`DataInput` interface, such as `readInt`, `readFloat`, or `readUTF`. Individual -bytes and arrays of bytes are read with the methods of `InputStream`. Except -for serializable fields, primitive data is read from block-data records. - -`ObjectInputStream` can be extended to utilize customized information in the -stream about classes or to replace objects that have been deserialized. Refer -to the `resolveClass` and `resolveObject` method descriptions for details. - -## 1.4 Object Streams as Containers - -Object Serialization produces and consumes a stream of bytes that contain one -or more primitives and objects. The objects written to the stream, in turn, -refer to other objects, which are also represented in the stream. Object -Serialization produces just one stream format that encodes and stores the -contained objects. - -Each object that acts as a container implements an interface which allows -primitives and objects to be stored in or retrieved from it. These interfaces -are the `ObjectOutput` and `ObjectInput` interfaces which: - -- Provide a stream to write to and to read from -- Handle requests to write primitive types and objects to the stream -- Handle requests to read primitive types and objects from the stream - -Each object which is to be stored in a stream must explicitly allow itself to -be stored and must implement the protocols needed to save and restore its -state. Object Serialization defines two such protocols. The protocols allow the -container to ask the object to write and read its state. - -To be stored in an Object Stream, each object must implement either the -`Serializable` or the `Externalizable` interface: - -- For a `Serializable` class, Object Serialization can automatically save and - restore fields of each class of an object and automatically handle classes - that evolve by adding fields or supertypes. A serializable class can - declare which of its fields are saved or restored, and write and read - optional values and objects. - -- For an `Externalizable` class, Object Serialization delegates to the class - complete control over its external format and how the state of the - supertype(s) is saved and restored. - -## 1.5 Defining Serializable Fields for a Class - -The serializable fields of a class can be defined two different ways. Default -serializable fields of a class are defined to be the non-transient and -non-static fields. This default computation can be overridden by declaring a -special field in the `Serializable` class, `serialPersistentFields`. This field -must be initialized with an array of `ObjectStreamField` objects that list the -names and types of the serializable fields. The modifiers for the field are -required to be private, static, and final. If the field's value is null or is -otherwise not an instance of `ObjectStreamField[]`, or if the field does not -have the required modifiers, then the behavior is as if the field were not -declared at all. - -For example, the following declaration duplicates the default behavior. - -``` -class List implements Serializable { - List next; - - private static final ObjectStreamField[] serialPersistentFields - = {new ObjectStreamField("next", List.class)}; - -} -``` - -By using `serialPersistentFields` to define the Serializable fields for a -class, there no longer is a limitation that a serializable field must be a -field within the current definition of the `Serializable` class. The -`writeObject` and `readObject` methods of the `Serializable` class can map the -current implementation of the class to the serializable fields of the class -using the interface that is described in [Section 1.7, "Accessing Serializable -Fields of a Class"](#accessing-serializable-fields-of-a-class). Therefore, the -fields for a `Serializable` class can change in a later release, as long as it -maintains the mapping back to its Serializable fields that must remain -compatible across release boundaries. - -**Note:** There is, however, a limitation to the use of this mechanism to -specify serializable fields for inner classes. Inner classes can only contain -final static fields that are initialized to constants or expressions built up -from constants. Consequently, it is not possible to set -`serialPersistentFields` for an inner class (though it is possible to set it -for static member classes). For other restrictions pertaining to serialization -of inner class instances, see section [Section 1.10, "The Serializable -Interface"](#the-serializable-interface). - -## 1.6 Documenting Serializable Fields and Data for a Class - -It is important to document the serializable state of a class to enable -interoperability with alternative implementations of a Serializable class and -to document class evolution. Documenting a serializable field gives one a final -opportunity to review whether or not the field should be serializable. The -serialization javadoc tags, `@serial`, `@serialField`, and `@serialData`, -provide a way to document the serialized form for a Serializable class within -the source code. - -- The `@serial` tag should be placed in the javadoc comment for a default - serializable field. The syntax is as follows: `@serial` *field-description* - The optional *field-description* describes the meaning of the field and its - acceptable values. The *field-description* can span multiple lines. When a - field is added after the initial release, a *@since* tag indicates the - version the field was added. The *field-description* for `@serial` provides - serialization-specific documentation and is appended to the javadoc comment - for the field within the serialized form documentation. - -- The `@serialField` tag is used to document an `ObjectStreamField` component - of a `serialPersistentFields` array. One of these tags should be used for - each `ObjectStreamField` component. The syntax is as follows: - `@serialField` *field-name field-type field-description* - -- The `@serialData` tag describes the sequences and types of data written or - read. The tag describes the sequence and type of optional data written by - `writeObject` or all data written by the `Externalizable.writeExternal` - method. The syntax is as follows: `@serialData` *data-description* - -The javadoc application recognizes the serialization javadoc tags and generates -a specification for each Serializable and Externalizable class. See [Section -C.1, "Example Alternate Implementation of -java.io.File"](examples.html#c.1-example-alternate-implementation-of-java.io.file) -for an example that uses these tags. - -When a class is declared Serializable, the serializable state of the object is -defined by serializable fields (by name and type) plus optional data. Optional -data can only be written explicitly by the `writeObject` method of a -`Serializable` class. Optional data can be read by the `Serializable` class' -`readObject` method or serialization will skip unread optional data. - -When a class is declared Externalizable, the data that is written to the stream -by the class itself defines the serialized state. The class must specify the -order, types, and meaning of each datum that is written to the stream. The -class must handle its own evolution, so that it can continue to read data -written by and write data that can be read by previous versions. The class must -coordinate with the superclass when saving and restoring data. The location of -the superclasses data in the stream must be specified. - -The designer of a Serializable class must ensure that the information saved for -the class is appropriate for persistence and follows the -serialization-specified rules for interoperability and evolution. Class -evolution is explained in greater detail in [Chapter -5](version.html#versioning-of-serializable-objects), "Versioning of -Serializable Objects". - -## 1.7 Accessing Serializable Fields of a Class - -Serialization provides two mechanisms for accessing the serializable fields in -a stream: - -- The default mechanism requires no customization -- The Serializable Fields API allows a class to explicitly access/set the - serializable fields by name and type - -The default mechanism is used automatically when reading or writing objects -that implement the `Serializable` interface and do no further customization. -The serializable fields are mapped to the corresponding fields of the class and -values are either written to the stream from those fields or are read in and -assigned respectively. If the class provides `writeObject` and `readObject` -methods, the default mechanism can be invoked by calling `defaultWriteObject` -and `defaultReadObject`. When the `writeObject` and `readObject` methods are -implemented, the class has an opportunity to modify the serializable field -values before they are written or after they are read. - -When the default mechanism cannot be used, the serializable class can use the -`putFields` method of `ObjectOutputStream` to put the values for the -serializable fields into the stream. The `writeFields` method of -`ObjectOutputStream` puts the values in the correct order, then writes them to -the stream using the existing protocol for serialization. Correspondingly, the -`readFields` method of `ObjectInputStream` reads the values from the stream and -makes them available to the class by name in any order. See [Section 2.2, "The -ObjectOutputStream.PutField -Class"](output.html#the-objectoutputstream.putfield-class) and [Section 3.2, -"The ObjectInputStream.GetField -Class"](input.html#the-objectinputstream.getfield-class) for a detailed -description of the Serializable Fields API. - -## 1.8 The ObjectOutput Interface - -The `ObjectOutput` interface provides an abstract, stream-based interface to -object storage. It extends the DataOutput interface so those methods can be -used for writing primitive data types. Objects that implement this interface -can be used to store primitives and objects. - -``` -package java.io; - -public interface ObjectOutput extends DataOutput -{ - public void writeObject(Object obj) throws IOException; - public void write(int b) throws IOException; - public void write(byte b[]) throws IOException; - public void write(byte b[], int off, int len) throws IOException; - public void flush() throws IOException; - public void close() throws IOException; -} -``` - -`The` `writeObject` method is used to write an object. The exceptions thrown -reflect errors while accessing the object or its fields, or exceptions that -occur in writing to storage. If any exception is thrown, the underlying storage -may be corrupted. If this occurs, refer to the object that is implementing this -interface for more information. - -## 1.9 The ObjectInput Interface - -The `ObjectInput` interface provides an abstract stream based interface to -object retrieval. It extends the `DataInput` interface so those methods for -reading primitive data types are accessible in this interface. - -``` -package java.io; - -public interface ObjectInput extends DataInput -{ - public Object readObject() - throws ClassNotFoundException, IOException; - public int read() throws IOException; - public int read(byte b[]) throws IOException; - public int read(byte b[], int off, int len) throws IOException; - public long skip(long n) throws IOException; - public int available() throws IOException; - public void close() throws IOException; -} -``` - -The `readObject` method is used to read and return an object. The exceptions -thrown reflect errors while accessing the objects or its fields or exceptions -that occur in reading from the storage. If any exception is thrown, the -underlying storage may be corrupted. If this occurs, refer to the object -implementing this interface for additional information. - -## 1.10 The Serializable Interface - -Object Serialization produces a stream with information about the Java^TM^ -classes for the objects which are being saved. For serializable objects, -sufficient information is kept to restore those objects even if a different -(but compatible) version of the implementation of the class is present. The -`Serializable` interface is defined to identify classes which implement the -serializable protocol: - -``` -package java.io; - -public interface Serializable {}; -``` - -A Serializable class must do the following: - -- Implement the `java.io.Serializable` interface - -- Identify the fields that should be serializable - - (Use the `serialPersistentFields` member to explicitly declare them - serializable or use the transient keyword to denote nonserializable - fields.) - -- Have access to the no-arg constructor of its first nonserializable - superclass - -The class can optionally define the following methods: - -- A `writeObject` method to control what information is saved or to append - additional information to the stream - -- A `readObject` method either to read the information written by the - corresponding `writeObject` method or to update the state of the object - after it has been restored - -- A `writeReplace` method to allow a class to nominate a replacement object - to be written to the stream - - (See [Section 2.5, "The writeReplace - Method"](output.html#the-writereplace-method) for additional information.) - -- A `readResolve` method to allow a class to designate a replacement object - for the object just read from the stream - - (See [Section 3.7, "The readResolve - Method](input.html#the-readresolve-method) for additional information.) - -`ObjectOutputStream` and `ObjectInputStream` allow the serializable classes on -which they operate to evolve (allow changes to the classes that are compatible -with the earlier versions of the classes). See [Section 5.5, "Compatible Java -Type Evolution"](version.html#compatible-java-type-evolution) for information -about the mechanism which is used to allow compatible changes. - -**Note:** Serialization of inner classes (i.e., nested classes that are not -static member classes), including local and anonymous classes, is strongly -discouraged for several reasons. Because inner classes declared in non-static -contexts contain implicit non-transient references to enclosing class -instances, serializing such an inner class instance will result in -serialization of its associated outer class instance as well. Synthetic fields -generated by `javac` (or other Java^TM^ compilers) to implement inner classes -are implementation dependent and may vary between compilers; differences in -such fields can disrupt compatibility as well as result in conflicting default -`serialVersionUID` values. The names assigned to local and anonymous inner -classes are also implementation dependent and may differ between compilers. -Since inner classes cannot declare static members other than compile-time -constant fields, they cannot use the `serialPersistentFields` mechanism to -designate serializable fields. Finally, because inner classes associated with -outer instances do not have zero-argument constructors (constructors of such -inner classes implicitly accept the enclosing instance as a prepended -parameter), they cannot implement `Externalizable`. None of the issues listed -above, however, apply to static member classes. - -## 1.11 The Externalizable Interface - -For Externalizable objects, only the identity of the class of the object is -saved by the container; the class must save and restore the contents. The -`Externalizable` interface is defined as follows: - -``` -package java.io; - -public interface Externalizable extends Serializable -{ - public void writeExternal(ObjectOutput out) - throws IOException; - - public void readExternal(ObjectInput in) - throws IOException, java.lang.ClassNotFoundException; -} -``` - -The class of an Externalizable object must do the following: - -- Implement the `java.io.Externalizable` interface - -- Implement a `writeExternal` method to save the state of the object - - (It must explicitly coordinate with its supertype to save its state.) - -- Implement a `readExternal` method to read the data written by the - `writeExternal` method from the stream and restore the state of the object - - (It must explicitly coordinate with the supertype to save its state.) - -- Have the `writeExternal` and `readExternal` methods be solely responsible - for the format, if an externally defined format is written - - **Note:** The `writeExternal` and `readExternal` methods are public and - raise the risk that a client may be able to write or read information in - the object other than by using its methods and fields. These methods must - be used only when the information held by the object is not sensitive or - when exposing it does not present a security risk. - -- Have a public no-arg constructor - - **Note:** Inner classes associated with enclosing instances cannot have - no-arg constructors, since constructors of such classes implicitly accept - the enclosing instance as a prepended parameter. Consequently the - `Externalizable` interface mechanism cannot be used for inner classes and - they should implement the `Serializable` interface, if they must be - serialized. Several limitations exist for serializable inner classes as - well, however; see [Section 1.10, "The Serializable - Interface"](#the-serializable-interface), for a full enumeration. - -An Externalizable class can optionally define the following methods: - -- A `writeReplace` method to allow a class to nominate a replacement object - to be written to the stream - - (See [Section 2.5, "The writeReplace - Method"](output.html#the-writereplace-method) for additional information.) - -- A `readResolve` method to allow a class to designate a replacement object - for the object just read from the stream - - (See [Section 3.7, "The readResolve - Method"](input.html#the-readresolve-method) for additional information.) - -## 1.12 Serialization of Enum Constants - -Enum constants are serialized differently than ordinary serializable or -externalizable objects. The serialized form of an enum constant consists solely -of its name; field values of the constant are not present in the form. To -serialize an enum constant, `ObjectOutputStream` writes the value returned by -the enum constant's `name` method. To deserialize an enum constant, -`ObjectInputStream` reads the constant name from the stream; the deserialized -constant is then obtained by calling the `java.lang.Enum.valueOf` method, -passing the constant's enum type along with the received constant name as -arguments. Like other serializable or externalizable objects, enum constants -can function as the targets of back references appearing subsequently in the -serialization stream. - -The process by which enum constants are serialized cannot be customized: any -class-specific `writeObject`, `readObject`, `readObjectNoData`, `writeReplace`, -and `readResolve` methods defined by enum types are ignored during -serialization and deserialization. Similarly, any `serialPersistentFields` or -`serialVersionUID` field declarations are also ignored--all enum types have a -fixed `serialVersionUID` of `0L`. Documenting serializable fields and data for -enum types is unnecessary, since there is no variation in the type of data -sent. - -## 1.13 Protecting Sensitive Information - -When developing a class that provides controlled access to resources, care must -be taken to protect sensitive information and functions. During -deserialization, the private state of the object is restored. For example, a -file descriptor contains a handle that provides access to an operating system -resource. Being able to forge a file descriptor would allow some forms of -illegal access, since restoring state is done from a stream. Therefore, the -serializing runtime must take the conservative approach and not trust the -stream to contain only valid representations of objects. To avoid compromising -a class, the sensitive state of an object must not be restored from the stream, -or it must be reverified by the class. Several techniques are available to -protect sensitive data in classes. - -The easiest technique is to mark fields that contain sensitive data as *private -transient*. Transient fields are not persistent and will not be saved by any -persistence mechanism. Marking the field will prevent the state from appearing -in the stream and from being restored during deserialization. Since writing and -reading (of private fields) cannot be superseded outside of the class, the -transient fields of the class are safe. - -Particularly sensitive classes should not be serialized at all. To accomplish -this, the object should not implement either the `Serializable` or the -`Externalizable` interface. - -Some classes may find it beneficial to allow writing and reading but -specifically handle and revalidate the state as it is deserialized. The class -should implement `writeObject` and `readObject` methods to save and restore -only the appropriate state. If access should be denied, throwing a -`NotSerializableException` will prevent further access. - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.base/share/specs/serialization/version.md b/jdk/src/java.base/share/specs/serialization/version.md deleted file mode 100644 index 5f4d0e7d4a9..00000000000 --- a/jdk/src/java.base/share/specs/serialization/version.md +++ /dev/null @@ -1,304 +0,0 @@ ---- -# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. -# 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. - -include-before: '[CONTENTS](index.html) | [PREV](class.html) | [NEXT](protocol.html)' -include-after: '[CONTENTS](index.html) | [PREV](class.html) | [NEXT](protocol.html)' - -title: 'Java Object Serialization Specification: 5 - Versioning of Serializable Objects' ---- - -- [Overview](#overview) -- [Goals](#goals) -- [Assumptions](#assumptions) -- [Who's Responsible for Versioning of - Streams](#whos-responsible-for-versioning-of-streams) -- [Compatible Java Type Evolution](#compatible-java-type-evolution) -- [Type Changes Affecting - Serialization](#type-changes-affecting-serialization) - -------------------------------------------------------------------------------- - -## 5.1 Overview - -When Java objects use serialization to save state in files, or as blobs in -databases, the potential arises that the version of a class reading the data is -different than the version that wrote the data. - -Versioning raises some fundamental questions about the identity of a class, -including what constitutes a compatible change. A ***compatible change*** is a -change that does not affect the contract between the class and its callers. - -This section describes the goals, assumptions, and a solution that attempts to -address this problem by restricting the kinds of changes allowed and by -carefully choosing the mechanisms. - -The proposed solution provides a mechanism for "automatic" handling of classes -that evolve by adding fields and adding classes. Serialization will handle -versioning without class-specific methods to be implemented for each version. -The stream format can be traversed without invoking class-specific methods. - -## 5.2 Goals - -The goals are to: - -- Support bidirectional communication between different versions of a class - operating in different virtual machines by: - - - Defining a mechanism that allows Java classes to read streams written - by older versions of the same class. - - - Defining a mechanism that allows Java classes to write streams intended - to be read by older versions of the same class. - -- Provide default serialization for persistence and for RMI. - -- Perform well and produce compact streams in simple cases, so that RMI can - use serialization. - -- Be able to identify and load classes that match the exact class used to - write the stream. - -- Keep the overhead low for nonversioned classes. - -- Use a stream format that allows the traversal of the stream without having - to invoke methods specific to the objects saved in the stream. - -## 5.3 Assumptions - -The assumptions are that: - -- Versioning will only apply to serializable classes since it must control - the stream format to achieve it goals. Externalizable classes will be - responsible for their own versioning which is tied to the external format. - -- All data and objects must be read from, or skipped in, the stream in the - same order as they were written. - -- Classes evolve individually as well as in concert with supertypes and - subtypes. - -- Classes are identified by name. Two classes with the same name may be - different versions or completely different classes that can be - distinguished only by comparing their interfaces or by comparing hashes of - the interfaces. - -- Default serialization will not perform any type conversions. - -- The stream format only needs to support a linear sequence of type changes, - not arbitrary branching of a type. - -## 5.4 Who's Responsible for Versioning of Streams - -In the evolution of classes, it is the responsibility of the evolved (later -version) class to maintain the contract established by the nonevolved class. -This takes two forms. First, the evolved class must not break the existing -assumptions about the interface provided by the original version, so that the -evolved class can be used in place of the original. Secondly, when -communicating with the original (or previous) versions, the evolved class must -provide sufficient and equivalent information to allow the earlier version to -continue to satisfy the nonevolved contract. - -> ![*Private serialization protocol and contract with supertype relationships - between evolved and nonevolved classes and their - instances*](images/version.gif) - -For the purposes of the discussion here, each class implements and extends the -interface or contract defined by its supertype. New versions of a class, for -example `foo'`, must continue to satisfy the contract for `foo` and may extend -the interface or modify its implementation. - -Communication between objects via serialization is not part of the contract -defined by these interfaces. Serialization is a private protocol between the -implementations. It is the responsibility of the implementations to communicate -sufficiently to allow each implementation to continue to satisfy the contract -expected by its clients. - -## 5.5 Compatible Java Type Evolution - -The Java Language Specification discusses binary compatibility of Java classes -as those classes evolve. Most of the flexibility of binary compatibility comes -from the use of late binding of symbolic references for the names of classes, -interfaces, fields, methods, and so on. - -The following are the principle aspects of the design for versioning of -serialized object streams. - -- The default serialization mechanism will use a symbolic model for binding - the fields in the stream to the fields in the corresponding class in the - virtual machine. - -- Each class referenced in the stream will uniquely identify itself, its - supertype, and the types and names of each serializable field written to - the stream. The fields are ordered with the primitive types first sorted by - field name, followed by the object fields sorted by field name. - -- Two types of data may occur in the stream for each class: required data - (corresponding directly to the serializable fields of the object); and - optional data (consisting of an arbitrary sequence of primitives and - objects). The stream format defines how the required and optional data - occur in the stream so that the whole class, the required, or the optional - parts can be skipped if necessary. - - - The required data consists of the fields of the object in the order - defined by the class descriptor. - - - The optional data is written to the stream and does not correspond - directly to fields of the class. The class itself is responsible for - the length, types, and versioning of this optional information. - -- If defined for a class, the `writeObject`/`readObject` methods supersede - the default mechanism to write/read the state of the class. These methods - write and read the optional data for a class. The required data is written - by calling `defaultWriteObject` and read by calling `defaultReadObject`. - -- The stream format of each class is identified by the use of a Stream Unique - Identifier (SUID). By default, this is the hash of the class. All later - versions of the class must declare the Stream Unique Identifier (SUID) that - they are compatible with. This guards against classes with the same name - that might inadvertently be identified as being versions of a single class. - -- Subtypes of `ObjectOutputStream` and `ObjectInputStream` may include their - own information identifying the class using the `annotateClass` method; for - example, `MarshalOutputStream` embeds the URL of the class. - -## 5.6 Type Changes Affecting Serialization - -With these concepts, we can now describe how the design will cope with the -different cases of an evolving class. The cases are described in terms of a -stream written by some version of a class. When the stream is read back by the -same version of the class, there is no loss of information or functionality. -The stream is the only source of information about the original class. Its -class descriptions, while a subset of the original class description, are -sufficient to match up the data in the stream with the version of the class -being reconstituted. - -The descriptions are from the perspective of the stream being read in order to -reconstitute either an earlier or later version of the class. In the parlance -of RPC systems, this is a "receiver makes right" system. The writer writes its -data in the most suitable form and the receiver must interpret that information -to extract the parts it needs and to fill in the parts that are not available. - -### 5.6.1 Incompatible Changes - -Incompatible changes to classes are those changes for which the guarantee of -interoperability cannot be maintained. The incompatible changes that may occur -while evolving a class are: - -- Deleting fields - If a field is deleted in a class, the stream written will - not contain its value. When the stream is read by an earlier class, the - value of the field will be set to the default value because no value is - available in the stream. However, this default value may adversely impair - the ability of the earlier version to fulfill its contract. - -- Moving classes up or down the hierarchy - This cannot be allowed since the - data in the stream appears in the wrong sequence. - -- Changing a nonstatic field to static or a nontransient field to transient - - When relying on default serialization, this change is equivalent to - deleting a field from the class. This version of the class will not write - that data to the stream, so it will not be available to be read by earlier - versions of the class. As when deleting a field, the field of the earlier - version will be initialized to the default value, which can cause the class - to fail in unexpected ways. - -- Changing the declared type of a primitive field - Each version of the class - writes the data with its declared type. Earlier versions of the class - attempting to read the field will fail because the type of the data in the - stream does not match the type of the field. - -- Changing the `writeObject` or `readObject` method so that it no longer - writes or reads the default field data or changing it so that it attempts - to write it or read it when the previous version did not. The default field - data must consistently either appear or not appear in the stream. - -- Changing a class from `Serializable` to `Externalizable` or vice versa is - an incompatible change since the stream will contain data that is - incompatible with the implementation of the available class. - -- Changing a class from a non-enum type to an enum type or vice versa since - the stream will contain data that is incompatible with the implementation - of the available class. - -- Removing either `Serializable` or `Externalizable` is an incompatible - change since when written it will no longer supply the fields needed by - older versions of the class. - -- Adding the `writeReplace` or `readResolve` method to a class is - incompatible if the behavior would produce an object that is incompatible - with any older version of the class. - -### 5.6.2 Compatible Changes - -The compatible changes to a class are handled as follows: - -- Adding fields - When the class being reconstituted has a field that does - not occur in the stream, that field in the object will be initialized to - the default value for its type. If class-specific initialization is needed, - the class may provide a readObject method that can initialize the field to - nondefault values. - -- Adding classes - The stream will contain the type hierarchy of each object - in the stream. Comparing this hierarchy in the stream with the current - class can detect additional classes. Since there is no information in the - stream from which to initialize the object, the class's fields will be - initialized to the default values. - -- Removing classes - Comparing the class hierarchy in the stream with that of - the current class can detect that a class has been deleted. In this case, - the fields and objects corresponding to that class are read from the - stream. Primitive fields are discarded, but the objects referenced by the - deleted class are created, since they may be referred to later in the - stream. They will be garbage-collected when the stream is garbage-collected - or reset. - -- Adding `writeObject`/`readObject` methods - If the version reading the - stream has these methods then `readObject` is expected, as usual, to read - the required data written to the stream by the default serialization. It - should call `defaultReadObject` first before reading any optional data. The - `writeObject` method is expected as usual to call `defaultWriteObject` to - write the required data and then may write optional data. - -- Removing `writeObject`/`readObject` methods - If the class reading the - stream does not have these methods, the required data will be read by - default serialization, and the optional data will be discarded. - -- Adding `java.io.Serializable` - This is equivalent to adding types. There - will be no values in the stream for this class so its fields will be - initialized to default values. The support for subclassing nonserializable - classes requires that the class's supertype have a no-arg constructor and - the class itself will be initialized to default values. If the no-arg - constructor is not available, the `InvalidClassException` is thrown. - -- Changing the access to a field - The access modifiers public, package, - protected, and private have no effect on the ability of serialization to - assign values to the fields. - -- Changing a field from static to nonstatic or transient to nontransient - - When relying on default serialization to compute the serializable fields, - this change is equivalent to adding a field to the class. The new field - will be written to the stream but earlier classes will ignore the value - since serialization will not assign values to static or transient fields. - -------------------------------------------------------------------------------- - -*[Copyright](../../../legal/SMICopyright.html) © 2005, 2017, Oracle -and/or its affiliates. All rights reserved.* diff --git a/jdk/src/java.desktop/share/specs/AWT_Native_Interface.html b/jdk/src/java.desktop/share/specs/AWT_Native_Interface.html deleted file mode 100644 index 782376099a8..00000000000 --- a/jdk/src/java.desktop/share/specs/AWT_Native_Interface.html +++ /dev/null @@ -1,776 +0,0 @@ - - - - - - Java AWT Native Interface Specification and Guide - - -The Java AWT Native Interface Specification and Guide
-Introduction
-The Java AWT Native Interface (JAWT) comprises a small set of native -(eg C language-based) APIs that provide a standard supported way -for interaction between Java API windows and surfaces, and -platform native API windows and surfaces. -Non-Java libraries may then render to a Java owned window. -
-Note: in this document the terms "Java AWT Native Interface", -"AWT Native Interface" and "JAWT" are interchangeable and -refer to this same specification. -
-The fundamental obstacle to native rendering without JAWT is that -is that the rendering code cannot identify where to draw. -The native code needs access to information about a Java -drawing surface (such as a handle to the underlying native ID of a -Canvas), but cannot get it.
-Without that information (ie without JAWT) an application could -use native rendering only by creating its own top-level window -not shared at all with Java. This is unacceptable for most uses. -Except for usage via JAWT, this is considered to be entirely -internal to the Java platform implementation: private, unsupported -and undocumented. --JAWT should be supported in all headful implementations -where technically possible although this is not enforced by the JCK. -There is a platform-specific and a platform -independent portion to the API, to account for the differing -data structures and requirements of each platform. -This document specifies the platform independent portions and -also documents the platform dependent portions for the Oracle JDK -supported desktop operating environments. -For AWT the term platform is less tied to the underlying operating -system than it is to the desktop windowing environment. -
-Reasons for using the AWT Native Interface include -
-
-- Use of a 3rd party native library not available in Java -
- A temporary porting aid before converting legacy code to Java -
- Rendering performance available only to native hardware accelerated APIs -
- Interoperation with another toolkit -
-Drawbacks include -
-
-The header file "jawt.h" -in the Appendix fully specifies the APIs provided by JAWT. -- A more complex application implementation, eg for painting -
- Potential for application instability if the native library does -not interoperate properly with AWT. -
- Increased application delivery complexity - per platform binaries -
-An example illustrating how easy it is to use the AWT Native Interface -is presented and discussed later in this document.
- -JAWT usage depends on JNI
-The definition of Java Standard Edition includes JNI, the Java -Native Interface. Many Java developers will never need to use it, -but the interface is the only standard supported way for a Java -language program to interact directly with -application code that has been compiled to the native machine -instructions for the host processor architecture. -JNI is used where ever there is a need for mixed languages. -These are by no means limited to cases like AWT. For example, you -could use JNI to integrate with native code that communicates with -a peripheral device, such as a scanner, connected to a system via a -USB port.
-So JNI is general enough to be used to access almost any -sort of native library. -The rest of this document assumes a familiarity with how -to use JNI. - -
How to use JAWT
-In this section we describe the most common usage of the AWT -Native Interface — overriding the paint method to -direct drawing operations to a native rendering library which then -queries the Java VM to determine the information it needs in order -to render. Note, however, that any native code may use the AWT -Native Interface to learn about a target drawing surface, not just -code in a paint method.
-The first step in hooking up a native rendering library to a -Java Canvas is to define a new class that extends -Canvas and overrides the paint method. The Java -system routes all drawing operations for a Canvas object -through the paint method, as it does for all other GUI -objects. Canvas is a good candidate for the rendering surface as -it does not have any content as a Button would.
-The new paint method, to be implemented in the native -rendering library, must be declared as public native void -, and the native library itself is loaded at runtime by including a -call to System.loadLibrary( "myRenderingLib")in -the static block of the class. The myRenderingLib -name is used for the native shared library; for Linux or the Solaris -operating environment, the actual name for the library file on disk -is libmyRenderingLib.so .
-Here is a simple example of such a class:
--import java.awt.*; -import java.awt.event.*; - -public class MyCanvas extends Canvas { - static { - System.loadLibrary("myRenderingLib"); - } - public native void paint(Graphics g); - - public static void main(String[] args) { - Frame f = new Frame(); - f.setBounds(0, 0, 500, 110); - f.add(new MyCanvas()); - f.addWindowListener( new WindowAdapter() { - public void windowClosing(WindowEvent ev) { - System.exit(0); - } - } ); - f.show(); - } -} --
-Note that this class has a main method that can be used -to run this code as an application for testing purposes.
-The next step is to run the javah tool on the -MyCanvas class file above to generate a C/C++ header file -that describes the interface to the native paint method -that Java expects to be used. javah is a standard tool -included with the JDK. NB: javac -h outputdir may also be used.
- -The final step and the most interesting one is to -write the native rendering method, with an interface that conforms -to the header file that javah generated, and build it as a -standard shared library (called myRenderingLib in the -above example) by linking it, against the appropriate JDK provided -$JDK_HOME/lib/$JAWT_LIB library for the target platform. -Where JAWT_LIB has the base name "jawt" and follows platform -shared object naming rules. i.e.: -
-
- -This code will call back to the Java virtual machine to -get the drawing surface information it needs to access the -MyCanvas peer. Once this information is available, the -code can draw directly to MyCanvas using standard drawing -routines supplied by the underlying operating system.- Windows: jawt.dll -
- MacOS: libjawt.dylib -
- Linux: libjawt.so -
- Solaris: libjawt.so -
Here is sample source code for a native paint method -designed for use in a X11-based drawing environment (Linux -or Solaris) and a Java VM where the AWT Native Interface is present:
--#include "MyCanvas.h" -#include "jawt_md.h" - -/* - * Class: MyCanvas - * Method: paint - * Signature: (Ljava/awt/Graphics;)V - */ -JNIEXPORT void JNICALL Java_MyCanvas_paint -(JNIEnv* env, jobject canvas, jobject graphics) -{ - JAWT awt; - JAWT_DrawingSurface* ds; - JAWT_DrawingSurfaceInfo* dsi; - JAWT_X11DrawingSurfaceInfo* dsi_x11; - jboolean result; - jint lock; - GC gc; - - short i; - char *testString = "^^^ rendered from native code ^^^"; - - /* Get the AWT */ - awt.version = JAWT_VERSION_9; - if (JAWT_GetAWT(env, &awt) == JNI_FALSE) { - printf("AWT Not found\n"); - return; - } - - /* Get the drawing surface */ - ds = awt.GetDrawingSurface(env, canvas); - if (ds == NULL) { - printf("NULL drawing surface\n"); - return; - } - - /* Lock the drawing surface */ - lock = ds->Lock(ds); - if((lock & JAWT_LOCK_ERROR) != 0) { - printf("Error locking surface\n"); - awt.FreeDrawingSurface(ds); - return; - } - - /* Get the drawing surface info */ - dsi = ds->GetDrawingSurfaceInfo(ds); - if (dsi == NULL) { - printf("Error getting surface info\n"); - ds->Unlock(ds); - awt.FreeDrawingSurface(ds); - return; - } - - /* Get the platform-specific drawing info */ - dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo; - - - /* Now paint */ - gc = XCreateGC(dsi_x11->display, dsi_x11->drawable, 0, 0); - XSetBackground(dsi_x11->display, gc, 0); - for (i=0; i<36;i++) - { - XSetForeground(dsi_x11->display, gc, 10*i); - XFillRectangle(dsi_x11->display, dsi_x11->drawable, gc, - 10*i, 5, 90, 90); - } - XSetForeground(dsi_x11->display, gc, 155); - XDrawImageString(dsi_x11->display, dsi_x11->drawable, gc, - 100, 110, testString, strlen(testString)); - XFreeGC(dsi_x11->display, gc); - - - /* Free the drawing surface info */ - ds->FreeDrawingSurfaceInfo(dsi); - - /* Unlock the drawing surface */ - ds->Unlock(ds); - - /* Free the drawing surface */ - awt.FreeDrawingSurface(ds); -} --The key data structure here is JAWT , which is defined -in jawt.h (included by jawt_md.h) ; it provides -access to all the information the native code needs to get the job -done. The first part of the native method is boilerplate: it -populates the JAWT structure, gets a -JAWT_DrawingSurface structure, locks the surface (only one -drawing engine at a time, please!), then gets a -JAWT_DrawingSurfaceInfo structure that contains a pointer -(in the platformInfo field) to the necessary -platform-specific drawing information. It also includes the -bounding rectangle of the drawing surface and the current clipping -region.
-The structure of the information pointed to by -platformInfo is defined in a machine-dependent header file -called jawt_md.h. For X11 drawing, it includes -information about the X11 display and X11 drawable associated with -MyCanvas. After the drawing operations are completed, -there is more boilerplate code as JAWT_DrawingSurfaceInfo -is freed and JAWT_DrawingSurface is unlocked and -freed.
-The corresponding code for the GDI API on the Microsoft Windows platform would -be structured similarly, but would include the version of -jawt_md.h for Microsoft Windows and the structure located -in the platformInfo field of drawing surface info would be -cast as a JAWT_Win32DrawingSurfaceInfo* . And, of course, -the actual drawing operations would need to be changed to those -appropriate for the Microsoft Windows platform. -The same also for MacOS. -
-Summary
-The ability to draw directly into a Java Canvas from a -native code library is extremely useful for developers planning to -migrate a legacy software system to Java, especially one that -includes a high-performance rendering engine. It makes it much -easier to migrate in stages, leaving performance-sensitive -rendering code alone, while other less-sensitive portions of code -are converted to Java. The result can be a modern Java-centric -application, providing the benefit of portability and development -efficiency, but one that does not sacrifice an investment in -performance of a key piece of native code.
-References
-The definitive reference to the Java Native Interface is The -Java Native Interface: Programmer's Guide and Specification by -Sheng Liang. This book was published in June -1999 by Addison-Wesley. The ISBN is 0-201-32577-2.
-Appendix
-Header Files for jawt.h and jawt_md.h
- -jawt.h
--#ifndef _JAVASOFT_JAWT_H_ -#define _JAVASOFT_JAWT_H_ - -#include "jni.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * AWT native interface. - * - * The AWT native interface allows a native C or C++ application a means - * by which to access native structures in AWT. This is to facilitate moving - * legacy C and C++ applications to Java and to target the needs of the - * developers who need to do their own native rendering to canvases - * for performance or other reasons. - * - * Conversely it also provides mechanisms for an application which already - * has a native window to provide that to AWT for AWT rendering. - * - * Since every platform may be different in its native data structures - * and APIs for windowing systems the application must necessarily - * provided per-platform source and compile and deliver per-platform - * native code to use this API. - * - * These interfaces are not part of the Java SE specification and - * a VM is not required to implement this API. However it is strongly - * recommended that all implementations which support headful AWT - * also support these interfaces. - * - */ - -/* - * AWT Native Drawing Surface (JAWT_DrawingSurface). - * - * For each platform, there is a native drawing surface structure. This - * platform-specific structure can be found in jawt_md.h. It is recommended - * that additional platforms follow the same model. It is also recommended - * that VMs on all platforms support the existing structures in jawt_md.h. - * - ******************* - * EXAMPLE OF USAGE: - ******************* - * - * On Microsoft Windows, a programmer wishes to access the HWND of a canvas - * to perform native rendering into it. The programmer has declared the - * paint() method for their canvas subclass to be native: - * - * - * MyCanvas.java: - * - * import java.awt.*; - * - * public class MyCanvas extends Canvas { - * - * static { - * System.loadLibrary("mylib"); - * } - * - * public native void paint(Graphics g); - * } - * - * - * myfile.c: - * - * #include "jawt_md.h" - * #include <assert.h> - * - * JNIEXPORT void JNICALL - * Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics) - * { - * JAWT awt; - * JAWT_DrawingSurface* ds; - * JAWT_DrawingSurfaceInfo* dsi; - * JAWT_Win32DrawingSurfaceInfo* dsi_win; - * jboolean result; - * jint lock; - * - * // Get the AWT. Request version 9 to access features in that release. - * awt.version = JAWT_VERSION_9; - * result = JAWT_GetAWT(env, &awt); - * assert(result != JNI_FALSE); - * - * // Get the drawing surface - * ds = awt.GetDrawingSurface(env, canvas); - * assert(ds != NULL); - * - * // Lock the drawing surface - * lock = ds->Lock(ds); - * assert((lock & JAWT_LOCK_ERROR) == 0); - * - * // Get the drawing surface info - * dsi = ds->GetDrawingSurfaceInfo(ds); - * - * // Get the platform-specific drawing info - * dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo; - * - * ////////////////////////////// - * // !!! DO PAINTING HERE !!! // - * ////////////////////////////// - * - * // Free the drawing surface info - * ds->FreeDrawingSurfaceInfo(dsi); - * - * // Unlock the drawing surface - * ds->Unlock(ds); - * - * // Free the drawing surface - * awt.FreeDrawingSurface(ds); - * } - * - */ - -/* - * JAWT_Rectangle - * Structure for a native rectangle. - */ -typedef struct jawt_Rectangle { - jint x; - jint y; - jint width; - jint height; -} JAWT_Rectangle; - -struct jawt_DrawingSurface; - -/* - * JAWT_DrawingSurfaceInfo - * Structure for containing the underlying drawing information of a component. - */ -typedef struct jawt_DrawingSurfaceInfo { - /* - * Pointer to the platform-specific information. This can be safely - * cast to a JAWT_Win32DrawingSurfaceInfo on Microsoft Windows or a - * JAWT_X11DrawingSurfaceInfo on Linux and Solaris. On MacOS this is a - * pointer to a NSObject that conforms to the JAWT_SurfaceLayers protocol. - * See jawt_md.h for details. - */ - void* platformInfo; - /* Cached pointer to the underlying drawing surface */ - struct jawt_DrawingSurface* ds; - /* Bounding rectangle of the drawing surface */ - JAWT_Rectangle bounds; - /* Number of rectangles in the clip */ - jint clipSize; - /* Clip rectangle array */ - JAWT_Rectangle* clip; -} JAWT_DrawingSurfaceInfo; - -#define JAWT_LOCK_ERROR 0x00000001 -#define JAWT_LOCK_CLIP_CHANGED 0x00000002 -#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004 -#define JAWT_LOCK_SURFACE_CHANGED 0x00000008 - -/* - * JAWT_DrawingSurface - * Structure for containing the underlying drawing information of a component. - * All operations on a JAWT_DrawingSurface MUST be performed from the same - * thread as the call to GetDrawingSurface. - */ -typedef struct jawt_DrawingSurface { - /* Cached reference to the Java environment of the calling thread. - * If Lock(), Unlock(), GetDrawingSurfaceInfo() or - * FreeDrawingSurfaceInfo() are called from a different thread, - * this data member should be set before calling those functions. - */ - JNIEnv* env; - /* Cached reference to the target object */ - jobject target; - /* - * Lock the surface of the target component for native rendering. - * When finished drawing, the surface must be unlocked with - * Unlock(). This function returns a bitmask with one or more of the - * following values: - * - * JAWT_LOCK_ERROR - When an error has occurred and the surface could not - * be locked. - * - * JAWT_LOCK_CLIP_CHANGED - When the clip region has changed. - * - * JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed. - * - * JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed - */ - jint (JNICALL *Lock) - (struct jawt_DrawingSurface* ds); - /* - * Get the drawing surface info. - * The value returned may be cached, but the values may change if - * additional calls to Lock() or Unlock() are made. - * Lock() must be called before this can return a valid value. - * Returns NULL if an error has occurred. - * When finished with the returned value, FreeDrawingSurfaceInfo must be - * called. - */ - JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo) - (struct jawt_DrawingSurface* ds); - /* - * Free the drawing surface info. - */ - void (JNICALL *FreeDrawingSurfaceInfo) - (JAWT_DrawingSurfaceInfo* dsi); - /* - * Unlock the drawing surface of the target component for native rendering. - */ - void (JNICALL *Unlock) - (struct jawt_DrawingSurface* ds); -} JAWT_DrawingSurface; - -/* - * JAWT - * Structure for containing native AWT functions. - */ -typedef struct jawt { - /* - * Version of this structure. This must always be set before - * calling JAWT_GetAWT(). It affects the functions returned. - * Must be one of the known pre-defined versions. - */ - jint version; - /* - * Return a drawing surface from a target jobject. This value - * may be cached. - * Returns NULL if an error has occurred. - * Target must be a java.awt.Component (should be a Canvas - * or Window for native rendering). - * FreeDrawingSurface() must be called when finished with the - * returned JAWT_DrawingSurface. - */ - JAWT_DrawingSurface* (JNICALL *GetDrawingSurface) - (JNIEnv* env, jobject target); - /* - * Free the drawing surface allocated in GetDrawingSurface. - */ - void (JNICALL *FreeDrawingSurface) - (JAWT_DrawingSurface* ds); - /* - * Since 1.4 - * Locks the entire AWT for synchronization purposes - */ - void (JNICALL *Lock)(JNIEnv* env); - /* - * Since 1.4 - * Unlocks the entire AWT for synchronization purposes - */ - void (JNICALL *Unlock)(JNIEnv* env); - /* - * Since 1.4 - * Returns a reference to a java.awt.Component from a native - * platform handle. On Windows, this corresponds to an HWND; - * on Solaris and Linux, this is a Drawable. For other platforms, - * see the appropriate machine-dependent header file for a description. - * The reference returned by this function is a local - * reference that is only valid in this environment. - * This function returns a NULL reference if no component could be - * found with matching platform information. - */ - jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo); - - /** - * Since 9 - * Creates a java.awt.Frame placed in a native container. Container is - * referenced by the native platform handle. For example on Windows this - * corresponds to an HWND. For other platforms, see the appropriate - * machine-dependent header file for a description. The reference returned - * by this function is a local reference that is only valid in this - * environment. This function returns a NULL reference if no frame could be - * created with matching platform information. - */ - jobject (JNICALL *CreateEmbeddedFrame) (JNIEnv *env, void* platformInfo); - - /** - * Since 9 - * Moves and resizes the embedded frame. The new location of the top-left - * corner is specified by x and y parameters relative to the native parent - * component. The new size is specified by width and height. - * - * The embedded frame should be created by CreateEmbeddedFrame() method, or - * this function will not have any effect. - * - * java.awt.Component.setLocation() and java.awt.Component.setBounds() for - * EmbeddedFrame really don't move it within the native parent. These - * methods always locate the embedded frame at (0, 0) for backward - * compatibility. To allow moving embedded frames this method was - * introduced, and it works just the same way as setLocation() and - * setBounds() for usual, non-embedded components. - * - * Using usual get/setLocation() and get/setBounds() together with this new - * method is not recommended. - */ - void (JNICALL *SetBounds) (JNIEnv *env, jobject embeddedFrame, - jint x, jint y, jint w, jint h); - /** - * Since 9 - * Synthesize a native message to activate or deactivate an EmbeddedFrame - * window depending on the value of parameter doActivate, if "true" - * activates the window; otherwise, deactivates the window. - * - * The embedded frame should be created by CreateEmbeddedFrame() method, or - * this function will not have any effect. - */ - void (JNICALL *SynthesizeWindowActivation) (JNIEnv *env, - jobject embeddedFrame, jboolean doActivate); -} JAWT; - -/* - * Get the AWT native structure. This function returns JNI_FALSE if - * an error occurs. - */ -_JNI_IMPORT_OR_EXPORT_ -jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt); - -/* - * Specify one of these constants as the JAWT.version - * Specifying an earlier version will limit the available functions to - * those provided in that earlier version of JAWT. - * See the "Since" note on each API. Methods with no "Since" - * may be presumed to be present in JAWT_VERSION_1_3. - */ -#define JAWT_VERSION_1_3 0x00010003 -#define JAWT_VERSION_1_4 0x00010004 -#define JAWT_VERSION_1_7 0x00010007 -#define JAWT_VERSION_9 0x00090000 - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* !_JAVASOFT_JAWT_H_ */ - --jawt_md.h (Linux/Solaris/X11 operating environment version)
--#ifndef _JAVASOFT_JAWT_MD_H_ -#define _JAVASOFT_JAWT_MD_H_ - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Intrinsic.h> -#include "jawt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * X11-specific declarations for AWT native interface. - * See notes in jawt.h for an example of use. - */ -typedef struct jawt_X11DrawingSurfaceInfo { - Drawable drawable; - Display* display; - VisualID visualID; - Colormap colormapID; - int depth; -} JAWT_X11DrawingSurfaceInfo; - -#ifdef __cplusplus -} -#endif - -#endif /* !_JAVASOFT_JAWT_MD_H_ */ --jawt_md.h (Microsoft Windows version)
--#ifndef _JAVASOFT_JAWT_MD_H_ -#define _JAVASOFT_JAWT_MD_H_ - -#include <windows.h> -#include "jawt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Microsoft Windows specific declarations for AWT native interface. - * See notes in jawt.h for an example of use. - */ -typedef struct jawt_Win32DrawingSurfaceInfo { - /* Native window, DDB, or DIB handle */ - union { - HWND hwnd; - HBITMAP hbitmap; - void* pbits; - }; - /* - * This HDC should always be used instead of the HDC returned from - * BeginPaint() or any calls to GetDC(). - */ - HDC hdc; - HPALETTE hpalette; -} JAWT_Win32DrawingSurfaceInfo; - -#ifdef __cplusplus -} -#endif - -#endif /* !_JAVASOFT_JAWT_MD_H_ */ --jawt_md.h (MacOS version)
--#ifndef _JAVASOFT_JAWT_MD_H_ -#define _JAVASOFT_JAWT_MD_H_ - -#include "jawt.h" - -#ifdef __OBJC__ -#import- - - diff --git a/jdk/src/java.management/share/specs/JVM-MANAGEMENT-MIB.mib b/jdk/src/java.management/share/specs/JVM-MANAGEMENT-MIB.mib deleted file mode 100644 index b1d9eab3d85..00000000000 --- a/jdk/src/java.management/share/specs/JVM-MANAGEMENT-MIB.mib +++ /dev/null @@ -1,3266 +0,0 @@ --- --- --- --- Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. --- 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. --- --- --- The JVM-MANAGEMENT-MIB Module --- --- See jvmManagementMIB MODULE-IDENTITY for a description overview. --- See conformance statements for mandatory objects --- - -JVM-MANAGEMENT-MIB DEFINITIONS ::= BEGIN - -IMPORTS - MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, Counter32, Gauge32, - Integer32, Counter64, enterprises - FROM SNMPv2-SMI - DisplayString, TEXTUAL-CONVENTION, RowPointer - FROM SNMPv2-TC - MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP - FROM SNMPv2-CONF; - --- Module Identity ------------------- - -jvmMgtMIB MODULE-IDENTITY - LAST-UPDATED "200403041800Z" - -- Format is "YYYYMMDDhhmmZ" - ORGANIZATION "Sun Microsystems, Inc." - CONTACT-INFO "Sun Microsystems, Inc. - 4150 Network Circle - Santa Clara, CA 95054 - 1-800-555-9SUN or - 1-650-960-1300 - http://www.sun.com - or contact your local support representative" - DESCRIPTION - "Copyright 2004 Sun Microsystems, Inc. All rights reserved. - - This module defines the MIB that provides access to the - Java[tm] Virtual Machine monitoring data. - This module is derived from the Java[tm] programming language APIs - described in the java.lang.management package of - Java[tm] 2, Standard Edition, 5.0. - - See the Java programming language APIs of JSR 163 for - 'Monitoring and Management of the Java[TM] Virtual Machine' - for more details. - - Where the Java programming language API uses long, or int, - the MIB often uses the corresponding unsigned quantity - - which is closer to the object semantics. - - In those cases, it often happens that the -1 value that might - be used by the API to indicate an unknown/unimplemented - value cannot be used. Instead the MIB uses the value 0, which - stricly speaking cannot be distinguished from a valid value. - In many cases however, a running system will have non-zero - values, so using 0 instead of -1 to indicate an unknown - quantity does not lose any functionality. - " - REVISION "200403041800Z" - -- Format is "YYYYMMDDhhmmZ" - DESCRIPTION - " - JVM-MANAGEMENT-MIB - JSR 163 Final Release 1.0 - " - - ::= { standard jsr163(163) 1 } - - --- Enterprise OIDs ------------------- - --- internet OBJECT IDENTIFIER ::= { iso(1) org(3) dod(6) 1 } --- private OBJECT IDENTIFIER ::= { internet 4 } --- enterprises OBJECT IDENTIFIER ::= { private 1 } - sun OBJECT IDENTIFIER ::= { enterprises 42 } - jmgt OBJECT IDENTIFIER ::= { sun products(2) 145 } - -- experimental OBJECT IDENTIFIER ::= { jmgt 1 } - standard OBJECT IDENTIFIER ::= { jmgt 3 } - ----------------------------------------------------------------------------- --- Textual Conventions ----------------------- --- --- Note: Some of the TEXTUAL-CONVENTIONs defined in this module are --- OCTET STRING with a 1023 size limitation (SIZE(0..1023)). --- --- As per RFC2578, section 7.1.2. OCTET STRING: --- --- "The OCTET STRING type represents arbitrary binary or textual data. --- Although the SMI-specified size limitation for this type is 65535 --- octets, MIB designers should realize that there may be --- implementation and interoperability limitations for sizes in --- excess of 255 octets." --- --- As a consequence an agent implementing this MIB may decide to --- restrict this maximum size to a lesser value than 1023, provided that --- it makes it clear in an AGENT-CAPABILITY statement. --- ----------------------------------------------------------------------------- - -JvmUnsigned64TC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "A non-negative 64-bit bit integer, without counter - semantics." - -- We have cloned the Unsigned64TC defined in RFC 2564 rather - -- than importing it because the JVM-MANAGEMENT-MIB and the - -- APPLICATION-MIB are not related. - -- - REFERENCE "RFC 2564 - APPLICATION-MIB, Unsigned64TC." - SYNTAX Counter64 - - -JvmJavaObjectNameTC ::= TEXTUAL-CONVENTION - DISPLAY-HINT "255a" - STATUS current - DESCRIPTION - "An Object Name, as implemented by the java.lang.management API, - which identify a runtime Object (e.g. a Class Loader, a - Memory Manager, etc...). - The name is assumed to be unique in the scope of the object's - class. - - This object syntax is equivalent to a DisplayString, but with a - a 1023 bytes size limits (instead of 255 for a DisplayString). - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in this type. - (1023 bytes max). - " - SYNTAX OCTET STRING (SIZE (0..1023)) - -JvmPathElementTC ::= TEXTUAL-CONVENTION - DISPLAY-HINT "255a" - STATUS current - DESCRIPTION - "A file or directory element in a PATH/CLASSPATH/LIBRARY_PATH - structure. - - This object syntax is equivalent to a DisplayString, but with a - a 1023 bytes size limits (instead of 255 for a DisplayString). - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in this type. - (1023 bytes max). - " - SYNTAX OCTET STRING (SIZE (0..1023)) - -JvmArgValueTC ::= TEXTUAL-CONVENTION - DISPLAY-HINT "255a" - STATUS current - DESCRIPTION - "A string representing an input argument. - - This object syntax is equivalent to a DisplayString, but with a - a 1023 bytes size limits (instead of 255 for a DisplayString). - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in this type. - (1023 bytes max). - " - SYNTAX OCTET STRING (SIZE (0..1023)) - -JvmVerboseLevelTC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "Defines whether the verbose flag for a feature is active. - verbose: the flag is on. - silent: the flag is off. - " - SYNTAX INTEGER { silent(1), verbose(2) } - - -JvmImplSupportStateTC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "Defines whether a feature is supported or not. - " - SYNTAX INTEGER { unsupported(1), supported(2) } - -JvmImplOptFeatureStateTC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "Defines whether an optional feature is supported, enabled, - or disabled. - - An optional feature can be: - - unsupported: The JVM does not support this feature. - enabled : The JVM supports this feature, and it - is enabled. - disabled : The JVM supports this feature, and it - is disabled. - - Only enabled(3) and disabled(4) may be supplied as values to a - SET request. unsupported(1) can only be set internally by the - agent. - " - SYNTAX INTEGER { unsupported(1), enabled(3), disabled(4) } - -JvmTimeMillis64TC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "An elapsed time, expressed in milli-seconds. - This type is based on Counter64, but without its specific - semantics. - " - SYNTAX Counter64 - -JvmTimeNanos64TC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "An elapsed time, expressed in nano-seconds. - This type is based on Counter64, but without its specific - semantics. - " - SYNTAX Counter64 - -JvmPositive32TC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "A positive Integer32. In Java that would be a number - in [0..Integer.MAX_VALUE]. - " - -- We use Integer32 (0..2147483647) rather than Unsigned32 because - -- Unsigned32 (0..2147483647) because Unsigned32 is based on - -- Gauge32 - which has a specific ASN.1 tag and a specific semantics. - -- In principle you cannot use a Gauge32 as base type for an index - -- in a table. - -- Note also that Unsigned32 is (0..2^32-1) - -- while Positive32 is (0..2^31-1) - -- - SYNTAX Integer32 (0..2147483647) - -JvmManagedMemoryTypeTC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - " - Defines the type of memory contained in a memory pool. - The pool may contain, heap memory or non-heap memory. - " - SYNTAX INTEGER { nonheap(1), heap(2) } - - -JvmValidityStateTC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - " - Defines whether an object is still valid. - " - SYNTAX INTEGER { invalid(1), valid(2) } - - -JvmThreadStateTC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "Defines the possible states of a thread running in the - Java virtual machine. They are virtual machine thread states - and do not reflect any operating system thread states. - - The first two bits: inNative(1) and suspended(2) can be - combined together and with any other bits. The remaining - bits 3-9, are mutually exclusive. Bits 10-16 are reserved - for future evolution of this MIB. - - An agent MUST always return a thread state with one of the - bits in the range 3-9 set to 1. The other(9) bit should only - be set to 1 if new thread states which are mutally exclusive - with bits 3-8 are defined. An implementation can define - additional implementation dependant states and uses bits - from bit 17. - - See java.lang.Thread.State, - java.lang.management.ThreadInfo. - " - -- - -- Take care that in SNMP bits are numbered starting at 1, from - -- left to right (1 is the highest bit). A bitmap defined by the - -- BITS construct is thus a byte array where bit 1 is the highest bit - -- of the first byte. - -- - SYNTAX BITS { -- Bits 1-2 may be specified in any combination - inNative(1), - suspended(2), - - -- Bits 3-9 are mutually exclusive. Attempting to - -- set more than a single bit to 1 will result in - -- a returned error-status of inconsistentValue. - newThread(3), - runnable(4), - blocked(5), - terminated(6), - waiting(7), - timedWaiting(8), - other(9) - -- Bits 10-16 are reserved for future use by - -- this MIB - } - - -JvmIndex64TC ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "A 64 bits string mapping an unsigned 64 bits integer value - in big-endian ordering (i.e: 1 is encoded as 0x0000000000000001). - - This type can be used when an unsigned 64 bits integer needs - to be used inside a table index. - " - SYNTAX OCTET STRING (SIZE(8)) - - --- OBJECT-TYPE OID tree ------------------------ - -jvmMgtMIBObjects - OBJECT IDENTIFIER ::= { jvmMgtMIB 1 } -jvmMgtMIBNotifications - OBJECT IDENTIFIER ::= { jvmMgtMIB 2 } -jvmMgtMIBConformance - OBJECT IDENTIFIER ::= { jvmMgtMIB 3 } - ------------------------------------------------------------------------ --- --- The JVM Class Loading group --- --- A collection of objects used to monitor Class Loading in the --- Java Virtual Machine. These objects define the SNMP management --- interface for the class loading system of the Java virtual machine. --- --- This group only contains a few scalar object and no tables. The objects --- from this group are mapped from the java.lang.management.ClassLoadingMXBean --- interface. --- --- See J2SE 5.0 API Specification, --- java.lang.management.ClassLoadingMXBean ------------------------------------------------------------------------ - --- Root OBJECT IDENTIFIER for ClassLoading group. --- -jvmClassLoading OBJECT IDENTIFIER ::= { jvmMgtMIBObjects 1 } - --- The following objects are mapped from the ClassLoadingMXBean interface. ------------------------------------------------------------------------ - -jvmClassesLoadedCount OBJECT-TYPE - SYNTAX Gauge32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The number of classes currently loaded in the JVM. - - See java.lang.management.ClassLoadingMXBean.getLoadedClassCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ClassLoadingMXBean" - ::= { jvmClassLoading 1 } - -jvmClassesTotalLoadedCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The total number of classes that have been loaded since - the JVM has started execution. - - See java.lang.management.ClassLoadingMXBean. - getTotalLoadedClassCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ClassLoadingMXBean" - ::= { jvmClassLoading 2 } - -jvmClassesUnloadedCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The total number of classes that have been unloaded since - the JVM has started execution. - - See java.lang.management.ClassLoadingMXBean.getUnloadedClassCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ClassLoadingMXBean" - ::= { jvmClassLoading 3 } - -jvmClassesVerboseLevel OBJECT-TYPE - SYNTAX JvmVerboseLevelTC - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "Enables or disables the verbose output for the class loading - system. The verbose output information and the output stream - to which the verbose information is emitted are implementation - dependent. Typically, a Java virtual machine implementation - prints a message each time a class file is loaded. - - verbose: if the verbose output is enabled. - silent: otherwise. - - See java.lang.management.ClassLoadingMXBean.isVerbose(), - java.lang.management.ClassLoadingMXBean.setVerbose() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ClassLoadingMXBean" - DEFVAL { silent } - ::= { jvmClassLoading 4 } - - ------------------------------------------------------------------------ --- --- The JVM Memory group --- --- A collection of objects used to monitor memory management in the --- Java Virtual Machine. These objects define management interface for --- the memory system of the Java virtual machine. --- --- Memory: --- --- The memory system of the Java virtual machine manages the following --- kinds of memory: heap, and non-heap. More information on these types --- of memory can be obtained from the J2SE 5.0 API Specification, --- java.lang.management.MemoryMXBean. --- --- Memory Pools and Memory Managers: --- --- Memory pools and memory managers are the abstract entities that monitor --- and manage the memory system of the Java virtual machine. --- --- Memory managers are represented by the jvmMemManagerTable, which contains --- one row per Memory manager. --- The garbage collector is one type of memory manager responsible for --- reclaiming memory occupied by unreachable objects. --- The jvmMemGCTable is an extension of the jvmMemManagerTable, which contains --- the attribute specific to garbage collectors. A garbage collector entity --- is thus represented by one row in the jvmMemManagerTable, and one --- extension row in the jvmMemGCTable. --- --- Memory Pools are represented by the jvmMemPoolTable, which contains one --- row per memory pool. A Java virtual machine may create or remove --- memory pools during execution. A memory pool can belong to either the --- heap or the non-heap memory. --- --- A memory manager is responsible for managing one or more memory pools. --- A memory pool can be managed by more than one memory manager. --- The jvmMemMgrRelPoolTable represents this managing/managed relationship. --- --- A Java virtual machine may add or remove memory managers during execution. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryMXBean for --- more information on memory types, memory managers, memory pools, --- and the memory subsystem. --- ------------------------------------------------------------------------ - --- Root OBJECT IDENTIFIER for the JVM Memory group. --- -jvmMemory OBJECT IDENTIFIER ::= { jvmMgtMIBObjects 2 } - --- The following objects are mapped from the MemoryMXBean interface. ------------------------------------------------------------------------ - -jvmMemoryPendingFinalCount OBJECT-TYPE - SYNTAX Gauge32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The approximate number objects that are pending for finalization. - - See java.lang.management.MemoryMXBean. - getObjectPendingFinalizationCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean" - ::= { jvmMemory 1 } - -jvmMemoryGCVerboseLevel OBJECT-TYPE - SYNTAX JvmVerboseLevelTC - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "Enables or disables verbose output for the memory system. - The verbose output information and the output stream to which - the verbose information is emitted are implementation dependent. - Typically, a Java virtual machine implementation prints a - message whenever it frees memory at garbage collection. - - verbose: if the verbose output is enabled, - silent: otherwise. - - See java.lang.management.MemoryMXBean.isVerbose(), - java.lang.management.MemoryMXBean.setVerbose() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean" - ::= { jvmMemory 2 } - -jvmMemoryGCCall OBJECT-TYPE - SYNTAX INTEGER { unsupported(1), supported(2), start(3), - started(4), failed(5) } - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "This object makes it possible to remotelly trigger the - Garbage Collector in the JVM. - - This object's syntax is an enumeration which defines: - - * Two state values, that can be returned from a GET request: - - unsupported(1): means that remote invocation of gc() is not - supported by the SNMP agent. - supported(2) : means that remote invocation of gc() is supported - by the SNMP agent. - - * One action value, that can be provided in a SET request to - trigger the garbage collector: - - start(3) : means that a manager wishes to trigger - garbage collection. - - * Two result value, that will be returned in the response to a - SET request when remote invocation of gc is supported - by the SNMP agent: - - started(4) : means that garbage collection was - successfully triggered. It does not mean - however that the action was successfullly - completed: gc might still be running when - this value is returned. - failed(5) : means that garbage collection couldn't be - triggered. - - * If remote invocation is not supported by the SNMP agent, then - unsupported(1) will always be returned as a result of either - a GET request, or a SET request with start(3) as input value. - - * If a SET request with anything but start(3) is received, then - the agent will return a wrongValue error. - - See java.lang.management.MemoryMXBean.gc() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean" - ::= { jvmMemory 3 } - --- The object identifiers in the range jvmMemory.[4-9] are reserved for future --- evolution of this MIB. --- --- We use the range jvmMemory.[10..19] for objects related to global JVM --- heap memory usage, as returned by --- java.lang.management.MemoryMXBean.getHeapMemoryUsage(). --- Object identifiers in the range jvmMemory.[14..19] are not used but --- reserved for future evolution of this MIB. --- -jvmMemoryHeapInitSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total amount of memory (in bytes) that the Java virtual machine - initially requests from the operating system for memory management - for heap memory pools. - - See java.lang.management.MemoryMXBean.getHeapMemoryUsage().getInit() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 10 } - - -jvmMemoryHeapUsed OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total amount of used memory (in bytes) from heap memory pools. - - See java.lang.management.MemoryMXBean.getHeapMemoryUsage().getUsed() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 11 } - -jvmMemoryHeapCommitted OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total amount of memory (in bytes) committed by heap memory pools. - - See java.lang.management.MemoryMXBean.getHeapMemoryUsage(). - getCommitted() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 12 } - -jvmMemoryHeapMaxSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total maximum size of memory (in bytes) for all heap memory pools. - - See java.lang.management.MemoryMXBean.getHeapMemoryUsage().getMax() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 13 } - --- We use the range jvmMemory.[20..29] for objects related to global JVM --- heap memory usage, as returned by --- lang.management.MemoryMXBean.getNonHeapMemoryUsage(). --- Object identifiers in the range jvmMemory.[24..29] are not used but are --- reserved for future evolution of this MIB. --- -jvmMemoryNonHeapInitSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total amount of memory (in bytes) that the Java virtual machine - initially requests from the operating system for memory management - for non heap memory pools. - - See java.lang.management.MemoryMXBean.getNonHeapMemoryUsage().getInit() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 20 } - - -jvmMemoryNonHeapUsed OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total amount of used memory (in bytes) from non heap memory pools. - - See java.lang.management.MemoryMXBean.getNonHeapMemoryUsage().getUsed() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 21 } - -jvmMemoryNonHeapCommitted OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total amount of memory (in bytes) committed by non heap memory pools. - - See java.lang.management.MemoryMXBean. - getNonHeapMemoryUsage().getCommitted() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 22 } - -jvmMemoryNonHeapMaxSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Total maximum size of memory (in bytes) for all non heap memory pools. - - See java.lang.management.MemoryMXBean.getNonHeapMemoryUsage().getMax() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemory 23 } - --- The object identifiers in the range jvmMemory.[30-99] are not used but are --- reserved for future evolution of this MIB. --- --- The JVM Memory Manager Table --- --- The jvmMemManagerTable represent memory manager abstract entities. --- The jvmMemManagerTable contains one row per memory manager. In --- addition, those memory managers which are also garbage collectors have --- an extension row in the jvmMemGCTable. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryMXBean for --- a detailed description of the memory subsystem. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryManagerMXBean --- for more information on memory managers. --- ------------------------------------------------------------------------ --- --- We use the range jvmMemory.[100..109] for objects related to memory --- managers. --- Object identifiers in the range jvmMemory.[102-109] are not used --- but are reserved for future evolution of this MIB. --- -jvmMemManagerTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmMemManagerEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The Memory Manager Table contains the whole list of Memory - Managers as returned by ManagementFactory.getMemoryManagerMXBeans(). - - When a MemoryManagerMXBean object is an instance of - GarbageCollectorMXBean, then additional information specific to - the GarbageCollectorMXBean class will be found in the - jvmGCTable, at the same index. - - Relationships between MemoryManagers and MemoryPools are shown - by the Memory Manager-Pool Relation table (jvmMemMgrPoolRelTable). - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryManagerMXBean" - ::= { jvmMemory 100 } - -jvmMemManagerEntry OBJECT-TYPE - SYNTAX JvmMemManagerEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "A jvmMemManagerEntry conceptual row represent an instance of the - java.lang.management.MemoryManagerMXBean interface. If that instance - is also an instance of java.lang.management.GarbageCollectorMXBean, - then additional information will be found in the jvmGCTable, at the - same index. - - Columnar objects in this table are mapped from attributes of - the MemoryManagerMXBean interface. - - See java.lang.management.MemoryManagerMXBean - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryManagerMXBean" - INDEX { jvmMemManagerIndex } - ::= { jvmMemManagerTable 1 } - -JvmMemManagerEntry ::= SEQUENCE { - jvmMemManagerIndex JvmPositive32TC, - jvmMemManagerName JvmJavaObjectNameTC, - jvmMemManagerState JvmValidityStateTC -} - -jvmMemManagerIndex OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "An index opaquely computed by the agent and which uniquely - identifies a Memory Manager. - - The jvmMemManagerIndex index is opaquely computed by the agent, - from e.g the hash code of the MemoryManager (or MemoryManager name). - The agent is responsible for allocating a free index when it needs - one (e.g. if two objects have the same hash, then it may increment - one of the values until the conflict is resolved). As a result a - manager must not depend on the value of that index across, - e.g. reboot of the agent, as this value is not guaranteed to - stay identical after the agent restarts. - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryManagerMXBean" - ::= { jvmMemManagerEntry 1 } - -jvmMemManagerName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The name of this memory manager, as returned by - MemoryManagerMXBean.getName(). - - See java.mangement.MemoryManagerMXBean.getName(). - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryManagerMXBean" - ::= { jvmMemManagerEntry 2 } - -jvmMemManagerState OBJECT-TYPE - SYNTAX JvmValidityStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Indicates whether this memory manager is valid in the Java - virtual machine. A memory manager becomes invalid once the - Java virtual machine removes it from the memory system. - - See java.lang.management.MemoryManagerMXBean.isValid() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryManagerMXBean" - ::= { jvmMemManagerEntry 3 } - - --- The JVM Garbage Collector Table --- --- The jvmMemGCTable is an extension of the jvmMemManagerTable. --- It represents garbage collector abstract entities. A garbage collector --- is a memory manager responsible for reclaiming memory occupied by --- unreachable objects. --- --- A garbage collector is thus represented by one row in the --- jvmMemManagerTable, plus an extension row in the jvmMemGCTable. --- The extension row in the jvmMemGCTable contains those attributes which --- are specific to garbage collectors. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryMXBean for --- a detailed description of the memory subsystem. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryManagerMXBean --- for more information on memory managers, and --- java.lang.management.GarbageCollectorMXBean for more information on --- garbage collectors. --- ------------------------------------------------------------------------ - -jvmMemGCTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmMemGCEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The Garbage Collector table provides additional information - on those MemoryManagers which are also GarbageCollectors. - This table extends the jvmMemManagerTable table. The index - used in the jvmMemGCTable table is imported from the - jvmMemManagerTable table. If a row from the jvmMemManagerTable - table is deleted, and if it has an extension in the jvmMemGCTable - table, then the extension row will also be deleted. - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.GarbageCollectorMXBean" - ::= { jvmMemory 101 } - -jvmMemGCEntry OBJECT-TYPE - SYNTAX JvmMemGCEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "Provide additional information on Garbage Collectors. - - Columnar objects in this table are mapped from the - GarbageCollectorMXBean interface. - - See java.lang.management.GarbageCollectorMXBean - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.GarbageCollectorMXBean" - INDEX { jvmMemManagerIndex } - ::= {jvmMemGCTable 1 } - -JvmMemGCEntry ::= SEQUENCE { - jvmMemGCCount Counter64, - jvmMemGCTimeMs JvmTimeMillis64TC -} - -jvmMemGCCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The total number of collections that have occurred, - as returned by GarbageCollectorMXBean.getCollectionCount(). - - If garbage collection statistics are not available, this - object is set to 0. - - See java.lang.management.GarbageCollectorMXBean.getCollectionCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.GarbageCollectorMXBean" - ::= { jvmMemGCEntry 2 } - -jvmMemGCTimeMs OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The approximate accumulated collection elapsed time in - milliseconds, since the Java virtual machine has started. - This object is set to 0 if the collection elapsed time is - undefined for this collector. - - See java.lang.management.GarbageCollectorMXBean.getCollectionTime() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.GarbageCollectorMXBean" - DEFVAL { 0 } - ::= { jvmMemGCEntry 3 } - --- The JVM Memory Pool Table --- --- The jvmMemPoolTable represent memory pool abstract entities. --- The jvmMemPoolTable contains one row per memory pool. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryMXBean for --- a detailed description of the memory subsystem. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryPoolMXBean --- for more information on memory pool. --- ------------------------------------------------------------------------ --- --- We use the range jvmMemory.[110..119] for objects related to memory pools. --- Object identifiers in the range jvmMemory.[111-119] are not used but --- are reserved for future evolution of this MIB. --- -jvmMemPoolTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmMemPoolEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The Memory Pool Table contains the whole list of MemoryPools - as returned by ManagementFactory.getMemoryPoolMXBeans(). - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemory 110 } - -jvmMemPoolEntry OBJECT-TYPE - SYNTAX JvmMemPoolEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - " - Represents a memory pool. The pool may contain heap memory or - non-heap memory. A row in this table represents - an instance of MemoryPoolMXBean. - - See java.lang.management.MemoryPoolMXBean - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - INDEX { jvmMemPoolIndex } - ::= { jvmMemPoolTable 1 } - -JvmMemPoolEntry ::= SEQUENCE { - jvmMemPoolIndex JvmPositive32TC, - jvmMemPoolName JvmJavaObjectNameTC, - jvmMemPoolType JvmManagedMemoryTypeTC, - jvmMemPoolState JvmValidityStateTC, - jvmMemPoolPeakReset JvmTimeMillis64TC, - - jvmMemPoolInitSize JvmUnsigned64TC, - jvmMemPoolUsed JvmUnsigned64TC, - jvmMemPoolCommitted JvmUnsigned64TC, - jvmMemPoolMaxSize JvmUnsigned64TC, - - jvmMemPoolPeakUsed JvmUnsigned64TC, - jvmMemPoolPeakCommitted JvmUnsigned64TC, - jvmMemPoolPeakMaxSize JvmUnsigned64TC, - - jvmMemPoolCollectUsed JvmUnsigned64TC, - jvmMemPoolCollectCommitted JvmUnsigned64TC, - jvmMemPoolCollectMaxSize JvmUnsigned64TC, - - jvmMemPoolThreshold JvmUnsigned64TC, - jvmMemPoolThreshdCount Counter64, - jvmMemPoolThreshdSupport JvmImplSupportStateTC, - jvmMemPoolCollectThreshold JvmUnsigned64TC, - jvmMemPoolCollectThreshdCount Counter64, - jvmMemPoolCollectThreshdSupport JvmImplSupportStateTC - -} - -jvmMemPoolIndex OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "An index value opaquely computed by the agent which uniquely - identifies a row in the jvmMemPoolTable. - - The jvmMemPoolIndex index is opaquely computed by the agent, - from e.g the hash code of the MemoryPool (or MemoryPool name). - The agent is responsible for allocating a free index when it - needs one (e.g. if two objects have the same hash, then it may - increment one of the values until the conflict is resolved). - As a result a manager must not depend on the value of that - index across, e.g. reboot of the agent, as this value is not - guaranteed to stay identical after the agent restarts. - " - ::= { jvmMemPoolEntry 1 } - -jvmMemPoolName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The name of this memory pool, as returned by - MemoryPoolMXBean.getName(). - - See java.lang.management.MemoryPoolMXBean.getName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 2 } - -jvmMemPoolType OBJECT-TYPE - SYNTAX JvmManagedMemoryTypeTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The type of memory managed in this pool. This pool may be used for - heap memory or non-heap memory. - - See java.lang.management.MemoryPoolMXBean.getMemoryType() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 3 } - -jvmMemPoolState OBJECT-TYPE - SYNTAX JvmValidityStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Indicates whether this memory pool is valid in the Java - virtual machine. A memory pool becomes invalid once the - Java virtual machine removes it from the memory system. - - See java.lang.management.MemoryPoolMXBean.isValid() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 4 } - -jvmMemPoolPeakReset OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-write - STATUS current - DESCRIPTION - " - This object indicates the last time - in milliseconds - at which - the peak memory usage statistic of this memory pool was reset - to the current memory usage. This corresponds to a time stamp - as returned by java.lang.System.currentTimeMillis(); - - Setting this object to a time earlier than its current time value - has no effect. Setting this object to a time later than its current - time value causes the peak memory usage statistic of this memory - pool to be reset to the current memory usage. The new value of this - object will be the time at which the reset operation is triggered. - - There could be a delay between the time at which the reset operation - is triggered and the time at which the actual resetting happens, so - this value is only indicative. - - See java.lang.management.MemoryPoolMXBean.resetPeakUsage() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 5 } - - --- The object identifier arcs in the range jvmMemPoolEntry.[6-9] are --- reserved for future evolution of this MIB. --- --- We use the range jvmMemPoolEntry.[10..19] for objects related to this --- pool memory usage, as returned by --- java.lang.management.MemoryPoolMXBean.getUsage(). --- Object identifiers in the range jvmMemPoolEntry.[14..19] are not --- used but are reserved for future evolution of this MIB. --- -jvmMemPoolInitSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Initial size of this memory pool. - - See java.lang.management.MemoryPoolMXBean.getUsage().getInit() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 10 } - - -jvmMemPoolUsed OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Amount of used memory in this memory pool. - - See java.lang.management.MemoryPoolMXBean.getUsage().getUsed() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 11 } - -jvmMemPoolCommitted OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Amount of committed memory in this memory pool. - - See java.lang.management.MemoryPoolMXBean.getUsage().getCommitted() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 12 } - -jvmMemPoolMaxSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Maximal size of this memory pool. - - See java.lang.management.MemoryPoolMXBean.getUsage().getMax() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 13 } - --- We use the range jvmMemPoolEntry.[20..29] for objects related to --- this pool peak memory usage, as returned by --- java.lang.management.MemoryPoolMXBean.getPeakUsage(). --- The object identifier arc jvmMemPoolEntry.20 which would have been --- used for the initial size is not used because the notion of initial --- size in the context of peak usage is meaningless. --- Therefore, we start numbering objects at 21. --- Object identifiers in the range jvmMemPoolEntry.[24..29] are not --- used but are reserved for future evolution of this MIB. --- -jvmMemPoolPeakUsed OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Amount of used memory in this memory pool when the peak usage - was reached. - - See java.lang.management.MemoryPoolMXBean.getPeakUsage().getUsed() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 21 } - -jvmMemPoolPeakCommitted OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Amount of committed memory in this memory pool when the peak usage - was reached. - - See java.lang.management.MemoryPoolMXBean.getPeakUsage().getCommitted() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 22 } - -jvmMemPoolPeakMaxSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - Maximal size of this memory pool when the peak usage - was reached. - - See java.lang.management.MemoryPoolMXBean.getPeakUsage().getMax() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 23 } - --- We use the range jvmMemPoolEntry.[30..39] for objects related to this --- pool collection memory usage, as returned by --- java.lang.management.MemoryPoolMXBean.getCollectionUsage(). --- The object identifier arc jvmMemPoolEntry.30 which would have been used --- for the initial size is not used because the notion of initial size in the --- context of collection usage is meaningless. --- Therefore, we start numbering objects at 31. --- Object identifiers in the range jvmMemPoolEntry.[34..39] are not used --- but are reserved for future evolution of this MIB. --- -jvmMemPoolCollectUsed OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - The amount of used memory at the most recent time that the - Java virtual machine has expended effort in recycling unused objects - in this memory pool. - - See java.lang.management.MemoryPoolMXBean.getCollectionUsage().getUsed() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 31 } - -jvmMemPoolCollectCommitted OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - The amount of committed memory at the most recent time that the - Java virtual machine has expended effort in recycling unused objects - in this memory pool. - - See java.lang.management.MemoryPoolMXBean.getCollectionUsage(). - getCommitted() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 32 } - -jvmMemPoolCollectMaxSize OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - " - The value of the maximum amount of memory at the most recent time - that the Java virtual machine has expended effort in recycling - unused objects in this memory pool. - - See java.lang.management.MemoryPoolMXBean.getCollectionUsage().getMax() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryUsage" - ::= { jvmMemPoolEntry 33 } - --- Object identifiers in the range jvmMemPoolEntry.[40-109] are reserved --- for future evolution of this MIB. --- --- We use the range jvmMemPoolEntry.[110..119] for objects related to this --- pool memory usage thresholds (range jvmMemPoolEntry.[10..19] was used for --- this pool memory usage). --- Object identifier arcs in the range jvmMemPoolEntry.[113..119] are not --- used but are reserved for future evolution of this MIB. --- -jvmMemPoolThreshold OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The threshold value for the memory usage of this memory pool, - in bytes. A zero value (0) indicates that no threshold value is - configured. - When the amount of used memory crosses over this threshold - value the JVM will trigger a usage memory threshold exceeded - notification, and the jvmMemPoolThreshdCount increases. - - If memory usage threshold is not supported, then this object, if - implemented, will always be equals to 0. In that case, attempting - to set this object will trigger an inconsistentValue error. - - See also jvmMemPoolThreshdSupport. - - See java.lang.management.MemoryPoolMXBean.getUsageThreshold(), - java.lang.management.MemoryPoolMXBean.setUsageThreshold(long), - java.lang.management.MemoryPoolMXBean.getUsageThresholdCount(), - java.lang.management.MemoryPoolMXBean.isUsageThresholdSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - DEFVAL { 0 } - ::= { jvmMemPoolEntry 110 } - -jvmMemPoolThreshdCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The number of times that the memory usage has crossed - the usage threshold, as detected by the Java virtual machine. - - If memory usage threshold is not supported, then this object, if - implemented, will always be equals to 0. - - See also jvmMemPoolThresholdSupport. - - See java.lang.management.MemoryPoolMXBean.getUsageThresholdCount(), - java.lang.management.MemoryPoolMXBean.isUsageThresholdSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 111 } - -jvmMemPoolThreshdSupport OBJECT-TYPE - SYNTAX JvmImplSupportStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Tells whether this memory pool supports usage threshold. - - See java.lang.management.MemoryPoolMXBean.isUsageThresholdSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 112 } - --- Object identifiers in the range jvmMemPoolEntry.[120-129] are reserved --- for future evolution of this MIB. --- --- We use the range jvmMemPoolEntry.[130..139] for objects related to --- this pool memory collection usage thresholds (range --- jvmMemPoolEntry.[30..39] was used for this pool collection memory usage). --- Object identifiers in the range jvmMemPoolEntry.[133..139] are not used --- but are reserved for future evolution of this MIB. --- -jvmMemPoolCollectThreshold OBJECT-TYPE - SYNTAX JvmUnsigned64TC - UNITS "bytes" - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The threshold value for the collection usage of this memory pool, - in bytes. A zero value (0) indicates that no threshold value is - configured. - When the amount of used memory crosses over this threshold - value the JVM will trigger a collection memory threshold exceeded - notification, and the jvmMemPoolCollectThreshdCount increases. - - If collection usage threshold is not supported, then this object, if - implemented, will always be equals to 0. In that case, attempting - to set this object will trigger an inconsistentValue error. - - See also jvmMemPoolCollectThreshdSupport. - - See java.lang.management.MemoryPoolMXBean. - getCollectionUsageThreshold(), - java.lang.management.MemoryPoolMXBean. - setCollectionUsageThreshold(long), - java.lang.management.MemoryPoolMXBean. - isCollectionUsageThresholdSupported(), - java.lang.management.MemoryPoolMXBean. - getCollectionUsageThresholdCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - DEFVAL { 0 } - ::= { jvmMemPoolEntry 131 } - -jvmMemPoolCollectThreshdCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The number of times that the memory usage has crossed - the collection usage threshold, as detected by the Java virtual - machine. - - If memory usage threshold is not supported, then this object, if - implemented, will always be equals to 0. - - See also jvmMemPoolCollectThreshdSupport. - - See java.lang.management.MemoryPoolMXBean. - getCollectionUsageThresholdCount(), - java.lang.management.MemoryPoolMXBean. - isCollectionUsageThresholdSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 132 } - -jvmMemPoolCollectThreshdSupport OBJECT-TYPE - SYNTAX JvmImplSupportStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Tells whether this memory pool supports collection usage threshold. - - See java.lang.management.MemoryPoolMXBean. - isCollectionUsageThresholdSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemPoolEntry 133 } - --- The JVM Memory Manager-Pool Relation Table ------------------------------------------------------------------------ --- The JVM Memory Pool Table --- --- The jvmMemPoolTable represent memory pool abstract entities. --- The jvmMemPoolTable contains one row per memory pool. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryMXBean for --- a detailed description of the memory subsystem. --- --- See J2SE 5.0 API Specification, java.lang.management.MemoryPoolMXBean --- for more information on memory pool. --- ------------------------------------------------------------------------ --- --- We use the range jvmMemory.[110..119] for objects related to memory pools. --- Object identifier arcs in the range jvmMemory.[111-119] are not used --- but are reserved for future evolution of this MIB. --- - -jvmMemMgrPoolRelTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmMemMgrPoolRelEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The Memory Manager-Pool Relation Table shows the - Memory Manager / Memory Pool relations, as returned by - MemoryPoolMXBean.getMemoryManagerNames() and - MemoryManagerMXBean.getMemoryPoolNames(). - This table imports the indexes from the jvmMemManagerTable table - and jvmMemPoolTable table. The jvmMemMgrRelManagerName and - jvmMemMgrRelPoolName objects are not actually necessary since - the indexes are self-sufficient to express the relationship - - but the names will make the table more understandable when displayed - in a management console. - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryManagerMXBean" - ::= { jvmMemory 120 } - -jvmMemMgrPoolRelEntry OBJECT-TYPE - SYNTAX JvmMemMgrPoolRelEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "A row in this table indicates that the Memory Manager identified - by jvmMemManagerIndex manages the Memory Pool identified by - jvmMemPoolIndex. Note that a pool may be managed by several - memory managers, and a memory manager can manage several - memory pool. - - See java.lang.management.MemoryManagerMXBean.getMemoryPoolNames(), - java.lang.management.MemoryPoolMXBean.getMemoryManagerNames() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean, - java.lang.management.MemoryManagerMXBean" - INDEX { jvmMemManagerIndex, jvmMemPoolIndex } - ::= { jvmMemMgrPoolRelTable 1 } - -JvmMemMgrPoolRelEntry ::= SEQUENCE { - jvmMemMgrRelManagerName JvmJavaObjectNameTC, - jvmMemMgrRelPoolName JvmJavaObjectNameTC -} - -jvmMemMgrRelManagerName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The name of the memory manager. - - See java.manangement.MemoryManagerMXBean.getName(); - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryManagerMXBean" - ::= { jvmMemMgrPoolRelEntry 2 } - -jvmMemMgrRelPoolName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The name of the memory pool. - - See java.manangement.MemoryPoolMXBean.getName(); - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmMemMgrPoolRelEntry 3 } - - ------------------------------------------------------------------------ --- --- The JVM Thread group --- --- A collection of objects used to monitor threads in the --- Java Virtual Machine. These objects define the SNMP management --- interface for the thread system of the Java virtual machine. --- --- The jvmThreadInstanceTable represents the threads which are currently --- alive in the system. The representation of a thread is derived from the --- set of methods in the ThreadMXBean that return information about a --- given thread. --- --- See J2SE 5.0 API Specification, java.lang.management.ThreadMXBean for --- a detailed description of the threading subsystem. --- ------------------------------------------------------------------------ - --- ------------------------------------------------------------------------ - -jvmThreading OBJECT IDENTIFIER ::= { jvmMgtMIBObjects 3 } - --- The following objects are mapped from the ThreadMXBean interface. ------------------------------------------------------------------------ - -jvmThreadCount OBJECT-TYPE - SYNTAX Gauge32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The current number of live threads. - - See java.lang.management.ThreadMXBean.getThreadCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 1 } - -jvmThreadDaemonCount OBJECT-TYPE - SYNTAX Gauge32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The current number of daemon threads. - - See java.lang.management.ThreadMXBean.getDaemonThreadCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 2 } - -jvmThreadPeakCount OBJECT-TYPE - SYNTAX Counter32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The peak thread count since the execution of the application. - - See java.lang.management.ThreadMXBean.getPeakThreadCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 3 } - -jvmThreadTotalStartedCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The total number of threads created and started since the Java - Virtual Machine started. - - See java.lang.management.ThreadMXBean.getTotalStartedThreadCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 4 } - -jvmThreadContentionMonitoring OBJECT-TYPE - SYNTAX JvmImplOptFeatureStateTC - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The state of the Thread Contention Monitoring feature. - This feature can be: - - unsupported: The JVM does not support Thread Contention Monitoring. - enabled : The JVM supports Thread Contention Monitoring, and it - is enabled. - disabled : The JVM supports Thread Contention Monitoring, and it - is disabled. - - Only enabled(3) and disabled(4) may be supplied as values to a - SET request. unsupported(1) can only be set internally by the - agent. - - When the feature is unsupported(1), any attempt to change - that value will fail: trying to set this object to - enabled(3) or disabled(4) will result in an `inconsistentValue' - error. Trying to set it to any other value will result in an - `wrongValue' error. - - See java.lang.management.ThreadMXBean. - isThreadContentionMonitoringSupported(), - java.lang.management.ThreadMXBean. - isThreadContentionMonitoringEnabled(), - java.lang.management.ThreadMXBean. - setThreadContentionMonitoringEnabled() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 5 } - -jvmThreadCpuTimeMonitoring OBJECT-TYPE - SYNTAX JvmImplOptFeatureStateTC - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The state of the Thread CPU Time Monitoring feature. - This feature can be: - - unsupported: The JVM does not support Thread CPU Time Monitoring. - enabled : The JVM supports Thread CPU Time Monitoring, and it - is enabled. - disabled : The JVM supports Thread CPU Time Monitoring, and it - is disabled. - - Only enabled(3) and disabled(4) may be supplied as values to a - SET request. unsupported(1) can only be set internally by the - agent. - - When the feature is unsupported(1), any attempt to change - that value will fail: trying to set this object to - enabled(3) or disabled(4) will result in an `inconsistentValue' - error. Trying to set it to any other value will result in an - `wrongValue' error. - - See java.lang.management.ThreadMXBean. - isThreadCpuTimeSupported(), - java.lang.management.ThreadMXBean. - isThreadCpuTimeEnabled(), - java.lang.management.ThreadMXBean. - setThreadCpuTimeEnabled() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 6 } - -jvmThreadPeakCountReset OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-write - STATUS current - DESCRIPTION - " - This object indicates the last time - in milliseconds - at which - the peak thread count was reset to the current thread count. - This corresponds to a time stamp as returned by - java.lang.System.currentTimeMillis(). - - Setting this object to a time earlier than its current time value - has no effect. Setting this object to a time later than its current - time value causes the peak thread count statistic to be reset to - the current thread count. The new value of this object will be - the time at which the reset operation is triggered. - - There could be a delay between the time at which the reset operation - is triggered and the time at which the actual resetting happens, so - this value is only indicative. - - See java.lang.management.ThreadMXBean.resetPeakThreadCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 7 } - - --- Object identifiers in the range jvmThreading.[8-10] are reserved --- for future evolution of this MIB. --- ------------------------------------------------------------------------ --- The JVM Thread Instance Table --- --- The jvmThreadInstanceTable represents the threads which are currently --- alive in the system. The representation of a thread is derived from the --- set of methods in the ThreadMXBean that return information about a --- given thread. --- --- See J2SE 5.0 API Specification, java.lang.management.ThreadMXBean for --- a detailed description of the threading subsystem. --- See also J2SE 5.0 API Specification, java.lang.management.ThreadInfo, --- and java.lang.Thread --- ------------------------------------------------------------------------ - -jvmThreadInstanceTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmThreadInstanceEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The Thread Instance Table is built from all the methods of - ThreadMXBean that take a ThreadID as parameter. - - See java.lang.management.ThreadMXBean.getAllThreadIds() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreading 10 } - -jvmThreadInstanceEntry OBJECT-TYPE - SYNTAX JvmThreadInstanceEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "A row in this table represents a live thread. - Attributes in this row are built from all the methods of - ThreadMXBean that take a ThreadID as parameter. - - See java.lang.management.ThreadMXBean - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - INDEX { jvmThreadInstIndex } - ::= { jvmThreadInstanceTable 1 } - -JvmThreadInstanceEntry ::= SEQUENCE { - jvmThreadInstIndex JvmIndex64TC, - jvmThreadInstId JvmUnsigned64TC, - jvmThreadInstState JvmThreadStateTC, - jvmThreadInstBlockCount Counter64, - jvmThreadInstBlockTimeMs JvmTimeMillis64TC, - jvmThreadInstWaitCount Counter64, - jvmThreadInstWaitTimeMs JvmTimeMillis64TC, - jvmThreadInstCpuTimeNs JvmTimeNanos64TC, - jvmThreadInstLockName JvmJavaObjectNameTC, - jvmThreadInstLockOwnerPtr RowPointer, - jvmThreadInstName JvmJavaObjectNameTC -} - -jvmThreadInstIndex OBJECT-TYPE - SYNTAX JvmIndex64TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "An index uniquely identifying a live thread, and directly - derived from the value of jvmThreadInstId. The jvmThreadInstId - cannot be used directly as index in the table, because integer - indexes cannot exceed an unsigned 32 int. - - The jvmThreadInstIndex index is an 8 byte octet string as - defined by the JvmIndex64TC TEXTUAL-CONVENTION. Its value is - directly derived from the value of the corresponding ThreadID - returned by jvmThreadInstId. - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean, java.lang.Thread" - ::= { jvmThreadInstanceEntry 1 } - -jvmThreadInstId OBJECT-TYPE - SYNTAX JvmUnsigned64TC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The thread ID, as returned by Thread.getId(). - - See java.lang.management.ThreadMXBean.getThreadInfo(long,boolean). - getThreadId() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean, java.lang.Thread" - ::= { jvmThreadInstanceEntry 2 } - -jvmThreadInstState OBJECT-TYPE - SYNTAX JvmThreadStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The state of this thread instance. - - See java.lang.management.ThreadMXBean.getThreadInfo(long,boolean). - getThreadState() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreadInstanceEntry 3 } - -jvmThreadInstBlockCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The total number of times that this thread has blocked to enter - or re-enter a monitor.. - - See java.lang.management.ThreadMXBean.getThreadInfo(long,boolean). - getBlockedCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreadInstanceEntry 4 } - -jvmThreadInstBlockTimeMs OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The approximate accumulated elapsed time (in millisecond) - that a thread has blocked to enter or re-enter a monitor since - it has started - or since thread contention monitoring was - enabled. - - This object is always set to 0 if thread contention monitoring - is disabled or not supported. - - See java.lang.management.ThreadMXBean.getThreadInfo(long,boolean). - getBlockedTime() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreadInstanceEntry 5 } - -jvmThreadInstWaitCount OBJECT-TYPE - SYNTAX Counter64 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The total number of times that this thread has waited for - notification. - - See java.lang.management.ThreadMXBean.getThreadInfo(long,boolean). - getWaitedCount() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreadInstanceEntry 6 } - -jvmThreadInstWaitTimeMs OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The approximate accumulated elapsed time (in millisecond) - that a thread has waited on a monitor through a - java.lang.Object.wait method since it has started - or since - thread contention monitoring wasenabled. - - This object is always set to 0 if thread contention monitoring - is disabled or not supported. - - See java.lang.management.ThreadMXBean.getThreadInfo(long,boolean). - getWaitedTime() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreadInstanceEntry 7 } - -jvmThreadInstCpuTimeNs OBJECT-TYPE - SYNTAX JvmTimeNanos64TC - UNITS "nanoseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The approximate accumulated CPU time (in nanosecond) for a thread - since it has started - or since thread CPU time monitoring was - enabled. - - If the thread of the specified ID is not alive or does not exist, - or the CPU time measurement is disabled or not supported, - this object is set to 0. - - See java.lang.management.ThreadMXBean.getThreadCpuTime(long), - java.lang.management.ThreadMXBean.isThreadCpuTimeSupported(), - java.lang.management.ThreadMXBean.isThreadCpuTimeEnabled() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean" - ::= { jvmThreadInstanceEntry 8 } - -jvmThreadInstName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "This thread name - as returned by Thread.getThreadName(). - - See java.lang.management.ThreadInfo.getThreadName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean, - java.lang.management.ThreadInfo" - ::= { jvmThreadInstanceEntry 9 } - -jvmThreadInstLockName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The string representation of the monitor lock that this thread - is blocked to enter or waiting to be notified through the - Object.wait method. - - See J2SE 5.0 API Specification, - java.lang.management.ThreadInfo.getLockName() - for more information on the format of this string. - - If this thread is not blocked then a zero-length string is returned. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the JvmJavaObjectNameTC - (1023 bytes max). - - See java.lang.management.ThreadInfo.getLockName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean, - java.lang.management.ThreadInfo" - ::= { jvmThreadInstanceEntry 10 } - -jvmThreadInstLockOwnerPtr OBJECT-TYPE - SYNTAX RowPointer - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "A pointer to the thread which owns the monitor of the - object on which this thread instance is blocked. - This object will point to jvmThreadInstId of the - lock owner thread. - - If this thread is not blocked then 0.0 is returned. - - See java.lang.management.ThreadInfo.getLockOwnerId() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.ThreadMXBean, - java.lang.management.ThreadInfo" - ::= { jvmThreadInstanceEntry 11 } - ------------------------------------------------------------------------ --- --- The JVM Runtime group --- --- A collection of objects used to monitor the Java Virtual Machine --- Runtime. These objects define the SNMP management interface for the --- runtime system of the Java virtual machine. --- --- The JVM Runtime group defines object mapped from the --- java.lang.management.RuntimeMXBean interface. --- --- See J2SE 5.0 API Specification, java.lang.management.RuntimeMXBean for --- a detailed description of the runtime system. --- ------------------------------------------------------------------------ - -jvmRuntime OBJECT IDENTIFIER ::= { jvmMgtMIBObjects 4 } - --- The following objects are mapped from the RuntimeMXBean interface. ------------------------------------------------------------------------ - -jvmRTName OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The name representing the running Java virtual machine. - - Note that the SNMP agent may have to truncate the name returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 1 } - -jvmRTVMName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The Java virtual machine implementation name. - - See java.lang.management.RuntimeMXBean.getVmName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 2 } - -jvmRTVMVendor OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The Java virtual machine implementation vendor. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getVmVendor() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 3 } - -jvmRTVMVersion OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The Java virtual machine implementation version. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getVmVersion() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 4 } - -jvmRTSpecName OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The Java virtual machine specification name. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getSpecName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 5 } - -jvmRTSpecVendor OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The Java virtual machine specification vendor. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getSpecVendor() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 6 } - -jvmRTSpecVersion OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The Java virtual machine specification version. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getSpecVersion() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 7 } - -jvmRTManagementSpecVersion OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The version of the management specification for the Java virtual - machine implementation. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.RuntimeMXBean.getManagementSpecVersion() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 8 } - -jvmRTBootClassPathSupport OBJECT-TYPE - SYNTAX JvmImplSupportStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Indicates whether the Java virtual machine supports the - boot class path mechanism used by the bootstrap class loader - to search for class files. - - See java.lang.management.RuntimeMXBean.isBootClassPathSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 9 } - -jvmRTInputArgsCount OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The number of input arguments passed to the Java Virtual Machine. - - See java.lang.management.RuntimeMXBean.getInputArguments() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 10 } - -jvmRTUptimeMs OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Uptime of the Java virtual machine, in milliseconds. This is - equivalent to ( System.currentTimeMillis() - jvmStartTimeMs ). - - See also jvmRTStartTimeMs. - - See java.lang.management.RuntimeMXBean.getUptime() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 11 } - -jvmRTStartTimeMs OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The approximate time when the Java virtual machine started, in - milliseconds. This is a time stamp as returned by - System.currentTimeMillis(). This time will not change unless - the Java Virtual Machine is restarted. - - See also jvmRTUptimeMs. - - See java.lang.management.RuntimeMXBean.getStartTime() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 12 } - - --- Object identifiers in the range jvmRuntime.[13-19] are reserved --- for future evolution of this MIB. --- ------------------------------------------------------------------------ --- --- The JVM Input Argument Table --- --- The jvmRTInputArgsTable contains one row per input argument given on --- the Java command line. --- --- See J2SE 5.0 API Specification, --- java.lang.management.RuntimeMXBean.getInputArguments() --- for more information. ------------------------------------------------------------------------ - -jvmRTInputArgsTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmRTInputArgsEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The Input Argument Table lists the input arguments passed - to the Java Virtual Machine. - - The jvmRTInputArgsIndex is the index of the argument in - the array returned by RuntimeMXBean.getInputArguments(). - - See java.lang.management.RuntimeMXBean.getInputArguments() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 20 } - -jvmRTInputArgsEntry OBJECT-TYPE - SYNTAX JvmRTInputArgsEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "Represent an input argument passed to the Java Virtual Machine. - - See java.lang.management.RuntimeMXBean.getInputArguments() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - INDEX { jvmRTInputArgsIndex } - ::= { jvmRTInputArgsTable 1 } - -JvmRTInputArgsEntry ::= SEQUENCE { - jvmRTInputArgsIndex JvmPositive32TC, - jvmRTInputArgsItem JvmArgValueTC -} - -jvmRTInputArgsIndex OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The index of the input argument, as in the array returned - by RuntimeMXBean.getInputArguments(). - - See java.lang.management.RuntimeMXBean.getInputArguments() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTInputArgsEntry 1 } - -jvmRTInputArgsItem OBJECT-TYPE - SYNTAX JvmArgValueTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "An input argument at index jvmRTInputArgsIndex, as in the array - returned by RuntimeMXBean.getInputArguments(). - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the JvmArgValueTC - (1023 bytes max). - - See java.lang.management.RuntimeMXBean.getInputArguments() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTInputArgsEntry 2 } - - ------------------------------------------------------------------------ --- --- The JVM Boot Class Path Table --- --- The jvmRTBootClassPathTable contains one row per path element in the --- bootclasspath. This table may not be implemented (or may be empty) if --- the bootclasspath feature is not supported by the underlying --- implementation. --- --- See J2SE 5.0 API Specification, --- java.lang.management.RuntimeMXBean.getBootClassPath() --- java.lang.management.RuntimeMXBean.isBootClassPathSupported() --- for more information. ------------------------------------------------------------------------ - -jvmRTBootClassPathTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmRTBootClassPathEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The boot class path that is used by the bootstrap class loader - to search for a class file for loading. - - Note that the SNMP agent may have to truncate the bootclasspath - elements contained in the string returned by the underlying API - if it does not fit in the JvmPathElementTC (1023 bytes max). - - This table is not implemented (or empty) if jvmRTBootClassPathSupport - is unsupported(1). - - See java.lang.management.RuntimeMXBean.getBootClassPath() - java.lang.management.RuntimeMXBean.isBootClassPathSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 21 } - -jvmRTBootClassPathEntry OBJECT-TYPE - SYNTAX JvmRTBootClassPathEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "Represent a path element in the Java Virtual Machine bootclasspath. - - See java.lang.management.RuntimeMXBean.getBootClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - INDEX { jvmRTBootClassPathIndex } - ::= { jvmRTBootClassPathTable 1 } - -JvmRTBootClassPathEntry ::= SEQUENCE { - jvmRTBootClassPathIndex JvmPositive32TC, - jvmRTBootClassPathItem JvmPathElementTC -} - -jvmRTBootClassPathIndex OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The index of the path element, as in the array obtained - by splitting RuntimeMXBean.getBootClassPath() in its elementary path - constituents. - - See java.lang.management.RuntimeMXBean.getBootClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTBootClassPathEntry 1 } - -jvmRTBootClassPathItem OBJECT-TYPE - SYNTAX JvmPathElementTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "An path element at index jvmRTBootClassPathIndex, as in the - array obtained by splitting RuntimeMXBean.getBootClassPath() in - its elementary path constituents. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the JvmPathElementTC - (1023 bytes max). - - See java.lang.management.RuntimeMXBean.getBootClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTBootClassPathEntry 2 } - ------------------------------------------------------------------------ --- --- The JVM Class Path Table --- --- The jvmRTClassPathTable contains one row per path element in the --- classpath. --- --- See J2SE 5.0 API Specification, --- java.lang.management.RuntimeMXBean.getClassPath() --- for more information. ------------------------------------------------------------------------ - -jvmRTClassPathTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmRTClassPathEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The class path that is used by the system class loader - to search for a class file. - - Note that the SNMP agent may have to truncate the classpath - elements contained in the string returned by the underlying API - if it does not fit in the JvmPathElementTC (1023 bytes max). - - See java.lang.management.RuntimeMXBean.getClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 22 } - -jvmRTClassPathEntry OBJECT-TYPE - SYNTAX JvmRTClassPathEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "Represent a path element in the Java Virtual Machine classpath. - - See java.lang.management.RuntimeMXBean.getClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - INDEX { jvmRTClassPathIndex } - ::= { jvmRTClassPathTable 1 } - -JvmRTClassPathEntry ::= SEQUENCE { - jvmRTClassPathIndex JvmPositive32TC, - jvmRTClassPathItem JvmPathElementTC -} - -jvmRTClassPathIndex OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The index of the path element, as in the array obtained - by splitting RuntimeMXBean.getClassPath() in its elementary - path constituents. - - See java.lang.management.RuntimeMXBean.getClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTClassPathEntry 1 } - -jvmRTClassPathItem OBJECT-TYPE - SYNTAX JvmPathElementTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "An path element at index jvmRTClassPathIndex, as in the array - obtained by splitting RuntimeMXBean.getClassPath() in its elementary - path constituents. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the JvmPathElementTC - (1023 bytes max). - - See java.lang.management.RuntimeMXBean.getClassPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTClassPathEntry 2 } - ------------------------------------------------------------------------ --- --- The JVM Library Path Table --- --- The jvmRTLibraryPathTable contains one row per path element in the --- librarypath. --- --- See J2SE 5.0 API Specification, --- java.lang.management.RuntimeMXBean.getLibraryPath() --- for more information. ------------------------------------------------------------------------ - -jvmRTLibraryPathTable OBJECT-TYPE - SYNTAX SEQUENCE OF JvmRTLibraryPathEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The library path. - - Note that the SNMP agent may have to truncate the librarypath - elements contained in the string returned by the underlying API - if it does not fit in the JvmPathElementTC (1023 bytes max). - - See java.lang.management.RuntimeMXBean.getLibraryPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRuntime 23 } - -jvmRTLibraryPathEntry OBJECT-TYPE - SYNTAX JvmRTLibraryPathEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "Represent a path element in the Java Virtual Machine librarypath. - - See java.lang.management.RuntimeMXBean.getLibraryPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - INDEX { jvmRTLibraryPathIndex } - ::= { jvmRTLibraryPathTable 1 } - -JvmRTLibraryPathEntry ::= SEQUENCE { - jvmRTLibraryPathIndex JvmPositive32TC, - jvmRTLibraryPathItem JvmPathElementTC -} - -jvmRTLibraryPathIndex OBJECT-TYPE - SYNTAX JvmPositive32TC - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The index of the path element, as in the array obtained - by splitting RuntimeMXBean.getLibraryPath() in its elementary - constituents. - - See java.lang.management.RuntimeMXBean.getLibraryPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTLibraryPathEntry 1 } - -jvmRTLibraryPathItem OBJECT-TYPE - SYNTAX JvmPathElementTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "An path element at index jvmRTLibraryPathIndex, as in the array - obtained by splitting RuntimeMXBean.getLibraryPath() in its elementary - path constituents. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the JvmPathElementTC - (1023 bytes max). - - See java.lang.management.RuntimeMXBean.getLibraryPath() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.RuntimeMXBean" - ::= { jvmRTLibraryPathEntry 2 } - ------------------------------------------------------------------------ --- --- The JVM Compilation group --- --- A collection of objects used to monitor the Java Virtual Machine --- Runtime Compiler (JIT). These objects define the SNMP management --- interface for the compilation system of the Java virtual machine. --- --- The JVM Compilation group defines object mapped from the --- java.lang.management.CompilationMXBean interface. --- --- See J2SE 5.0 API Specification, java.lang.management.CompilationMXBean for --- a detailed description of the runtime system. --- ------------------------------------------------------------------------ - -jvmCompilation OBJECT IDENTIFIER ::= { jvmMgtMIBObjects 5 } - --- The following objects are mapped from the CompilationMXBean interface. ------------------------------------------------------------------------ - -jvmJITCompilerName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The name of the Just-in-time (JIT) compiler. - - See java.lang.management.CompilationMXBean.getName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.CompilationMXBean" - ::= { jvmCompilation 1 } - -jvmJITCompilerTimeMs OBJECT-TYPE - SYNTAX JvmTimeMillis64TC - UNITS "milliseconds" - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Gets the approximate accumulated elapsed time (in milliseconds) - spent in compilation since the Java virtual machine has started. - If multiple threads are used for compilation, this value is - the summation of the approximate time that each thread - spent in compilation. - - If compiler time monitoring is not supported, then this object - remains set to 0. - - See java.lang.management.CompilationMXBean.getTotalCompilationTime() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.CompilationMXBean" - ::= { jvmCompilation 2 } - - -jvmJITCompilerTimeMonitoring OBJECT-TYPE - SYNTAX JvmImplSupportStateTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "Indicates whether the Java virtual machine supports - compilation time monitoring. - - See java.lang.management.CompilationMXBean. - isCompilationTimeMonitoringSupported() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.CompilationMXBean" - ::= { jvmCompilation 3 } - ------------------------------------------------------------------------ --- --- The JVM Operating System group --- --- A collection of objects used to monitor some resource of the --- Operating System the Java Virtual Machine is running on. These objects --- define the SNMP management interface offered by the Java virtual machine --- for the operating system on which it is running. --- --- The JVM Operating System group defines object mapped from the --- java.lang.management.OperatingSystemMXBean interface. --- --- See J2SE 5.0 API Specification, java.lang.management.OperatingSystemMXBean --- for a detailed description of the operating system. --- ------------------------------------------------------------------------ - -jvmOS OBJECT IDENTIFIER ::= { jvmMgtMIBObjects 6 } - --- The following objects are mapped from the OperatingSystemMXBean interface. ------------------------------------------------------------------------ - -jvmOSName OBJECT-TYPE - SYNTAX JvmJavaObjectNameTC - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The operating system name. - - See java.lang.management.OperatingSystemMXBean.getName() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.OperatingSystemMXBean" - ::= { jvmOS 1 } - -jvmOSArch OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The operating system architecture. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.OperatingSystemMXBean.getArch() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.OperatingSystemMXBean" - ::= { jvmOS 2 } - -jvmOSVersion OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The operating system version. - - Note that the SNMP agent may have to truncate the string returned - by the underlying API if it does not fit in the DisplayString - (255 bytes max). - - See java.lang.management.OperatingSystemMXBean.getVersion() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.OperatingSystemMXBean" - ::= { jvmOS 3 } - -jvmOSProcessorCount OBJECT-TYPE - - SYNTAX Integer32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The number of processors available to the Java virtual machine. - - See java.lang.management.OperatingSystemMXBean.getAvailableProcessors() - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.OperatingSystemMXBean" - ::= { jvmOS 4 } - --- --- NOTIFICATIONS --- ------------------------------------------------------------------------ - --- --- Low Memory Notifications --- - -jvmMgtMIBMemoryNotifs OBJECT IDENTIFIER ::= { jvmMgtMIBNotifications 2 } -jvmMgtMIBLowMemoryNotifs OBJECT IDENTIFIER ::= { jvmMgtMIBMemoryNotifs 1 } - -jvmLowMemoryPrefix OBJECT IDENTIFIER - ::= { jvmMgtMIBLowMemoryNotifs 0 } - --- Not used at this time, but reserved for future evolution of this MIB: --- --- jvmLowMemoryData OBJECT IDENTIFIER --- ::= { jvmMgtMIBLowMemoryNotifs 1 } --- - -jvmLowMemoryPoolUsageNotif NOTIFICATION-TYPE - OBJECTS { jvmMemPoolName, jvmMemPoolUsed, jvmMemPoolThreshdCount } - STATUS current - DESCRIPTION - "This notification is sent when the memory usage threshold of - a memory pool is exceeded. - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryNotification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmLowMemoryPrefix 1 } - -jvmLowMemoryPoolCollectNotif NOTIFICATION-TYPE - OBJECTS { jvmMemPoolName, jvmMemPoolCollectUsed, - jvmMemPoolCollectThreshdCount } - STATUS current - DESCRIPTION - "This notification is sent when the collection memory usage - threshold of a memory pool is exceeded. - " - REFERENCE "J2SE 5.0 API Specification, - java.lang.management.MemoryNotification, - java.lang.management.MemoryPoolMXBean" - ::= { jvmLowMemoryPrefix 2 } - --- --- Conformance Section --- ------------------------------------------------------------------------ - --- conformance information - -jvmMgtMIBCompliances - OBJECT IDENTIFIER ::= { jvmMgtMIBConformance 1 } -jvmMgtMIBGroups - OBJECT IDENTIFIER ::= { jvmMgtMIBConformance 2 } - - --- compliance statements - -jvmManagementCompliance MODULE-COMPLIANCE - STATUS current - DESCRIPTION - "The compliance statement for SNMP entities which - implement this MIB." - MODULE -- this module - MANDATORY-GROUPS { - jvmClassLoadingBasicGroup, - jvmClassLoadingSetGroup, - jvmMemoryBasicGroup, - jvmMemoryHeapUsageGroup, - jvmMemoryNonHeapUsageGroup, - jvmMemorySetGroup, - jvmMemManagerGroup, - jvmMemGCGroup, - jvmMemPoolBasicGroup, - jvmMemPoolUsageGroup, - jvmMemPoolPeakUsageGroup, - jvmMemPoolCollectUsageGroup, - jvmMemMgrPoolRelationGroup, - jvmThreadBasicGroup, - jvmThreadInstanceBasicGroup, - jvmRuntimeBasicGroup, - jvmOSGroup - } - - -- optional/conditional groups - GROUP jvmMemPoolMonitoringGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine does not support low memory detection in memory usage. - " - GROUP jvmMemPoolCollectMonitoringGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine does not support low memory detection in collection - memory usage. - " - GROUP jvmLowMemoryUsageNotifGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine does not support low memory usage detection. - " - GROUP jvmLowMemoryCollectNotifGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine does not support low collection memory usage detection. - " - GROUP jvmThreadInstanceCpuGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine does not support CPU time measurement for other threads. - " - GROUP jvmThreadInstanceBlockGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine does not support thread contention monitoring. - " - GROUP jvmRuntimeBootCPGroup - DESCRIPTION - "This group may not be implemented if the underlying - implementation does not support the bootclasspath feature. - " - GROUP jvmJITCompilerBasicGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine has no compilation system. - " - GROUP jvmJITCompilerTimeStatGroup - DESCRIPTION - "This group may not be implemented if the Java virtual - machine has no compilation system, or does not support - JIT Compiler time statistics. - " - ::= { jvmMgtMIBCompliances 1 } - - --- units of conformance - -jvmClassLoadingGroups OBJECT IDENTIFIER ::= { jvmMgtMIBGroups 1 } - -jvmClassLoadingBasicGroup OBJECT-GROUP - OBJECTS { - jvmClassesLoadedCount, - jvmClassesTotalLoadedCount, - jvmClassesUnloadedCount - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.ClassLoadingMXBean interface. - " - ::= { jvmClassLoadingGroups 1 } - -jvmClassLoadingSetGroup OBJECT-GROUP - OBJECTS { - jvmClassesVerboseLevel - } - STATUS current - DESCRIPTION - "A collection of writable scalar objects that are mapped from JSR 163 - java.lang.management.ClassLoadingMXBean interface, and make it possible - to act on class loading. Accessing these objects may - require special permissions - the agent implementation is - responsible for puting in place the appropriate access control - if needed. - " - ::= { jvmClassLoadingGroups 2 } - -jvmMemoryGroups OBJECT IDENTIFIER ::= { jvmMgtMIBGroups 2 } - -jvmMemoryBasicGroup OBJECT-GROUP - OBJECTS { - jvmMemoryPendingFinalCount - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.MemoryManagerMXBean interface. - " - ::= { jvmMemoryGroups 1 } - -jvmMemoryHeapUsageGroup OBJECT-GROUP - OBJECTS { - jvmMemoryHeapInitSize, - jvmMemoryHeapUsed, - jvmMemoryHeapCommitted, - jvmMemoryHeapMaxSize - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.MemoryMXBean.getHeapMemoryUsage(). - When several of these objects are requested within a single - SNMP request, the agent must ensure that - java.lang.management.MemoryPoolMXBean.getHeapMemoryUsage() is - called only once, in order to guarantee that the set of - values returned for these objects remain coherent and give - a consistent snapshot of the heap memory usage made by - Heap Memory Pools. - " - ::= { jvmMemoryGroups 2 } - -jvmMemoryNonHeapUsageGroup OBJECT-GROUP - OBJECTS { - jvmMemoryNonHeapInitSize, - jvmMemoryNonHeapUsed, - jvmMemoryNonHeapCommitted, - jvmMemoryNonHeapMaxSize - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.MemoryMXBean.getNonHeapMemoryUsage(). - When several of these objects are requested within a single - SNMP request, the agent must ensure that - java.lang.management.MemoryPoolMXBean.getNonHeapMemoryUsage() is - called only once, in order to guarantee that the set of - values returned for these objects remain coherent and give - a consistent snapshot of the non heap memory usage made by - Non Heap Memory Pools. - " - ::= { jvmMemoryGroups 3 } - -jvmMemorySetGroup OBJECT-GROUP - OBJECTS { - jvmMemoryGCVerboseLevel, - jvmMemoryGCCall - } - STATUS current - DESCRIPTION - "A collection of writable scalar objects that are mapped from JSR 163 - java.lang.management.MemoryMXBean interface, and make it possible - to act on the Garbage Collector. Accessing these objects may - require special permissions - the agent implementation is - responsible for puting in place the appropriate access control - if needed. - " - ::= { jvmMemoryGroups 4 } - -jvmMemManagerGroup OBJECT-GROUP - OBJECTS { - jvmMemManagerName, - jvmMemManagerState - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.MemoryManagerMXBean interface. - " - ::= { jvmMemoryGroups 5 } - -jvmMemGCGroup OBJECT-GROUP - OBJECTS { - jvmMemGCCount, - jvmMemGCTimeMs - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.GarbageCollectorMXBean interface, and are - specific to GarbageCollector MXBeans. - These objects are used to model the inheritence link between - GarbageCollectorMXBean and its super interface - MemoryManagerMXBean. - " - ::= { jvmMemoryGroups 6 } - -jvmMemPoolGroups OBJECT IDENTIFIER ::= { jvmMemoryGroups 7 } - -jvmMemPoolBasicGroup OBJECT-GROUP - OBJECTS { - jvmMemPoolName, - jvmMemPoolType, - jvmMemPoolState, - jvmMemPoolPeakReset, - jvmMemPoolThreshdSupport, - jvmMemPoolCollectThreshdSupport - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.MemoryPoolMXBean interface. - " - ::= { jvmMemPoolGroups 1 } - -jvmMemPoolMonitoringGroup OBJECT-GROUP - OBJECTS { - jvmMemPoolThreshold, - jvmMemPoolThreshdCount - } - STATUS current - DESCRIPTION - "Memory usage threshold objects mapped from - JSR 163 java.lang.management.MemoryPoolMXBean interface, which makes - it possible to configure low memory detection. - Accessing this object may require special permissions - the agent - implementation is responsible for puting in place the appropriate - access control if needed. - " - ::= { jvmMemPoolGroups 2 } - -jvmMemPoolUsageGroup OBJECT-GROUP - OBJECTS { - jvmMemPoolInitSize, - jvmMemPoolUsed, - jvmMemPoolCommitted, - jvmMemPoolMaxSize - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.MemoryPoolMXBean.getUsage(). - When several of these objects are requested within a single - SNMP request, the agent must ensure that - java.lang.management.MemoryPoolMXBean.getUsage() is - called only once, in order to guarantee that the set of - values returned for these objects remain coherent and give - a consistent snapshot of the memory used by this Memory - Pool. - " - ::= { jvmMemPoolGroups 3 } - -jvmMemPoolPeakUsageGroup OBJECT-GROUP - OBJECTS { - jvmMemPoolPeakUsed, - jvmMemPoolPeakCommitted, - jvmMemPoolPeakMaxSize - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.MemoryPoolMXBean.getPeakUsage(). - When several of these objects are requested within a single - SNMP request, the agent must ensure that - java.lang.management.MemoryPoolMXBean.getPeakUsage() is - called only once, in order to guarantee that the set of - values returned for these objects remain coherent and give - a consistent snapshot of the peak memory usage made by - this Memory Pool. - " - ::= { jvmMemPoolGroups 4 } - -jvmMemPoolCollectUsageGroup OBJECT-GROUP - OBJECTS { - jvmMemPoolCollectUsed, - jvmMemPoolCollectCommitted, - jvmMemPoolCollectMaxSize - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.MemoryPoolMXBean.getCollectionUsage(). - When several of these objects are requested within a single - SNMP request, the agent must ensure that - java.lang.management.MemoryPoolMXBean.getCollectionUsage() is - called only once, in order to guarantee that the set of - values returned for these objects remain coherent and give - a consistent snapshot of the collection memory usage made by - this Memory Pool. - " - ::= { jvmMemPoolGroups 5 } - -jvmMemPoolCollectMonitoringGroup OBJECT-GROUP - OBJECTS { - jvmMemPoolCollectThreshold, - jvmMemPoolCollectThreshdCount - } - STATUS current - DESCRIPTION - "Memory collection usage threshold objects mapped from JSR 163 - java.lang.management.MemoryPoolMXBean interface, which makes - it possible to configure low memory detection. - Accessing this object may require special permissions - the agent - implementation is responsible for putting in place the appropriate - access control if needed. - " - ::= { jvmMemPoolGroups 6 } - - -jvmMemMgrPoolRelationGroup OBJECT-GROUP - OBJECTS { - jvmMemMgrRelManagerName, - jvmMemMgrRelPoolName - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.MemoryPoolMXBean and - java.lang.management.MemoryManagerMXBean interface, and show the - relationship between Memory Managers and Memory Pools. - " - ::= { jvmMemoryGroups 8 } - -jvmThreadGroups OBJECT IDENTIFIER ::= { jvmMgtMIBGroups 3 } - -jvmThreadBasicGroup OBJECT-GROUP - OBJECTS { - jvmThreadCount, - jvmThreadDaemonCount, - jvmThreadPeakCount, - jvmThreadTotalStartedCount, - jvmThreadContentionMonitoring, - jvmThreadCpuTimeMonitoring, - jvmThreadPeakCountReset - } - STATUS current - DESCRIPTION - "A collection of scalar objects that are mapped from JSR 163 - java.lang.management.ThreadMXBean interface. - " - ::= { jvmThreadGroups 1 } - -jvmThreadInstanceGroups OBJECT IDENTIFIER ::= { jvmThreadGroups 2 } - -jvmThreadInstanceBasicGroup OBJECT-GROUP - OBJECTS { - jvmThreadInstId, - jvmThreadInstState, - jvmThreadInstName, - jvmThreadInstLockName, - jvmThreadInstLockOwnerPtr - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.ThreadMXBean interface, and are - relative to an instance of java.lang.Thread. - " - ::= { jvmThreadInstanceGroups 1} - -jvmThreadInstanceCpuGroup OBJECT-GROUP - OBJECTS { - jvmThreadInstCpuTimeNs - } - STATUS current - DESCRIPTION - "A columnar object mapped from JSR 163 - java.lang.management.ThreadMXBean interface which provides CPU - time statistics about an instance of java.lang.Thread. - " - ::= { jvmThreadInstanceGroups 2 } - - -jvmThreadInstanceBlockGroup OBJECT-GROUP - OBJECTS { - jvmThreadInstBlockCount, - jvmThreadInstBlockTimeMs, - jvmThreadInstWaitCount, - jvmThreadInstWaitTimeMs - } - STATUS current - DESCRIPTION - "A collection of columnar objects that are mapped from JSR 163 - java.lang.management.ThreadMXBean interface, and which provide - synchronization statistics about an instance of java.lang.Thread. - " - ::= { jvmThreadInstanceGroups 3 } - - -jvmRuntimeGroups OBJECT IDENTIFIER ::= { jvmMgtMIBGroups 4 } - -jvmRuntimeBasicGroup OBJECT-GROUP - OBJECTS { - jvmRTName, - jvmRTVMName, - jvmRTVMVendor, - jvmRTVMVersion, - jvmRTSpecName, - jvmRTSpecVendor, - jvmRTSpecVersion, - jvmRTManagementSpecVersion, - jvmRTUptimeMs, - jvmRTStartTimeMs, - jvmRTBootClassPathSupport, - jvmRTInputArgsCount, - jvmRTInputArgsItem, - jvmRTClassPathItem, - jvmRTLibraryPathItem - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.RuntimeMXBean interface. - " - ::= { jvmRuntimeGroups 1 } - - -jvmRuntimeBootCPGroup OBJECT-GROUP - OBJECTS { - jvmRTBootClassPathItem - } - STATUS current - DESCRIPTION - "A columnar object that is mapped from JSR 163 - java.lang.management.RuntimeMXBean.getBootClassPath() interface, - and provide information about bootclasspath elements. - " - ::= { jvmRuntimeGroups 2 } - -jvmJITCompilerGroups OBJECT IDENTIFIER ::= { jvmMgtMIBGroups 5 } - -jvmJITCompilerBasicGroup OBJECT-GROUP - OBJECTS { - jvmJITCompilerName, - jvmJITCompilerTimeMonitoring - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.CompilationMXBean interface. - " - ::= { jvmJITCompilerGroups 1 } - -jvmJITCompilerTimeStatGroup OBJECT-GROUP - OBJECTS { - jvmJITCompilerTimeMs - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.CompilationMXBean interface and provide - time statistic about the JIT Compiler. - " - ::= { jvmJITCompilerGroups 2 } - -jvmOSGroup OBJECT-GROUP - OBJECTS { - jvmOSName, - jvmOSArch, - jvmOSVersion, - jvmOSProcessorCount - } - STATUS current - DESCRIPTION - "A collection of objects that are mapped from JSR 163 - java.lang.management.OperatingSystemMXBean interface. - " - ::= { jvmMgtMIBGroups 6 } - -jvmLowMemoryUsageNotifGroup NOTIFICATION-GROUP - NOTIFICATIONS { - jvmLowMemoryPoolUsageNotif - } - STATUS current - DESCRIPTION - "A collection of notifications emitted when low - memory usage conditions are detected. - " - ::= { jvmMgtMIBGroups 7 } - -jvmLowMemoryCollectNotifGroup NOTIFICATION-GROUP - NOTIFICATIONS { - jvmLowMemoryPoolCollectNotif - } - STATUS current - DESCRIPTION - "A collection of notifications emitted when low - collection memory usage conditions are detected. - " - ::= { jvmMgtMIBGroups 8 } - -END From 7a520e19a19953f1a0eedb9ffd069317036f9cfe Mon Sep 17 00:00:00 2001 From: Daniel Fuchs-#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * MacOS specific declarations for AWT native interface. - * See notes in jawt.h for an example of use. - */ - -/* - * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this - * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will - * return false. This is to maintain compatibility with applications that used the - * interface with Java 6 which had multiple rendering models. This flag is not necessary - * when JAWT version 1.7 or greater is used as this is the only supported rendering mode. - * - * Example: - * JAWT awt; - * awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER; - * jboolean success = JAWT_GetAWT(env, &awt); - */ -#define JAWT_MACOSX_USE_CALAYER 0x80000000 - -/* - * When the native Cocoa toolkit is in use, the pointer stored in - * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the - * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the - * specified layer to be overlaid on the Components rectangle. If the window the - * Component belongs to has a CALayer attached to it, this layer will be accessible via - * the windowLayer property. - */ -#ifdef __OBJC__ -@protocol JAWT_SurfaceLayers -@property (readwrite, retain) CALayer *layer; -@property (readonly) CALayer *windowLayer; -@end -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* !_JAVASOFT_JAWT_MD_H_ */ - Date: Thu, 8 Jun 2017 12:24:13 +0100 Subject: [PATCH 040/130] 8181430: HTTP/2 client might deadlock when receiving data during the initial handshake CountDownLatch removed. Data produced during the handshake is instead buffered until the preface is sent. Reviewed-by: michaelm, msheppar, prappo --- .../jdk/incubator/http/Http2Connection.java | 84 +++++++++++-------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java index 5c13878ad86..275325f8b29 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,47 +111,56 @@ class Http2Connection { */ - // A small class that allows to control the state of - // the connection preface. This is just a thin wrapper - // over a CountDownLatch. - private final class PrefaceController { + // A small class that allows to control frames with respect to the state of + // the connection preface. Any data received before the connection + // preface is sent will be buffered. + private final class FramesController { volatile boolean prefaceSent; - private final CountDownLatch latch = new CountDownLatch(1); + volatile List pending; - // This method returns immediately if the preface is sent, - // and blocks until the preface is sent if not. - // In the common case this where the preface is already sent - // this will cost not more than a volatile read. - void waitUntilPrefaceSent() { + boolean processReceivedData(FramesDecoder decoder, ByteBufferReference buf) + throws IOException + { + // if preface is not sent, buffers data in the pending list if (!prefaceSent) { - try { - // If the preface is not sent then await on the latch - Log.logTrace("Waiting until connection preface is sent"); - latch.await(); - Log.logTrace("Preface sent: resuming reading"); - assert prefaceSent; - } catch (InterruptedException e) { - String msg = Utils.stackTrace(e); - Log.logTrace(msg); - shutdown(e); + synchronized (this) { + if (!prefaceSent) { + if (pending == null) pending = new ArrayList<>(); + pending.add(buf); + return false; + } } } + + // Preface is sent. Checks for pending data and flush it. + // We rely on this method being called from within the readlock, + // so we know that no other thread could execute this method + // concurrently while we're here. + // This ensures that later incoming buffers will not + // be processed before we have flushed the pending queue. + // No additional synchronization is therefore necessary here. + List pending = this.pending; + this.pending = null; + if (pending != null) { + // flush pending data + for (ByteBufferReference b : pending) { + decoder.decode(b); + } + } + + // push the received buffer to the frames decoder. + decoder.decode(buf); + return true; } // Mark that the connection preface is sent void markPrefaceSent() { assert !prefaceSent; - prefaceSent = true; - // Release the latch. If asyncReceive was scheduled it will - // be waiting for the release and will be woken up by this - // call. If not, then the semaphore will no longer be used after - // this. - latch.countDown(); + synchronized (this) { + prefaceSent = true; + } } - boolean isPrefaceSent() { - return prefaceSent; - } } volatile boolean closed; @@ -176,7 +185,7 @@ class Http2Connection { * Each of this connection's Streams MUST use this controller. */ private final WindowController windowController = new WindowController(); - private final PrefaceController prefaceController = new PrefaceController(); + private final FramesController framesController = new FramesController(); final WindowUpdateSender windowUpdater; static final int DEFAULT_FRAME_SIZE = 16 * 1024; @@ -409,11 +418,11 @@ class Http2Connection { // SettingsFrame sent by the server) before the connection // preface is fully sent might result in the server // sending a GOAWAY frame with 'invalid_preface'. - prefaceController.waitUntilPrefaceSent(); synchronized (readlock) { - assert prefaceController.isPrefaceSent(); try { - framesDecoder.decode(buffer); + // the readlock ensures that the order of incoming buffers + // is preserved. + framesController.processReceivedData(framesDecoder, buffer); } catch (Throwable e) { String msg = Utils.stackTrace(e); Log.logTrace(msg); @@ -646,7 +655,8 @@ class Http2Connection { Log.logFrames(sf, "OUT"); // send preface bytes and SettingsFrame together connection.write(ref.get()); - + // mark preface sent. + framesController.markPrefaceSent(); Log.logTrace("PREFACE_BYTES sent"); Log.logTrace("Settings Frame sent"); @@ -654,8 +664,10 @@ class Http2Connection { // minus the initial 64 K specified in protocol final int len = client2.client().getReceiveBufferSize() - (64 * 1024 - 1); windowUpdater.sendWindowUpdate(len); + // there will be an ACK to the windows update - which should + // cause any pending data stored before the preface was sent to be + // flushed (see PrefaceController). Log.logTrace("finished sending connection preface"); - prefaceController.markPrefaceSent(); } /** From 3d902cf92ab1590049931ccf08cfbaa98924b70b Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Thu, 8 Jun 2017 12:41:07 +0100 Subject: [PATCH 041/130] 8180044: java/net/httpclient/ManyRequests.java failed due to timeout Fixes several race conditions observed while testing. Reviewed-by: michaelm, msheppar, prappo --- .../jdk/incubator/http/HttpClientImpl.java | 8 ++- .../incubator/http/PlainHttpConnection.java | 23 +++++++- .../classes/jdk/incubator/http/Stream.java | 4 +- .../sun/net/httpserver/FileServerHandler.java | 16 +++-- .../java/net/httpclient/ManyRequests.java | 59 ++++++++++++++++--- .../java/net/httpclient/ManyRequests2.java | 48 +++++++++++++++ 6 files changed, 140 insertions(+), 18 deletions(-) create mode 100644 jdk/test/java/net/httpclient/ManyRequests2.java diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java index a0cb429ef55..c4087b0a4ec 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java @@ -344,7 +344,13 @@ class HttpClientImpl extends HttpClient { c.configureBlocking(false); SelectionKey key = c.keyFor(selector); SelectorAttachment sa; - if (key == null) { + if (key == null || !key.isValid()) { + if (key != null) { + // key is canceled. + // invoke selectNow() to purge it + // before registering the new event. + selector.selectNow(); + } sa = new SelectorAttachment(c, selector); } else { sa = (SelectorAttachment) key.attachment(); diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java index 7bb69850c83..6126725b3cf 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java @@ -62,6 +62,7 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { private volatile Consumer asyncReceiver; private volatile Consumer errorReceiver; private volatile Supplier readBufferSupplier; + private boolean asyncReading; private final AsyncWriteQueue asyncOutputQ = new AsyncWriteQueue(this::asyncOutput); @@ -70,6 +71,9 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { @Override public void startReading() { try { + synchronized(reading) { + asyncReading = true; + } client.registerEvent(new ReadEvent()); } catch (IOException e) { shutdown(); @@ -78,6 +82,9 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { @Override public void stopAsyncReading() { + synchronized(reading) { + asyncReading = false; + } client.cancelRegistration(chan); } @@ -279,7 +286,7 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { void asyncRead() { synchronized (reading) { try { - while (true) { + while (asyncReading) { ByteBufferReference buf = readBufferSupplier.get(); int n = chan.read(buf.get()); if (n == -1) { @@ -325,7 +332,7 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { return -1; } Utils.flipToMark(buf, mark); - String s = "Receive (" + n + " bytes) "; + // String s = "Receive (" + n + " bytes) "; //debugPrint(s, buf); return n; } @@ -393,6 +400,10 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { shutdown(); } + @Override + public String toString() { + return super.toString() + "/" + chan; + } } // used in blocking channels only @@ -422,6 +433,11 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { public void abort() { close(); } + + @Override + public String toString() { + return super.toString() + "/" + chan; + } } @Override @@ -447,7 +463,8 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection { CompletableFuture whenReceivingResponse() { CompletableFuture cf = new MinimalFuture<>(); try { - client.registerEvent(new ReceiveResponseEvent(cf)); + ReceiveResponseEvent evt = new ReceiveResponseEvent(cf); + client.registerEvent(evt); } catch (IOException e) { cf.completeExceptionally(e); } diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java index a0eb54e0076..de0c6a8f7cd 100644 --- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java +++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java @@ -803,7 +803,9 @@ class Stream extends ExchangeImpl { completeResponseExceptionally(e); try { // will send a RST_STREAM frame - connection.resetStream(streamid, ResetFrame.CANCEL); + if (streamid != 0) { + connection.resetStream(streamid, ResetFrame.CANCEL); + } } catch (IOException ex) { Log.logError(ex); } diff --git a/jdk/test/com/sun/net/httpserver/FileServerHandler.java b/jdk/test/com/sun/net/httpserver/FileServerHandler.java index 00ccd7d1a43..298dc095906 100644 --- a/jdk/test/com/sun/net/httpserver/FileServerHandler.java +++ b/jdk/test/com/sun/net/httpserver/FileServerHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,8 +214,8 @@ class EchoHandler implements HttpHandler { t.sendResponseHeaders(200, in.length); OutputStream os = t.getResponseBody(); os.write(in); - os.close(); - is.close(); + close(os); + close(is); } else { OutputStream os = t.getResponseBody(); byte[] buf = new byte[64 * 1024]; @@ -232,9 +232,15 @@ class EchoHandler implements HttpHandler { String s = Integer.toString(count); os.write(s.getBytes()); } + close(os); + close(is); + } + } + + protected void close(OutputStream os) throws IOException { os.close(); + } + protected void close(InputStream is) throws IOException { is.close(); } } -} - diff --git a/jdk/test/java/net/httpclient/ManyRequests.java b/jdk/test/java/net/httpclient/ManyRequests.java index 47f21c60d0f..7420c7223ed 100644 --- a/jdk/test/java/net/httpclient/ManyRequests.java +++ b/jdk/test/java/net/httpclient/ManyRequests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8087112 + * @bug 8087112 8180044 * @modules jdk.incubator.httpclient * java.logging * jdk.httpserver @@ -32,13 +32,20 @@ * @compile ../../../com/sun/net/httpserver/LogFilter.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests + * @run main/othervm/timeout=40 -Dtest.insertDelay=true ManyRequests + * @run main/othervm/timeout=40 -Dtest.chunkSize=64 ManyRequests + * @run main/othervm/timeout=40 -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests * @summary Send a large number of requests asynchronously */ + // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsParameters; import com.sun.net.httpserver.HttpsServer; +import com.sun.net.httpserver.HttpExchange; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import jdk.incubator.http.HttpClient; import jdk.incubator.http.HttpRequest; import java.net.InetSocketAddress; @@ -65,7 +72,10 @@ public class ManyRequests { Logger logger = Logger.getLogger("com.sun.net.httpserver"); logger.setLevel(Level.ALL); logger.info("TEST"); - + System.out.println("Sending " + REQUESTS + + " requests; delay=" + INSERT_DELAY + + ", chunks=" + CHUNK_SIZE + + ", XFixed=" + XFIXED); SSLContext ctx = new SimpleSSLContext().get(); InetSocketAddress addr = new InetSocketAddress(0); @@ -86,11 +96,36 @@ public class ManyRequests { //static final int REQUESTS = 1000; static final int REQUESTS = 20; + static final boolean INSERT_DELAY = Boolean.getBoolean("test.insertDelay"); + static final int CHUNK_SIZE = Math.max(0, + Integer.parseInt(System.getProperty("test.chunkSize", "0"))); + static final boolean XFIXED = Boolean.getBoolean("test.XFixed"); + + static class TestEchoHandler extends EchoHandler { + final Random rand = new Random(); + @Override + public void handle(HttpExchange e) throws IOException { + System.out.println("Server: received " + e.getRequestURI()); + super.handle(e); + } + protected void close(OutputStream os) throws IOException { + if (INSERT_DELAY) { + try { Thread.sleep(rand.nextInt(200)); } catch (InterruptedException e) {} + } + super.close(os); + } + protected void close(InputStream is) throws IOException { + if (INSERT_DELAY) { + try { Thread.sleep(rand.nextInt(200)); } catch (InterruptedException e) {} + } + super.close(is); + } + } static void test(HttpsServer server, HttpClient client) throws Exception { int port = server.getAddress().getPort(); - URI uri = new URI("https://127.0.0.1:" + port + "/foo/x"); - server.createContext("/foo", new EchoHandler()); + URI baseURI = new URI("https://127.0.0.1:" + port + "/foo/x"); + server.createContext("/foo", new TestEchoHandler()); server.start(); RequestLimiter limiter = new RequestLimiter(40); @@ -99,24 +134,32 @@ public class ManyRequests { HashMap bodies = new HashMap<>(); for (int i=0; i client.sendAsync(r, asByteArray())) + .thenCompose((v) -> { + System.out.println("Client: sendAsync: " + r.uri()); + return client.sendAsync(r, asByteArray()); + }) .thenCompose((resp) -> { limiter.requestComplete(); if (resp.statusCode() != 200) { String s = "Expected 200, got: " + resp.statusCode(); + System.out.println(s + " from " + + resp.request().uri().getPath()); return completedWithIOException(s); } else { counter++; - System.out.println("Result from " + counter); + System.out.println("Result (" + counter + ") from " + + resp.request().uri().getPath()); } return CompletableFuture.completedStage(resp.body()) .thenApply((b) -> new Pair<>(resp, b)); diff --git a/jdk/test/java/net/httpclient/ManyRequests2.java b/jdk/test/java/net/httpclient/ManyRequests2.java new file mode 100644 index 00000000000..2ec01de9734 --- /dev/null +++ b/jdk/test/java/net/httpclient/ManyRequests2.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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 8087112 8180044 + * @modules jdk.incubator.httpclient + * java.logging + * jdk.httpserver + * @library /lib/testlibrary/ / + * @build jdk.testlibrary.SimpleSSLContext EchoHandler + * @compile ../../../com/sun/net/httpserver/LogFilter.java + * @compile ../../../com/sun/net/httpserver/FileServerHandler.java + * @build ManyRequests ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.insertDelay=true ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.chunkSize=64 ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests2 + * @summary Send a large number of requests asynchronously. The server echoes back using known content length. + */ + // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests + +public class ManyRequests2 { + + public static void main(String[] args) throws Exception { + ManyRequests.main(args); + } +} From 0a843fc371c2158e985df69995b68098b3a76ed2 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 8 Jun 2017 13:49:11 +0200 Subject: [PATCH 042/130] 8180300: Move JDWP specs to specs directory Reviewed-by: sspitsyn --- .../share/classes/com/sun/jdi/connect/spi/Connection.java | 4 ++-- .../classes/com/sun/jdi/connect/spi/TransportService.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java index 2067d714c4b..1e7943fbd70 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java @@ -82,7 +82,7 @@ public abstract class Connection { * thrown. The first byte of the packet is stored in element * {@code 0} of the byte array, the second in element {@code 1}, * and so on. The bytes in the byte array are laid out as per the - * + * * JDWP specification. That is, all fields in the packet * are in big endian order as per the JDWP specification. * @@ -119,7 +119,7 @@ public abstract class Connection { * * The byte array provided to this method should be laid out * as per the + * href="{@docRoot}/../specs/jdwp/jdwp-spec.html"> * JDWP specification. That is, all fields in the packet * are in big endian order. The first byte, that is element * {@code pkt[0]}, is the first byte of the {@code length} field. diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java index 61eba8880cc..1c06bd39447 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java @@ -43,7 +43,7 @@ import com.sun.jdi.connect.TransportTimeoutException; * Debug Wire Protocol (JDWP) packets over an underlying * communication protocol. In essence a transport service * implementation binds JDWP (as specified in the - * + * * JDWP specification) to an underlying communication * protocol. A transport service implementation provides * a reliable JDWP packet transportation service. JDWP @@ -166,7 +166,7 @@ public abstract class TransportService { * is followed by a handshake to ensure that the connection is * to a target VM. The handshake involves the exchange * of a string JDWP-Handshake as specified in the + * href="{@docRoot}/../specs/jdwp/jdwp-spec.html"> * Java Debug Wire Protocol specification. * * @param address @@ -315,7 +315,7 @@ public abstract class TransportService { * connection is indeed to a target VM. The handshake involves * the exchange of a string JDWP-Handshake as specified * in the + * href="{@docRoot}/../specs/jdwp/jdwp-spec.html"> * Java Debug Wire Protocol specification. * * @param listenKey From e9fe6f3c6b7c9d70138948717a351988e1df2d18 Mon Sep 17 00:00:00 2001 From: Erik Joelsson
Date: Thu, 8 Jun 2017 14:53:48 +0200 Subject: [PATCH 043/130] 8178064: OpenJDK RI binary should include the license file for freetype Reviewed-by: tbell, ihse --- common/autoconf/generated-configure.sh | 158 ++++++++++++++++++++++++- common/autoconf/lib-freetype.m4 | 16 +++ common/autoconf/spec.gmk.in | 1 + common/conf/jib-profiles.js | 10 ++ make/CreateJmods.gmk | 1 + 5 files changed, 185 insertions(+), 1 deletion(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index cf23d7e99b8..ab0642affe6 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -688,6 +688,7 @@ LIBFFI_LIBS LIBFFI_CFLAGS ALSA_LIBS ALSA_CFLAGS +FREETYPE_LICENSE FREETYPE_BUNDLE_LIB_PATH FREETYPE_LIBS FREETYPE_CFLAGS @@ -1199,6 +1200,7 @@ with_freetype_include with_freetype_lib with_freetype_src enable_freetype_bundling +with_freetype_license with_alsa with_alsa_include with_alsa_lib @@ -2151,6 +2153,7 @@ Optional Packages: --with-freetype-src specify directory with freetype sources to automatically build the library (experimental, Windows-only) + --with-freetype-license if bundling freetype, also bundle this license file --with-alsa specify prefix directory for the alsa package (expecting the libraries under PATH/lib and the headers under PATH/include) @@ -5183,7 +5186,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1494858828 +DATE_WHEN_GENERATED=1496926402 ############################################################################### # @@ -57706,6 +57709,12 @@ if test "${enable_freetype_bundling+set}" = set; then : fi +# Check whether --with-freetype-license was given. +if test "${with_freetype_license+set}" = set; then : + withval=$with_freetype_license; +fi + + # Need to specify explicitly since it needs to be overridden on some versions of macosx FREETYPE_BASE_NAME=freetype FREETYPE_CFLAGS= @@ -63652,6 +63661,153 @@ $as_echo "$BUNDLE_FREETYPE" >&6; } fi # end freetype needed + FREETYPE_LICENSE="" + if test "x$with_freetype_license" = "xyes"; then + as_fn_error $? "--with-freetype-license must have a value" "$LINENO" 5 + elif test "x$with_freetype_license" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype license" >&5 +$as_echo_n "checking for freetype license... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_license" >&5 +$as_echo "$with_freetype_license" >&6; } + FREETYPE_LICENSE="$with_freetype_license" + + # Only process if variable expands to non-empty + + if test "x$FREETYPE_LICENSE" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$FREETYPE_LICENSE" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of FREETYPE_LICENSE" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + FREETYPE_LICENSE="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$FREETYPE_LICENSE" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + FREETYPE_LICENSE="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_LICENSE to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a unix platform. Hooray! :) + path="$FREETYPE_LICENSE" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_LICENSE, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_LICENSE, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + if test -d "$path"; then + FREETYPE_LICENSE="`cd "$path"; $THEPWDCMD -L`" + else + dir="`$DIRNAME "$path"`" + base="`$BASENAME "$path"`" + FREETYPE_LICENSE="`cd "$dir"; $THEPWDCMD -L`/$base" + fi + fi + fi + + if test ! -f "$FREETYPE_LICENSE"; then + as_fn_error $? "$FREETYPE_LICENSE cannot be found" "$LINENO" 5 + fi + fi + + diff --git a/common/autoconf/lib-freetype.m4 b/common/autoconf/lib-freetype.m4 index e7790caa64b..17dd726e54c 100644 --- a/common/autoconf/lib-freetype.m4 +++ b/common/autoconf/lib-freetype.m4 @@ -194,6 +194,8 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], [specify directory with freetype sources to automatically build the library (experimental, Windows-only)])]) AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) + AC_ARG_WITH(freetype-license, [AS_HELP_STRING([--with-freetype-license], + [if bundling freetype, also bundle this license file])]) # Need to specify explicitly since it needs to be overridden on some versions of macosx FREETYPE_BASE_NAME=freetype @@ -443,7 +445,21 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], fi # end freetype needed + FREETYPE_LICENSE="" + if test "x$with_freetype_license" = "xyes"; then + AC_MSG_ERROR([--with-freetype-license must have a value]) + elif test "x$with_freetype_license" != "x"; then + AC_MSG_CHECKING([for freetype license]) + AC_MSG_RESULT([$with_freetype_license]) + FREETYPE_LICENSE="$with_freetype_license" + BASIC_FIXUP_PATH(FREETYPE_LICENSE) + if test ! -f "$FREETYPE_LICENSE"; then + AC_MSG_ERROR([$FREETYPE_LICENSE cannot be found]) + fi + fi + AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) AC_SUBST(FREETYPE_CFLAGS) AC_SUBST(FREETYPE_LIBS) + AC_SUBST(FREETYPE_LICENSE) ]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 9946fa2b679..877ede9d9b1 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -312,6 +312,7 @@ DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@ FREETYPE_LIBS:=@FREETYPE_LIBS@ FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@ FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@ +FREETYPE_LICENSE=@FREETYPE_LICENSE@ CUPS_CFLAGS:=@CUPS_CFLAGS@ ALSA_LIBS:=@ALSA_LIBS@ ALSA_CFLAGS:=@ALSA_CFLAGS@ diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index 1892fafab9f..54ccfcecd52 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -893,6 +893,16 @@ var getJibProfilesProfiles = function (input, common, data) { } }); + // The windows ri profile needs to add the freetype license file + profilesRiFreetype = { + "windows-x86-ri": { + configure_args: "--with-freetype-license=" + + input.get("freetype", "install_path") + + "/freetype-2.7.1-v120-x86/freetype.md" + } + }; + profiles = concatObjects(profiles, profilesRiFreetype); + // Generate the missing platform attributes profiles = generatePlatformAttributes(profiles); profiles = generateDefaultMakeTargetsConfigureArg(common, profiles); diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index 7d4287e02d8..2a27e3629a6 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -81,6 +81,7 @@ endif LEGAL_NOTICES := \ $(SUPPORT_OUTPUTDIR)/modules_legal/java.base \ + $(wildcard $(SUPPORT_OUTPUTDIR)/modules_legal/$(MODULE)) \ $(call FindModuleLegalDirs, $(MODULE)) \ # From 938744edaba1102653cd10b939218820e848a0f8 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 8 Jun 2017 14:53:56 +0200 Subject: [PATCH 044/130] 8178064: OpenJDK RI binary should include the license file for freetype Reviewed-by: tbell, ihse --- jdk/make/copy/Copy-java.desktop.gmk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jdk/make/copy/Copy-java.desktop.gmk b/jdk/make/copy/Copy-java.desktop.gmk index 49d6b86aeb2..710375594e4 100644 --- a/jdk/make/copy/Copy-java.desktop.gmk +++ b/jdk/make/copy/Copy-java.desktop.gmk @@ -77,6 +77,13 @@ ifneq ($(FREETYPE_BUNDLE_LIB_PATH), ) endif TARGETS += $(FREETYPE_TARGET_LIB) + + $(eval $(call SetupCopyFiles, COPY_FREETYPE_LICENSE, \ + FILES := $(FREETYPE_LICENSE), \ + DEST := $(LEGAL_DST_DIR), \ + )) + + TARGETS += $(COPY_FREETYPE_LICENSE) endif ################################################################################ From fde342fc8117cad0e85585f2b2daff7750309734 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 8 Jun 2017 16:36:06 +0200 Subject: [PATCH 045/130] 8181788: Unable to build JDK10 on SPARC-M8 machines Reviewed-by: tbell --- common/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index 1892fafab9f..8f940224465 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -387,7 +387,7 @@ var getJibProfilesCommon = function (input, data) { // on such hardware. if (input.build_cpu == "sparcv9") { var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\""); - if (cpu_brand.trim().match('SPARC-.7')) { + if (cpu_brand.trim().match('SPARC-.[78]')) { boot_jdk_revision = "8u20"; boot_jdk_subdirpart = "1.8.0_20"; } From 75b3070ce173e2f823d7b08e7e4bdbc4d0fb1760 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:53 +0000 Subject: [PATCH 046/130] Added tag jdk-9+173 for changeset c57e79c03808 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 02ceae47e64..ac719147800 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -415,3 +415,4 @@ b25838a28195f4b6dab34668411eedd2d366a16c jdk-9+169 4d163ec59d989a9261ed7f848bc6303f90869af5 jdk-9+170 4c12464a907db4656c1033f56fa49cba643ac629 jdk-9+171 2c25fc24103251f9711a1c280c31e1e41016d90f jdk-9+172 +88d7fd969e7df0e07a53b201cfd29393ca33ede9 jdk-9+173 From 7781ed0fd6abf9d8edceed844494e0f39648433d Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:53 +0000 Subject: [PATCH 047/130] Added tag jdk-9+173 for changeset 17af9f5736f7 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 7bff670cf7a..1f76802f679 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -575,3 +575,4 @@ fbb9c802649585d19f6d7e81b4a519d44806225a jdk-9+168 38a240fd58a287acb1963920b92ed4d9c2fd39e3 jdk-9+170 d53171650a2cc6c6f699c966c533b914ca9c0602 jdk-9+171 1ae9e84f68b359420d2d153ecfe5ee2903e33a2e jdk-9+172 +e64b1cb48d6e7703928a9d1da106fc27f8cb65fd jdk-9+173 From f0331aab76aeb6191e09911b3e6aa04142944696 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:53 +0000 Subject: [PATCH 048/130] Added tag jdk-9+173 for changeset 7c17d86598bc --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 0d60dac7b11..6db1eeda878 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -415,3 +415,4 @@ b2218d41edef02ee8f94bb438f885b2ba79bfa08 jdk-9+169 8a4ab3b0ab9a86df73d9a1e337134f2dbe006725 jdk-9+170 c62e5964cfcf144d8f72e9ba69757897785349a9 jdk-9+171 95ed14547ca9246baed34f90ef3ca13217538a8c jdk-9+172 +534ba4f8cfcf12accc5b9adb943103f2ff79fe16 jdk-9+173 From b659d744231d1d852d2ff3935685e0ea2300cbcd Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:55 +0000 Subject: [PATCH 049/130] Added tag jdk-9+173 for changeset d952dcd38dba --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 7c40923b81b..d973120b189 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -415,3 +415,4 @@ e78da9db6299b3fcba49300d52e2359e82fdd218 jdk-9+168 ef9954f6896bb0b95ac62bf769f68b59a7a56ccd jdk-9+170 29bbedd4cce8e14742bdb22118c057b877c02f0f jdk-9+171 0ff9ad7d067cd4fa14450cf208bf019175a0aaba jdk-9+172 +a5506b425f1bf91530d8417b57360e5d89328c0c jdk-9+173 From e68df62c6dd0d365aa207c7d0ae37ca507337ed4 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:55 +0000 Subject: [PATCH 050/130] Added tag jdk-9+173 for changeset c4bf1e214a16 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 336aefb8bd9..65daf6b0720 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -415,3 +415,4 @@ d02b6fbcab06c59a5f5a4a6736bd4ec6d2567855 jdk-9+162 6e78f902f477a093afca85a1042f97410d01eb69 jdk-9+170 c27321c889cf4c8e465a61b84572c00ef7ee6004 jdk-9+171 eedb6e54c8bd6197ecba5fc0d8568bac8ae852dd jdk-9+172 +9788347e0629d0cb3a0e55a903494ff741d4fa15 jdk-9+173 From 3b066f59e52a919358a92d36907e53bb5bca49d4 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:55 +0000 Subject: [PATCH 051/130] Added tag jdk-9+173 for changeset fac2783f3c0b --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index c9414b1e81a..7353c4ba3b0 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -418,3 +418,4 @@ b1f30c27367bd286fa4eb8a767335e917a5b5b82 jdk-9+166 e75d3abe579a7b39b762fc0a1a337c49eb072d82 jdk-9+170 139e7c786ee4885efe53eb650b72c7b5a2d3b964 jdk-9+171 8c615099f3e3ca137325be34bf566b767d9e3c64 jdk-9+172 +2bd967aa452c1e0e87a6173bef6fbb96ef1c521b jdk-9+173 From be4b3bd942c26636691d8eaeb77a53b5718f5601 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:57 +0000 Subject: [PATCH 052/130] Added tag jdk-9+173 for changeset 4b53bf8b530c --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index 085ea4b1ab9..1c018e6b021 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -415,3 +415,4 @@ bc21e5ba6bf1538551093f57fa0f1a6571be05cc jdk-9+168 18355c879c69a33167f1862896738a7b9a4da729 jdk-9+170 aae59039c1f5701ae933c5eed30e75d6e3afaeee jdk-9+171 03669efa77f51852f5301623cad4a2e1bb4fb9f6 jdk-9+172 +123eb0956a459bca29d0812c62fca50da563ee40 jdk-9+173 From 6cef7d30d1ca040383535b8daebb9c925cffdc78 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 8 Jun 2017 16:32:57 +0000 Subject: [PATCH 053/130] Added tag jdk-9+173 for changeset 3669cf10f2e3 --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index 0ab0ec514d5..4e9aaddad61 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -406,3 +406,4 @@ e118c818dbf84d15191414c453b77c089116fdc0 jdk-9+167 550bfc15779f8f339610793867fdc251125811b5 jdk-9+170 fc416270a776409b74006262dd0a9f5f5ff31555 jdk-9+171 c8d6b740f0f7ec834b4157bf0d4523e8bbddb3f0 jdk-9+172 +fa8e4de50e821eed876388c84f7129a6739268be jdk-9+173 From a944319c4e28029eea584fbf4b9c9cac3c647e8f Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 8 Jun 2017 15:50:22 -0700 Subject: [PATCH 054/130] 8180296: Move Javadoc: doclet, taglet specs to specs directory Reviewed-by: ksrini --- .../classes/com/sun/source/doctree/package-info.java | 6 ++++-- .../share/classes/jdk/javadoc/doclet/StandardDoclet.java | 8 ++++++-- langtools/src/jdk.javadoc/share/classes/module-info.java | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java index ba5d6cb655b..25947058df8 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,8 @@ * * @author Jonathan Gibbons * @since 1.8 - * @see http://docs.oracle.com/javase/8/docs/technotes/tools/unix/javadoc.html#CHDJGIJB + * + * @see + * Documentation Comment Specification for the Standard Doclet */ package com.sun.source.doctree; diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java index a82181cd9a4..1de02a6f3ef 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,11 @@ import javax.lang.model.SourceVersion; import jdk.javadoc.internal.doclets.formats.html.HtmlDoclet; /** - * This doclet generates HTML-formatted documentation for the specified modules, packages and types. + * This doclet generates HTML-formatted documentation for the specified modules, + * packages and types. + * + * @see + * Documentation Comment Specification for the Standard Doclet */ public class StandardDoclet implements Doclet { diff --git a/langtools/src/jdk.javadoc/share/classes/module-info.java b/langtools/src/jdk.javadoc/share/classes/module-info.java index 8e7d4e10d2c..5499c7127d1 100644 --- a/langtools/src/jdk.javadoc/share/classes/module-info.java +++ b/langtools/src/jdk.javadoc/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,9 @@ * {@link javax.tools.ToolProvider#getSystemDocumentationTool system documentation tool} * and its command line equivalent, javadoc. * + * @see + * Documentation Comment Specification for the Standard Doclet + * * @moduleGraph * @since 9 */ From 9c851a749c5bff1075d1c1cf7ac761b169c744c2 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Fri, 9 Jun 2017 16:26:32 +0100 Subject: [PATCH 055/130] 8173654: Regression since 8u60: System.getenv doesn't return env var set in JNI code Reviewed-by: erikj --- jdk/make/lib/CoreLibraries.gmk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index 5bb93942087..224b3392a03 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -132,7 +132,8 @@ TARGETS += $(BUILD_LIBVERIFY) ########################################################################################## -LIBJAVA_SRC_DIRS := $(call FindSrcDirsForLib, java.base, java) +# Allow a custom makefile to add extra src dirs +LIBJAVA_SRC_DIRS += $(call FindSrcDirsForLib, java.base, java) LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \ -I$(JDK_TOPDIR)/src/java.base/share/native/libfdlibm \ From 18b1dfcafa832f889733e32522ce735c85772e17 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Fri, 9 Jun 2017 16:52:07 +0100 Subject: [PATCH 056/130] 8181867: [tests] Reorganize EchoHandlers This fix reorganize some test files and rename some test classes. Several classes named EchoHandler in the unnamed package are renamed to make it clear what classes (and sources) tests that use these EchoHandler implementations effectively depend on. Reviewed-by: chegar --- .../com/sun/net/httpserver/EchoHandler.java | 98 +++++++ .../sun/net/httpserver/FileServerHandler.java | 266 ++++++------------ .../sun/net/httpserver/SimpleFileServer.java | 73 +++++ .../java/net/httpclient/HttpEchoHandler.java | 87 ++++++ .../net/httpclient/LightWeightHttpServer.java | 5 +- .../java/net/httpclient/ManyRequests.java | 3 +- .../java/net/httpclient/ManyRequests2.java | 3 +- .../java/net/httpclient/RequestBodyTest.java | 3 +- jdk/test/java/net/httpclient/SmokeTest.java | 5 +- .../java/net/httpclient/http2/BasicTest.java | 6 +- .../java/net/httpclient/http2/ErrorTest.java | 4 +- .../httpclient/http2/FixedThreadPoolTest.java | 6 +- .../net/httpclient/http2/RedirectTest.java | 4 +- .../http2/server/Http2EchoHandler.java | 76 +++++ 14 files changed, 442 insertions(+), 197 deletions(-) create mode 100644 jdk/test/com/sun/net/httpserver/EchoHandler.java create mode 100644 jdk/test/com/sun/net/httpserver/SimpleFileServer.java create mode 100644 jdk/test/java/net/httpclient/HttpEchoHandler.java create mode 100644 jdk/test/java/net/httpclient/http2/server/Http2EchoHandler.java diff --git a/jdk/test/com/sun/net/httpserver/EchoHandler.java b/jdk/test/com/sun/net/httpserver/EchoHandler.java new file mode 100644 index 00000000000..0b9de1f3d62 --- /dev/null +++ b/jdk/test/com/sun/net/httpserver/EchoHandler.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * 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.util.*; +import java.util.concurrent.*; +import java.util.logging.*; +import java.io.*; +import java.net.*; +import java.security.*; +import javax.net.ssl.*; +import com.sun.net.httpserver.*; + +/** + * Implements a basic static EchoHandler for an HTTP server + */ +public class EchoHandler implements HttpHandler { + + byte[] read(InputStream is) throws IOException { + byte[] buf = new byte[1024]; + byte[] result = new byte[0]; + + while (true) { + int n = is.read(buf); + if (n > 0) { + byte[] b1 = new byte[result.length + n]; + System.arraycopy(result, 0, b1, 0, result.length); + System.arraycopy(buf, 0, b1, result.length, n); + result = b1; + } else if (n == -1) { + return result; + } + } + } + + public void handle (HttpExchange t) + throws IOException + { + InputStream is = t.getRequestBody(); + Headers map = t.getRequestHeaders(); + String fixedrequest = map.getFirst ("XFixed"); + + // return the number of bytes received (no echo) + String summary = map.getFirst ("XSummary"); + if (fixedrequest != null && summary == null) { + byte[] in = read(is); + t.sendResponseHeaders(200, in.length); + OutputStream os = t.getResponseBody(); + os.write(in); + close(os); + close(is); + } else { + OutputStream os = t.getResponseBody(); + byte[] buf = new byte[64 * 1024]; + t.sendResponseHeaders(200, 0); + int n, count=0;; + + while ((n = is.read(buf)) != -1) { + if (summary == null) { + os.write(buf, 0, n); + } + count += n; + } + if (summary != null) { + String s = Integer.toString(count); + os.write(s.getBytes()); + } + close(os); + close(is); + } + } + + protected void close(OutputStream os) throws IOException { + os.close(); + } + protected void close(InputStream is) throws IOException { + is.close(); + } +} diff --git a/jdk/test/com/sun/net/httpserver/FileServerHandler.java b/jdk/test/com/sun/net/httpserver/FileServerHandler.java index 298dc095906..bff78443839 100644 --- a/jdk/test/com/sun/net/httpserver/FileServerHandler.java +++ b/jdk/test/com/sun/net/httpserver/FileServerHandler.java @@ -31,216 +31,122 @@ import javax.net.ssl.*; import com.sun.net.httpserver.*; /** - * Implements a basic static content HTTP server + * Implements a basic static content HTTP file server handler * which understands text/html, text/plain content types * * Must be given an abs pathname to the document root. * Directory listings together with text + html files * can be served. * - * File Server created on files sub-path - * - * Echo server created on echo sub-path */ public class FileServerHandler implements HttpHandler { - public static void main (String[] args) throws Exception { - if (args.length != 3) { - System.out.println ("usage: java FileServerHandler rootDir port logfilename"); - System.exit(1); - } - Logger logger = Logger.getLogger("com.sun.net.httpserver"); - ConsoleHandler ch = new ConsoleHandler(); - logger.setLevel(Level.ALL); - ch.setLevel(Level.ALL); - logger.addHandler(ch); + String docroot; - String rootDir = args[0]; - int port = Integer.parseInt (args[1]); - String logfile = args[2]; - HttpServer server = HttpServer.create (new InetSocketAddress (port), 0); - HttpHandler h = new FileServerHandler (rootDir); - HttpHandler h1 = new EchoHandler (); + public FileServerHandler (String docroot) { + this.docroot = docroot; + } - HttpContext c = server.createContext ("/files", h); - c.getFilters().add (new LogFilter (new File (logfile))); - HttpContext c1 = server.createContext ("/echo", h1); - c.getFilters().add (new LogFilter (new File (logfile))); - c1.getFilters().add (new LogFilter (new File (logfile))); - server.setExecutor (Executors.newCachedThreadPool()); - server.start (); + int invocation = 1; + public void handle (HttpExchange t) + throws IOException + { + InputStream is = t.getRequestBody(); + Headers map = t.getRequestHeaders(); + Headers rmap = t.getResponseHeaders(); + URI uri = t.getRequestURI(); + String path = uri.getPath(); + + int x = 0; + while (is.read () != -1) x++; + is.close(); + File f = new File (docroot, path); + if (!f.exists()) { + notfound (t, path); + return; + } + String fixedrequest = map.getFirst ("XFixed"); + + String method = t.getRequestMethod(); + if (method.equals ("HEAD")) { + rmap.set ("Content-Length", Long.toString (f.length())); + t.sendResponseHeaders (200, -1); + t.close(); + } else if (!method.equals("GET")) { + t.sendResponseHeaders (405, -1); + t.close(); + return; } - String docroot; - - FileServerHandler (String docroot) { - this.docroot = docroot; + if (path.endsWith (".html") || path.endsWith (".htm")) { + rmap.set ("Content-Type", "text/html"); + } else { + rmap.set ("Content-Type", "text/plain"); } - - int invocation = 1; - public void handle (HttpExchange t) - throws IOException - { - InputStream is = t.getRequestBody(); - Headers map = t.getRequestHeaders(); - Headers rmap = t.getResponseHeaders(); - URI uri = t.getRequestURI(); - String path = uri.getPath(); - - int x = 0; - while (is.read () != -1) x++; - is.close(); - File f = new File (docroot, path); - if (!f.exists()) { - notfound (t, path); + if (f.isDirectory()) { + if (!path.endsWith ("/")) { + moved (t); return; } - String fixedrequest = map.getFirst ("XFixed"); - - String method = t.getRequestMethod(); - if (method.equals ("HEAD")) { - rmap.set ("Content-Length", Long.toString (f.length())); - t.sendResponseHeaders (200, -1); - t.close(); - } else if (!method.equals("GET")) { - t.sendResponseHeaders (405, -1); - t.close(); - return; + rmap.set ("Content-Type", "text/html"); + t.sendResponseHeaders (200, 0); + String[] list = f.list(); + OutputStream os = t.getResponseBody(); + PrintStream p = new PrintStream (os); + p.println (" Directory listing for: " + path+ "
"); + p.println (""); + for (int i=0; i
"+list[i]+""); } - - if (path.endsWith (".html") || path.endsWith (".htm")) { - rmap.set ("Content-Type", "text/html"); + p.println ("
"); + p.flush(); + p.close(); + } else { + int clen; + if (fixedrequest != null) { + clen = (int) f.length(); } else { - rmap.set ("Content-Type", "text/plain"); + clen = 0; } - if (f.isDirectory()) { - if (!path.endsWith ("/")) { - moved (t); - return; - } - rmap.set ("Content-Type", "text/html"); - t.sendResponseHeaders (200, 0); - String[] list = f.list(); - OutputStream os = t.getResponseBody(); - PrintStream p = new PrintStream (os); - p.println ("Directory listing for: " + path+ "
"); - p.println (""); - for (int i=0; i
"+list[i]+""); - } - p.println ("
"); - p.flush(); - p.close(); - } else { - int clen; - if (fixedrequest != null) { - clen = (int) f.length(); - } else { - clen = 0; - } - t.sendResponseHeaders (200, clen); - OutputStream os = t.getResponseBody(); - FileInputStream fis = new FileInputStream (f); - int count = 0; - try { + t.sendResponseHeaders (200, clen); + OutputStream os = t.getResponseBody(); + FileInputStream fis = new FileInputStream (f); + int count = 0; + try { byte[] buf = new byte [16 * 1024]; int len; while ((len=fis.read (buf)) != -1) { os.write (buf, 0, len); count += len; } - } catch (IOException e) { - e.printStackTrace(); - } - fis.close(); - os.close(); + } catch (IOException e) { + e.printStackTrace(); } - } - - void moved (HttpExchange t) throws IOException { - Headers req = t.getRequestHeaders(); - Headers map = t.getResponseHeaders(); - URI uri = t.getRequestURI(); - String host = req.getFirst ("Host"); - String location = "http://"+host+uri.getPath() + "/"; - map.set ("Content-Type", "text/html"); - map.set ("Location", location); - t.sendResponseHeaders (301, -1); - t.close(); - } - - void notfound (HttpExchange t, String p) throws IOException { - t.getResponseHeaders().set ("Content-Type", "text/html"); - t.sendResponseHeaders (404, 0); - OutputStream os = t.getResponseBody(); - String s = "File not found
"; - s = s + p + ""; - os.write (s.getBytes()); + fis.close(); os.close(); - t.close(); } } -class EchoHandler implements HttpHandler { - - byte[] read(InputStream is) throws IOException { - byte[] buf = new byte[1024]; - byte[] result = new byte[0]; - - while (true) { - int n = is.read(buf); - if (n > 0) { - byte[] b1 = new byte[result.length + n]; - System.arraycopy(result, 0, b1, 0, result.length); - System.arraycopy(buf, 0, b1, result.length, n); - result = b1; - } else if (n == -1) { - return result; - } - } + void moved (HttpExchange t) throws IOException { + Headers req = t.getRequestHeaders(); + Headers map = t.getResponseHeaders(); + URI uri = t.getRequestURI(); + String host = req.getFirst ("Host"); + String location = "http://"+host+uri.getPath() + "/"; + map.set ("Content-Type", "text/html"); + map.set ("Location", location); + t.sendResponseHeaders (301, -1); + t.close(); } - public void handle (HttpExchange t) - throws IOException - { - InputStream is = t.getRequestBody(); - Headers map = t.getRequestHeaders(); - String fixedrequest = map.getFirst ("XFixed"); - - // return the number of bytes received (no echo) - String summary = map.getFirst ("XSummary"); - if (fixedrequest != null && summary == null) { - byte[] in = read(is); - t.sendResponseHeaders(200, in.length); - OutputStream os = t.getResponseBody(); - os.write(in); - close(os); - close(is); - } else { - OutputStream os = t.getResponseBody(); - byte[] buf = new byte[64 * 1024]; - t.sendResponseHeaders(200, 0); - int n, count=0;; - - while ((n = is.read(buf)) != -1) { - if (summary == null) { - os.write(buf, 0, n); - } - count += n; - } - if (summary != null) { - String s = Integer.toString(count); - os.write(s.getBytes()); - } - close(os); - close(is); - } - } - - protected void close(OutputStream os) throws IOException { - os.close(); - } - protected void close(InputStream is) throws IOException { - is.close(); - } + void notfound (HttpExchange t, String p) throws IOException { + t.getResponseHeaders().set ("Content-Type", "text/html"); + t.sendResponseHeaders (404, 0); + OutputStream os = t.getResponseBody(); + String s = "
File not found
"; + s = s + p + ""; + os.write (s.getBytes()); + os.close(); + t.close(); } +} diff --git a/jdk/test/com/sun/net/httpserver/SimpleFileServer.java b/jdk/test/com/sun/net/httpserver/SimpleFileServer.java new file mode 100644 index 00000000000..0d32f37bda3 --- /dev/null +++ b/jdk/test/com/sun/net/httpserver/SimpleFileServer.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * 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.util.*; +import java.util.concurrent.*; +import java.util.logging.*; +import java.io.*; +import java.net.*; +import java.security.*; +import javax.net.ssl.*; +import com.sun.net.httpserver.*; + +/** + * Implements a basic static content HTTP server + * which understands text/html, text/plain content types + * + * Must be given an abs pathname to the document root. + * Directory listings together with text + html files + * can be served. + * + * File Server created on files sub-path + * + * Echo server created on echo sub-path + */ +public class SimpleFileServer { + + public static void main (String[] args) throws Exception { + if (args.length != 3) { + System.out.println ("usage: java FileServerHandler rootDir port logfilename"); + System.exit(1); + } + Logger logger = Logger.getLogger("com.sun.net.httpserver"); + ConsoleHandler ch = new ConsoleHandler(); + logger.setLevel(Level.ALL); + ch.setLevel(Level.ALL); + logger.addHandler(ch); + + String rootDir = args[0]; + int port = Integer.parseInt (args[1]); + String logfile = args[2]; + HttpServer server = HttpServer.create (new InetSocketAddress (port), 0); + HttpHandler h = new FileServerHandler (rootDir); + HttpHandler h1 = new EchoHandler (); + + HttpContext c = server.createContext ("/files", h); + c.getFilters().add (new LogFilter (new File (logfile))); + HttpContext c1 = server.createContext ("/echo", h1); + c.getFilters().add (new LogFilter (new File (logfile))); + c1.getFilters().add (new LogFilter (new File (logfile))); + server.setExecutor (Executors.newCachedThreadPool()); + server.start (); + } +} diff --git a/jdk/test/java/net/httpclient/HttpEchoHandler.java b/jdk/test/java/net/httpclient/HttpEchoHandler.java new file mode 100644 index 00000000000..914d89161ac --- /dev/null +++ b/jdk/test/java/net/httpclient/HttpEchoHandler.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * 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 com.sun.net.httpserver.*; +import java.net.*; +import jdk.incubator.http.*; +import java.io.*; +import java.util.concurrent.*; +import javax.net.ssl.*; +import java.nio.file.*; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import jdk.testlibrary.SimpleSSLContext; +import static jdk.incubator.http.HttpRequest.*; +import static jdk.incubator.http.HttpResponse.*; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class HttpEchoHandler implements HttpHandler { + public HttpEchoHandler() {} + + @Override + public void handle(HttpExchange t) + throws IOException { + try { + System.err.println("EchoHandler received request to " + t.getRequestURI()); + InputStream is = t.getRequestBody(); + Headers map = t.getRequestHeaders(); + Headers map1 = t.getResponseHeaders(); + map1.add("X-Hello", "world"); + map1.add("X-Bye", "universe"); + String fixedrequest = map.getFirst("XFixed"); + File outfile = File.createTempFile("foo", "bar"); + FileOutputStream fos = new FileOutputStream(outfile); + int count = (int) is.transferTo(fos); + is.close(); + fos.close(); + InputStream is1 = new FileInputStream(outfile); + OutputStream os = null; + // return the number of bytes received (no echo) + String summary = map.getFirst("XSummary"); + if (fixedrequest != null && summary == null) { + t.sendResponseHeaders(200, count); + os = t.getResponseBody(); + is1.transferTo(os); + } else { + t.sendResponseHeaders(200, 0); + os = t.getResponseBody(); + is1.transferTo(os); + + if (summary != null) { + String s = Integer.toString(count); + os.write(s.getBytes()); + } + } + outfile.delete(); + os.close(); + is1.close(); + } catch (Throwable e) { + e.printStackTrace(); + throw new IOException(e); + } + } +} diff --git a/jdk/test/java/net/httpclient/LightWeightHttpServer.java b/jdk/test/java/net/httpclient/LightWeightHttpServer.java index a0d6e9ac9c7..d80a382d669 100644 --- a/jdk/test/java/net/httpclient/LightWeightHttpServer.java +++ b/jdk/test/java/net/httpclient/LightWeightHttpServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,9 @@ /** * library /lib/testlibrary/ / - * build jdk.testlibrary.SimpleSSLContext ProxyServer EchoHandler + * build jdk.testlibrary.SimpleSSLContext ProxyServer * compile ../../../com/sun/net/httpserver/LogFilter.java + * compile ../../../com/sun/net/httpserver/EchoHandler.java * compile ../../../com/sun/net/httpserver/FileServerHandler.java */ import com.sun.net.httpserver.Headers; diff --git a/jdk/test/java/net/httpclient/ManyRequests.java b/jdk/test/java/net/httpclient/ManyRequests.java index 7420c7223ed..8803b397528 100644 --- a/jdk/test/java/net/httpclient/ManyRequests.java +++ b/jdk/test/java/net/httpclient/ManyRequests.java @@ -28,8 +28,9 @@ * java.logging * jdk.httpserver * @library /lib/testlibrary/ / - * @build jdk.testlibrary.SimpleSSLContext EchoHandler + * @build jdk.testlibrary.SimpleSSLContext * @compile ../../../com/sun/net/httpserver/LogFilter.java + * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests * @run main/othervm/timeout=40 -Dtest.insertDelay=true ManyRequests diff --git a/jdk/test/java/net/httpclient/ManyRequests2.java b/jdk/test/java/net/httpclient/ManyRequests2.java index 2ec01de9734..26c281fca61 100644 --- a/jdk/test/java/net/httpclient/ManyRequests2.java +++ b/jdk/test/java/net/httpclient/ManyRequests2.java @@ -28,8 +28,9 @@ * java.logging * jdk.httpserver * @library /lib/testlibrary/ / - * @build jdk.testlibrary.SimpleSSLContext EchoHandler + * @build jdk.testlibrary.SimpleSSLContext * @compile ../../../com/sun/net/httpserver/LogFilter.java + * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @build ManyRequests ManyRequests2 * @run main/othervm/timeout=40 -Dtest.XFixed=true ManyRequests2 diff --git a/jdk/test/java/net/httpclient/RequestBodyTest.java b/jdk/test/java/net/httpclient/RequestBodyTest.java index fd0bbcc7aaa..446eb0324f5 100644 --- a/jdk/test/java/net/httpclient/RequestBodyTest.java +++ b/jdk/test/java/net/httpclient/RequestBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * jdk.httpserver * @library /lib/testlibrary/ * @compile ../../../com/sun/net/httpserver/LogFilter.java + * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @build LightWeightHttpServer * @build jdk.testlibrary.SimpleSSLContext diff --git a/jdk/test/java/net/httpclient/SmokeTest.java b/jdk/test/java/net/httpclient/SmokeTest.java index 8d33296c390..a0636cc1df5 100644 --- a/jdk/test/java/net/httpclient/SmokeTest.java +++ b/jdk/test/java/net/httpclient/SmokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,9 @@ * java.logging * jdk.httpserver * @library /lib/testlibrary/ / - * @build jdk.testlibrary.SimpleSSLContext ProxyServer EchoHandler + * @build jdk.testlibrary.SimpleSSLContext ProxyServer * @compile ../../../com/sun/net/httpserver/LogFilter.java + * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @run main/othervm -Djdk.httpclient.HttpClient.log=errors,trace SmokeTest */ diff --git a/jdk/test/java/net/httpclient/http2/BasicTest.java b/jdk/test/java/net/httpclient/http2/BasicTest.java index 615843df973..9744eda9034 100644 --- a/jdk/test/java/net/httpclient/http2/BasicTest.java +++ b/jdk/test/java/net/httpclient/http2/BasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,11 +62,11 @@ public class BasicTest { sslContext = sslct.get(); client = getClient(); httpServer = new Http2TestServer(false, 0, exec, sslContext); - httpServer.addHandler(new EchoHandler(), "/"); + httpServer.addHandler(new Http2EchoHandler(), "/"); httpPort = httpServer.getAddress().getPort(); httpsServer = new Http2TestServer(true, 0, exec, sslContext); - httpsServer.addHandler(new EchoHandler(), "/"); + httpsServer.addHandler(new Http2EchoHandler(), "/"); httpsPort = httpsServer.getAddress().getPort(); httpURIString = "http://127.0.0.1:" + httpPort + "/foo/"; diff --git a/jdk/test/java/net/httpclient/http2/ErrorTest.java b/jdk/test/java/net/httpclient/http2/ErrorTest.java index a2e115071e6..9a8815df14b 100644 --- a/jdk/test/java/net/httpclient/http2/ErrorTest.java +++ b/jdk/test/java/net/httpclient/http2/ErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 ErrorTest { 0, exec, serverContext); - httpsServer.addHandler(new EchoHandler(), "/"); + httpsServer.addHandler(new Http2EchoHandler(), "/"); int httpsPort = httpsServer.getAddress().getPort(); String httpsURIString = "https://127.0.0.1:" + httpsPort + "/bar/"; diff --git a/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java b/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java index 39676149e3a..d6de84aca6c 100644 --- a/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java +++ b/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,11 +62,11 @@ public class FixedThreadPoolTest { sslContext = sslct.get(); client = getClient(); httpServer = new Http2TestServer(false, 0, exec, sslContext); - httpServer.addHandler(new EchoHandler(), "/"); + httpServer.addHandler(new Http2EchoHandler(), "/"); httpPort = httpServer.getAddress().getPort(); httpsServer = new Http2TestServer(true, 0, exec, sslContext); - httpsServer.addHandler(new EchoHandler(), "/"); + httpsServer.addHandler(new Http2EchoHandler(), "/"); httpsPort = httpsServer.getAddress().getPort(); httpURIString = "http://127.0.0.1:" + httpPort + "/foo/"; diff --git a/jdk/test/java/net/httpclient/http2/RedirectTest.java b/jdk/test/java/net/httpclient/http2/RedirectTest.java index 634467e06e1..cf0278585f3 100644 --- a/jdk/test/java/net/httpclient/http2/RedirectTest.java +++ b/jdk/test/java/net/httpclient/http2/RedirectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,7 +79,7 @@ public class RedirectTest { httpServer.addHandler(new RedirectHandler(sup(altURIString1)), "/foo"); altServer.addHandler(new RedirectHandler(sup(altURIString2)), "/redir"); - altServer.addHandler(new EchoHandler(), "/redir/again"); + altServer.addHandler(new Http2EchoHandler(), "/redir/again"); httpServer.start(); altServer.start(); diff --git a/jdk/test/java/net/httpclient/http2/server/Http2EchoHandler.java b/jdk/test/java/net/httpclient/http2/server/Http2EchoHandler.java new file mode 100644 index 00000000000..c1ebebe0d2f --- /dev/null +++ b/jdk/test/java/net/httpclient/http2/server/Http2EchoHandler.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * 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.io.*; +import jdk.incubator.http.internal.common.HttpHeadersImpl; + +public class Http2EchoHandler implements Http2Handler { + public Http2EchoHandler() {} + + @Override + public void handle(Http2TestExchange t) + throws IOException { + try { + System.err.println("EchoHandler received request to " + t.getRequestURI()); + InputStream is = t.getRequestBody(); + HttpHeadersImpl map = t.getRequestHeaders(); + HttpHeadersImpl map1 = t.getResponseHeaders(); + map1.addHeader("X-Hello", "world"); + map1.addHeader("X-Bye", "universe"); + String fixedrequest = map.firstValue("XFixed").orElse(null); + File outfile = File.createTempFile("foo", "bar"); + //System.err.println ("QQQ = " + outfile.toString()); + FileOutputStream fos = new FileOutputStream(outfile); + int count = (int) is.transferTo(fos); + System.err.printf("EchoHandler read %d bytes\n", count); + is.close(); + fos.close(); + InputStream is1 = new FileInputStream(outfile); + OutputStream os = null; + // return the number of bytes received (no echo) + String summary = map.firstValue("XSummary").orElse(null); + if (fixedrequest != null && summary == null) { + t.sendResponseHeaders(200, count); + os = t.getResponseBody(); + int count1 = (int)is1.transferTo(os); + System.err.printf("EchoHandler wrote %d bytes\n", count1); + } else { + t.sendResponseHeaders(200, 0); + os = t.getResponseBody(); + int count1 = (int)is1.transferTo(os); + System.err.printf("EchoHandler wrote %d bytes\n", count1); + + if (summary != null) { + String s = Integer.toString(count); + os.write(s.getBytes()); + } + } + outfile.delete(); + os.close(); + is1.close(); + } catch (Throwable e) { + e.printStackTrace(); + throw new IOException(e); + } + } +} From 2a1e7b6b4a49ce9c4b499b2b642209f766d7ca81 Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan
Date: Fri, 9 Jun 2017 09:54:59 -0700 Subject: [PATCH 057/130] 8180334: Unable to build jaotc launcher on windows Reviewed-by: erikj, ihse, mchung --- jdk/make/launcher/Launcher-jdk.aot.gmk | 7 +-- jdk/make/launcher/LauncherCommon.gmk | 10 +++- .../java.base/share/native/launcher/defines.h | 13 +++-- .../java.base/share/native/launcher/main.c | 47 +++++++++++++++++-- jdk/src/java.base/share/native/libjli/args.c | 6 +-- jdk/src/java.base/share/native/libjli/java.c | 4 ++ .../java.base/share/native/libjli/jli_util.h | 4 +- 7 files changed, 75 insertions(+), 16 deletions(-) diff --git a/jdk/make/launcher/Launcher-jdk.aot.gmk b/jdk/make/launcher/Launcher-jdk.aot.gmk index 9aea620ac9e..2a46c7a6a13 100644 --- a/jdk/make/launcher/Launcher-jdk.aot.gmk +++ b/jdk/make/launcher/Launcher-jdk.aot.gmk @@ -30,7 +30,7 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, jaotc, \ MAIN_CLASS := jdk.tools.jaotc.Main, \ - JAVA_ARGS := -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI \ + EXTRA_JAVA_ARGS := -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ @@ -38,12 +38,13 @@ $(eval $(call SetupBuildLauncher, jaotc, \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ - --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ + , \ + JAVA_ARGS := --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ --add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ - --add-exports=jdk.internal.vm.ci/jdk.vm.ci.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ + --add-exports=jdk.internal.vm.ci/jdk.vm.ci.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \ -XX:+UseAOT \ -Djvmci.UseProfilingInformation=false \ -Dgraal.UseExceptionProbability=false \ diff --git a/jdk/make/launcher/LauncherCommon.gmk b/jdk/make/launcher/LauncherCommon.gmk index a4178039d6e..08938e05fb2 100644 --- a/jdk/make/launcher/LauncherCommon.gmk +++ b/jdk/make/launcher/LauncherCommon.gmk @@ -66,7 +66,10 @@ JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manife # MAIN_MODULE The module of the main class to launch if different from the # current module # MAIN_CLASS The Java main class to launch -# JAVA_ARGS Processed into a -DJAVA_ARGS C flag +# JAVA_ARGS Processed into a -DJAVA_ARGS and added to CFLAGS +# EXTRA_JAVA_ARGS Processed into a -DEXTRA_JAVA_ARGS and is prepended +# before JAVA_ARGS to CFLAGS, primarily to allow long string literal +# compile time defines exceeding Visual Studio 2013 limitations. # CFLAGS Additional CFLAGS # CFLAGS_windows Additional CFLAGS_windows # LIBS_unix Additional LIBS_unix @@ -104,6 +107,11 @@ define SetupBuildLauncherBody endif ifneq ($$($1_JAVA_ARGS), ) + ifneq ($$($1_EXTRA_JAVA_ARGS), ) + $1_EXTRA_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \ + $$(addprefix -J, $$($1_EXTRA_JAVA_ARGS)), "$$a"$(COMMA) )) }' + $1_CFLAGS += -DEXTRA_JAVA_ARGS=$$($1_EXTRA_JAVA_ARGS_STR) + endif $1_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \ $$(addprefix -J, $$($1_JAVA_ARGS)) -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS), "$$a"$(COMMA) )) }' $1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR) diff --git a/jdk/src/java.base/share/native/launcher/defines.h b/jdk/src/java.base/share/native/launcher/defines.h index 4470ae5d466..1e4e35a044f 100644 --- a/jdk/src/java.base/share/native/launcher/defines.h +++ b/jdk/src/java.base/share/native/launcher/defines.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,17 +44,24 @@ #define DOT_VERSION "0.0" #ifdef JAVA_ARGS -#define HAS_JAVA_ARGS JNI_TRUE #ifdef PROGNAME static const char* const_progname = PROGNAME; #else static char* const_progname = NULL; #endif static const char* const_jargs[] = JAVA_ARGS; +#ifdef EXTRA_JAVA_ARGS +static const char* const_extra_jargs[] = EXTRA_JAVA_ARGS; +#else +static const char** const_extra_jargs = NULL; +#endif #else /* !JAVA_ARGS */ -#define HAS_JAVA_ARGS JNI_FALSE +#ifdef EXTRA_JAVA_ARGS +#error "EXTRA_JAVA_ARGS defined without JAVA_ARGS" +#endif static const char* const_progname = "java"; static const char** const_jargs = NULL; +static const char** const_extra_jargs = NULL; static const char* const_appclasspath[] = { NULL }; #endif /* JAVA_ARGS */ diff --git a/jdk/src/java.base/share/native/launcher/main.c b/jdk/src/java.base/share/native/launcher/main.c index 8e27a2a2ed9..5c743659fd4 100644 --- a/jdk/src/java.base/share/native/launcher/main.c +++ b/jdk/src/java.base/share/native/launcher/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,8 @@ WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow) { int margc; char** margv; + int jargc; + char** jargv; const jboolean const_javaw = JNI_TRUE; __initenv = _environ; @@ -95,10 +97,47 @@ main(int argc, char **argv) { int margc; char** margv; + int jargc; + char** jargv; const jboolean const_javaw = JNI_FALSE; #endif /* JAVAW */ + { + int i, main_jargc, extra_jargc; + JLI_List list; - JLI_InitArgProcessing(!HAS_JAVA_ARGS, const_disable_argfile); + main_jargc = (sizeof(const_jargs) / sizeof(char *)) > 1 + ? sizeof(const_jargs) / sizeof(char *) + : 0; // ignore the null terminator index + + extra_jargc = (sizeof(const_extra_jargs) / sizeof(char *)) > 1 + ? sizeof(const_extra_jargs) / sizeof(char *) + : 0; // ignore the null terminator index + + if (main_jargc > 0 && extra_jargc > 0) { // combine extra java args + jargc = main_jargc + extra_jargc; + list = JLI_List_new(jargc + 1); + + for (i = 0 ; i < extra_jargc; i++) { + JLI_List_add(list, JLI_StringDup(const_extra_jargs[i])); + } + + for (i = 0 ; i < main_jargc ; i++) { + JLI_List_add(list, JLI_StringDup(const_jargs[i])); + } + + // terminate the list + JLI_List_add(list, NULL); + jargv = list->elements; + } else if (extra_jargc > 0) { // should never happen + fprintf(stderr, "EXTRA_JAVA_ARGS defined without JAVA_ARGS"); + abort(); + } else { // no extra args, business as usual + jargc = main_jargc; + jargv = (char **) const_jargs; + } + } + + JLI_InitArgProcessing(jargc > 0, const_disable_argfile); #ifdef _WIN32 { @@ -164,12 +203,12 @@ main(int argc, char **argv) } #endif /* WIN32 */ return JLI_Launch(margc, margv, - sizeof(const_jargs) / sizeof(char *), const_jargs, + jargc, (const char**) jargv, 0, NULL, VERSION_STRING, DOT_VERSION, (const_progname != NULL) ? const_progname : *margv, (const_launcher != NULL) ? const_launcher : *margv, - HAS_JAVA_ARGS, + jargc > 0, const_cpwildcard, const_javaw, 0); } diff --git a/jdk/src/java.base/share/native/libjli/args.c b/jdk/src/java.base/share/native/libjli/args.c index 9eb2317de6c..3d11f1cffa8 100644 --- a/jdk/src/java.base/share/native/libjli/args.c +++ b/jdk/src/java.base/share/native/libjli/args.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ static size_t argsCount = 1; static jboolean stopExpansion = JNI_FALSE; static jboolean relaunch = JNI_FALSE; -void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile) { +void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) { // No expansion for relaunch if (argsCount != 1) { relaunch = JNI_TRUE; @@ -91,7 +91,7 @@ void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile) { expectingNoDashArg = JNI_FALSE; // for tools, this value remains 0 all the time. - firstAppArgIndex = isJava ? NOT_FOUND : 0; + firstAppArgIndex = hasJavaArgs ? 0: NOT_FOUND; } int JLI_GetAppArgIndex() { diff --git a/jdk/src/java.base/share/native/libjli/java.c b/jdk/src/java.base/share/native/libjli/java.c index 8967f70bc98..e1c13354e80 100644 --- a/jdk/src/java.base/share/native/libjli/java.c +++ b/jdk/src/java.base/share/native/libjli/java.c @@ -246,6 +246,10 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ DumpState(); if (JLI_IsTraceLauncher()) { int i; + printf("Java args:\n"); + for (i = 0; i < jargc ; i++) { + printf("jargv[%d] = %s\n", i, jargv[i]); + } printf("Command line args:\n"); for (i = 0; i < argc ; i++) { printf("argv[%d] = %s\n", i, argv[i]); diff --git a/jdk/src/java.base/share/native/libjli/jli_util.h b/jdk/src/java.base/share/native/libjli/jli_util.h index b4e8a69b3eb..34b1c029509 100644 --- a/jdk/src/java.base/share/native/libjli/jli_util.h +++ b/jdk/src/java.base/share/native/libjli/jli_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,7 +133,7 @@ char *JLI_List_combine(JLI_List sl); char *JLI_List_join(JLI_List l, char sep); JLI_List JLI_List_split(const char *str, char sep); -void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile); +void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile); JLI_List JLI_PreprocessArg(const char *arg); jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name); From 70eda1ba26e0b330547c5943a6e9e093bf9238f5 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Fri, 9 Jun 2017 11:26:42 -0700 Subject: [PATCH 058/130] 8181824: Broken javadoc link in java.util.BitSet Reviewed-by: martin --- jdk/src/java.base/share/classes/java/util/BitSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/util/BitSet.java b/jdk/src/java.base/share/classes/java/util/BitSet.java index f453965f672..c9dafaed3e8 100644 --- a/jdk/src/java.base/share/classes/java/util/BitSet.java +++ b/jdk/src/java.base/share/classes/java/util/BitSet.java @@ -1212,7 +1212,7 @@ public class BitSet implements Cloneable, java.io.Serializable { * * The stream binds to this bit set when the terminal stream operation * commences (specifically, the spliterator for the stream is - * late-binding). If the + * late-binding). If the * bit set is modified during that operation then the result is undefined. * * @return a stream of integers representing set indices From 9c237e549c6dc390be6bd5695b7f50a41c479c36 Mon Sep 17 00:00:00 2001 From: Vicente Romero
Date: Fri, 9 Jun 2017 11:27:03 -0700 Subject: [PATCH 059/130] 8175794: Type inference regression after JDK-8078093 Co-authored-by: Maurizio Cimadamore Reviewed-by: mcimadamore --- .../sun/tools/javac/comp/ArgumentAttr.java | 17 +++----- .../com/sun/tools/javac/comp/Infer.java | 3 +- .../T8175794/MissingReturnConstraintTest.java | 43 +++++++++++++++++++ 3 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 langtools/test/tools/javac/T8175794/MissingReturnConstraintTest.java diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java index eb8311d7f2c..e8cc0a95161 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java @@ -556,19 +556,16 @@ public class ArgumentAttr extends JCTree.Visitor { Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) { Type mtype = methodType(); ResultInfo localInfo = resultInfo(resultInfo); + Type t; if (mtype != null && mtype.hasTag(METHOD) && mtype.isPartial()) { - Type t = ((PartiallyInferredMethodType)mtype).check(localInfo); - if (!deferredAttrContext.inferenceContext.free(localInfo.pt)) { - speculativeTypes.put(localInfo, t); - return localInfo.check(tree.pos(), t); - } else { - return t; - } + //poly invocation + t = ((PartiallyInferredMethodType)mtype).check(localInfo); } else { - Type t = localInfo.check(tree.pos(), speculativeTree.type); - speculativeTypes.put(localInfo, t); - return t; + //standalone invocation + t = localInfo.check(tree.pos(), speculativeTree.type); } + speculativeTypes.put(localInfo, t); + return t; } /** diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java index 641283ab427..303cdcf09e5 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java @@ -344,9 +344,8 @@ public class Infer { //inline logic from Attr.checkMethod - if unchecked conversion was required, erase //return type _after_ resolution, and check against target ret = types.erasure(ret); - resultInfo.check(env.tree, ret); } - return ret; + return resultInfo.check(env.tree, ret); } catch (InferenceException ex) { resultInfo.checkContext.report(null, ex.getDiagnostic()); Assert.error(); //cannot get here (the above should throw) diff --git a/langtools/test/tools/javac/T8175794/MissingReturnConstraintTest.java b/langtools/test/tools/javac/T8175794/MissingReturnConstraintTest.java new file mode 100644 index 00000000000..8ffef06b647 --- /dev/null +++ b/langtools/test/tools/javac/T8175794/MissingReturnConstraintTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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 8175794 + * @summary Type inference regression after JDK-8078093 + * @compile MissingReturnConstraintTest.java + */ + +import java.util.concurrent.ExecutorService; + +public abstract class MissingReturnConstraintTest { + void f(ExecutorService s) { + s.submit(() -> run(() -> {})); + } + + abstract void run(ThrowableRunnable action) throws E; + + public interface ThrowableRunnable { + void run() throws T; + } +} From 73ed08346f81aa06de2327f1b3fc95866d34cd2c Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:34 +0000 Subject: [PATCH 060/130] Added tag jdk-10+11 for changeset 4bc3aabebb15 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index f9418eb8d40..fa8bbfd5bd6 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -426,3 +426,4 @@ b94be69cbb1d2943b886bf2d458745756df146e4 jdk-10+9 4c12464a907db4656c1033f56fa49cba643ac629 jdk-9+171 6558c37afe832582238d338578d598f30c6fdd75 jdk-10+10 2c25fc24103251f9711a1c280c31e1e41016d90f jdk-9+172 +6b750cdb823a029a25ff2e560302cc2d28a86cb6 jdk-10+11 From c016d62e370e3a2d84f5d3bc1ee856d0538723de Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:36 +0000 Subject: [PATCH 061/130] Added tag jdk-10+11 for changeset ad1cc988c3df --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 5446a03dd07..25bdc03c568 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -426,3 +426,4 @@ b9409a7daa6c793dd631e52fe6ef79d08a3b337a jdk-10+9 29bbedd4cce8e14742bdb22118c057b877c02f0f jdk-9+171 df64bd4757d0d130d62a22b8143ba31d3a16ac18 jdk-10+10 0ff9ad7d067cd4fa14450cf208bf019175a0aaba jdk-9+172 +7c54889c0ec649ee04643e5cace434623d0dc667 jdk-10+11 From 587059abffe5703db8f4e8a44aa19e70a1d54b3b Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:42 +0000 Subject: [PATCH 062/130] Added tag jdk-10+11 for changeset 2e1d6204a3b2 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 39375bc3c9b..242074168dd 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -426,3 +426,4 @@ ac697b2bdf486ef18caad2092bd24036e14946ac jdk-10+5 c27321c889cf4c8e465a61b84572c00ef7ee6004 jdk-9+171 bd4b2c8835f35760a51c1475b03a16cc20c62973 jdk-10+10 eedb6e54c8bd6197ecba5fc0d8568bac8ae852dd jdk-9+172 +95bab8bf9201ae8bfdf28e164bf33b78e49477e7 jdk-10+11 From 7892c4adca1915b732aa4e01bca7a546b6073808 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:42 +0000 Subject: [PATCH 063/130] Added tag jdk-10+11 for changeset a3f22e014d8c --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 5ce70347c45..b516d29e36c 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -426,3 +426,4 @@ aed5a4edc8275c1c50195503756ff92bfe0197f5 jdk-10+7 c62e5964cfcf144d8f72e9ba69757897785349a9 jdk-9+171 080c37fd77e2c4629b91059298e37758afbdbc46 jdk-10+10 95ed14547ca9246baed34f90ef3ca13217538a8c jdk-9+172 +8ef8a0f1c4dfea17e10125e1f885920538e63085 jdk-10+11 From 7db6349d8d6559e4d2f77ed1eefd8d9b0f9d2e94 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:43 +0000 Subject: [PATCH 064/130] Added tag jdk-10+11 for changeset 3d88a6f51b8d --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 96d2cfeb22d..71e0ff80efc 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -586,3 +586,4 @@ f5ded0cf954c770deeecb80f2ba1ba6a05cd979b jdk-10+8 d53171650a2cc6c6f699c966c533b914ca9c0602 jdk-9+171 c6cd3ec8d46b034e57c86399380ffcf7f25706e4 jdk-10+10 1ae9e84f68b359420d2d153ecfe5ee2903e33a2e jdk-9+172 +7f14e550f1e8abea41c223e5fdad2261e99ba929 jdk-10+11 From e94dd9f48fff6ee6e82873e4d1e3db05af95744b Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:47 +0000 Subject: [PATCH 065/130] Added tag jdk-10+11 for changeset f7479ee8de69 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index d34a5e4f202..ab907cee1cf 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -426,3 +426,4 @@ a8e4d2286ebaf93c0f69fb4bbd399253f396db00 jdk-10+9 aae59039c1f5701ae933c5eed30e75d6e3afaeee jdk-9+171 48a87c3414d374e3a26ddb270318c9af10de4b32 jdk-10+10 03669efa77f51852f5301623cad4a2e1bb4fb9f6 jdk-9+172 +daa70bfed35ecf0575884c954dc95135e0f94b29 jdk-10+11 From 10ed2a620b683fb70e966e54d479b212bdfca3b2 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:48 +0000 Subject: [PATCH 066/130] Added tag jdk-10+11 for changeset e23867f72c3f --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 50d71f96912..b211e8bd765 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -429,3 +429,4 @@ e705867d9989d00e4357f66f18b302c95e13b5e7 jdk-10+8 139e7c786ee4885efe53eb650b72c7b5a2d3b964 jdk-9+171 3ccd9f37faa601866db5edb827363e797f5a2493 jdk-10+10 8c615099f3e3ca137325be34bf566b767d9e3c64 jdk-9+172 +2d22d6732a73e615b9e13d6bc93bf026db3bc231 jdk-10+11 From ed2248341194f043f012473cddd5adc231de06c6 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Fri, 9 Jun 2017 21:34:51 +0000 Subject: [PATCH 067/130] Added tag jdk-10+11 for changeset d2cd50ed7a23 --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index d72ec8bac69..a0d0e8bcd99 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -417,3 +417,4 @@ d7d69c89088aec56d13bbff81a6f0a8b68ca75f4 jdk-10+9 fc416270a776409b74006262dd0a9f5f5ff31555 jdk-9+171 f381e171bec90afee95dc2920793754b58b6f705 jdk-10+10 c8d6b740f0f7ec834b4157bf0d4523e8bbddb3f0 jdk-9+172 +ae0c4f1560e41e94a843e9933558d0223575869d jdk-10+11 From 52270d16cc203e4ead8587ad45ac80e22879124c Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Sun, 11 Jun 2017 18:36:23 -0700 Subject: [PATCH 068/130] 8181080: Refactor several sun/net shell tests to plain java tests Reviewed-by: chegar, alanb --- .../nameservice/dns/CNameTest.java | 73 +++++++++++++++++ .../net/InetAddress/nameservice/dns/cname.sh | 81 ------------------- jdk/test/sun/net/ftp/MarkResetTest.java | 38 ++++++--- jdk/test/sun/net/ftp/MarkResetTest.sh | 55 ------------- .../protocol/file/DirPermissionDenied.java | 46 ++++++++++- .../www/protocol/file/DirPermissionDenied.sh | 45 ----------- .../www/protocol/jrt/OtherResourcesTest.java | 50 ++++++++++++ .../net/www/protocol/jrt/other_resources.sh | 45 ----------- 8 files changed, 192 insertions(+), 241 deletions(-) create mode 100644 jdk/test/sun/net/InetAddress/nameservice/dns/CNameTest.java delete mode 100644 jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh delete mode 100644 jdk/test/sun/net/ftp/MarkResetTest.sh delete mode 100644 jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh create mode 100644 jdk/test/sun/net/www/protocol/jrt/OtherResourcesTest.java delete mode 100644 jdk/test/sun/net/www/protocol/jrt/other_resources.sh diff --git a/jdk/test/sun/net/InetAddress/nameservice/dns/CNameTest.java b/jdk/test/sun/net/InetAddress/nameservice/dns/CNameTest.java new file mode 100644 index 00000000000..3836947eea4 --- /dev/null +++ b/jdk/test/sun/net/InetAddress/nameservice/dns/CNameTest.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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 jdk.test.lib.process.ProcessTools; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; + +/** + * @test + * @bug 4763315 + * @modules java.naming + * @library /test/lib + * @build CanonicalName Lookup jdk.test.lib.process.* + * @run main/othervm/timeout=120 CNameTest + * @summary Test DNS provider's handling of CNAME records + */ +public class CNameTest { + private static final String HOST = "www-proxy.us.oracle.com"; + private static final String POLICY = "grant {" + System.lineSeparator() + + " permission java.net .SocketPermission \"${HOST}\", \"resolve\";" + + System.lineSeparator() + "};"; + + public static void main(String[] args) throws Exception { + // Prerequisite check + int rc = ProcessTools.executeTestJava("CanonicalName", HOST) + .outputTo(System.out) + .errorTo(System.out) + .getExitValue(); + if (rc != 0) { + System.out.println("DNS not configured or host doesn't" + + " resolve to CNAME record"); + return; + } + + // Tests - with & without security manager + Path policy = Paths.get(".", "java.policy"); + Files.write(policy, POLICY.getBytes(), StandardOpenOption.CREATE_NEW); + String[] opts = new String[]{ + "-Dsun.net.spi.nameservice.provider.1=dns,sun", + "-Djava.security.manager -Djava.security.policy=" + policy + }; + for (String opt : opts) { + ProcessTools.executeTestJava(opt, "Lookup", HOST) + .outputTo(System.out) + .errorTo(System.err) + .shouldHaveExitValue(0); + } + } +} + diff --git a/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh b/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh deleted file mode 100644 index a93f2652613..00000000000 --- a/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. -# 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 4763315 -# @modules java.naming -# @build CanonicalName Lookup -# @run shell/timeout=120 cname.sh -# @summary Test DNS provider's handling of CNAME records - - -# The host that we try to resolve - -HOST=www-proxy.us.oracle.com - -# fail gracefully if DNS is not configured or there -# isn't a CNAME record. - -CLASSPATH=${TESTCLASSES} -export CLASSPATH -JAVA="${TESTJAVA}/bin/java" - -sh -xc "$JAVA ${TESTVMOPTS} CanonicalName $HOST" 2>&1 -if [ $? != 0 ]; then - echo "DNS not configured or host doesn't resolve to CNAME record" - exit 0 -fi - -failures=0 - -go() { - echo '' - sh -xc "$JAVA ${TESTVMOPTS} $1 Lookup $2" 2>&1 - if [ $? != 0 ]; then failures=`expr $failures + 1`; fi -} - -# Tests - with & without security manager - -POLICY=java.policy -echo "grant {" > ${POLICY} -echo " permission java.net.SocketPermission \"${HOST}\", \"resolve\";" >> ${POLICY} -echo "};" >> ${POLICY} - -np="-Dsun.net.spi.nameservice.provider.1=dns,sun" -sm="-Djava.security.manager -Djava.security.policy=${POLICY}" - -go "" "$HOST" -go "$sm" "$HOST" - - -# -# Results -# -echo '' -if [ $failures -gt 0 ]; - then echo "$failures test(s) failed"; - else echo "All test(s) passed"; fi -exit $failures diff --git a/jdk/test/sun/net/ftp/MarkResetTest.java b/jdk/test/sun/net/ftp/MarkResetTest.java index 1f9e1bdec94..d3236fe5544 100644 --- a/jdk/test/sun/net/ftp/MarkResetTest.java +++ b/jdk/test/sun/net/ftp/MarkResetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,15 +22,30 @@ */ /* - * - * run from MarkResetTest.sh + * @test + * @bug 4673103 + * @run main/othervm/timeout=140 MarkResetTest + * @summary URLConnection.getContent() hangs over FTP for DOC, PPT, XLS files */ -import java.io.*; -import java.net.*; -import java.util.regex.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URL; +import java.net.URLConnection; +import java.nio.file.Files; +import java.nio.file.Paths; public class MarkResetTest { + private static final String FILE_NAME = "EncDec.doc"; /** * A class that simulates, on a separate, an FTP server. @@ -388,7 +403,9 @@ public class MarkResetTest { } public static void main(String[] args) throws Exception { - MarkResetTest test = new MarkResetTest(); + Files.copy(Paths.get(System.getProperty("test.src"), FILE_NAME), + Paths.get(".", FILE_NAME)); + new MarkResetTest(); } public MarkResetTest() { @@ -402,9 +419,8 @@ public class MarkResetTest { port = server.getPort(); } - String filename = "EncDec.doc"; - URL url = new URL("ftp://localhost:" + port + "/" + - filename); + + URL url = new URL("ftp://localhost:" + port + "/" + FILE_NAME); URLConnection con = url.openConnection(); System.out.println("getContent: " + con.getContent()); @@ -438,7 +454,7 @@ public class MarkResetTest { server.interrupt(); // Did we pass ? - if (len != (new File(filename)).length()) { + if (len != (new File(FILE_NAME)).length()) { throw new Exception("Failed to read the file correctly"); } System.out.println("PASSED: File read correctly"); diff --git a/jdk/test/sun/net/ftp/MarkResetTest.sh b/jdk/test/sun/net/ftp/MarkResetTest.sh deleted file mode 100644 index b673e5d4d68..00000000000 --- a/jdk/test/sun/net/ftp/MarkResetTest.sh +++ /dev/null @@ -1,55 +0,0 @@ -# -# 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 -# 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 4673103 -# @run shell/timeout=140 MarkResetTest.sh -# @summary URLConnection.getContent() hangs over FTP for DOC, PPT, XLS files - -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin | AIX ) - PS=":" - FS="/" - ;; - CYGWIN* ) - PS=";" - FS="/" - ;; - Windows* ) - PS=";" - FS="\\" - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - -${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}MarkResetTest.java - -# ftp server used by the test requires the file to be present -# in this directory -cp ${TESTSRC}${FS}EncDec.doc . - -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} MarkResetTest diff --git a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java b/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java index 7ffe3a1d67c..a391428f329 100644 --- a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java +++ b/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,14 +21,36 @@ * questions. */ +/** + * @test + * @bug 6977851 + * @summary NPE from FileURLConnection.connect + * @library /test/lib + * @build DirPermissionDenied jdk.test.lib.process.* + * jdk.test.lib.util.FileUtils + * @run testng DirPermissionDenied + */ + +import java.io.IOException; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; -import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.FileUtils; +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; +import org.testng.annotations.BeforeTest; public class DirPermissionDenied { - public static void main(String[] args) throws Exception { - URL url = new URL("file:" + args[0]); + private static final Path TEST_DIR = Paths.get( + "DirPermissionDeniedDirectory"); + @Test + public void doTest() throws MalformedURLException { + URL url = new URL(TEST_DIR.toUri().toString()); try { URLConnection uc = url.openConnection(); uc.connect(); @@ -56,4 +78,20 @@ public class DirPermissionDenied { throw new RuntimeException("Failed " + e); } } + + @BeforeTest + public void setup() throws Throwable { + // mkdir and chmod "333" + Files.createDirectories(TEST_DIR); + ProcessTools.executeCommand("chmod", "333", TEST_DIR.toString()) + .outputTo(System.out) + .errorTo(System.out) + .shouldHaveExitValue(0); + } + + @AfterTest + public void tearDown() throws IOException { + FileUtils.deleteFileIfExistsWithRetry(TEST_DIR); + } } + diff --git a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh b/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh deleted file mode 100644 index 1bceecfe7ca..00000000000 --- a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (c) 2010, 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. -# - -# -# @test -# @bug 6977851 -# @summary NPE from FileURLConnection.connect -# @build DirPermissionDenied -# @run shell DirPermissionDenied.sh - -TESTDIR="${TESTCLASSES}/DirPermissionDeniedDirectory" -echo ${TESTDIR} - -rm -rf ${TESTDIR} -mkdir -p ${TESTDIR} -chmod 333 ${TESTDIR} - -$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR} -result=$? - -# Add back read access for user, otherwise not removable on some systems -chmod u+r ${TESTDIR} - -rm -rf ${TESTDIR} -exit $result diff --git a/jdk/test/sun/net/www/protocol/jrt/OtherResourcesTest.java b/jdk/test/sun/net/www/protocol/jrt/OtherResourcesTest.java new file mode 100644 index 00000000000..00ec82282e0 --- /dev/null +++ b/jdk/test/sun/net/www/protocol/jrt/OtherResourcesTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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 jdk.test.lib.JDKToolFinder; +import static jdk.test.lib.process.ProcessTools.executeCommand; + +/** + * @test + * @bug 8142968 + * @summary Access a jrt:/ resource in an observable module that is not in + * the boot layer and hence not known to the built-in class loaders. + * This test is intended to run with --limit-modules. + * @library /test/lib + * @build OtherResources OtherResourcesTest + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.process.* + * @run main OtherResourcesTest + */ +public class OtherResourcesTest { + public static void main(String[] args) throws Throwable { + String classes = System.getProperty("test.classes"); + executeCommand(JDKToolFinder.getTestJDKTool("java"), + "--limit-modules", "java.base", + "-cp", classes, "OtherResources") + .outputTo(System.out) + .errorTo(System.out) + .shouldHaveExitValue(0); + } +} + diff --git a/jdk/test/sun/net/www/protocol/jrt/other_resources.sh b/jdk/test/sun/net/www/protocol/jrt/other_resources.sh deleted file mode 100644 index 79903759092..00000000000 --- a/jdk/test/sun/net/www/protocol/jrt/other_resources.sh +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. -# 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 -# @build OtherResources -# @run shell other_resources.sh -# @summary Access a jrt:/ resource in an observable module that is not in -# the boot layer and hence not known to the built-in class loaders. This -# test is a shell test because the run tag doesn't support --limit-modules. - -set -e - -if [ -z "$TESTJAVA" ]; then - if [ $# -lt 1 ]; then exit 1; fi - TESTJAVA="$1"; shift - COMPILEJAVA="${TESTJAVA}" - TESTSRC="`pwd`" - TESTCLASSES="`pwd`" -fi - -JAVA="$TESTJAVA/bin/java ${TESTVMOPTS}" -$JAVA --limit-modules java.base -cp $TESTCLASSES OtherResources - -exit 0 - From ee12e25629b36c6eaa5dd7c5430e44cc07de9fc3 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Thu, 15 Jun 2017 17:24:13 +0000 Subject: [PATCH 069/130] Added tag jdk-9+174 for changeset 6ab502c6ffb1 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index 1c018e6b021..6a975968853 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -416,3 +416,4 @@ bc21e5ba6bf1538551093f57fa0f1a6571be05cc jdk-9+168 aae59039c1f5701ae933c5eed30e75d6e3afaeee jdk-9+171 03669efa77f51852f5301623cad4a2e1bb4fb9f6 jdk-9+172 123eb0956a459bca29d0812c62fca50da563ee40 jdk-9+173 +50c077995aa249890ece698a2a2db4c4fba90e10 jdk-9+174 From a58b9af0b6ebaaad61283f6060766b7497c41be9 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 15 Jun 2017 10:55:35 -0700 Subject: [PATCH 070/130] 8149146: [javadoc] eliminate doclet.xml Reviewed-by: ksrini, bpatel --- .../html/AnnotationTypeWriterImpl.java | 4 +- .../doclets/formats/html/ClassWriterImpl.java | 4 +- .../AnnotationTypeRequiredMemberWriter.java | 5 +- .../toolkit/builders/AbstractBuilder.java | 97 +-------- .../builders/AbstractMemberBuilder.java | 32 +-- .../builders/AnnotationTypeBuilder.java | 83 +++---- .../builders/AnnotationTypeFieldBuilder.java | 46 ++-- .../AnnotationTypeOptionalMemberBuilder.java | 20 +- .../AnnotationTypeRequiredMemberBuilder.java | 49 +++-- .../toolkit/builders/BuilderFactory.java | 39 ++-- .../toolkit/builders/ClassBuilder.java | 175 +++++++-------- .../builders/ConstantsSummaryBuilder.java | 52 ++--- .../toolkit/builders/ConstructorBuilder.java | 47 ++-- .../toolkit/builders/EnumConstantBuilder.java | 38 ++-- .../toolkit/builders/FieldBuilder.java | 38 ++-- .../toolkit/builders/LayoutParser.java | 135 ------------ .../builders/MemberSummaryBuilder.java | 130 +++++------ .../toolkit/builders/MethodBuilder.java | 30 +-- .../builders/ModuleSummaryBuilder.java | 65 +++--- .../builders/PackageSummaryBuilder.java | 68 +++--- .../toolkit/builders/PropertyBuilder.java | 37 ++-- .../builders/SerializedFormBuilder.java | 128 ++++++----- .../doclets/toolkit/builders/XMLNode.java | 74 ------- .../doclets/toolkit/resources/doclet.xml | 202 ------------------ .../toolkit/resources/doclets.properties | 3 - 25 files changed, 500 insertions(+), 1101 deletions(-) delete mode 100644 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java delete mode 100644 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/XMLNode.java delete mode 100644 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java index 45f5de1997d..f2cf1189605 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java @@ -375,7 +375,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter Content li = HtmlTree.LI(contents.summaryLabel); li.addContent(Contents.SPACE); Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + MemberSummaryBuilder memberSummaryBuilder = configuration.getBuilderFactory().getMemberSummaryBuilder(this); Content liNavField = new HtmlTree(HtmlTag.LI); addNavSummaryLink(memberSummaryBuilder, @@ -426,7 +426,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter Content li = HtmlTree.LI(contents.detailLabel); li.addContent(Contents.SPACE); Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + MemberSummaryBuilder memberSummaryBuilder = configuration.getBuilderFactory().getMemberSummaryBuilder(this); AbstractMemberWriter writerField = ((AbstractMemberWriter) memberSummaryBuilder. diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java index cbb0bfb590d..b67ac97ff9c 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java @@ -688,7 +688,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite Content li = HtmlTree.LI(contents.summaryLabel); li.addContent(Contents.SPACE); Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + MemberSummaryBuilder memberSummaryBuilder = configuration.getBuilderFactory().getMemberSummaryBuilder(this); for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.summarySet) { Content liNav = new HtmlTree(HtmlTag.LI); @@ -724,7 +724,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite Content li = HtmlTree.LI(contents.detailLabel); li.addContent(Contents.SPACE); Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + MemberSummaryBuilder memberSummaryBuilder = configuration.getBuilderFactory().getMemberSummaryBuilder(this); for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.detailSet) { Content liNav = new HtmlTree(HtmlTag.LI); diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java index e6b3c6a09be..de5a6e6c643 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 +25,9 @@ package jdk.javadoc.internal.doclets.toolkit; -import java.io.*; - import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; + /** * The interface for writing annotation type required member output. * diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java index 232c8712660..59af84598e3 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java @@ -25,28 +25,22 @@ package jdk.javadoc.internal.doclets.toolkit.builders; -import java.lang.reflect.*; import java.util.*; import javax.lang.model.element.PackageElement; import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; -import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.DocletException; import jdk.javadoc.internal.doclets.toolkit.Messages; import jdk.javadoc.internal.doclets.toolkit.Resources; -import jdk.javadoc.internal.doclets.toolkit.util.UncheckedDocletException; -import jdk.javadoc.internal.doclets.toolkit.util.InternalException; -import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException; import jdk.javadoc.internal.doclets.toolkit.util.Utils; -import static javax.tools.Diagnostic.Kind.*; /** * The superclass for all builders. A builder is a class that provides * the structure and content of API documentation. A builder is completely * doclet independent which means that any doclet can use builders to - * construct documentation, as long as it impelements the appropriate + * construct documentation, as long as it implements the appropriate * writer interfaces. For example, if a doclet wanted to use * {@link ConstantsSummaryBuilder} to build a constant summary, all it has to * do is implement the ConstantsSummaryWriter interface and pass it to the @@ -74,17 +68,9 @@ public abstract class AbstractBuilder { */ final Set containingPackagesSeen; - /** - * Shared parser for the builder XML file - */ - final LayoutParser layoutParser; - - Context(BaseConfiguration configuration, - Set containingPackagesSeen, - LayoutParser layoutParser) { + Context(BaseConfiguration configuration, Set containingPackagesSeen) { this.configuration = configuration; this.containingPackagesSeen = containingPackagesSeen; - this.layoutParser = layoutParser; } } @@ -93,6 +79,7 @@ public abstract class AbstractBuilder { */ protected final BaseConfiguration configuration; + protected final BuilderFactory builderFactory; protected final Messages messages; protected final Resources resources; protected final Utils utils; @@ -104,99 +91,23 @@ public abstract class AbstractBuilder { */ protected final Set containingPackagesSeen; - protected final LayoutParser layoutParser; - - /** - * True if we want to print debug output. - */ - protected static final boolean DEBUG = false; - /** * Construct a Builder. * @param c a context providing information used in this run of the doclet */ public AbstractBuilder(Context c) { this.configuration = c.configuration; + this.builderFactory = configuration.getBuilderFactory(); this.messages = configuration.getMessages(); this.resources = configuration.getResources(); this.utils = configuration.utils; this.containingPackagesSeen = c.containingPackagesSeen; - this.layoutParser = c.layoutParser; } - /** - * Return the name of this builder. - * - * @return the name of the builder. - */ - public abstract String getName(); - /** * Build the documentation. * * @throws DocletException if there is a problem building the documentation */ public abstract void build() throws DocletException; - - /** - * Build the documentation, as specified by the given XML element. - * - * @param node the XML element that specifies which component to document. - * @param contentTree content tree to which the documentation will be added - * @throws DocletException if there is a problem building the documentation - */ - protected void build(XMLNode node, Content contentTree) throws DocletException { - String component = node.name; - try { - String methodName = "build" + component; - if (DEBUG) { - configuration.reporter.print(ERROR, - "DEBUG: " + getClass().getName() + "." + methodName); - } - Method method = getClass().getMethod(methodName, XMLNode.class, Content.class); - method.invoke(this, node, contentTree); - - } catch (NoSuchMethodException e) { - // Use SimpleDocletException instead of InternalException because there is nothing - // informative about about the place the exception occurred, here in this method. - // The problem is either a misconfigured doclet.xml file or a missing method in the - // user-supplied(?) doclet - String message = resources.getText("doclet.builder.unknown.component", component); - throw new SimpleDocletException(message, e); - - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - if (cause instanceof DocletException) { - throw (DocletException) cause; - } else if (cause instanceof UncheckedDocletException) { - throw (DocletException) cause.getCause(); - } else { - // use InternalException, so that a stacktrace showing the position of - // the internal exception is generated - String message = resources.getText("doclet.builder.exception.in.component", component, - e.getCause()); - throw new InternalException(message, e.getCause()); - } - - } catch (ReflectiveOperationException e) { - // Use SimpleDocletException instead of InternalException because there is nothing - // informative about about the place the exception occurred, here in this method. - // The problem is specific to the method being invoked, such as illegal access - // or illegal argument. - String message = resources.getText("doclet.builder.exception.in.component", component, e); - throw new SimpleDocletException(message, e.getCause()); - } - } - - /** - * Build the documentation, as specified by the children of the given XML element. - * - * @param node the XML element that specifies which components to document. - * @param contentTree content tree to which the documentation will be added - * @throws DocletException if there is a problem while building the children - */ - protected void buildChildren(XMLNode node, Content contentTree) throws DocletException { - for (XMLNode child : node.children) - build(child, contentTree); - } } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java index f0d11e9838d..55507e09dcd 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java @@ -25,14 +25,6 @@ package jdk.javadoc.internal.doclets.toolkit.builders; -import java.util.Collection; -import java.util.Comparator; -import java.util.Iterator; -import java.util.SortedSet; -import java.util.TreeSet; - -import javax.lang.model.element.Element; - import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.DocletException; @@ -50,7 +42,6 @@ import jdk.javadoc.internal.doclets.toolkit.DocletException; */ public abstract class AbstractMemberBuilder extends AbstractBuilder { - public final Comparator comparator; /** * Construct a SubBuilder. * @param context a context object, providing information used in this run @@ -58,7 +49,6 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder { */ public AbstractMemberBuilder(Context context) { super(context); - comparator = utils.makeGeneralPurposeComparator(); } /** @@ -72,20 +62,14 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder { throw new AssertionError(); } - /** - * Builds the sub component if there is anything to document. * - * @param node the XML element that specifies which components to document. - * @param contentTree content tree to which the documentation will be added - * @throws DocletException if there is a problem while building the documentation + * Build the documentation. + * + * @param contentTree The content tree into which to add the documention + * @throws DocletException if there is a problem building the documentation */ - @Override - public void build(XMLNode node, Content contentTree) throws DocletException { - if (hasMembersToDocument()) { - super.build(node, contentTree); - } - } + public abstract void build(Content contentTree) throws DocletException; /** * Returns true if this subbuilder has anything to document. @@ -93,10 +77,4 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder { * @return true if this subbuilder has anything to document */ public abstract boolean hasMembersToDocument(); - - public SortedSet asSortedSet(Collection members) { - SortedSet out = new TreeSet<>(comparator); - out.addAll(members); - return out; - } } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java index 065a0da840c..01115b69859 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +46,6 @@ import jdk.javadoc.internal.doclets.toolkit.DocletException; */ public class AnnotationTypeBuilder extends AbstractBuilder { - /** - * The root element of the annotation type XML is {@value}. - */ - public static final String ROOT = "AnnotationTypeDoc"; - /** * The annotation type being documented. */ @@ -100,29 +95,24 @@ public class AnnotationTypeBuilder extends AbstractBuilder { */ @Override public void build() throws DocletException { - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return ROOT; + buildAnnotationTypeDoc(contentTree); } /** * Build the annotation type documentation. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws DocletException { + protected void buildAnnotationTypeDoc(Content contentTree) throws DocletException { contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") + " " + utils.getSimpleName(annotationType)); Content annotationContentTree = writer.getAnnotationContentHeader(); - buildChildren(node, annotationContentTree); + + buildAnnotationTypeInfo(annotationContentTree); + buildMemberSummary(annotationContentTree); + buildAnnotationTypeMemberDetails(annotationContentTree); + writer.addAnnotationContentTree(contentTree, annotationContentTree); writer.addFooter(contentTree); writer.printDocument(contentTree); @@ -136,7 +126,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder { */ private void copyDocFiles() throws DocletException { PackageElement containingPackage = utils.containingPackage(annotationType); - if((configuration.packages == null || + if ((configuration.packages == null || !configuration.packages.contains(containingPackage) && !containingPackagesSeen.contains(containingPackage))){ //Only copy doc files dir if the containing package is not @@ -150,34 +140,36 @@ public class AnnotationTypeBuilder extends AbstractBuilder { /** * Build the annotation information tree documentation. * - * @param node the XML element that specifies which components to document * @param annotationContentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildAnnotationTypeInfo(XMLNode node, Content annotationContentTree) + protected void buildAnnotationTypeInfo(Content annotationContentTree) throws DocletException { Content annotationInfoTree = writer.getAnnotationInfoTreeHeader(); - buildChildren(node, annotationInfoTree); + + buildDeprecationInfo(annotationInfoTree); + buildAnnotationTypeSignature(annotationInfoTree); + buildAnnotationTypeDescription(annotationInfoTree); + buildAnnotationTypeTagInfo(annotationInfoTree); + annotationContentTree.addContent(writer.getAnnotationInfo(annotationInfoTree)); } /** * If this annotation is deprecated, build the appropriate information. * - * @param node the XML element that specifies which components to document * @param annotationInfoTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo (XMLNode node, Content annotationInfoTree) { + protected void buildDeprecationInfo(Content annotationInfoTree) { writer.addAnnotationTypeDeprecationInfo(annotationInfoTree); } /** * Build the signature of the current annotation type. * - * @param node the XML element that specifies which components to document * @param annotationInfoTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) { + protected void buildAnnotationTypeSignature(Content annotationInfoTree) { writer.addAnnotationTypeSignature(utils.modifiersToString(annotationType, true), annotationInfoTree); } @@ -185,48 +177,47 @@ public class AnnotationTypeBuilder extends AbstractBuilder { /** * Build the annotation type description. * - * @param node the XML element that specifies which components to document * @param annotationInfoTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeDescription(XMLNode node, Content annotationInfoTree) { + protected void buildAnnotationTypeDescription(Content annotationInfoTree) { writer.addAnnotationTypeDescription(annotationInfoTree); } /** * Build the tag information for the current annotation type. * - * @param node the XML element that specifies which components to document * @param annotationInfoTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeTagInfo(XMLNode node, Content annotationInfoTree) { + protected void buildAnnotationTypeTagInfo(Content annotationInfoTree) { writer.addAnnotationTypeTagInfo(annotationInfoTree); } /** * Build the member summary contents of the page. * - * @param node the XML element that specifies which components to document * @param annotationContentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildMemberSummary(XMLNode node, Content annotationContentTree) throws DocletException { + protected void buildMemberSummary(Content annotationContentTree) throws DocletException { Content memberSummaryTree = writer.getMemberTreeHeader(); - configuration.getBuilderFactory(). - getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); + builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); annotationContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); } /** * Build the member details contents of the page. * - * @param node the XML element that specifies which components to document * @param annotationContentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildAnnotationTypeMemberDetails(XMLNode node, Content annotationContentTree) + protected void buildAnnotationTypeMemberDetails(Content annotationContentTree) throws DocletException { Content memberDetailsTree = writer.getMemberTreeHeader(); - buildChildren(node, memberDetailsTree); + + buildAnnotationTypeFieldDetails(memberDetailsTree); + buildAnnotationTypeRequiredMemberDetails(memberDetailsTree); + buildAnnotationTypeOptionalMemberDetails(memberDetailsTree); + if (memberDetailsTree.isValid()) { annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); } @@ -235,39 +226,33 @@ public class AnnotationTypeBuilder extends AbstractBuilder { /** * Build the annotation type field documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildAnnotationTypeFieldDetails(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeFieldDetails(Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getAnnotationTypeFieldsBuilder(writer).buildChildren(node, memberDetailsTree); + builderFactory.getAnnotationTypeFieldsBuilder(writer).build(memberDetailsTree); } /** * Build the annotation type optional member documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildAnnotationTypeOptionalMemberDetails(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeOptionalMemberDetails(Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node, memberDetailsTree); + builderFactory.getAnnotationTypeOptionalMemberBuilder(writer).build(memberDetailsTree); } /** * Build the annotation type required member documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - public void buildAnnotationTypeRequiredMemberDetails(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeRequiredMemberDetails(Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node, memberDetailsTree); + builderFactory.getAnnotationTypeRequiredMemberBuilder(writer).build(memberDetailsTree); } } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java index a5e61be42a3..361de387e00 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java @@ -110,15 +110,6 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { writer, VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS); } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "AnnotationTypeFieldDetails"; - } - - /** * Returns whether or not there are members to document. * @return whether or not there are members to document @@ -128,26 +119,32 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { return !members.isEmpty(); } + /** + * {@inheritDoc} + */ + @Override + public void build(Content contentTree) throws DocletException { + buildAnnotationTypeField(contentTree); + } + /** * Build the annotation type field documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildAnnotationTypeField(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeField(Content memberDetailsTree) throws DocletException { - buildAnnotationTypeMember(node, memberDetailsTree); + buildAnnotationTypeMember(memberDetailsTree); } /** * Build the member documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeMember(Content memberDetailsTree) throws DocletException { if (writer == null) { return; @@ -162,7 +159,12 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { writer.addAnnotationDetailsTreeHeader(typeElement, detailsTree); Content annotationDocTree = writer.getAnnotationDocTreeHeader(currentMember, detailsTree); - buildChildren(node, annotationDocTree); + + buildSignature(annotationDocTree); + buildDeprecationInfo(annotationDocTree); + buildMemberComments(annotationDocTree); + buildTagInfo(annotationDocTree); + detailsTree.addContent(writer.getAnnotationDoc( annotationDocTree, currentMember == lastElement)); memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree)); @@ -173,10 +175,9 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content annotationDocTree) { + protected void buildSignature(Content annotationDocTree) { annotationDocTree.addContent( writer.getSignature(currentMember)); } @@ -184,10 +185,9 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) { + protected void buildDeprecationInfo(Content annotationDocTree) { writer.addDeprecated(currentMember, annotationDocTree); } @@ -195,11 +195,10 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { * Build the comments for the member. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildMemberComments(XMLNode node, Content annotationDocTree) { - if(! configuration.nocomment){ + protected void buildMemberComments(Content annotationDocTree) { + if (!configuration.nocomment) { writer.addComments(currentMember, annotationDocTree); } } @@ -207,10 +206,9 @@ public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content annotationDocTree) { + protected void buildTagInfo(Content annotationDocTree) { writer.addTags(currentMember, annotationDocTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java index d004dbb76a7..ab15d180f98 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,29 +81,33 @@ public class AnnotationTypeOptionalMemberBuilder extends AnnotationTypeRequiredM * {@inheritDoc} */ @Override - public String getName() { - return "AnnotationTypeOptionalMemberDetails"; + public void build(Content contentTree) throws DocletException { + buildAnnotationTypeOptionalMember(contentTree); } /** * Build the annotation type optional member documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildAnnotationTypeOptionalMember(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeOptionalMember(Content memberDetailsTree) throws DocletException { - buildAnnotationTypeMember(node, memberDetailsTree); + buildAnnotationTypeMember(memberDetailsTree); + } + + @Override + protected void buildAnnotationTypeMemberChildren(Content annotationDocTree) { + super.buildAnnotationTypeMemberChildren(annotationDocTree); + buildDefaultValueInfo(annotationDocTree); } /** * Build the default value for this optional member. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildDefaultValueInfo(XMLNode node, Content annotationDocTree) { + protected void buildDefaultValueInfo(Content annotationDocTree) { ((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo(currentMember, annotationDocTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java index 1c368a2a623..5b134fcee9c 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java @@ -112,14 +112,6 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED); } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "AnnotationTypeRequiredMemberDetails"; - } - /** * Returns whether or not there are members to document. * @return whether or not there are members to document @@ -129,26 +121,32 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { return !members.isEmpty(); } + /** + * {@inheritDoc} + */ + @Override + public void build(Content contentTree) throws DocletException { + buildAnnotationTypeRequiredMember(contentTree); + } + /** * Build the annotation type required member documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildAnnotationTypeRequiredMember(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeRequiredMember(Content memberDetailsTree) throws DocletException { - buildAnnotationTypeMember(node, memberDetailsTree); + buildAnnotationTypeMember(memberDetailsTree); } /** * Build the member documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if an error occurs */ - public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) + protected void buildAnnotationTypeMember(Content memberDetailsTree) throws DocletException { if (writer == null) { return; @@ -162,7 +160,9 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { writer.addAnnotationDetailsTreeHeader(typeElement, detailsTree); Content annotationDocTree = writer.getAnnotationDocTreeHeader( currentMember, detailsTree); - buildChildren(node, annotationDocTree); + + buildAnnotationTypeMemberChildren(annotationDocTree); + detailsTree.addContent(writer.getAnnotationDoc( annotationDocTree, currentMember == lastMember)); memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree)); @@ -170,23 +170,28 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { } } + protected void buildAnnotationTypeMemberChildren(Content annotationDocTree) { + buildSignature(annotationDocTree); + buildDeprecationInfo(annotationDocTree); + buildMemberComments(annotationDocTree); + buildTagInfo(annotationDocTree); + } + /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content annotationDocTree) { + protected void buildSignature(Content annotationDocTree) { annotationDocTree.addContent(writer.getSignature(currentMember)); } /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) { + protected void buildDeprecationInfo(Content annotationDocTree) { writer.addDeprecated(currentMember, annotationDocTree); } @@ -194,11 +199,10 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { * Build the comments for the member. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildMemberComments(XMLNode node, Content annotationDocTree) { - if(! configuration.nocomment) { + protected void buildMemberComments(Content annotationDocTree) { + if (!configuration.nocomment) { writer.addComments(currentMember, annotationDocTree); } } @@ -206,10 +210,9 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param annotationDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content annotationDocTree) { + protected void buildTagInfo(Content annotationDocTree) { writer.addTags(currentMember, annotationDocTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java index 0a51c9102b7..eccd4b1af42 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java @@ -53,11 +53,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; public class BuilderFactory { - /** - * The current configuration of the doclet. - */ - private final BaseConfiguration configuration; - /** * The factory to retrieve the required writers from. */ @@ -71,12 +66,10 @@ public class BuilderFactory { * being executed. */ public BuilderFactory (BaseConfiguration configuration) { - this.configuration = configuration; this.writerFactory = configuration.getWriterFactory(); Set containingPackagesSeen = new HashSet<>(); - context = new AbstractBuilder.Context(configuration, containingPackagesSeen, - LayoutParser.getInstance(configuration)); + context = new AbstractBuilder.Context(configuration, containingPackagesSeen); } /** @@ -150,9 +143,10 @@ public class BuilderFactory { /** * Return an instance of the method builder for the given class. * + * @param classWriter the writer for the enclosing class * @return an instance of the method builder for the given class. */ - public AbstractBuilder getMethodBuilder(ClassWriter classWriter) { + public AbstractMemberBuilder getMethodBuilder(ClassWriter classWriter) { return MethodBuilder.getInstance(context, classWriter.getTypeElement(), writerFactory.getMethodWriter(classWriter)); } @@ -161,10 +155,11 @@ public class BuilderFactory { * Return an instance of the annotation type fields builder for the given * class. * + * @param annotationTypeWriter the writer for the enclosing annotation type * @return an instance of the annotation type field builder for the given * annotation type. */ - public AbstractBuilder getAnnotationTypeFieldsBuilder( + public AbstractMemberBuilder getAnnotationTypeFieldsBuilder( AnnotationTypeWriter annotationTypeWriter) { return AnnotationTypeFieldBuilder.getInstance(context, annotationTypeWriter.getAnnotationTypeElement(), @@ -175,10 +170,11 @@ public class BuilderFactory { * Return an instance of the annotation type member builder for the given * class. * + * @param annotationTypeWriter the writer for the enclosing annotation type * @return an instance of the annotation type member builder for the given * annotation type. */ - public AbstractBuilder getAnnotationTypeOptionalMemberBuilder( + public AbstractMemberBuilder getAnnotationTypeOptionalMemberBuilder( AnnotationTypeWriter annotationTypeWriter) { return AnnotationTypeOptionalMemberBuilder.getInstance(context, annotationTypeWriter.getAnnotationTypeElement(), @@ -189,10 +185,11 @@ public class BuilderFactory { * Return an instance of the annotation type member builder for the given * class. * + * @param annotationTypeWriter the writer for the enclosing annotation type * @return an instance of the annotation type member builder for the given * annotation type. */ - public AbstractBuilder getAnnotationTypeRequiredMemberBuilder( + public AbstractMemberBuilder getAnnotationTypeRequiredMemberBuilder( AnnotationTypeWriter annotationTypeWriter) { return AnnotationTypeRequiredMemberBuilder.getInstance(context, annotationTypeWriter.getAnnotationTypeElement(), @@ -202,9 +199,10 @@ public class BuilderFactory { /** * Return an instance of the enum constants builder for the given class. * + * @param classWriter the writer for the enclosing class * @return an instance of the enum constants builder for the given class. */ - public AbstractBuilder getEnumConstantsBuilder(ClassWriter classWriter) { + public AbstractMemberBuilder getEnumConstantsBuilder(ClassWriter classWriter) { return EnumConstantBuilder.getInstance(context, classWriter.getTypeElement(), writerFactory.getEnumConstantWriter(classWriter)); } @@ -212,9 +210,10 @@ public class BuilderFactory { /** * Return an instance of the field builder for the given class. * + * @param classWriter the writer for the enclosing class * @return an instance of the field builder for the given class. */ - public AbstractBuilder getFieldBuilder(ClassWriter classWriter) { + public AbstractMemberBuilder getFieldBuilder(ClassWriter classWriter) { return FieldBuilder.getInstance(context, classWriter.getTypeElement(), writerFactory.getFieldWriter(classWriter)); } @@ -222,9 +221,10 @@ public class BuilderFactory { /** * Return an instance of the property builder for the given class. * + * @param classWriter the writer for the enclosing class * @return an instance of the field builder for the given class. */ - public AbstractBuilder getPropertyBuilder(ClassWriter classWriter) { + public AbstractMemberBuilder getPropertyBuilder(ClassWriter classWriter) { final PropertyWriter propertyWriter = writerFactory.getPropertyWriter(classWriter); return PropertyBuilder.getInstance(context, @@ -235,9 +235,10 @@ public class BuilderFactory { /** * Return an instance of the constructor builder for the given class. * + * @param classWriter the writer for the enclosing class * @return an instance of the constructor builder for the given class. */ - public AbstractBuilder getConstructorBuilder(ClassWriter classWriter) { + public AbstractMemberBuilder getConstructorBuilder(ClassWriter classWriter) { return ConstructorBuilder.getInstance(context, classWriter.getTypeElement(), writerFactory.getConstructorWriter(classWriter)); } @@ -245,9 +246,10 @@ public class BuilderFactory { /** * Return an instance of the member summary builder for the given class. * + * @param classWriter the writer for the enclosing class * @return an instance of the member summary builder for the given class. */ - public AbstractBuilder getMemberSummaryBuilder(ClassWriter classWriter) { + public MemberSummaryBuilder getMemberSummaryBuilder(ClassWriter classWriter) { return MemberSummaryBuilder.getInstance(classWriter, context); } @@ -255,10 +257,11 @@ public class BuilderFactory { * Return an instance of the member summary builder for the given annotation * type. * + * @param annotationTypeWriter the writer for the enclosing annotation type * @return an instance of the member summary builder for the given * annotation type. */ - public AbstractBuilder getMemberSummaryBuilder(AnnotationTypeWriter annotationTypeWriter) { + public MemberSummaryBuilder getMemberSummaryBuilder(AnnotationTypeWriter annotationTypeWriter) { return MemberSummaryBuilder.getInstance(annotationTypeWriter, context); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java index 436fcb143f6..7e527993cb7 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,11 +47,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.Utils; */ public class ClassBuilder extends AbstractBuilder { - /** - * The root element of the class XML is {@value}. - */ - public static final String ROOT = "ClassDoc"; - /** * The class being documented. */ @@ -112,8 +107,7 @@ public class ClassBuilder extends AbstractBuilder { * @param writer the doclet specific writer. * @return the new ClassBuilder */ - public static ClassBuilder getInstance(Context context, - TypeElement typeElement, ClassWriter writer) { + public static ClassBuilder getInstance(Context context, TypeElement typeElement, ClassWriter writer) { return new ClassBuilder(context, typeElement, writer); } @@ -122,153 +116,151 @@ public class ClassBuilder extends AbstractBuilder { */ @Override public void build() throws DocletException { - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return ROOT; + buildClassDoc(contentTree); } /** * Handles the {@literal } tag. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added - * @throws DocletException if there is a problem while building the documentation + * @throws DocletException if there is a problem while building the documentation */ - public void buildClassDoc(XMLNode node, Content contentTree) throws DocletException { - String key; - if (isInterface) { - key = "doclet.Interface"; - } else if (isEnum) { - key = "doclet.Enum"; - } else { - key = "doclet.Class"; - } - contentTree = writer.getHeader(configuration.getText(key) + " " + - utils.getSimpleName(typeElement)); - Content classContentTree = writer.getClassContentHeader(); - buildChildren(node, classContentTree); - writer.addClassContentTree(contentTree, classContentTree); - writer.addFooter(contentTree); - writer.printDocument(contentTree); - copyDocFiles(); - } + protected void buildClassDoc(Content contentTree) throws DocletException { + String key; + if (isInterface) { + key = "doclet.Interface"; + } else if (isEnum) { + key = "doclet.Enum"; + } else { + key = "doclet.Class"; + } + contentTree = writer.getHeader(configuration.getText(key) + " " + + utils.getSimpleName(typeElement)); + Content classContentTree = writer.getClassContentHeader(); + + buildClassTree(classContentTree); + buildClassInfo(classContentTree); + buildMemberSummary(classContentTree); + buildMemberDetails(classContentTree); + + writer.addClassContentTree(contentTree, classContentTree); + writer.addFooter(contentTree); + writer.printDocument(contentTree); + copyDocFiles(); + } /** * Build the class tree documentation. * - * @param node the XML element that specifies which components to document * @param classContentTree the content tree to which the documentation will be added */ - public void buildClassTree(XMLNode node, Content classContentTree) { + protected void buildClassTree(Content classContentTree) { writer.addClassTree(classContentTree); } /** * Build the class information tree documentation. * - * @param node the XML element that specifies which components to document * @param classContentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildClassInfo(XMLNode node, Content classContentTree) throws DocletException { + protected void buildClassInfo(Content classContentTree) throws DocletException { Content classInfoTree = writer.getClassInfoTreeHeader(); - buildChildren(node, classInfoTree); + + buildTypeParamInfo(classInfoTree); + buildSuperInterfacesInfo(classInfoTree); + buildImplementedInterfacesInfo(classInfoTree); + buildSubClassInfo(classInfoTree); + buildSubInterfacesInfo(classInfoTree); + buildInterfaceUsageInfo(classInfoTree); + buildNestedClassInfo(classInfoTree); + buildFunctionalInterfaceInfo(classInfoTree); + buildDeprecationInfo(classInfoTree); + buildClassSignature(classInfoTree); + buildClassDescription(classInfoTree); + buildClassTagInfo(classInfoTree); + classContentTree.addContent(writer.getClassInfo(classInfoTree)); } /** * Build the type parameters of this class. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildTypeParamInfo(XMLNode node, Content classInfoTree) { + protected void buildTypeParamInfo(Content classInfoTree) { writer.addTypeParamInfo(classInfoTree); } /** * If this is an interface, list all super interfaces. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildSuperInterfacesInfo(XMLNode node, Content classInfoTree) { + protected void buildSuperInterfacesInfo(Content classInfoTree) { writer.addSuperInterfacesInfo(classInfoTree); } /** * If this is a class, list all interfaces implemented by this class. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildImplementedInterfacesInfo(XMLNode node, Content classInfoTree) { + protected void buildImplementedInterfacesInfo(Content classInfoTree) { writer.addImplementedInterfacesInfo(classInfoTree); } /** * List all the classes extend this one. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildSubClassInfo(XMLNode node, Content classInfoTree) { + protected void buildSubClassInfo(Content classInfoTree) { writer.addSubClassInfo(classInfoTree); } /** * List all the interfaces that extend this one. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildSubInterfacesInfo(XMLNode node, Content classInfoTree) { + protected void buildSubInterfacesInfo(Content classInfoTree) { writer.addSubInterfacesInfo(classInfoTree); } /** * If this is an interface, list all classes that implement this interface. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildInterfaceUsageInfo(XMLNode node, Content classInfoTree) { + protected void buildInterfaceUsageInfo(Content classInfoTree) { writer.addInterfaceUsageInfo(classInfoTree); } /** * If this is an functional interface, display appropriate message. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildFunctionalInterfaceInfo(XMLNode node, Content classInfoTree) { + protected void buildFunctionalInterfaceInfo(Content classInfoTree) { writer.addFunctionalInterfaceInfo(classInfoTree); } /** * If this class is deprecated, build the appropriate information. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo (XMLNode node, Content classInfoTree) { + protected void buildDeprecationInfo(Content classInfoTree) { writer.addClassDeprecationInfo(classInfoTree); } /** * If this is an inner class or interface, list the enclosing class or interface. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildNestedClassInfo (XMLNode node, Content classInfoTree) { + protected void buildNestedClassInfo(Content classInfoTree) { writer.addNestedClassInfo(classInfoTree); } @@ -279,7 +271,7 @@ public class ClassBuilder extends AbstractBuilder { */ private void copyDocFiles() throws DocFileIOException { PackageElement containingPackage = utils.containingPackage(typeElement); - if((configuration.packages == null || + if ((configuration.packages == null || !configuration.packages.contains(containingPackage)) && !containingPackagesSeen.contains(containingPackage)) { //Only copy doc files dir if the containing package is not @@ -293,122 +285,107 @@ public class ClassBuilder extends AbstractBuilder { /** * Build the signature of the current class. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildClassSignature(XMLNode node, Content classInfoTree) { + protected void buildClassSignature(Content classInfoTree) { writer.addClassSignature(utils.modifiersToString(typeElement, true), classInfoTree); } /** * Build the class description. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildClassDescription(XMLNode node, Content classInfoTree) { + protected void buildClassDescription(Content classInfoTree) { writer.addClassDescription(classInfoTree); } /** * Build the tag information for the current class. * - * @param node the XML element that specifies which components to document * @param classInfoTree the content tree to which the documentation will be added */ - public void buildClassTagInfo(XMLNode node, Content classInfoTree) { + protected void buildClassTagInfo(Content classInfoTree) { writer.addClassTagInfo(classInfoTree); } /** * Build the member summary contents of the page. * - * @param node the XML element that specifies which components to document * @param classContentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildMemberSummary(XMLNode node, Content classContentTree) throws DocletException { + protected void buildMemberSummary(Content classContentTree) throws DocletException { Content memberSummaryTree = writer.getMemberTreeHeader(); - configuration.getBuilderFactory(). - getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); + builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); } /** * Build the member details contents of the page. * - * @param node the XML element that specifies which components to document * @param classContentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildMemberDetails(XMLNode node, Content classContentTree) throws DocletException { + protected void buildMemberDetails(Content classContentTree) throws DocletException { Content memberDetailsTree = writer.getMemberTreeHeader(); - buildChildren(node, memberDetailsTree); + + buildEnumConstantsDetails(memberDetailsTree); + buildPropertyDetails(memberDetailsTree); + buildFieldDetails(memberDetailsTree); + buildConstructorDetails(memberDetailsTree); + buildMethodDetails(memberDetailsTree); + classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); } /** * Build the enum constants documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildEnumConstantsDetails(XMLNode node, - Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); + protected void buildEnumConstantsDetails(Content memberDetailsTree) throws DocletException { + builderFactory.getEnumConstantsBuilder(writer).build(memberDetailsTree); } /** * Build the field documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildFieldDetails(XMLNode node, - Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getFieldBuilder(writer).buildChildren(node, memberDetailsTree); + protected void buildFieldDetails(Content memberDetailsTree) throws DocletException { + builderFactory.getFieldBuilder(writer).build(memberDetailsTree); } /** * Build the property documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildPropertyDetails(XMLNode node, - Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getPropertyBuilder(writer).buildChildren(node, memberDetailsTree); + public void buildPropertyDetails( Content memberDetailsTree) throws DocletException { + builderFactory.getPropertyBuilder(writer).build(memberDetailsTree); } /** * Build the constructor documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildConstructorDetails(XMLNode node, - Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getConstructorBuilder(writer).buildChildren(node, memberDetailsTree); + protected void buildConstructorDetails(Content memberDetailsTree) throws DocletException { + builderFactory.getConstructorBuilder(writer).build(memberDetailsTree); } /** * Build the method documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildMethodDetails(XMLNode node, - Content memberDetailsTree) throws DocletException { - configuration.getBuilderFactory(). - getMethodBuilder(writer).buildChildren(node, memberDetailsTree); + protected void buildMethodDetails(Content memberDetailsTree) throws DocletException { + builderFactory.getMethodBuilder(writer).build(memberDetailsTree); } } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java index a1909f75f05..b87c39abc01 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java @@ -51,11 +51,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap; */ public class ConstantsSummaryBuilder extends AbstractBuilder { - /** - * The root element of the constant summary XML is {@value}. - */ - public static final String ROOT = "ConstantSummary"; - /** * The maximum number of package directories shown in the constant * value index. @@ -133,27 +128,21 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { //Doclet does not support this output. return; } - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return ROOT; + buildConstantSummary(contentTree); } /** * Build the constant summary. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildConstantSummary(XMLNode node, Content contentTree) throws DocletException { + protected void buildConstantSummary(Content contentTree) throws DocletException { contentTree = writer.getHeader(); - buildChildren(node, contentTree); + + buildContents(contentTree); + buildConstantSummaries(contentTree); + writer.addFooter(contentTree); writer.printDocument(contentTree); } @@ -161,10 +150,9 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Build the list of packages. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the content list will be added */ - public void buildContents(XMLNode node, Content contentTree) { + protected void buildContents(Content contentTree) { Content contentListTree = writer.getContentsHeader(); printedPackageHeaders.clear(); for (PackageElement pkg : configuration.packages) { @@ -178,18 +166,20 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Build the summary for each documented package. * - * @param node the XML element that specifies which components to document * @param contentTree the tree to which the summaries will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildConstantSummaries(XMLNode node, Content contentTree) throws DocletException { + protected void buildConstantSummaries(Content contentTree) throws DocletException { printedPackageHeaders.clear(); Content summariesTree = writer.getConstantSummaries(); for (PackageElement aPackage : configuration.packages) { if (hasConstantField(aPackage)) { currentPackage = aPackage; //Build the documentation for the current package. - buildChildren(node, summariesTree); + + buildPackageHeader(summariesTree); + buildClassConstantSummary(summariesTree); + first = false; } } @@ -199,10 +189,9 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Build the header for the given package. * - * @param node the XML element that specifies which components to document * @param summariesTree the tree to which the package header will be added */ - public void buildPackageHeader(XMLNode node, Content summariesTree) { + protected void buildPackageHeader(Content summariesTree) { PackageElement abbrevPkg = configuration.workArounds.getAbbreviatedPackageElement(currentPackage); if (!printedPackageHeaders.contains(abbrevPkg)) { writer.addPackageName(currentPackage, summariesTree, first); @@ -213,12 +202,11 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Build the summary for the current class. * - * @param node the XML element that specifies which components to document * @param summariesTree the tree to which the class constant summary will be added * @throws DocletException if there is a problem while building the documentation * */ - public void buildClassConstantSummary(XMLNode node, Content summariesTree) + protected void buildClassConstantSummary(Content summariesTree) throws DocletException { SortedSet classes = !currentPackage.isUnnamed() ? utils.getAllClasses(currentPackage) @@ -231,7 +219,9 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { } currentClass = te; //Build the documentation for the current class. - buildChildren(node, classConstantTree); + + buildConstantMembers(classConstantTree); + } writer.addClassConstant(summariesTree, classConstantTree); } @@ -239,12 +229,11 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Build the summary of constant members in the class. * - * @param node the XML element that specifies which components to document * @param classConstantTree the tree to which the constant members table * will be added */ - public void buildConstantMembers(XMLNode node, Content classConstantTree) { - new ConstantFieldBuilder(currentClass).buildMembersSummary(node, classConstantTree); + protected void buildConstantMembers(Content classConstantTree) { + new ConstantFieldBuilder(currentClass).buildMembersSummary(classConstantTree); } /** @@ -338,11 +327,10 @@ public class ConstantsSummaryBuilder extends AbstractBuilder { /** * Builds the table of constants for a given class. * - * @param node the XML element that specifies which components to document * @param classConstantTree the tree to which the class constants table * will be added */ - protected void buildMembersSummary(XMLNode node, Content classConstantTree) { + protected void buildMembersSummary(Content classConstantTree) { SortedSet members = members(); if (!members.isEmpty()) { writer.addConstantMembers(typeElement, members, classConstantTree); diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java index c569fd92261..3e51e4d9ff9 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java @@ -51,11 +51,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap; */ public class ConstructorBuilder extends AbstractMemberBuilder { - /** - * The name of this builder. - */ - public static final String NAME = "ConstructorDetails"; - /** * The current constructor that is being documented at this point in time. */ @@ -85,7 +80,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder { * Construct a new ConstructorBuilder. * * @param context the build context. - * @param typeElement the class whoses members are being documented. + * @param typeElement the class whose members are being documented. * @param writer the doclet specific writer. */ private ConstructorBuilder(Context context, @@ -108,7 +103,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder { * Construct a new ConstructorBuilder. * * @param context the build context. - * @param typeElement the class whoses members are being documented. + * @param typeElement the class whose members are being documented. * @param writer the doclet specific writer. * @return the new ConstructorBuilder */ @@ -117,14 +112,6 @@ public class ConstructorBuilder extends AbstractMemberBuilder { return new ConstructorBuilder(context, typeElement, writer); } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return NAME; - } - /** * {@inheritDoc} */ @@ -142,14 +129,21 @@ public class ConstructorBuilder extends AbstractMemberBuilder { return writer; } + /** + * {@inheritDoc} + */ + @Override + public void build(Content contentTree) throws DocletException { + buildConstructorDoc(contentTree); + } + /** * Build the constructor documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException is there is a problem while building the documentation */ - public void buildConstructorDoc(XMLNode node, Content memberDetailsTree) throws DocletException { + protected void buildConstructorDoc(Content memberDetailsTree) throws DocletException { if (writer == null) { return; } @@ -161,7 +155,12 @@ public class ConstructorBuilder extends AbstractMemberBuilder { for (Element contructor : constructors) { currentConstructor = (ExecutableElement)contructor; Content constructorDocTree = writer.getConstructorDocTreeHeader(currentConstructor, constructorDetailsTree); - buildChildren(node, constructorDocTree); + + buildSignature(constructorDocTree); + buildDeprecationInfo(constructorDocTree); + buildConstructorComments(constructorDocTree); + buildTagInfo(constructorDocTree); + constructorDetailsTree.addContent(writer.getConstructorDoc(constructorDocTree, currentConstructor == lastElement)); } @@ -173,20 +172,18 @@ public class ConstructorBuilder extends AbstractMemberBuilder { /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param constructorDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content constructorDocTree) { + protected void buildSignature(Content constructorDocTree) { constructorDocTree.addContent(writer.getSignature(currentConstructor)); } /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param constructorDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content constructorDocTree) { + protected void buildDeprecationInfo(Content constructorDocTree) { writer.addDeprecated(currentConstructor, constructorDocTree); } @@ -194,10 +191,9 @@ public class ConstructorBuilder extends AbstractMemberBuilder { * Build the comments for the constructor. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param constructorDocTree the content tree to which the documentation will be added */ - public void buildConstructorComments(XMLNode node, Content constructorDocTree) { + protected void buildConstructorComments(Content constructorDocTree) { if (!configuration.nocomment) { writer.addComments(currentConstructor, constructorDocTree); } @@ -206,10 +202,9 @@ public class ConstructorBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param constructorDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content constructorDocTree) { + protected void buildTagInfo(Content constructorDocTree) { writer.addTags(currentConstructor, constructorDocTree); } } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java index 227157056ba..2635c5540b3 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java @@ -107,14 +107,6 @@ public class EnumConstantBuilder extends AbstractMemberBuilder { return new EnumConstantBuilder(context, typeElement, writer); } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "EnumConstantDetails"; - } - /** * Returns whether or not there are members to document. * @@ -125,14 +117,21 @@ public class EnumConstantBuilder extends AbstractMemberBuilder { return !enumConstants.isEmpty(); } + /** + * {@inheritDoc} + */ + @Override + public void build(Content contentTree) throws DocletException { + buildEnumConstant(contentTree); + } + /** * Build the enum constant documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException is there is a problem while building the documentation */ - public void buildEnumConstant(XMLNode node, Content memberDetailsTree) throws DocletException { + protected void buildEnumConstant(Content memberDetailsTree) throws DocletException { if (writer == null) { return; } @@ -144,7 +143,12 @@ public class EnumConstantBuilder extends AbstractMemberBuilder { currentElement = (VariableElement)enumConstant; Content enumConstantsTree = writer.getEnumConstantsTreeHeader(currentElement, enumConstantsDetailsTree); - buildChildren(node, enumConstantsTree); + + buildSignature(enumConstantsTree); + buildDeprecationInfo(enumConstantsTree); + buildEnumConstantComments(enumConstantsTree); + buildTagInfo(enumConstantsTree); + enumConstantsDetailsTree.addContent(writer.getEnumConstants( enumConstantsTree, currentElement == lastElement)); } @@ -156,20 +160,18 @@ public class EnumConstantBuilder extends AbstractMemberBuilder { /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param enumConstantsTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content enumConstantsTree) { + protected void buildSignature(Content enumConstantsTree) { enumConstantsTree.addContent(writer.getSignature(currentElement)); } /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param enumConstantsTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content enumConstantsTree) { + protected void buildDeprecationInfo(Content enumConstantsTree) { writer.addDeprecated(currentElement, enumConstantsTree); } @@ -177,10 +179,9 @@ public class EnumConstantBuilder extends AbstractMemberBuilder { * Build the comments for the enum constant. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param enumConstantsTree the content tree to which the documentation will be added */ - public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) { + protected void buildEnumConstantComments(Content enumConstantsTree) { if (!configuration.nocomment) { writer.addComments(currentElement, enumConstantsTree); } @@ -189,10 +190,9 @@ public class EnumConstantBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param enumConstantsTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content enumConstantsTree) { + protected void buildTagInfo(Content enumConstantsTree) { writer.addTags(currentElement, enumConstantsTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java index f2f684ac16e..abcbc4bcf14 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java @@ -109,14 +109,6 @@ public class FieldBuilder extends AbstractMemberBuilder { return new FieldBuilder(context, typeElement, writer); } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "FieldDetails"; - } - /** * Returns whether or not there are members to document. * @@ -127,14 +119,21 @@ public class FieldBuilder extends AbstractMemberBuilder { return !fields.isEmpty(); } + /** + * {@inheritDoc} + */ + @Override + public void build(Content contentTree) throws DocletException { + buildFieldDoc(contentTree); + } + /** * Build the field documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildFieldDoc(XMLNode node, Content memberDetailsTree) throws DocletException { + protected void buildFieldDoc(Content memberDetailsTree) throws DocletException { if (writer == null) { return; } @@ -145,7 +144,12 @@ public class FieldBuilder extends AbstractMemberBuilder { for (Element element : fields) { currentElement = (VariableElement)element; Content fieldDocTree = writer.getFieldDocTreeHeader(currentElement, fieldDetailsTree); - buildChildren(node, fieldDocTree); + + buildSignature(fieldDocTree); + buildDeprecationInfo(fieldDocTree); + buildFieldComments(fieldDocTree); + buildTagInfo(fieldDocTree); + fieldDetailsTree.addContent(writer.getFieldDoc( fieldDocTree, currentElement == lastElement)); } @@ -157,20 +161,18 @@ public class FieldBuilder extends AbstractMemberBuilder { /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param fieldDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content fieldDocTree) { + protected void buildSignature(Content fieldDocTree) { fieldDocTree.addContent(writer.getSignature(currentElement)); } /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param fieldDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) { + protected void buildDeprecationInfo(Content fieldDocTree) { writer.addDeprecated(currentElement, fieldDocTree); } @@ -178,10 +180,9 @@ public class FieldBuilder extends AbstractMemberBuilder { * Build the comments for the field. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param fieldDocTree the content tree to which the documentation will be added */ - public void buildFieldComments(XMLNode node, Content fieldDocTree) { + protected void buildFieldComments(Content fieldDocTree) { if (!configuration.nocomment) { writer.addComments(currentElement, fieldDocTree); } @@ -190,10 +191,9 @@ public class FieldBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param fieldDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content fieldDocTree) { + protected void buildTagInfo(Content fieldDocTree) { writer.addTags(currentElement, fieldDocTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java deleted file mode 100644 index 8c806bdb70d..00000000000 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. - * 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 jdk.javadoc.internal.doclets.toolkit.builders; - -import java.io.*; -import java.util.*; - -import javax.xml.parsers.*; - -import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; -import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; -import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException; -import org.xml.sax.*; -import org.xml.sax.helpers.DefaultHandler; - - -/** - * Parse the XML that specified the order of operation for the builders. This - * Parser uses SAX parsing. - * - * This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @see SAXParser - */ -public class LayoutParser extends DefaultHandler { - - /** - * The map of XML elements that have been parsed. - */ - private final Map
xmlElementsMap; - private XMLNode currentNode; - private final BaseConfiguration configuration; - private String currentRoot; - private boolean isParsing; - - private LayoutParser(BaseConfiguration configuration) { - xmlElementsMap = new HashMap<>(); - this.configuration = configuration; - } - - /** - * Return an instance of the BuilderXML. - * - * @param configuration the current configuration of the doclet. - * @return an instance of the BuilderXML. - */ - public static LayoutParser getInstance(BaseConfiguration configuration) { - return new LayoutParser(configuration); - } - - /** - * Parse the XML specifying the layout of the documentation. - * - * @param root the name of the desired node - * @return the list of XML elements parsed. - * @throws DocFileIOException if there is a problem reading a user-supplied build file - * @throws SimpleDocletException if there is a problem reading the system build file - */ - public XMLNode parseXML(String root) throws DocFileIOException, SimpleDocletException { - if (!xmlElementsMap.containsKey(root)) { - try { - currentRoot = root; - isParsing = false; - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); - InputStream in = configuration.getBuilderXML(); - saxParser.parse(in, this); - } catch (IOException | ParserConfigurationException | SAXException e) { - String message = (configuration.builderXMLPath == null) - ? configuration.getResources().getText("doclet.exception.read.resource", - BaseConfiguration.DEFAULT_BUILDER_XML, e) - : configuration.getResources().getText("doclet.exception.read.file", - configuration.builderXMLPath, e); - throw new SimpleDocletException(message, e); - } - } - return xmlElementsMap.get(root); - } - - /** - * {@inheritDoc} - */ - @Override - public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) - throws SAXException { - if (isParsing || qName.equals(currentRoot)) { - isParsing = true; - currentNode = new XMLNode(currentNode, qName); - for (int i = 0; i < attrs.getLength(); i++) - currentNode.attrs.put(attrs.getLocalName(i), attrs.getValue(i)); - if (qName.equals(currentRoot)) - xmlElementsMap.put(qName, currentNode); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void endElement(String namespaceURI, String sName, String qName) - throws SAXException { - if (! isParsing) { - return; - } - currentNode = currentNode.parent; - isParsing = ! qName.equals(currentRoot); - } -} diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java index c4c600fbc5f..4c7c13f38b4 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java @@ -32,12 +32,6 @@ import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; -import javax.lang.model.type.ArrayType; -import javax.lang.model.type.DeclaredType; -import javax.lang.model.type.ExecutableType; -import javax.lang.model.type.PrimitiveType; -import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.SimpleTypeVisitor9; import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree.Kind; @@ -53,6 +47,9 @@ import jdk.javadoc.internal.doclets.toolkit.CommentUtils; /** * Builds the member summary. + * There are two anonymous subtype variants of this builder, created + * in the {@link #getInstance} methods. One is for general types; + * the other is for annotation types. * * This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. @@ -62,12 +59,12 @@ import jdk.javadoc.internal.doclets.toolkit.CommentUtils; * @author Jamie Ho * @author Bhavesh Patel (Modified) */ -public class MemberSummaryBuilder extends AbstractMemberBuilder { +public abstract class MemberSummaryBuilder extends AbstractMemberBuilder { - /** - * The XML root for this builder. + /* + * Comparator used to sort the members in the summary. */ - public static final String NAME = "MemberSummary"; + private final Comparator
comparator; /** * The member summary writers for the given class. @@ -77,7 +74,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * The type being documented. */ - private final TypeElement typeElement; + protected final TypeElement typeElement; /** * Construct a new MemberSummaryBuilder. @@ -90,22 +87,45 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { super(context); this.typeElement = typeElement; memberSummaryWriters = new EnumMap<>(VisibleMemberMap.Kind.class); + + comparator = utils.makeGeneralPurposeComparator(); } /** - * Construct a new MemberSummaryBuilder. + * Construct a new MemberSummaryBuilder for a general type. * * @param classWriter the writer for the class whose members are being * summarized. * @param context the build context. + * @return the instance */ public static MemberSummaryBuilder getInstance( ClassWriter classWriter, Context context) { - MemberSummaryBuilder builder = new MemberSummaryBuilder(context, - classWriter.getTypeElement()); + MemberSummaryBuilder builder = new MemberSummaryBuilder(context, classWriter.getTypeElement()) { + @Override + public void build(Content contentTree) { + buildPropertiesSummary(contentTree); + buildNestedClassesSummary(contentTree); + buildEnumConstantsSummary(contentTree); + buildFieldsSummary(contentTree); + buildConstructorsSummary(contentTree); + buildMethodsSummary(contentTree); + } + + @Override + public boolean hasMembersToDocument() { + for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) { + VisibleMemberMap members = getVisibleMemberMap(kind); + if (!members.noVisibleMembers()) { + return true; + } + } + return false; + } + }; WriterFactory wf = context.configuration.getWriterFactory(); for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) { - MemberSummaryWriter msw = builder.getVisibleMemberMap(kind).noVisibleMembers() + MemberSummaryWriter msw = builder.getVisibleMemberMap(kind).noVisibleMembers() ? null : wf.getMemberSummaryWriter(classWriter, kind); builder.memberSummaryWriters.put(kind, msw); @@ -114,16 +134,29 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { } /** - * Construct a new MemberSummaryBuilder. + * Construct a new MemberSummaryBuilder for an annotation type. * * @param annotationTypeWriter the writer for the class whose members are * being summarized. - * @param configuration the current configuration of the doclet. + * @param context the build context. + * @return the instance */ public static MemberSummaryBuilder getInstance( AnnotationTypeWriter annotationTypeWriter, Context context) { MemberSummaryBuilder builder = new MemberSummaryBuilder(context, - annotationTypeWriter.getAnnotationTypeElement()); + annotationTypeWriter.getAnnotationTypeElement()) { + @Override + public void build(Content contentTree) { + buildAnnotationTypeFieldsSummary(contentTree); + buildAnnotationTypeRequiredMemberSummary(contentTree); + buildAnnotationTypeOptionalMemberSummary(contentTree); + } + + @Override + public boolean hasMembersToDocument() { + return !utils.getAnnotationMembers(typeElement).isEmpty(); + } + }; WriterFactory wf = context.configuration.getWriterFactory(); for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) { MemberSummaryWriter msw = builder.getVisibleMemberMap(kind).noVisibleMembers() @@ -134,14 +167,6 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { return builder; } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return NAME; - } - /** * Return the specified visible member map. * @@ -181,32 +206,12 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { return out; } - /** - * Return true it there are any members to summarize. - * - * @return true if there are any members to summarize. - */ - @Override - public boolean hasMembersToDocument() { - if (utils.isAnnotationType(typeElement)) { - return !utils.getAnnotationMethods(typeElement).isEmpty(); - } - for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) { - VisibleMemberMap members = getVisibleMemberMap(kind); - if (!members.noVisibleMembers()) { - return true; - } - } - return false; - } - /** * Build the summary for the enum constants. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) { + protected void buildEnumConstantsSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.ENUM_CONSTANTS); VisibleMemberMap visibleMemberMap = @@ -217,10 +222,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the summary for fields. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeFieldsSummary(XMLNode node, Content memberSummaryTree) { + protected void buildAnnotationTypeFieldsSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS); VisibleMemberMap visibleMemberMap = @@ -231,10 +235,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the summary for the optional members. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeOptionalMemberSummary(XMLNode node, Content memberSummaryTree) { + protected void buildAnnotationTypeOptionalMemberSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL); VisibleMemberMap visibleMemberMap = @@ -245,10 +248,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the summary for the optional members. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildAnnotationTypeRequiredMemberSummary(XMLNode node, Content memberSummaryTree) { + protected void buildAnnotationTypeRequiredMemberSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED); VisibleMemberMap visibleMemberMap = @@ -259,10 +261,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the summary for the fields. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) { + protected void buildFieldsSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.FIELDS); VisibleMemberMap visibleMemberMap = @@ -272,8 +273,10 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the summary for the fields. + * + * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildPropertiesSummary(XMLNode node, Content memberSummaryTree) { + protected void buildPropertiesSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.PROPERTIES); VisibleMemberMap visibleMemberMap = @@ -284,10 +287,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the summary for the nested classes. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildNestedClassesSummary(XMLNode node, Content memberSummaryTree) { + protected void buildNestedClassesSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.INNER_CLASSES); VisibleMemberMap visibleMemberMap = @@ -298,10 +300,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the method summary. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildMethodsSummary(XMLNode node, Content memberSummaryTree) { + protected void buildMethodsSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.METHODS); VisibleMemberMap visibleMemberMap = @@ -312,10 +313,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { /** * Build the constructor summary. * - * @param node the XML element that specifies which components to document * @param memberSummaryTree the content tree to which the documentation will be added */ - public void buildConstructorsSummary(XMLNode node, Content memberSummaryTree) { + protected void buildConstructorsSummary(Content memberSummaryTree) { MemberSummaryWriter writer = memberSummaryWriters.get(VisibleMemberMap.Kind.CONSTRUCTORS); VisibleMemberMap visibleMemberMap = @@ -521,4 +521,10 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { writer.addMemberTree(memberSummaryTree, memberTree); } } + + private SortedSet asSortedSet(Collection members) { + SortedSet out = new TreeSet<>(comparator); + out.addAll(members); + return out; + } } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java index 6d372fd68ef..1c1e0942340 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java @@ -116,26 +116,25 @@ public class MethodBuilder extends AbstractMemberBuilder { * {@inheritDoc} */ @Override - public String getName() { - return "MethodDetails"; + public boolean hasMembersToDocument() { + return !methods.isEmpty(); } /** * {@inheritDoc} */ @Override - public boolean hasMembersToDocument() { - return !methods.isEmpty(); + public void build(Content contentTree) throws DocletException { + buildMethodDoc(contentTree); } /** * Build the method documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildMethodDoc(XMLNode node, Content memberDetailsTree) throws DocletException { + protected void buildMethodDoc(Content memberDetailsTree) throws DocletException { if (writer == null) { return; } @@ -147,7 +146,12 @@ public class MethodBuilder extends AbstractMemberBuilder { for (Element method : methods) { currentMethod = (ExecutableElement)method; Content methodDocTree = writer.getMethodDocTreeHeader(currentMethod, methodDetailsTree); - buildChildren(node, methodDocTree); + + buildSignature(methodDocTree); + buildDeprecationInfo(methodDocTree); + buildMethodComments(methodDocTree); + buildTagInfo(methodDocTree); + methodDetailsTree.addContent(writer.getMethodDoc( methodDocTree, currentMethod == lastElement)); } @@ -158,20 +162,18 @@ public class MethodBuilder extends AbstractMemberBuilder { /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param methodDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content methodDocTree) { + protected void buildSignature(Content methodDocTree) { methodDocTree.addContent(writer.getSignature(currentMethod)); } /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param methodDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content methodDocTree) { + protected void buildDeprecationInfo(Content methodDocTree) { writer.addDeprecated(currentMethod, methodDocTree); } @@ -179,10 +181,9 @@ public class MethodBuilder extends AbstractMemberBuilder { * Build the comments for the method. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param methodDocTree the content tree to which the documentation will be added */ - public void buildMethodComments(XMLNode node, Content methodDocTree) { + protected void buildMethodComments(Content methodDocTree) { if (!configuration.nocomment) { ExecutableElement method = currentMethod; if (utils.getFullBody(currentMethod).isEmpty()) { @@ -199,10 +200,9 @@ public class MethodBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param methodDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content methodDocTree) { + protected void buildTagInfo(Content methodDocTree) { writer.addTags(currentMethod, methodDocTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java index 47b20f8b1fb..efe280e6329 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,8 +26,6 @@ package jdk.javadoc.internal.doclets.toolkit.builders; import javax.lang.model.element.ModuleElement; -import javax.lang.model.element.PackageElement; -import javax.tools.StandardLocation; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.DocletException; @@ -46,10 +44,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; * @author Bhavesh Patel */ public class ModuleSummaryBuilder extends AbstractBuilder { - /** - * The root element of the module summary XML is {@value}. - */ - public static final String ROOT = "ModuleDoc"; /** * The module being documented. @@ -66,11 +60,6 @@ public class ModuleSummaryBuilder extends AbstractBuilder { */ private Content contentTree; - /** - * The module package being documented. - */ - private PackageElement pkg; - /** * Construct a new ModuleSummaryBuilder. * @@ -112,27 +101,20 @@ public class ModuleSummaryBuilder extends AbstractBuilder { //Doclet does not support this output. return; } - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return ROOT; + buildModuleDoc(contentTree); } /** * Build the module documentation. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildModuleDoc(XMLNode node, Content contentTree) throws DocletException { + protected void buildModuleDoc(Content contentTree) throws DocletException { contentTree = moduleWriter.getModuleHeader(mdle.getSimpleName().toString()); - buildChildren(node, contentTree); + + buildContent(contentTree); + moduleWriter.addModuleFooter(contentTree); moduleWriter.printDocument(contentTree); utils.copyDirectory(mdle, DocPaths.moduleSummary(mdle)); @@ -141,70 +123,72 @@ public class ModuleSummaryBuilder extends AbstractBuilder { /** * Build the content for the module doc. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the module contents * will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildContent(XMLNode node, Content contentTree) throws DocletException { + protected void buildContent(Content contentTree) throws DocletException { Content moduleContentTree = moduleWriter.getContentHeader(); - buildChildren(node, moduleContentTree); + + buildModuleDescription(moduleContentTree); + buildModuleTags(moduleContentTree); + buildSummary(moduleContentTree); + moduleWriter.addModuleContent(contentTree, moduleContentTree); } /** * Build the module summary. * - * @param node the XML element that specifies which components to document * @param moduleContentTree the module content tree to which the summaries will * be added * @throws DocletException if there is a problem while building the documentation */ - public void buildSummary(XMLNode node, Content moduleContentTree) throws DocletException { + protected void buildSummary(Content moduleContentTree) throws DocletException { Content summaryContentTree = moduleWriter.getSummaryHeader(); - buildChildren(node, summaryContentTree); + + buildPackagesSummary(summaryContentTree); + buildModulesSummary(summaryContentTree); + buildServicesSummary(summaryContentTree); + moduleContentTree.addContent(moduleWriter.getSummaryTree(summaryContentTree)); } /** * Build the modules summary. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the content tree to which the summaries will * be added */ - public void buildModulesSummary(XMLNode node, Content summaryContentTree) { + protected void buildModulesSummary(Content summaryContentTree) { moduleWriter.addModulesSummary(summaryContentTree); } /** * Build the package summary. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the content tree to which the summaries will be added */ - public void buildPackagesSummary(XMLNode node, Content summaryContentTree) { + protected void buildPackagesSummary(Content summaryContentTree) { moduleWriter.addPackagesSummary(summaryContentTree); - } + } /** * Build the services summary. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the content tree to which the summaries will be added */ - public void buildServicesSummary(XMLNode node, Content summaryContentTree) { + protected void buildServicesSummary(Content summaryContentTree) { moduleWriter.addServicesSummary(summaryContentTree); } /** * Build the description for the module. * - * @param node the XML element that specifies which components to document * @param moduleContentTree the tree to which the module description will * be added */ - public void buildModuleDescription(XMLNode node, Content moduleContentTree) { + protected void buildModuleDescription(Content moduleContentTree) { if (!configuration.nocomment) { moduleWriter.addModuleDescription(moduleContentTree); } @@ -213,10 +197,9 @@ public class ModuleSummaryBuilder extends AbstractBuilder { /** * Build the tags of the summary. * - * @param node the XML element that specifies which components to document * @param moduleContentTree the tree to which the module tags will be added */ - public void buildModuleTags(XMLNode node, Content moduleContentTree) { + protected void buildModuleTags(Content moduleContentTree) { if (!configuration.nocomment) { moduleWriter.addModuleTags(moduleContentTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java index 554588f339c..43ac9836f20 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,10 +50,6 @@ import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter; * @author Bhavesh Patel (Modified) */ public class PackageSummaryBuilder extends AbstractBuilder { - /** - * The root element of the package summary XML is {@value}. - */ - public static final String ROOT = "PackageDoc"; /** * The package being documented. @@ -112,27 +108,20 @@ public class PackageSummaryBuilder extends AbstractBuilder { //Doclet does not support this output. return; } - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return ROOT; + buildPackageDoc(contentTree); } /** * Build the package documentation. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildPackageDoc(XMLNode node, Content contentTree) throws DocletException { + protected void buildPackageDoc(Content contentTree) throws DocletException { contentTree = packageWriter.getPackageHeader(utils.getPackageName(packageElement)); - buildChildren(node, contentTree); + + buildContent(contentTree); + packageWriter.addPackageFooter(contentTree); packageWriter.printDocument(contentTree); utils.copyDocFiles(packageElement); @@ -141,39 +130,47 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the content for the package. * - * @param node the XML element that specifies which components to document * @param contentTree the content tree to which the package contents * will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildContent(XMLNode node, Content contentTree) throws DocletException { + protected void buildContent(Content contentTree) throws DocletException { Content packageContentTree = packageWriter.getContentHeader(); - buildChildren(node, packageContentTree); + + buildPackageDescription(packageContentTree); + buildPackageTags(packageContentTree); + buildSummary(packageContentTree); + packageWriter.addPackageContent(contentTree, packageContentTree); } /** * Build the package summary. * - * @param node the XML element that specifies which components to document * @param packageContentTree the package content tree to which the summaries will * be added * @throws DocletException if there is a problem while building the documentation */ - public void buildSummary(XMLNode node, Content packageContentTree) throws DocletException { + protected void buildSummary(Content packageContentTree) throws DocletException { Content summaryContentTree = packageWriter.getSummaryHeader(); - buildChildren(node, summaryContentTree); + + buildInterfaceSummary(summaryContentTree); + buildClassSummary(summaryContentTree); + buildEnumSummary(summaryContentTree); + buildExceptionSummary(summaryContentTree); + buildErrorSummary(summaryContentTree); + buildAnnotationTypeSummary(summaryContentTree); + packageContentTree.addContent(summaryContentTree); } /** * Build the summary for the interfaces in this package. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the summary tree to which the interface summary * will be added */ - public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) { + protected void buildInterfaceSummary(Content summaryContentTree) { String interfaceTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Interface_Summary"), @@ -195,11 +192,10 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the summary for the classes in this package. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the summary tree to which the class summary will * be added */ - public void buildClassSummary(XMLNode node, Content summaryContentTree) { + protected void buildClassSummary(Content summaryContentTree) { String classTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Class_Summary"), @@ -220,11 +216,10 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the summary for the enums in this package. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the summary tree to which the enum summary will * be added */ - public void buildEnumSummary(XMLNode node, Content summaryContentTree) { + protected void buildEnumSummary(Content summaryContentTree) { String enumTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Enum_Summary"), @@ -245,11 +240,10 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the summary for the exceptions in this package. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the summary tree to which the exception summary will * be added */ - public void buildExceptionSummary(XMLNode node, Content summaryContentTree) { + protected void buildExceptionSummary(Content summaryContentTree) { String exceptionTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Exception_Summary"), @@ -272,11 +266,10 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the summary for the errors in this package. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the summary tree to which the error summary will * be added */ - public void buildErrorSummary(XMLNode node, Content summaryContentTree) { + protected void buildErrorSummary(Content summaryContentTree) { String errorTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Error_Summary"), @@ -298,11 +291,10 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the summary for the annotation type in this package. * - * @param node the XML element that specifies which components to document * @param summaryContentTree the summary tree to which the annotation type * summary will be added */ - public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) { + protected void buildAnnotationTypeSummary(Content summaryContentTree) { String annotationtypeTableSummary = configuration.getText("doclet.Member_Table_Summary", configuration.getText("doclet.Annotation_Types_Summary"), @@ -327,11 +319,10 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the description of the summary. * - * @param node the XML element that specifies which components to document * @param packageContentTree the tree to which the package description will * be added */ - public void buildPackageDescription(XMLNode node, Content packageContentTree) { + protected void buildPackageDescription(Content packageContentTree) { if (configuration.nocomment) { return; } @@ -341,10 +332,9 @@ public class PackageSummaryBuilder extends AbstractBuilder { /** * Build the tags of the summary. * - * @param node the XML element that specifies which components to document * @param packageContentTree the tree to which the package tags will be added */ - public void buildPackageTags(XMLNode node, Content packageContentTree) { + protected void buildPackageTags(Content packageContentTree) { if (configuration.nocomment) { return; } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java index 7108c6739aa..e678aa0d3d6 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java @@ -109,14 +109,6 @@ public class PropertyBuilder extends AbstractMemberBuilder { return new PropertyBuilder(context, typeElement, writer); } - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "PropertyDetails"; - } - /** * Returns whether or not there are members to document. * @@ -127,14 +119,21 @@ public class PropertyBuilder extends AbstractMemberBuilder { return !properties.isEmpty(); } + /** + * {@inheritDoc} + */ + @Override + public void build(Content contentTree) throws DocletException { + buildPropertyDoc(contentTree); + } + /** * Build the property documentation. * - * @param node the XML element that specifies which components to document * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildPropertyDoc(XMLNode node, Content memberDetailsTree) throws DocletException { + protected void buildPropertyDoc(Content memberDetailsTree) throws DocletException { if (writer == null) { return; } @@ -146,7 +145,11 @@ public class PropertyBuilder extends AbstractMemberBuilder { currentProperty = (ExecutableElement)property; Content propertyDocTree = writer.getPropertyDocTreeHeader(currentProperty, propertyDetailsTree); - buildChildren(node, propertyDocTree); + + buildSignature(propertyDocTree); + buildPropertyComments(propertyDocTree); + buildTagInfo(propertyDocTree); + propertyDetailsTree.addContent(writer.getPropertyDoc( propertyDocTree, currentProperty == lastElement)); } @@ -158,20 +161,18 @@ public class PropertyBuilder extends AbstractMemberBuilder { /** * Build the signature. * - * @param node the XML element that specifies which components to document * @param propertyDocTree the content tree to which the documentation will be added */ - public void buildSignature(XMLNode node, Content propertyDocTree) { + protected void buildSignature(Content propertyDocTree) { propertyDocTree.addContent(writer.getSignature(currentProperty)); } /** * Build the deprecation information. * - * @param node the XML element that specifies which components to document * @param propertyDocTree the content tree to which the documentation will be added */ - public void buildDeprecationInfo(XMLNode node, Content propertyDocTree) { + protected void buildDeprecationInfo(Content propertyDocTree) { writer.addDeprecated(currentProperty, propertyDocTree); } @@ -179,10 +180,9 @@ public class PropertyBuilder extends AbstractMemberBuilder { * Build the comments for the property. Do nothing if * {@link BaseConfiguration#nocomment} is set to true. * - * @param node the XML element that specifies which components to document * @param propertyDocTree the content tree to which the documentation will be added */ - public void buildPropertyComments(XMLNode node, Content propertyDocTree) { + protected void buildPropertyComments(Content propertyDocTree) { if (!configuration.nocomment) { writer.addComments(currentProperty, propertyDocTree); } @@ -191,10 +191,9 @@ public class PropertyBuilder extends AbstractMemberBuilder { /** * Build the tag information. * - * @param node the XML element that specifies which components to document * @param propertyDocTree the content tree to which the documentation will be added */ - public void buildTagInfo(XMLNode node, Content propertyDocTree) { + protected void buildTagInfo(Content propertyDocTree) { writer.addTags(currentProperty, propertyDocTree); } diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java index b19f7e665e5..042ac2bd52f 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +25,10 @@ package jdk.javadoc.internal.doclets.toolkit.builders; -import java.util.*; + +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; @@ -54,11 +57,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.Utils; */ public class SerializedFormBuilder extends AbstractBuilder { - /** - * The root element of the serialized form XML is {@value}. - */ - public static final String NAME = "SerializedForm"; - /** * The writer for this builder. */ @@ -139,28 +137,21 @@ public class SerializedFormBuilder extends AbstractBuilder { //Doclet does not support this output. return; } - build(layoutParser.parseXML(NAME), contentTree); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return NAME; + buildSerializedForm(contentTree); } /** * Build the serialized form. * - * @param node the XML element that specifies which components to document * @param serializedTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildSerializedForm(XMLNode node, Content serializedTree) throws DocletException { + protected void buildSerializedForm(Content serializedTree) throws DocletException { serializedTree = writer.getHeader(configuration.getText( "doclet.Serialized_Form")); - buildChildren(node, serializedTree); + + buildSerializedFormSummaries(serializedTree); + writer.addFooter(serializedTree); writer.printDocument(serializedTree); } @@ -168,16 +159,16 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the serialized form summaries. * - * @param node the XML element that specifies which components to document * @param serializedTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) + protected void buildSerializedFormSummaries(Content serializedTree) throws DocletException { Content serializedSummariesTree = writer.getSerializedSummariesHeader(); for (PackageElement pkg : configuration.packages) { currentPackage = pkg; - buildChildren(node, serializedSummariesTree); + + buildPackageSerializedForm(serializedSummariesTree); } serializedTree.addContent(writer.getSerializedContent( serializedSummariesTree)); @@ -186,11 +177,10 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the package serialized form for the current package being processed. * - * @param node the XML element that specifies which components to document * @param serializedSummariesTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) throws DocletException { + protected void buildPackageSerializedForm(Content serializedSummariesTree) throws DocletException { Content packageSerializedTree = writer.getPackageSerializedHeader(); SortedSet classes = utils.getAllClassesUnfiltered(currentPackage); if (classes.isEmpty()) { @@ -202,17 +192,19 @@ public class SerializedFormBuilder extends AbstractBuilder { if (!serialClassFoundToDocument(classes)) { return; } - buildChildren(node, packageSerializedTree); + + buildPackageHeader(packageSerializedTree); + buildClassSerializedForm(packageSerializedTree); + writer.addPackageSerializedTree(serializedSummariesTree, packageSerializedTree); } /** * Build the package header. * - * @param node the XML element that specifies which components to document * @param packageSerializedTree content tree to which the documentation will be added */ - public void buildPackageHeader(XMLNode node, Content packageSerializedTree) { + protected void buildPackageHeader(Content packageSerializedTree) { packageSerializedTree.addContent(writer.getPackageHeader( utils.getPackageName(currentPackage))); } @@ -220,11 +212,10 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the class serialized form. * - * @param node the XML element that specifies which components to document * @param packageSerializedTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildClassSerializedForm(XMLNode node, Content packageSerializedTree) + protected void buildClassSerializedForm(Content packageSerializedTree) throws DocletException { Content classSerializedTree = writer.getClassSerializedHeader(); SortedSet typeElements = utils.getAllClassesUnfiltered(currentPackage); @@ -237,7 +228,10 @@ public class SerializedFormBuilder extends AbstractBuilder { continue; } Content classTree = writer.getClassHeader(currentTypeElement); - buildChildren(node, classTree); + + buildSerialUIDInfo(classTree); + buildClassContent(classTree); + classSerializedTree.addContent(classTree); } } @@ -247,10 +241,9 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the serial UID information for the given class. * - * @param node the XML element that specifies which components to document * @param classTree content tree to which the serial UID information will be added */ - public void buildSerialUIDInfo(XMLNode node, Content classTree) { + protected void buildSerialUIDInfo(Content classTree) { Content serialUidTree = writer.getSerialUIDInfoHeader(); for (Element e : utils.getFieldsUnfiltered(currentTypeElement)) { VariableElement field = (VariableElement)e; @@ -267,25 +260,26 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the summaries for the methods and fields. * - * @param node the XML element that specifies which components to document * @param classTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildClassContent(XMLNode node, Content classTree) throws DocletException { + protected void buildClassContent(Content classTree) throws DocletException { Content classContentTree = writer.getClassContentHeader(); - buildChildren(node, classContentTree); + + buildSerializableMethods(classContentTree); + buildFieldHeader(classContentTree); + buildSerializableFields(classContentTree); + classTree.addContent(classContentTree); } /** - * Build the summaries for the methods that belong to the given - * class. + * Build the summaries for the methods that belong to the given class. * - * @param node the XML element that specifies which components to document * @param classContentTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildSerializableMethods(XMLNode node, Content classContentTree) throws DocletException { + protected void buildSerializableMethods(Content classContentTree) throws DocletException { Content serializableMethodTree = methodWriter.getSerializableMethodsHeader(); SortedSet members = utils.serializationMethods(currentTypeElement); if (!members.isEmpty()) { @@ -293,7 +287,11 @@ public class SerializedFormBuilder extends AbstractBuilder { currentMember = member; Content methodsContentTree = methodWriter.getMethodsContentHeader( currentMember == members.last()); - buildChildren(node, methodsContentTree); + + buildMethodSubHeader(methodsContentTree); + buildDeprecatedMethodInfo(methodsContentTree); + buildMethodInfo(methodsContentTree); + serializableMethodTree.addContent(methodsContentTree); } } @@ -316,54 +314,51 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the method sub header. * - * @param node the XML element that specifies which components to document * @param methodsContentTree content tree to which the documentation will be added */ - public void buildMethodSubHeader(XMLNode node, Content methodsContentTree) { + protected void buildMethodSubHeader(Content methodsContentTree) { methodWriter.addMemberHeader((ExecutableElement)currentMember, methodsContentTree); } /** * Build the deprecated method description. * - * @param node the XML element that specifies which components to document * @param methodsContentTree content tree to which the documentation will be added */ - public void buildDeprecatedMethodInfo(XMLNode node, Content methodsContentTree) { + protected void buildDeprecatedMethodInfo(Content methodsContentTree) { methodWriter.addDeprecatedMemberInfo((ExecutableElement)currentMember, methodsContentTree); } /** * Build the information for the method. * - * @param node the XML element that specifies which components to document * @param methodsContentTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildMethodInfo(XMLNode node, Content methodsContentTree) throws DocletException { - if(configuration.nocomment){ + protected void buildMethodInfo(Content methodsContentTree) throws DocletException { + if (configuration.nocomment) { return; } - buildChildren(node, methodsContentTree); + + buildMethodDescription(methodsContentTree); + buildMethodTags(methodsContentTree); } /** * Build method description. * - * @param node the XML element that specifies which components to document * @param methodsContentTree content tree to which the documentation will be added */ - public void buildMethodDescription(XMLNode node, Content methodsContentTree) { + protected void buildMethodDescription(Content methodsContentTree) { methodWriter.addMemberDescription((ExecutableElement)currentMember, methodsContentTree); } /** * Build the method tags. * - * @param node the XML element that specifies which components to document * @param methodsContentTree content tree to which the documentation will be added */ - public void buildMethodTags(XMLNode node, Content methodsContentTree) { + protected void buildMethodTags(Content methodsContentTree) { methodWriter.addMemberTags((ExecutableElement)currentMember, methodsContentTree); ExecutableElement method = (ExecutableElement)currentMember; if (method.getSimpleName().toString().compareTo("writeExternal") == 0 @@ -380,10 +375,9 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the field header. * - * @param node the XML element that specifies which components to document * @param classContentTree content tree to which the documentation will be added */ - public void buildFieldHeader(XMLNode node, Content classContentTree) { + protected void buildFieldHeader(Content classContentTree) { if (!utils.serializableFields(currentTypeElement).isEmpty()) { buildFieldSerializationOverview(currentTypeElement, classContentTree); } @@ -419,11 +413,10 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the summaries for the fields that belong to the given class. * - * @param node the XML element that specifies which components to document * @param classContentTree content tree to which the documentation will be added * @throws DocletException if there is a problem while building the documentation */ - public void buildSerializableFields(XMLNode node, Content classContentTree) + protected void buildSerializableFields(Content classContentTree) throws DocletException { SortedSet members = utils.serializableFields(currentTypeElement); if (!members.isEmpty()) { @@ -433,7 +426,11 @@ public class SerializedFormBuilder extends AbstractBuilder { if (!utils.definesSerializableFields(currentTypeElement)) { Content fieldsContentTree = fieldWriter.getFieldsContentHeader( currentMember == members.last()); - buildChildren(node, fieldsContentTree); + + buildFieldSubHeader(fieldsContentTree); + buildFieldDeprecationInfo(fieldsContentTree); + buildFieldInfo(fieldsContentTree); + serializableFieldsTree.addContent(fieldsContentTree); } else { buildSerialFieldTagsInfo(serializableFieldsTree); @@ -448,10 +445,9 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the field sub header. * - * @param node the XML element that specifies which components to document * @param fieldsContentTree content tree to which the documentation will be added */ - public void buildFieldSubHeader(XMLNode node, Content fieldsContentTree) { + protected void buildFieldSubHeader(Content fieldsContentTree) { if (!utils.definesSerializableFields(currentTypeElement)) { VariableElement field = (VariableElement) currentMember; fieldWriter.addMemberHeader(utils.asTypeElement(field.asType()), @@ -464,10 +460,9 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the field deprecation information. * - * @param node the XML element that specifies which components to document * @param fieldsContentTree content tree to which the documentation will be added */ - public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) { + protected void buildFieldDeprecationInfo(Content fieldsContentTree) { if (!utils.definesSerializableFields(currentTypeElement)) { fieldWriter.addMemberDeprecatedInfo((VariableElement)currentMember, fieldsContentTree); @@ -479,8 +474,8 @@ public class SerializedFormBuilder extends AbstractBuilder { * * @param serializableFieldsTree content tree to which the documentation will be added */ - public void buildSerialFieldTagsInfo(Content serializableFieldsTree) { - if(configuration.nocomment){ + protected void buildSerialFieldTagsInfo(Content serializableFieldsTree) { + if (configuration.nocomment) { return; } VariableElement field = (VariableElement)currentMember; @@ -524,17 +519,16 @@ public class SerializedFormBuilder extends AbstractBuilder { /** * Build the field information. * - * @param node the XML element that specifies which components to document * @param fieldsContentTree content tree to which the documentation will be added */ - public void buildFieldInfo(XMLNode node, Content fieldsContentTree) { - if(configuration.nocomment){ + protected void buildFieldInfo(Content fieldsContentTree) { + if (configuration.nocomment) { return; } VariableElement field = (VariableElement)currentMember; TypeElement te = utils.getEnclosingTypeElement(currentMember); // Process default Serializable field. - if ((utils.getSerialTrees(field).isEmpty()) /*&& ! field.isSynthetic()*/ + if ((utils.getSerialTrees(field).isEmpty()) /*&& !field.isSynthetic()*/ && configuration.serialwarn) { messages.warning(field, "doclet.MissingSerialTag", utils.getFullyQualifiedName(te), diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/XMLNode.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/XMLNode.java deleted file mode 100644 index ae21e7e2c02..00000000000 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/XMLNode.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. - * 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 jdk.javadoc.internal.doclets.toolkit.builders; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Simple class to represent the attribute and elements of an XML node. - * - * This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -public class XMLNode { - XMLNode(XMLNode parent, String qname) { - this.parent = parent; - name = qname; - attrs = new HashMap<>(); - children = new ArrayList<>(); - - if (parent != null) - parent.children.add(this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("<"); - sb.append(name); - for (Map.Entry
e: attrs.entrySet()) - sb.append(" " + e.getKey() + "=\"" + e.getValue() + "\""); - if (children.size() == 0) - sb.append("/>"); - else { - sb.append(">"); - for (XMLNode c: children) - sb.append(c.toString()); - sb.append("" + name + ">"); - } - return sb.toString(); - } - - final XMLNode parent; - final String name; - final Map attrs; - final List children; -} diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml deleted file mode 100644 index 3148605db46..00000000000 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties index c100ad7e435..7b8b657c5b5 100644 --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties @@ -14,9 +14,6 @@ doclet.Option_reuse=Option reused: {0} doclet.Option_doclint_no_qualifiers=Access qualifiers not permitted for -Xdoclint arguments doclet.Option_doclint_invalid_arg=Invalid argument for -Xdoclint option doclet.Option_doclint_package_invalid_arg=Invalid argument for -Xdoclint/package option -doclet.builder.exception.in.component=An exception occurred while building a component: {0}\n\ -\t({1}) -doclet.builder.unknown.component=Unknown component referenced in doclet build file: {0} doclet.error.initializing.dest.dir=Error initializing destination directory: {0} doclet.exception.read.file=Error reading file: {0}\n\ \t({1}) From 08148506c22179c83fcac9ec21bf7498bf845794 Mon Sep 17 00:00:00 2001 From: Robert Field- - -- -- - - -- - - - - -- -- - - -- - - - - - - - -- -- - - - - -- - - - -- -- -- - - - - -- -- - - - - -- -- - - - - - - -- - -- - - - - - - - - - - - - -- - - - - - - -- -- -- - - - - -- -- - - - -- -- - - - - -- -- - - - - -- -- - - - - - -- - -- - -- - -- -- -- - -- - -- -- - - -- - - - -- - - Date: Fri, 16 Jun 2017 10:32:46 -0700 Subject: [PATCH 071/130] 8180510: jshell tool: crash on entering pseudo-commands: / or /- Reviewed-by: jlahoda --- .../classes/jdk/internal/jshell/tool/JShellTool.java | 4 ++++ langtools/test/jdk/jshell/ToolSimpleTest.java | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java index c58ba51b883..1388e5e7480 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -1706,9 +1706,13 @@ public class JShellTool implements MessageHandler { // Documentation pseudo-commands registerCommand(new Command("/ ", "help.id", + arg -> cmdHelp("rerun"), + EMPTY_COMPLETION_PROVIDER, CommandKind.HELP_ONLY)); registerCommand(new Command("/- ", "help.previous", + arg -> cmdHelp("rerun"), + EMPTY_COMPLETION_PROVIDER, CommandKind.HELP_ONLY)); registerCommand(new Command("intro", "help.intro", diff --git a/langtools/test/jdk/jshell/ToolSimpleTest.java b/langtools/test/jdk/jshell/ToolSimpleTest.java index 647d0fdafcc..56fd594273b 100644 --- a/langtools/test/jdk/jshell/ToolSimpleTest.java +++ b/langtools/test/jdk/jshell/ToolSimpleTest.java @@ -388,6 +388,14 @@ public class ToolSimpleTest extends ReplToolTesting { ); } + @Test + public void testConfusedUserPseudoCommands() { + test( + (a) -> assertHelp(a, "/- ", "last snippet", "digits"), + (a) -> assertHelp(a, "/ ", "last snippet", "digits") + ); + } + private void assertHelp(boolean a, String command, String... find) { assertCommandCheckOutput(a, command, s -> { for (String f : find) { From d18eaf57ca3af00431de286bd0c23171f1a58596 Mon Sep 17 00:00:00 2001 From: Lana Steuck Date: Sat, 17 Jun 2017 00:15:44 +0000 Subject: [PATCH 072/130] Added tag jdk-10+12 for changeset ea7475564d07 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index ce63bf3d479..bca34185301 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -429,3 +429,4 @@ aae59039c1f5701ae933c5eed30e75d6e3afaeee jdk-9+171 daa70bfed35ecf0575884c954dc95135e0f94b29 jdk-10+11 123eb0956a459bca29d0812c62fca50da563ee40 jdk-9+173 50c077995aa249890ece698a2a2db4c4fba90e10 jdk-9+174 +2bd34895dda246cff9e713401f3544260dfbe80f jdk-10+12 From 6c04ae3d71382a3baf522b4824c42af40ad36f06 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Mon, 12 Jun 2017 12:25:40 -0700 Subject: [PATCH 073/130] 8144185: javac produces incorrect RuntimeInvisibleTypeAnnotations length attribute Reviewed-by: sadayapalam --- .../sun/tools/javac/comp/LambdaToMethod.java | 18 +++- .../TypeAnnotationPropagationTest.java | 102 ++++++++++++++++++ 2 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 langtools/test/tools/javac/annotations/typeAnnotations/classfile/TypeAnnotationPropagationTest.java diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java index 6cf779f629b..ae12103cf70 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java @@ -2056,7 +2056,7 @@ public class LambdaToMethod extends TreeTranslator { Assert.error(skind.name()); throw new AssertionError(); } - if (ret != sym) { + if (ret != sym && skind.propagateAnnotations()) { ret.setDeclarationAttributes(sym.getRawAttributes()); ret.setTypeAttributes(sym.getRawTypeAttributes()); } @@ -2092,7 +2092,6 @@ public class LambdaToMethod extends TreeTranslator { if (m.containsKey(lambdaIdent.sym)) { Symbol tSym = m.get(lambdaIdent.sym); JCTree t = make.Ident(tSym).setType(lambdaIdent.type); - tSym.setTypeAttributes(lambdaIdent.sym.getRawTypeAttributes()); return t; } break; @@ -2101,7 +2100,6 @@ public class LambdaToMethod extends TreeTranslator { // Transform outer instance variable references anchoring them to the captured synthetic. Symbol tSym = m.get(lambdaIdent.sym.owner); JCExpression t = make.Ident(tSym).setType(lambdaIdent.sym.owner.type); - tSym.setTypeAttributes(lambdaIdent.sym.owner.getRawTypeAttributes()); t = make.Select(t, lambdaIdent.name); t.setType(lambdaIdent.type); TreeInfo.setSymbol(t, lambdaIdent.sym); @@ -2122,7 +2120,6 @@ public class LambdaToMethod extends TreeTranslator { if (m.containsKey(fieldAccess.sym.owner)) { Symbol tSym = m.get(fieldAccess.sym.owner); JCExpression t = make.Ident(tSym).setType(fieldAccess.sym.owner.type); - tSym.setTypeAttributes(fieldAccess.sym.owner.getRawTypeAttributes()); return t; } return null; @@ -2322,7 +2319,18 @@ public class LambdaToMethod extends TreeTranslator { CAPTURED_VAR, // variables in enclosing scope to translated synthetic parameters CAPTURED_THIS, // class symbols to translated synthetic parameters (for captured member access) CAPTURED_OUTER_THIS, // used when `this' capture is illegal, but outer this capture is legit (JDK-8129740) - TYPE_VAR // original to translated lambda type variables + TYPE_VAR; // original to translated lambda type variables + + boolean propagateAnnotations() { + switch (this) { + case CAPTURED_VAR: + case CAPTURED_THIS: + case CAPTURED_OUTER_THIS: + return false; + default: + return true; + } + } } /** diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TypeAnnotationPropagationTest.java b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TypeAnnotationPropagationTest.java new file mode 100644 index 00000000000..d58e55111d2 --- /dev/null +++ b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TypeAnnotationPropagationTest.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2017, Google Inc. All rights reserved. + * 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 8144185 + * @summary javac produces incorrect RuntimeInvisibleTypeAnnotations length attribute + * @modules jdk.jdeps/com.sun.tools.classfile + */ + +import static java.lang.annotation.ElementType.TYPE_USE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.Code_attribute; +import com.sun.tools.classfile.Method; +import com.sun.tools.classfile.RuntimeVisibleTypeAnnotations_attribute; +import com.sun.tools.classfile.TypeAnnotation; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import java.util.Arrays; +import java.util.Objects; + +public class TypeAnnotationPropagationTest extends ClassfileTestHelper { + public static void main(String[] args) throws Exception { + new TypeAnnotationPropagationTest().run(); + } + + public void run() throws Exception { + ClassFile cf = getClassFile("TypeAnnotationPropagationTest$Test.class"); + + Method f = null; + for (Method m : cf.methods) { + if (m.getName(cf.constant_pool).contains("f")) { + f = m; + break; + } + } + + int idx = f.attributes.getIndex(cf.constant_pool, Attribute.Code); + Code_attribute cattr = (Code_attribute) f.attributes.get(idx); + idx = cattr.attributes.getIndex(cf.constant_pool, Attribute.RuntimeVisibleTypeAnnotations); + RuntimeVisibleTypeAnnotations_attribute attr = + (RuntimeVisibleTypeAnnotations_attribute) cattr.attributes.get(idx); + + TypeAnnotation anno = attr.annotations[0]; + assertEquals(anno.position.lvarOffset, new int[] {3}, "start_pc"); + assertEquals(anno.position.lvarLength, new int[] {8}, "length"); + assertEquals(anno.position.lvarIndex, new int[] {1}, "index"); + } + + void assertEquals(int[] actual, int[] expected, String message) { + if (!Arrays.equals(actual, expected)) { + throw new AssertionError( + String.format( + "actual: %s, expected: %s, %s", + Arrays.toString(actual), Arrays.toString(expected), message)); + } + } + + /** ********************* Test class ************************ */ + static class Test { + void f() { + @A String s = ""; + Runnable r = + () -> { + Objects.requireNonNull(s); + Objects.requireNonNull(s); + Objects.requireNonNull(s); + Objects.requireNonNull(s); + Objects.requireNonNull(s); + Objects.requireNonNull(s); + }; + } + + @Retention(RUNTIME) + @Target(TYPE_USE) + @interface A {} + } +} + From d222800a8b07907aecb82bac72747f1f81890a4d Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Mon, 12 Jun 2017 12:39:26 -0700 Subject: [PATCH 074/130] 8181820: jdk/test/lib/Platform should not depend on jdk/test/lib/Utils Reviewed-by: alanb, chegar --- test/lib/jdk/test/lib/Platform.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java index 26bbf1bae94..75720134be6 100644 --- a/test/lib/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -23,6 +23,10 @@ package jdk.test.lib; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.regex.Pattern; public class Platform { @@ -228,7 +232,7 @@ public class Platform { public static boolean canPtraceAttachLinux() throws Exception { // SELinux deny_ptrace: - String deny_ptrace = Utils.fileAsString("/sys/fs/selinux/booleans/deny_ptrace"); + String deny_ptrace = fileAsString("/sys/fs/selinux/booleans/deny_ptrace"); if (deny_ptrace != null && deny_ptrace.contains("1")) { // ptrace will be denied: return false; @@ -239,7 +243,7 @@ public class Platform { // 1 - restricted ptrace: a process must be a children of the inferior or user is root // 2 - only processes with CAP_SYS_PTRACE may use ptrace or user is root // 3 - no attach: no processes may use ptrace with PTRACE_ATTACH - String ptrace_scope = Utils.fileAsString("/proc/sys/kernel/yama/ptrace_scope"); + String ptrace_scope = fileAsString("/proc/sys/kernel/yama/ptrace_scope"); if (ptrace_scope != null) { if (ptrace_scope.startsWith("3")) { return false; @@ -265,4 +269,10 @@ public class Platform { .matcher(osArch) .matches(); } + + private static String fileAsString(String filename) throws IOException { + Path filePath = Paths.get(filename); + if (!Files.exists(filePath)) return null; + return new String(Files.readAllBytes(filePath)); + } } From 1d0a99f1c350f6893769c0761f0bfe4e9dbae435 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Mon, 12 Jun 2017 12:40:43 -0700 Subject: [PATCH 075/130] 8181759: add explicit @build actions for jdk.test.lib classes in all :tier1 tests Reviewed-by: alanb --- jdk/test/java/lang/Class/forName/modules/TestDriver.java | 5 ++++- jdk/test/java/lang/Double/ParseHexFloatingPoint.java | 1 + jdk/test/java/lang/Integer/BitTwiddle.java | 1 + jdk/test/java/lang/Long/BitTwiddle.java | 1 + jdk/test/java/lang/Math/CubeRootTests.java | 1 + jdk/test/java/lang/Math/HypotTests.java | 1 + jdk/test/java/lang/Math/IeeeRecommendedTests.java | 1 + jdk/test/java/lang/Math/Log1pTests.java | 1 + jdk/test/java/lang/Math/MultiplicationTests.java | 1 + jdk/test/java/lang/ProcessHandle/Basic.java | 6 ++++++ jdk/test/java/lang/ProcessHandle/InfoTest.java | 7 ++++++- jdk/test/java/lang/ProcessHandle/OnExitTest.java | 7 ++++++- jdk/test/java/lang/ProcessHandle/TreeTest.java | 5 +++++ .../java/lang/StackTraceElement/WithClassLoaderName.java | 3 ++- jdk/test/java/lang/StackWalker/StackWalkTest.java | 1 + jdk/test/java/lang/StrictMath/CubeRootTests.java | 1 + jdk/test/java/lang/StrictMath/ExpTests.java | 1 + jdk/test/java/lang/StrictMath/HypotTests.java | 1 + .../java/lang/String/CompactString/SerializationTest.java | 1 + jdk/test/java/lang/String/LiteralReplace.java | 1 + .../StringBuffer/CompactStringBufferSerialization.java | 1 + .../StringBuilder/CompactStringBuilderSerialization.java | 1 + jdk/test/java/lang/Thread/ThreadStateTest.java | 1 + .../lang/invoke/LFCaching/LFGarbageCollectedTest.java | 1 + .../lang/invoke/LFCaching/LFMultiThreadCachingTest.java | 1 + .../lang/invoke/LFCaching/LFSingleThreadCachingTest.java | 1 + .../lang/invoke/MethodHandles/CatchExceptionTest.java | 1 + jdk/test/java/lang/ref/CleanerTest.java | 7 ++++++- jdk/test/java/math/BigDecimal/StringConstructor.java | 1 + jdk/test/java/math/BigInteger/BigIntegerTest.java | 1 + jdk/test/java/math/BigInteger/ModPow65537.java | 1 + jdk/test/java/math/BigInteger/PrimeTest.java | 1 + .../java/nio/Buffer/LimitDirectMemoryNegativeTest.java | 6 ++++++ jdk/test/java/util/Base64/TestBase64.java | 1 + jdk/test/java/util/List/SubList.java | 1 + jdk/test/java/util/WeakHashMap/GCDuringIteration.java | 1 + .../util/concurrent/ThreadPoolExecutor/ConfigChanges.java | 1 + .../java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java | 3 ++- jdk/test/java/util/logging/FileHandlerMaxLocksTest.java | 2 ++ jdk/test/java/util/regex/RegExTest.java | 1 + .../java/util/zip/InflaterInputStream/TestAvailable.java | 1 + jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java | 2 ++ jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java | 3 +++ jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java | 2 ++ jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java | 8 ++++++-- jdk/test/jdk/internal/util/jar/TestVersionedStream.java | 2 ++ jdk/test/jdk/modules/incubator/ImageModules.java | 4 +++- jdk/test/sun/misc/SunMiscSignalTest.java | 7 ++++++- 48 files changed, 100 insertions(+), 10 deletions(-) diff --git a/jdk/test/java/lang/Class/forName/modules/TestDriver.java b/jdk/test/java/lang/Class/forName/modules/TestDriver.java index db5323cabd0..ad14b3969c8 100644 --- a/jdk/test/java/lang/Class/forName/modules/TestDriver.java +++ b/jdk/test/java/lang/Class/forName/modules/TestDriver.java @@ -43,7 +43,10 @@ import static org.testng.Assert.assertTrue; * @summary Tests for Class.forName(Module,String) * @library /lib/testlibrary /test/lib * @modules jdk.compiler - * @build jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.ProcessTools + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * jdk.test.lib.compiler.CompilerUtils + * jdk.testlibrary.ProcessTools * TestDriver TestMain TestLayer * @run testng TestDriver */ diff --git a/jdk/test/java/lang/Double/ParseHexFloatingPoint.java b/jdk/test/java/lang/Double/ParseHexFloatingPoint.java index 39f8f750e18..a26a8b7a756 100644 --- a/jdk/test/java/lang/Double/ParseHexFloatingPoint.java +++ b/jdk/test/java/lang/Double/ParseHexFloatingPoint.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main ParseHexFloatingPoint * @bug 4826774 8078672 * @summary Numerical tests for hexadecimal inputs to parse{Double, Float} (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Integer/BitTwiddle.java b/jdk/test/java/lang/Integer/BitTwiddle.java index 9fc710c513e..efa8c411331 100644 --- a/jdk/test/java/lang/Integer/BitTwiddle.java +++ b/jdk/test/java/lang/Integer/BitTwiddle.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main BitTwiddle * @bug 4495754 8078672 * @summary Basic test for int bit twiddling (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Long/BitTwiddle.java b/jdk/test/java/lang/Long/BitTwiddle.java index 52925458420..7502d40aff3 100644 --- a/jdk/test/java/lang/Long/BitTwiddle.java +++ b/jdk/test/java/lang/Long/BitTwiddle.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main BitTwiddle * @bug 4495754 8078672 * @summary Basic test for long bit twiddling (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Math/CubeRootTests.java b/jdk/test/java/lang/Math/CubeRootTests.java index 7dd4a18b81c..53ef270377f 100644 --- a/jdk/test/java/lang/Math/CubeRootTests.java +++ b/jdk/test/java/lang/Math/CubeRootTests.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main CubeRootTests * @bug 4347132 4939441 8078672 * @summary Tests for {Math, StrictMath}.cbrt (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Math/HypotTests.java b/jdk/test/java/lang/Math/HypotTests.java index a55549f12f1..0f31a8881f8 100644 --- a/jdk/test/java/lang/Math/HypotTests.java +++ b/jdk/test/java/lang/Math/HypotTests.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main HypotTests * @bug 4851638 4939441 8078672 * @summary Tests for {Math, StrictMath}.hypot (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Math/IeeeRecommendedTests.java b/jdk/test/java/lang/Math/IeeeRecommendedTests.java index 8315fa74ba1..830b16d765a 100644 --- a/jdk/test/java/lang/Math/IeeeRecommendedTests.java +++ b/jdk/test/java/lang/Math/IeeeRecommendedTests.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main IeeeRecommendedTests * @bug 4860891 4826732 4780454 4939441 4826652 8078672 * @summary Tests for IEEE 754[R] recommended functions and similar methods (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Math/Log1pTests.java b/jdk/test/java/lang/Math/Log1pTests.java index b1dde3ab965..021a651ed18 100644 --- a/jdk/test/java/lang/Math/Log1pTests.java +++ b/jdk/test/java/lang/Math/Log1pTests.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main Log1pTests * @bug 4851638 4939441 8078672 * @summary Tests for {Math, StrictMath}.log1p (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/Math/MultiplicationTests.java b/jdk/test/java/lang/Math/MultiplicationTests.java index 1bc29d092ef..4fbb787e083 100644 --- a/jdk/test/java/lang/Math/MultiplicationTests.java +++ b/jdk/test/java/lang/Math/MultiplicationTests.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main MultiplicationTests * @bug 5100935 * @summary Tests for multiplication methods (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/lang/ProcessHandle/Basic.java b/jdk/test/java/lang/ProcessHandle/Basic.java index 34e1021a340..09674814283 100644 --- a/jdk/test/java/lang/ProcessHandle/Basic.java +++ b/jdk/test/java/lang/ProcessHandle/Basic.java @@ -39,6 +39,12 @@ import org.testng.annotations.Test; * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.management + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng Basic * @summary Basic tests for ProcessHandler * @author Roger Riggs diff --git a/jdk/test/java/lang/ProcessHandle/InfoTest.java b/jdk/test/java/lang/ProcessHandle/InfoTest.java index fbd855db91d..8f6201ff6bf 100644 --- a/jdk/test/java/lang/ProcessHandle/InfoTest.java +++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java @@ -51,7 +51,12 @@ import org.testng.annotations.Test; * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.management - * @build jdk.test.lib.Platform jdk.test.lib.Utils + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng InfoTest * @summary Functions of ProcessHandle.Info * @author Roger Riggs diff --git a/jdk/test/java/lang/ProcessHandle/OnExitTest.java b/jdk/test/java/lang/ProcessHandle/OnExitTest.java index 9bdc566fcb1..444143782e9 100644 --- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java +++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java @@ -43,7 +43,12 @@ import org.testng.TestNG; * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.management - * @build jdk.test.lib.Platform jdk.test.lib.Utils + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng OnExitTest * @summary Functions of Process.onExit and ProcessHandle.onExit * @author Roger Riggs diff --git a/jdk/test/java/lang/ProcessHandle/TreeTest.java b/jdk/test/java/lang/ProcessHandle/TreeTest.java index 8e3580a4a84..854734c1c86 100644 --- a/jdk/test/java/lang/ProcessHandle/TreeTest.java +++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java @@ -48,6 +48,11 @@ import org.testng.annotations.Test; * @modules java.base/jdk.internal.misc * jdk.management * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng/othervm TreeTest * @summary Test counting and JavaChild.spawning and counting of Processes. * @author Roger Riggs diff --git a/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java b/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java index f723b972561..58572496295 100644 --- a/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java +++ b/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java @@ -27,7 +27,8 @@ * @summary Basic test StackTraceElement with class loader names * @library lib /lib/testlibrary /test/lib * @modules jdk.compiler - * @build m1/* WithClassLoaderName + * @build jdk.test.lib.compiler.CompilerUtils + * m1/* WithClassLoaderName * @run main/othervm m1/com.app.Main * @run main/othervm WithClassLoaderName */ diff --git a/jdk/test/java/lang/StackWalker/StackWalkTest.java b/jdk/test/java/lang/StackWalker/StackWalkTest.java index 9d4dd991e65..ad7a2c463ec 100644 --- a/jdk/test/java/lang/StackWalker/StackWalkTest.java +++ b/jdk/test/java/lang/StackWalker/StackWalkTest.java @@ -38,6 +38,7 @@ import jdk.test.lib.RandomFactory; * @bug 8140450 * @summary Stack Walk Test (use -Dseed=X to set PRNG seed) * @library /test/lib + * @build jdk.test.lib.RandomFactory * @compile StackRecorderUtil.java * @run main/othervm StackWalkTest * @run main/othervm/java.security.policy=stackwalktest.policy StackWalkTest diff --git a/jdk/test/java/lang/StrictMath/CubeRootTests.java b/jdk/test/java/lang/StrictMath/CubeRootTests.java index 094150010a0..f4a3978075d 100644 --- a/jdk/test/java/lang/StrictMath/CubeRootTests.java +++ b/jdk/test/java/lang/StrictMath/CubeRootTests.java @@ -26,6 +26,7 @@ * @bug 4347132 8136799 * @key randomness * @library /test/lib + * @build jdk.test.lib.RandomFactory * @build Tests * @build FdlibmTranslit * @build CubeRootTests diff --git a/jdk/test/java/lang/StrictMath/ExpTests.java b/jdk/test/java/lang/StrictMath/ExpTests.java index ec463f2cbee..9c4b9b20801 100644 --- a/jdk/test/java/lang/StrictMath/ExpTests.java +++ b/jdk/test/java/lang/StrictMath/ExpTests.java @@ -26,6 +26,7 @@ * @bug 8139688 * @key randomness * @library /test/lib + * @build jdk.test.lib.RandomFactory * @build Tests * @build FdlibmTranslit * @build ExpTests diff --git a/jdk/test/java/lang/StrictMath/HypotTests.java b/jdk/test/java/lang/StrictMath/HypotTests.java index 6fa4cdeafca..0b1dd41691f 100644 --- a/jdk/test/java/lang/StrictMath/HypotTests.java +++ b/jdk/test/java/lang/StrictMath/HypotTests.java @@ -27,6 +27,7 @@ * @key randomness * @summary Tests for StrictMath.hypot * @library /test/lib + * @build jdk.test.lib.RandomFactory * @build Tests * @build FdlibmTranslit * @build HypotTests diff --git a/jdk/test/java/lang/String/CompactString/SerializationTest.java b/jdk/test/java/lang/String/CompactString/SerializationTest.java index 94fa9aadabf..3ef08924233 100644 --- a/jdk/test/java/lang/String/CompactString/SerializationTest.java +++ b/jdk/test/java/lang/String/CompactString/SerializationTest.java @@ -31,6 +31,7 @@ import static org.testng.Assert.assertEquals; * @test * @bug 8077559 * @library /test/lib + * @build jdk.test.lib.util.SerializationUtils * @summary Tests Compact String. This one is testing String serialization * among -XX:+CompactStrings/-XX:-CompactStrings/LegacyString * @run testng/othervm -XX:+CompactStrings SerializationTest diff --git a/jdk/test/java/lang/String/LiteralReplace.java b/jdk/test/java/lang/String/LiteralReplace.java index 4a3541986db..5e1638bcedf 100644 --- a/jdk/test/java/lang/String/LiteralReplace.java +++ b/jdk/test/java/lang/String/LiteralReplace.java @@ -24,6 +24,7 @@ /* @test * @bug 8058779 8054307 * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run testng LiteralReplace * @summary Basic tests of String.replace(CharSequence, CharSequence) * @key randomness diff --git a/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java b/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java index 3f721d52959..8e166a6b623 100644 --- a/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java +++ b/jdk/test/java/lang/StringBuffer/CompactStringBufferSerialization.java @@ -33,6 +33,7 @@ import static org.testng.Assert.*; * @test * @bug 8077559 * @library /test/lib + * @build jdk.test.lib.util.SerializationUtils * @summary Tests Compact String. This one is testing StringBuffer serialization * among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuffer * @run testng/othervm -XX:+CompactStrings CompactStringBufferSerialization diff --git a/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java b/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java index 6a66e2b9dd2..931c71fd5d6 100644 --- a/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java +++ b/jdk/test/java/lang/StringBuilder/CompactStringBuilderSerialization.java @@ -33,6 +33,7 @@ import static org.testng.Assert.*; * @test * @bug 8077559 * @library /test/lib + * @build jdk.test.lib.util.SerializationUtils * @summary Tests Compact String. This one is testing StringBuilder serialization * among -XX:+CompactStrings/-XX:-CompactStrings/LegacyStringBuilder * @run testng/othervm -XX:+CompactStrings CompactStringBuilderSerialization diff --git a/jdk/test/java/lang/Thread/ThreadStateTest.java b/jdk/test/java/lang/Thread/ThreadStateTest.java index 6509e391099..1377c550226 100644 --- a/jdk/test/java/lang/Thread/ThreadStateTest.java +++ b/jdk/test/java/lang/Thread/ThreadStateTest.java @@ -33,6 +33,7 @@ import static java.lang.Thread.State.*; * @library /lib/testlibrary * @library /test/lib * @build jdk.testlibrary.* + * @build jdk.test.lib.LockFreeLogger * @build ThreadStateTest ThreadStateController * @run main/othervm -Xmixed ThreadStateTest */ diff --git a/jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java b/jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java index de1c2de4ce8..91be7bdb253 100644 --- a/jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java +++ b/jdk/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java @@ -29,6 +29,7 @@ * @summary Test verifies that lambda forms are garbage collected * @author kshefov * @library /lib/testlibrary /java/lang/invoke/common + * @build jdk.test.lib.TimeLimitedRunner * @build TestMethods * @build LambdaFormTestCase * @build LFGarbageCollectedTest diff --git a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java index a3608f91705..bd9ace8ccbe 100644 --- a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java +++ b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java @@ -31,6 +31,7 @@ * @modules java.base/java.lang.invoke:open * java.base/java.lang.ref:open * java.management + * @build jdk.test.lib.TimeLimitedRunner * @build TestMethods * @build LambdaFormTestCase * @build LFCachingTestCase diff --git a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java index 828f85fa4fe..5427fba792e 100644 --- a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java +++ b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java @@ -31,6 +31,7 @@ * @modules java.base/java.lang.ref:open * java.base/java.lang.invoke:open * java.management + * @build jdk.test.lib.TimeLimitedRunner * @build TestMethods * @build LambdaFormTestCase * @build LFCachingTestCase diff --git a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java index e01235bd2d3..de2bec2c198 100644 --- a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java +++ b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java @@ -44,6 +44,7 @@ import java.util.function.Supplier; /* @test * @library /lib/testlibrary /java/lang/invoke/common /test/lib + * @build jdk.test.lib.TimeLimitedRunner * @compile CatchExceptionTest.java * @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest * @key intermittent randomness diff --git a/jdk/test/java/lang/ref/CleanerTest.java b/jdk/test/java/lang/ref/CleanerTest.java index c6778669f00..f7ab46f50d9 100644 --- a/jdk/test/java/lang/ref/CleanerTest.java +++ b/jdk/test/java/lang/ref/CleanerTest.java @@ -51,7 +51,12 @@ import org.testng.annotations.Test; * @test * @library /lib/testlibrary /test/lib * @build sun.hotspot.WhiteBox - * @build jdk.test.lib.Utils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @modules java.base/jdk.internal * java.base/jdk.internal.misc * java.base/jdk.internal.ref diff --git a/jdk/test/java/math/BigDecimal/StringConstructor.java b/jdk/test/java/math/BigDecimal/StringConstructor.java index df51b32574a..47ecf7085cc 100644 --- a/jdk/test/java/math/BigDecimal/StringConstructor.java +++ b/jdk/test/java/math/BigDecimal/StringConstructor.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main StringConstructor * @bug 4103117 4331084 4488017 4490929 6255285 6268365 8074460 8078672 * @summary Tests the BigDecimal string constructor (use -Dseed=X to set PRNG seed). diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java index 06c2da5b06e..8d043c57649 100644 --- a/jdk/test/java/math/BigInteger/BigIntegerTest.java +++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main BigIntegerTest * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946 4026465 8074460 8078672 8032027 * @summary tests methods in BigInteger (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/math/BigInteger/ModPow65537.java b/jdk/test/java/math/BigInteger/ModPow65537.java index d8acf648548..230336b94f5 100644 --- a/jdk/test/java/math/BigInteger/ModPow65537.java +++ b/jdk/test/java/math/BigInteger/ModPow65537.java @@ -24,6 +24,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main ModPow65537 * @bug 4891312 8074460 8078672 * @summary verify that modPow() not broken by the special case for 65537 (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/math/BigInteger/PrimeTest.java b/jdk/test/java/math/BigInteger/PrimeTest.java index bfac4c82dde..74b777239ca 100644 --- a/jdk/test/java/math/BigInteger/PrimeTest.java +++ b/jdk/test/java/math/BigInteger/PrimeTest.java @@ -26,6 +26,7 @@ /* * @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main PrimeTest * @bug 8026236 8074460 8078672 * @summary test primality verification methods in BigInteger (use -Dseed=X to set PRNG seed) diff --git a/jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java b/jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java index 136839bd539..af157136715 100644 --- a/jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java +++ b/jdk/test/java/nio/Buffer/LimitDirectMemoryNegativeTest.java @@ -28,6 +28,12 @@ * various bad values fail to launch the VM * @requires (os.arch == "x86_64") | (os.arch == "amd64") | (os.arch == "sparcv9") * @library /test/lib + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * * @run main LimitDirectMemoryNegativeTest foo * @run main LimitDirectMemoryNegativeTest 10kmt diff --git a/jdk/test/java/util/Base64/TestBase64.java b/jdk/test/java/util/Base64/TestBase64.java index b557965080e..0874e7fb40b 100644 --- a/jdk/test/java/util/Base64/TestBase64.java +++ b/jdk/test/java/util/Base64/TestBase64.java @@ -26,6 +26,7 @@ * 8014217 8025003 8026330 8028397 8129544 8165243 * @summary tests java.util.Base64 * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main TestBase64 * @key randomness */ diff --git a/jdk/test/java/util/List/SubList.java b/jdk/test/java/util/List/SubList.java index 29610fa33f5..0b2d02e4fe6 100644 --- a/jdk/test/java/util/List/SubList.java +++ b/jdk/test/java/util/List/SubList.java @@ -25,6 +25,7 @@ * @test * @bug 8079136 * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run testng SubList * @summary Basic functionality of sublists * @key randomness diff --git a/jdk/test/java/util/WeakHashMap/GCDuringIteration.java b/jdk/test/java/util/WeakHashMap/GCDuringIteration.java index 8c6c4eacda5..53df6e4f755 100644 --- a/jdk/test/java/util/WeakHashMap/GCDuringIteration.java +++ b/jdk/test/java/util/WeakHashMap/GCDuringIteration.java @@ -25,6 +25,7 @@ * @test * @bug 6499848 * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main GCDuringIteration * @summary Check that iterators work properly in the presence of * concurrent finalization and removal of elements. diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java index 9b52728e56a..73969d46720 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java @@ -26,6 +26,7 @@ * @bug 6450200 * @summary Test proper handling of pool state changes * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main/othervm ConfigChanges * @key randomness * @author Martin Buchholz diff --git a/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java b/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java index 149cc66c74c..3299f674adb 100644 --- a/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java +++ b/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java @@ -27,7 +27,8 @@ * @summary Test the extended API and the aliasing additions in JarFile that * support multi-release jar files * @library /lib/testlibrary/java/util/jar /test/lib - * @build Compiler JarBuilder CreateMultiReleaseTestJars + * @build jdk.test.lib.RandomFactory + * Compiler JarBuilder CreateMultiReleaseTestJars * @run testng MultiReleaseJarAPI */ diff --git a/jdk/test/java/util/logging/FileHandlerMaxLocksTest.java b/jdk/test/java/util/logging/FileHandlerMaxLocksTest.java index 74924badd9c..4f19b5be789 100644 --- a/jdk/test/java/util/logging/FileHandlerMaxLocksTest.java +++ b/jdk/test/java/util/logging/FileHandlerMaxLocksTest.java @@ -29,6 +29,8 @@ * "logging.properties" file with default value of 100. This property can be * overriden by specifying this property in the custom config file. * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @author rpatil * @run main/othervm FileHandlerMaxLocksTest */ diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java index 724052e900d..b61ea07e577 100644 --- a/jdk/test/java/util/regex/RegExTest.java +++ b/jdk/test/java/util/regex/RegExTest.java @@ -38,6 +38,7 @@ * 8176029 * * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main RegExTest * @key randomness */ diff --git a/jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java b/jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java index 0234016bbe1..a7417bfd96d 100644 --- a/jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java +++ b/jdk/test/java/util/zip/InflaterInputStream/TestAvailable.java @@ -23,6 +23,7 @@ /* @test * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main TestAvailable * @bug 7031075 8161426 * @summary Make sure that available() method behaves as expected. diff --git a/jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java b/jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java index d5344c3bdf2..0a660e373aa 100644 --- a/jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java +++ b/jdk/test/java/util/zip/ZipFile/MultiThreadedReadTest.java @@ -25,6 +25,8 @@ * @bug 8038491 * @summary Crash in ZipFile.read() when ZipFileInputStream is shared between threads * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run main MultiThreadedReadTest * @key randomness */ diff --git a/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java b/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java index 4dc480c67ea..c4e47193e14 100644 --- a/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java +++ b/jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java @@ -25,6 +25,9 @@ * @test * @bug 6374379 * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * @run main ReadLongZipFileName * @summary Verify that we can read zip file names > 255 chars long */ diff --git a/jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java b/jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java index bee70c019b0..d5611558d27 100644 --- a/jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java +++ b/jdk/test/java/util/zip/ZipFile/ZipEntryFreeTest.java @@ -25,6 +25,8 @@ * @bug 6907252 * @summary ZipFileInputStream Not Thread-Safe * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run main ZipEntryFreeTest */ diff --git a/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java index aff92170577..881dc6969ef 100644 --- a/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java +++ b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java @@ -27,8 +27,12 @@ * @library /test/lib * @modules java.base/jdk.internal.ref * java.base/jdk.internal.misc - * @build jdk.test.lib.* - * @build jdk.test.lib.process.* + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main ExitOnThrow * @summary Ensure that if a cleaner throws an exception then the VM exits */ diff --git a/jdk/test/jdk/internal/util/jar/TestVersionedStream.java b/jdk/test/jdk/internal/util/jar/TestVersionedStream.java index 9a370d27df0..c7c0c8783b4 100644 --- a/jdk/test/jdk/internal/util/jar/TestVersionedStream.java +++ b/jdk/test/jdk/internal/util/jar/TestVersionedStream.java @@ -27,6 +27,8 @@ * @summary basic tests for multi-release jar versioned streams * @library /test/lib * @modules jdk.jartool/sun.tools.jar java.base/jdk.internal.util.jar + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run testng TestVersionedStream */ diff --git a/jdk/test/jdk/modules/incubator/ImageModules.java b/jdk/test/jdk/modules/incubator/ImageModules.java index 857abca8dc3..e569a175acc 100644 --- a/jdk/test/jdk/modules/incubator/ImageModules.java +++ b/jdk/test/jdk/modules/incubator/ImageModules.java @@ -28,7 +28,9 @@ * @library /lib/testlibrary /test/lib * @key intermittent * @modules jdk.compiler jdk.jartool jdk.jlink - * @build jdk.test.lib.compiler.CompilerUtils + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * jdk.test.lib.compiler.CompilerUtils * @run testng/othervm ImageModules */ diff --git a/jdk/test/sun/misc/SunMiscSignalTest.java b/jdk/test/sun/misc/SunMiscSignalTest.java index 33d4d3ac41c..056843e673c 100644 --- a/jdk/test/sun/misc/SunMiscSignalTest.java +++ b/jdk/test/sun/misc/SunMiscSignalTest.java @@ -46,7 +46,12 @@ import sun.misc.SignalHandler; * @library /test/lib * @modules jdk.unsupported * java.base/jdk.internal.misc - * @build jdk.test.lib.Platform jdk.test.lib.Utils + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng/othervm -Xrs -DXrs=true SunMiscSignalTest * @run testng/othervm SunMiscSignalTest * @summary sun.misc.Signal test From f84b52122002fc346445df8bb8a2dcdd4f6c32b7 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Mon, 12 Jun 2017 12:43:26 -0700 Subject: [PATCH 076/130] 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests Reviewed-by: alanb --- .../sun/corba/7130985/CorbaExceptionsCompileTest.java | 4 +++- .../crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java | 2 ++ .../io/FilePermission/FilePermissionCollectionMerge.java | 2 ++ jdk/test/java/io/FilePermission/Invalid.java | 2 ++ jdk/test/java/io/FilePermission/MergeName.java | 7 +++++++ jdk/test/java/io/FilePermission/ReadFileOnPath.java | 7 +++++++ jdk/test/java/io/InputStream/ReadAllBytes.java | 1 + jdk/test/java/io/InputStream/ReadNBytes.java | 1 + .../java/io/Serializable/class/NonSerializableTest.java | 9 +++++++-- .../evolution/RenamePackage/RenamePackageTest.java | 7 ++++++- .../Serializable/failureAtomicity/FailureAtomicity.java | 2 ++ .../Serializable/serialver/classpath/ClasspathTest.java | 6 +++++- .../io/Serializable/serialver/nested/NestedTest.java | 8 ++++++-- jdk/test/java/net/Inet6Address/B6206527.java | 2 ++ jdk/test/java/net/Inet6Address/B6558853.java | 2 ++ jdk/test/java/net/InetAddress/CheckJNI.java | 2 ++ jdk/test/java/net/InetAddress/ptr/Lookup.java | 8 ++++++-- jdk/test/java/net/MulticastSocket/JoinLeave.java | 2 ++ jdk/test/java/net/MulticastSocket/SetLoopbackMode.java | 2 ++ jdk/test/java/net/NetworkConfigurationProbe.java | 7 +++++++ .../net/ServerSocket/AcceptCauseFileDescriptorLeak.java | 8 ++++++-- jdk/test/java/net/Socket/LinkLocal.java | 2 ++ jdk/test/java/net/Socket/OldSocketImplTestDriver.java | 7 ++++++- .../java/net/SocketPermission/SocketPermissionTest.java | 2 ++ .../java/net/URLClassLoader/closetest/CloseTest.java | 5 ++++- .../URLClassLoader/closetest/GetResourceAsStream.java | 5 ++++- .../URLClassLoader/getresourceasstream/TestDriver.java | 8 ++++++-- .../java/net/URLClassLoader/sealing/CheckSealedTest.java | 8 ++++++-- jdk/test/java/net/URLConnection/6212146/TestDriver.java | 8 ++++++-- jdk/test/java/net/httpclient/RequestBodyTest.java | 2 ++ jdk/test/java/net/ipv6tests/B6521014.java | 2 ++ .../java/net/spi/URLStreamHandlerProvider/Basic.java | 4 +++- .../nio/channels/AsynchronousSocketChannel/Basic.java | 1 + .../channels/DatagramChannel/BasicMulticastTests.java | 4 +++- .../DatagramChannel/MulticastSendReceiveTests.java | 4 +++- .../java/nio/channels/DatagramChannel/Promiscuous.java | 4 +++- jdk/test/java/nio/channels/FileChannel/Transfer.java | 1 + .../java/nio/channels/Selector/LotsOfUpdatesTest.java | 8 +++++++- jdk/test/java/nio/channels/SocketChannel/VectorIO.java | 1 + jdk/test/java/nio/file/FileStore/Basic.java | 2 ++ jdk/test/java/nio/file/FileSystem/Basic.java | 2 ++ jdk/test/java/nio/file/Files/CopyAndMove.java | 3 ++- jdk/test/java/nio/file/Files/DeleteOnClose.java | 7 +++++++ jdk/test/java/nio/file/Files/StreamLinesTest.java | 1 + jdk/test/java/nio/file/WatchService/LotsOfEvents.java | 1 + .../security/AccessController/DoPrivAccompliceTest.java | 8 +++++++- .../security/KeyStore/PKCS12/EntryProtectionTest.java | 2 ++ .../java/security/MessageDigest/TestDigestIOStream.java | 1 + jdk/test/java/security/MessageDigest/TestSameLength.java | 2 ++ jdk/test/java/security/MessageDigest/TestSameValue.java | 2 ++ .../ExtensiblePolicy/ExtensiblePolicyWithJarTest.java | 1 + .../java/security/SecureRandom/DrbgParametersSpec.java | 2 ++ jdk/test/java/security/Signature/Offsets.java | 1 + .../javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java | 1 + .../ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java | 1 + jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java | 1 + .../DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java | 1 + .../net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java | 1 + .../ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java | 1 + .../ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java | 1 + jdk/test/jdk/security/jarsigner/Spec.java | 2 ++ .../www/protocol/https/HttpsURLConnection/B6216082.java | 4 +++- .../protocol/https/HttpsURLConnection/PostThruProxy.java | 6 ++++++ .../https/HttpsURLConnection/PostThruProxyWithAuth.java | 6 ++++++ .../sun/net/www/protocol/jar/GetContentTypeTest.java | 6 +++++- jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java | 8 ++++++-- jdk/test/sun/nio/cs/FindDecoderBugs.java | 1 + jdk/test/sun/nio/cs/FindEncoderBugs.java | 1 + jdk/test/sun/security/ec/SignatureOffsets.java | 1 + jdk/test/sun/security/krb5/auto/ModuleName.java | 6 ++++++ jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java | 1 + jdk/test/sun/security/krb5/auto/rcache_usemd5.sh | 1 + jdk/test/sun/security/mscapi/SignatureOffsets.java | 1 + .../sun/security/pkcs11/rsa/TestKeyPairGenerator.java | 1 + jdk/test/sun/security/rsa/SignatureOffsets.java | 1 + .../ssl/CertPathRestrictions/TLSRestrictions.java | 6 ++++++ jdk/test/sun/security/ssl/rsa/SignatureOffsets.java | 1 + jdk/test/sun/security/tools/jarsigner/AltProvider.java | 9 +++++++++ jdk/test/sun/security/tools/jarsigner/Options.java | 2 ++ .../sun/security/tools/jarsigner/TimestampCheck.java | 8 ++++++++ .../sun/security/tools/jarsigner/TsacertOptionTest.java | 1 + jdk/test/sun/security/tools/jarsigner/Warning.java | 2 ++ .../tools/jarsigner/multiRelease/MVJarSigningTest.java | 7 +++++++ .../tools/jarsigner/warnings/AliasNotInStoreTest.java | 1 + .../jarsigner/warnings/BadExtendedKeyUsageTest.java | 1 + .../tools/jarsigner/warnings/BadKeyUsageTest.java | 1 + .../jarsigner/warnings/BadNetscapeCertTypeTest.java | 1 + .../tools/jarsigner/warnings/ChainNotValidatedTest.java | 1 + .../tools/jarsigner/warnings/HasExpiredCertTest.java | 1 + .../tools/jarsigner/warnings/HasExpiringCertTest.java | 1 + .../tools/jarsigner/warnings/HasUnsignedEntryTest.java | 1 + .../tools/jarsigner/warnings/MultipleWarningsTest.java | 1 + .../tools/jarsigner/warnings/NoTimestampTest.java | 1 + .../tools/jarsigner/warnings/NotSignedByAliasTest.java | 1 + .../tools/jarsigner/warnings/NotYetValidCertTest.java | 1 + jdk/test/sun/security/tools/keytool/ImportPrompt.java | 8 ++++++++ jdk/test/sun/security/tools/keytool/PrintSSL.java | 7 +++++++ jdk/test/sun/security/tools/keytool/ReadJar.java | 9 +++++++++ jdk/test/sun/security/tools/keytool/WeakAlg.java | 7 +++++++ jdk/test/tools/jar/InputFilesTest.java | 2 ++ jdk/test/tools/jar/ReleaseBeforeFiles.java | 2 ++ jdk/test/tools/jar/compat/CLICompatibility.java | 4 +++- jdk/test/tools/jar/mmrjar/Basic.java | 2 ++ jdk/test/tools/jar/modularJar/Basic.java | 4 +++- jdk/test/tools/jar/multiRelease/ApiValidatorTest.java | 9 ++++++++- jdk/test/tools/jar/multiRelease/Basic.java | 9 ++++++++- jdk/test/tools/jar/multiRelease/Basic1.java | 9 +++++++-- jdk/test/tools/jar/multiRelease/RuntimeTest.java | 7 +++++++ .../jlink/multireleasejar/JLinkMultiReleaseJarTest.java | 9 +++++++-- .../SystemModuleDescriptors/CompiledVersionTest.java | 6 ++++-- .../plugins/SystemModuleDescriptors/UserModuleTest.java | 6 ++++-- jdk/test/tools/jmod/JmodNegativeTest.java | 2 ++ jdk/test/tools/jmod/JmodTest.java | 2 ++ jdk/test/tools/jmod/hashes/HashesTest.java | 2 ++ jdk/test/tools/launcher/LauncherMessageTest.java | 2 ++ .../modules/addexports/AddExportsTestWarningError.java | 4 +++- .../modules/addreads/AddReadsTestWarningError.java | 4 +++- .../modules/patch/systemmodules/PatchSystemModules.java | 2 ++ 118 files changed, 376 insertions(+), 45 deletions(-) diff --git a/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java b/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java index c4eaa555e9a..58bc6ee2a5d 100644 --- a/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java +++ b/jdk/test/com/sun/corba/7130985/CorbaExceptionsCompileTest.java @@ -26,8 +26,10 @@ * @bug 7130985 * @summary Four helper classes missing in Sun JDK * @library /lib/testlibrary /test/lib - * @build jdk.testlibrary.* * @modules java.corba + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * jdk.testlibrary.* * @run main CorbaExceptionsCompileTest */ diff --git a/jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java b/jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java index c923edb2a1a..c133f11b2d1 100644 --- a/jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java +++ b/jdk/test/com/sun/crypto/provider/CICO/PBEFunc/CipherNCFuncTest.java @@ -25,6 +25,8 @@ * @test * @bug 8048604 * @library ../ /test/lib + * @build jdk.test.lib.RandomFactory + * @run main CipherNCFuncTest * @summary This test verifies the assertion "There should be no transformation * on the plaintext/ciphertext in encryption/decryption mechanism" for * feature "NullCipher". diff --git a/jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java b/jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java index c85be3d6fde..b8964931f30 100644 --- a/jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java +++ b/jdk/test/java/io/FilePermission/FilePermissionCollectionMerge.java @@ -28,6 +28,8 @@ * @summary FilePermissionCollection merges incorrectly * @modules java.base/sun.security.util * @library /test/lib + * @build jdk.test.lib.Asserts + * @run main FilePermissionCollectionMerge */ import sun.security.util.FilePermCompat; diff --git a/jdk/test/java/io/FilePermission/Invalid.java b/jdk/test/java/io/FilePermission/Invalid.java index 2a343d7049c..f9cf20da1ca 100644 --- a/jdk/test/java/io/FilePermission/Invalid.java +++ b/jdk/test/java/io/FilePermission/Invalid.java @@ -27,6 +27,8 @@ * @bug 8167646 * @summary Better invalid FilePermission * @library /test/lib + * @build jdk.test.lib.Asserts + * @run main Invalid */ import jdk.test.lib.Asserts; diff --git a/jdk/test/java/io/FilePermission/MergeName.java b/jdk/test/java/io/FilePermission/MergeName.java index 09215877fd8..c2eff765f2d 100644 --- a/jdk/test/java/io/FilePermission/MergeName.java +++ b/jdk/test/java/io/FilePermission/MergeName.java @@ -37,6 +37,13 @@ import java.util.stream.IntStream; * @bug 8170364 * @summary FilePermission path modified during merge * @library /test/lib + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * @run main MergeName */ public class MergeName { diff --git a/jdk/test/java/io/FilePermission/ReadFileOnPath.java b/jdk/test/java/io/FilePermission/ReadFileOnPath.java index b106b7b5968..3d8a60aa089 100644 --- a/jdk/test/java/io/FilePermission/ReadFileOnPath.java +++ b/jdk/test/java/io/FilePermission/ReadFileOnPath.java @@ -27,6 +27,13 @@ * @library /lib/testlibrary /test/lib * @modules java.base/jdk.internal.misc * jdk.compiler + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main ReadFileOnPath * @summary Still able to read file on the same path */ diff --git a/jdk/test/java/io/InputStream/ReadAllBytes.java b/jdk/test/java/io/InputStream/ReadAllBytes.java index 88ab4d66791..c190cd2dd54 100644 --- a/jdk/test/java/io/InputStream/ReadAllBytes.java +++ b/jdk/test/java/io/InputStream/ReadAllBytes.java @@ -33,6 +33,7 @@ import jdk.test.lib.RandomFactory; * @test * @bug 8080835 * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main ReadAllBytes * @summary Basic test for InputStream.readAllBytes * @key randomness diff --git a/jdk/test/java/io/InputStream/ReadNBytes.java b/jdk/test/java/io/InputStream/ReadNBytes.java index 3b3999f1647..1fbca35d3bb 100644 --- a/jdk/test/java/io/InputStream/ReadNBytes.java +++ b/jdk/test/java/io/InputStream/ReadNBytes.java @@ -33,6 +33,7 @@ import jdk.test.lib.RandomFactory; * @test * @bug 8080835 * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main ReadNBytes * @summary Basic test for InputStream.readNBytes * @key randomness diff --git a/jdk/test/java/io/Serializable/class/NonSerializableTest.java b/jdk/test/java/io/Serializable/class/NonSerializableTest.java index 53f4a44c860..b2ac4e933cb 100644 --- a/jdk/test/java/io/Serializable/class/NonSerializableTest.java +++ b/jdk/test/java/io/Serializable/class/NonSerializableTest.java @@ -25,8 +25,13 @@ * @test * @bug 4075221 * @library /test/lib - * @build jdk.test.lib.compiler.* - * @build jdk.test.lib.process.* + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng/timeout=300 NonSerializableTest * @summary Enable serialize of nonSerializable Class descriptor. */ diff --git a/jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java b/jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java index 10456827f78..7a3da8e04d5 100644 --- a/jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java +++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java @@ -26,7 +26,12 @@ * @bug 4087295 4785472 * @library /test/lib * @build jdk.test.lib.compiler.CompilerUtils - * @build jdk.test.lib.process.ProcessTools + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @build RenamePackageTest * @run main RenamePackageTest * @summary Enable resolveClass() to accommodate package renaming. diff --git a/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java b/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java index f20f3f44539..8be6ce1142b 100644 --- a/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java +++ b/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java @@ -27,6 +27,8 @@ * @summary Better failure atomicity for default read object. * @modules jdk.compiler * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @compile FailureAtomicity.java SerialRef.java * @run main failureAtomicity.FailureAtomicity */ diff --git a/jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java b/jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java index b4cb6085321..92986eb5aea 100644 --- a/jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java +++ b/jdk/test/java/io/Serializable/serialver/classpath/ClasspathTest.java @@ -25,8 +25,12 @@ * @test * @bug 4035147 4785472 * @library /test/lib + * @build jdk.test.lib.Utils + * @build jdk.test.lib.Asserts + * @build jdk.test.lib.JDKToolFinder * @build jdk.test.lib.JDKToolLauncher - * @build jdk.test.lib.process.ProcessTools + * @build jdk.test.lib.Platform + * @build jdk.test.lib.process.* * @build ClasspathTest * @run main serialver.ClasspathTest * @summary Test the use of the -classpath switch in the serialver application. diff --git a/jdk/test/java/io/Serializable/serialver/nested/NestedTest.java b/jdk/test/java/io/Serializable/serialver/nested/NestedTest.java index 160a931d9da..9b8963b355e 100644 --- a/jdk/test/java/io/Serializable/serialver/nested/NestedTest.java +++ b/jdk/test/java/io/Serializable/serialver/nested/NestedTest.java @@ -25,8 +25,12 @@ * @test * @bug 4312217 4785473 * @library /test/lib - * @build jdk.test.lib.JDKToolLauncher - * @build jdk.test.lib.process.ProcessTools + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @build NestedTest * @run main serialver.NestedTest * @summary To test the use of nested class specification using the '.' diff --git a/jdk/test/java/net/Inet6Address/B6206527.java b/jdk/test/java/net/Inet6Address/B6206527.java index 9ce617b3437..6189606be31 100644 --- a/jdk/test/java/net/Inet6Address/B6206527.java +++ b/jdk/test/java/net/Inet6Address/B6206527.java @@ -26,6 +26,8 @@ * @bug 6206527 * @summary "cannot assign address" when binding ServerSocket on Suse 9 * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main B6206527 */ diff --git a/jdk/test/java/net/Inet6Address/B6558853.java b/jdk/test/java/net/Inet6Address/B6558853.java index 408c30de64a..bff36c56062 100644 --- a/jdk/test/java/net/Inet6Address/B6558853.java +++ b/jdk/test/java/net/Inet6Address/B6558853.java @@ -26,6 +26,8 @@ * @bug 6558853 * @summary getHostAddress() on connections using IPv6 link-local addrs should have zone id * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main B6558853 */ diff --git a/jdk/test/java/net/InetAddress/CheckJNI.java b/jdk/test/java/net/InetAddress/CheckJNI.java index 76ac633e921..54d2255166f 100644 --- a/jdk/test/java/net/InetAddress/CheckJNI.java +++ b/jdk/test/java/net/InetAddress/CheckJNI.java @@ -25,6 +25,8 @@ * @bug 4889870 4890033 * @summary java -Xcheck:jni failing in net code on Solaris / [Datagram]Socket.getLocalAddress() failure * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main/othervm -Xcheck:jni CheckJNI */ diff --git a/jdk/test/java/net/InetAddress/ptr/Lookup.java b/jdk/test/java/net/InetAddress/ptr/Lookup.java index c3c5eebde78..d3051173297 100644 --- a/jdk/test/java/net/InetAddress/ptr/Lookup.java +++ b/jdk/test/java/net/InetAddress/ptr/Lookup.java @@ -28,8 +28,12 @@ * @summary Test that reverse lookups of IPv4 addresses work when IPv6 * is enabled * @library /test/lib - * @build jdk.test.lib.JDKToolFinder - * jdk.test.lib.process.OutputAnalyzer + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * Lookup * @run main Lookup root * diff --git a/jdk/test/java/net/MulticastSocket/JoinLeave.java b/jdk/test/java/net/MulticastSocket/JoinLeave.java index 2e59a08444e..a4f914bb650 100644 --- a/jdk/test/java/net/MulticastSocket/JoinLeave.java +++ b/jdk/test/java/net/MulticastSocket/JoinLeave.java @@ -26,6 +26,8 @@ * @bug 4091811 4148753 4102731 * @summary Test java.net.MulticastSocket joinGroup and leaveGroup * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main JoinLeave */ diff --git a/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java b/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java index 03bb39b48de..a23f26dddd7 100644 --- a/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java +++ b/jdk/test/java/net/MulticastSocket/SetLoopbackMode.java @@ -26,6 +26,8 @@ * @bug 4686717 * @summary Test MulticastSocket.setLoopbackMode * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main/othervm SetLoopbackMode */ diff --git a/jdk/test/java/net/NetworkConfigurationProbe.java b/jdk/test/java/net/NetworkConfigurationProbe.java index 607671b8045..ed3763566bf 100644 --- a/jdk/test/java/net/NetworkConfigurationProbe.java +++ b/jdk/test/java/net/NetworkConfigurationProbe.java @@ -25,6 +25,13 @@ * @test * @summary NOT A TEST. Captures the network interface configuration. * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main NetworkConfigurationProbe */ diff --git a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java index d2e3af48689..b62b6057366 100644 --- a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java +++ b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java @@ -30,8 +30,12 @@ * can cause fd leak * @requires (os.family != "windows") * @library /test/lib - * @build jdk.test.lib.JDKToolFinder - * jdk.test.lib.process.OutputAnalyzer + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * AcceptCauseFileDescriptorLeak * @run main/othervm AcceptCauseFileDescriptorLeak root */ diff --git a/jdk/test/java/net/Socket/LinkLocal.java b/jdk/test/java/net/Socket/LinkLocal.java index 9957c5c44f0..d048764e981 100644 --- a/jdk/test/java/net/Socket/LinkLocal.java +++ b/jdk/test/java/net/Socket/LinkLocal.java @@ -27,6 +27,8 @@ * @summary Connecting to a link-local IPv6 address should not * causes a SocketException to be thrown. * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main LinkLocal */ diff --git a/jdk/test/java/net/Socket/OldSocketImplTestDriver.java b/jdk/test/java/net/Socket/OldSocketImplTestDriver.java index 840579f3ab9..3bfb8967c42 100644 --- a/jdk/test/java/net/Socket/OldSocketImplTestDriver.java +++ b/jdk/test/java/net/Socket/OldSocketImplTestDriver.java @@ -30,7 +30,12 @@ import java.nio.file.Paths; * @test * @bug 6449565 * @library /test/lib - * @build jdk.test.lib.process.ProcessTools + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main OldSocketImplTestDriver * @summary Test driver for OdlSocketImpl */ diff --git a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java index 360fd2c8c62..c0c3260380a 100644 --- a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java +++ b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java @@ -26,6 +26,8 @@ * @bug 8047031 * @summary SocketPermission tests for legacy socket types * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run testng/othervm SocketPermissionTest */ diff --git a/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java b/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java index 78256ed9f09..3453f8a56a0 100644 --- a/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java +++ b/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java @@ -30,7 +30,10 @@ * @library ../../../../com/sun/net/httpserver * /lib/testlibrary * /test/lib - * @build FileServerHandler JarUtils jdk.test.lib.compiler.CompilerUtils + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform + * FileServerHandler JarUtils * @run main/othervm CloseTest * @summary URL-downloaded jar files can consume all available file descriptors */ diff --git a/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java b/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java index 30afec4be4d..896dd404b30 100644 --- a/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java +++ b/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java @@ -26,7 +26,10 @@ * @bug 6899919 * @library /lib/testlibrary /test/lib * @modules jdk.compiler - * @build JarUtils jdk.test.lib.compiler.CompilerUtils + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform + * JarUtils * @run main/othervm GetResourceAsStream */ diff --git a/jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java b/jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java index 5daaee95407..526689e21ea 100644 --- a/jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java +++ b/jdk/test/java/net/URLClassLoader/getresourceasstream/TestDriver.java @@ -26,8 +26,12 @@ * @bug 5103449 * @summary REGRESSION: getResourceAsStream is broken in JDK1.5.0-rc * @library /test/lib - * @build jdk.test.lib.JDKToolFinder - * jdk.test.lib.process.ProcessTools + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * Test * @run main/othervm TestDriver */ diff --git a/jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java b/jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java index f0f70496281..b733b678871 100644 --- a/jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java +++ b/jdk/test/java/net/URLClassLoader/sealing/CheckSealedTest.java @@ -26,8 +26,12 @@ * @bug 4244970 * @summary Test to see if sealing violation is detected correctly * @library /test/lib - * @build jdk.test.lib.JDKToolFinder - * jdk.test.lib.process.OutputAnalyzer + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main CheckSealedTest */ diff --git a/jdk/test/java/net/URLConnection/6212146/TestDriver.java b/jdk/test/java/net/URLConnection/6212146/TestDriver.java index 31bee6fefec..d6bffb198de 100644 --- a/jdk/test/java/net/URLConnection/6212146/TestDriver.java +++ b/jdk/test/java/net/URLConnection/6212146/TestDriver.java @@ -27,8 +27,12 @@ * @summary URLConnection.connect() fails on JAR Entry it creates * file handler leak * @library /test/lib - * @build jdk.test.lib.JDKToolFinder - * jdk.test.lib.process.ProcessTools + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * Test * @run main/othervm TestDriver */ diff --git a/jdk/test/java/net/httpclient/RequestBodyTest.java b/jdk/test/java/net/httpclient/RequestBodyTest.java index e60a06abc4f..9cb90a0fed4 100644 --- a/jdk/test/java/net/httpclient/RequestBodyTest.java +++ b/jdk/test/java/net/httpclient/RequestBodyTest.java @@ -29,6 +29,8 @@ * @library /lib/testlibrary/ /test/lib * @compile ../../../com/sun/net/httpserver/LogFilter.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java + * @build jdk.test.lib.Platform + * @build jdk.test.lib.util.FileUtils * @build LightWeightHttpServer * @build jdk.testlibrary.SimpleSSLContext * @run testng/othervm RequestBodyTest diff --git a/jdk/test/java/net/ipv6tests/B6521014.java b/jdk/test/java/net/ipv6tests/B6521014.java index a622bb1a69d..6d5aa0b252a 100644 --- a/jdk/test/java/net/ipv6tests/B6521014.java +++ b/jdk/test/java/net/ipv6tests/B6521014.java @@ -26,6 +26,8 @@ * @bug 6521014 6543428 * @summary IOException thrown when Socket tries to bind to an local IPv6 address on SuSE Linux * @library /test/lib + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform * @run main B6521014 */ diff --git a/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java b/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java index eff3d6a785e..d5da7fa6621 100644 --- a/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java +++ b/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java @@ -56,7 +56,9 @@ import static java.util.Arrays.asList; * @modules jdk.compiler * @summary Basic test for URLStreamHandlerProvider * @library /lib/testlibrary /test/lib - * @build jdk.testlibrary.JDKToolFinder + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * jdk.testlibrary.JDKToolFinder * @compile Basic.java Child.java * @run main Basic */ diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java index bc2b4fa81c1..0dc0318ab68 100644 --- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java +++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java @@ -25,6 +25,7 @@ * @bug 4607272 6842687 6878369 6944810 7023403 * @summary Unit test for AsynchronousSocketChannel(use -Dseed=X to set PRNG seed) * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main Basic -skipSlowConnectTest * @key randomness intermittent */ diff --git a/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java b/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java index 4ce1b41f701..cb2d2c0f15d 100644 --- a/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java +++ b/jdk/test/java/nio/channels/DatagramChannel/BasicMulticastTests.java @@ -25,7 +25,9 @@ * @bug 4527345 * @summary Unit test for DatagramChannel's multicast support * @library /test/lib - * @build BasicMulticastTests + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * BasicMulticastTests * @run main BasicMulticastTests */ diff --git a/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java b/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java index 591e3945e98..7569d14f155 100644 --- a/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java +++ b/jdk/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java @@ -25,7 +25,9 @@ * @bug 4527345 7026376 6633549 * @summary Unit test for DatagramChannel's multicast support * @library /test/lib - * @build MulticastSendReceiveTests + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * MulticastSendReceiveTests * @run main MulticastSendReceiveTests * @run main/othervm -Djava.net.preferIPv4Stack=true MulticastSendReceiveTests * @key randomness diff --git a/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java b/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java index d79a641002c..0ee99f155ad 100644 --- a/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java +++ b/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java @@ -26,7 +26,9 @@ * @summary Test for interference when two sockets are bound to the same * port but joined to different multicast groups * @library /test/lib - * @build Promiscuous + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * Promiscuous * @run main Promiscuous * @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous * @key randomness diff --git a/jdk/test/java/nio/channels/FileChannel/Transfer.java b/jdk/test/java/nio/channels/FileChannel/Transfer.java index a6566996b0c..9e2eeb49d72 100644 --- a/jdk/test/java/nio/channels/FileChannel/Transfer.java +++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java @@ -26,6 +26,7 @@ * @summary Test FileChannel.transferFrom and transferTo (use -Dseed=X to set PRNG seed) * @library .. * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run testng/timeout=300 Transfer * @key randomness */ diff --git a/jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java b/jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java index 34da13f3076..ef2c389ef39 100644 --- a/jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java +++ b/jdk/test/java/nio/channels/Selector/LotsOfUpdatesTest.java @@ -28,7 +28,13 @@ * Solaris if maximum number of file descriptors is less than 10000 * @requires (os.family != "windows") * @library /test/lib - * @build LotsOfUpdates + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * LotsOfUpdates * @run main LotsOfUpdatesTest */ diff --git a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java index 11df48a71f1..4e5f17d27c8 100644 --- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java +++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java @@ -24,6 +24,7 @@ /* @test * @summary Test socketchannel vector IO (use -Dseed=X to set PRNG seed) * @library .. /test/lib + * @build jdk.test.lib.RandomFactory * @run main VectorIO * @key randomness */ diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 16997de8495..bc33002b70c 100644 --- a/jdk/test/java/nio/file/FileStore/Basic.java +++ b/jdk/test/java/nio/file/FileStore/Basic.java @@ -26,6 +26,8 @@ * @summary Unit test for java.nio.file.FileStore * @key intermittent * @library .. /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run main Basic */ diff --git a/jdk/test/java/nio/file/FileSystem/Basic.java b/jdk/test/java/nio/file/FileSystem/Basic.java index d0546896206..83f2acbe9ce 100644 --- a/jdk/test/java/nio/file/FileSystem/Basic.java +++ b/jdk/test/java/nio/file/FileSystem/Basic.java @@ -25,6 +25,8 @@ * @bug 4313887 6838333 8132497 * @summary Unit test for java.nio.file.FileSystem * @library .. /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run main/othervm Basic */ diff --git a/jdk/test/java/nio/file/Files/CopyAndMove.java b/jdk/test/java/nio/file/Files/CopyAndMove.java index f3094f2b357..ce9f681d4f7 100644 --- a/jdk/test/java/nio/file/Files/CopyAndMove.java +++ b/jdk/test/java/nio/file/Files/CopyAndMove.java @@ -25,7 +25,8 @@ * @bug 4313887 6838333 6917021 7006126 6950237 8006645 * @summary Unit test for java.nio.file.Files copy and move methods (use -Dseed=X to set PRNG seed) * @library .. /test/lib - * @build CopyAndMove PassThroughFileSystem + * @build jdk.test.lib.RandomFactory + * CopyAndMove PassThroughFileSystem * @run main/othervm CopyAndMove * @key randomness */ diff --git a/jdk/test/java/nio/file/Files/DeleteOnClose.java b/jdk/test/java/nio/file/Files/DeleteOnClose.java index 3df075689aa..f5fab1c5be2 100644 --- a/jdk/test/java/nio/file/Files/DeleteOnClose.java +++ b/jdk/test/java/nio/file/Files/DeleteOnClose.java @@ -26,6 +26,13 @@ * @bug 4313887 * @summary Unit test for DELETE_ON_CLOSE open option * @library /test/lib .. + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * @run main DeleteOnClose */ import java.io.IOException; diff --git a/jdk/test/java/nio/file/Files/StreamLinesTest.java b/jdk/test/java/nio/file/Files/StreamLinesTest.java index 8ffe8919a87..402b114ae0b 100644 --- a/jdk/test/java/nio/file/Files/StreamLinesTest.java +++ b/jdk/test/java/nio/file/Files/StreamLinesTest.java @@ -25,6 +25,7 @@ * @bug 8072773 * @library /test/lib /lib/testlibrary/bootlib * @build java.base/java.util.stream.OpTestCase + * jdk.test.lib.RandomFactory * @run testng/othervm StreamLinesTest * @summary Tests streams returned from Files.lines, primarily focused on * testing the file-channel-based stream stream with supported diff --git a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java index 04a96c09fda..d882adae4db 100644 --- a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java +++ b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java @@ -26,6 +26,7 @@ * @summary Tests WatchService behavior when lots of events are pending (use -Dseed=X to set PRNG seed) * @library .. * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main/timeout=180 LotsOfEvents * @key randomness */ diff --git a/jdk/test/java/security/AccessController/DoPrivAccompliceTest.java b/jdk/test/java/security/AccessController/DoPrivAccompliceTest.java index be8b719bb33..711c3030dde 100644 --- a/jdk/test/java/security/AccessController/DoPrivAccompliceTest.java +++ b/jdk/test/java/security/AccessController/DoPrivAccompliceTest.java @@ -42,7 +42,13 @@ import java.nio.file.Paths; * DoPrivAccmplice.jar. * * @library /test/lib - * + * @build jdk.test.lib.util.JarUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main/othervm DoPrivAccompliceTest */ diff --git a/jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java b/jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java index 225ffa3a6eb..5395a72fba5 100644 --- a/jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java +++ b/jdk/test/java/security/KeyStore/PKCS12/EntryProtectionTest.java @@ -42,6 +42,8 @@ import java.util.Arrays; * specified by different PBE algorithms (use -Dseed=X to set PRNG seed) * @library /test/lib /lib/testlibrary ../ * @key randomness + * @build jdk.test.lib.RandomFactory + * @run main EntryProtectionTest */ public class EntryProtectionTest { private static final char[] PASSWORD = "passwd".toCharArray(); diff --git a/jdk/test/java/security/MessageDigest/TestDigestIOStream.java b/jdk/test/java/security/MessageDigest/TestDigestIOStream.java index 623ee0f9c8b..13399500893 100644 --- a/jdk/test/java/security/MessageDigest/TestDigestIOStream.java +++ b/jdk/test/java/security/MessageDigest/TestDigestIOStream.java @@ -41,6 +41,7 @@ import static java.lang.System.out; * @author Kevin Liu * @key randomness * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main/timeout=180 TestDigestIOStream */ diff --git a/jdk/test/java/security/MessageDigest/TestSameLength.java b/jdk/test/java/security/MessageDigest/TestSameLength.java index 4d614b1e387..3a41776b16f 100644 --- a/jdk/test/java/security/MessageDigest/TestSameLength.java +++ b/jdk/test/java/security/MessageDigest/TestSameLength.java @@ -36,6 +36,8 @@ import jdk.test.lib.RandomFactory; * @author Kevin Liu * @key randomness * @library /test/lib + * @build jdk.test.lib.RandomFactory + * @run main TestSameLength */ public class TestSameLength { diff --git a/jdk/test/java/security/MessageDigest/TestSameValue.java b/jdk/test/java/security/MessageDigest/TestSameValue.java index dbf109e46f5..b8b69ed722e 100644 --- a/jdk/test/java/security/MessageDigest/TestSameValue.java +++ b/jdk/test/java/security/MessageDigest/TestSameValue.java @@ -37,6 +37,8 @@ import jdk.test.lib.RandomFactory; * @author Kevin Liu * @key randomness * @library /test/lib + * @build jdk.test.lib.RandomFactory + * @run main TestSameValue */ public class TestSameValue { diff --git a/jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java b/jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java index f6701e995d8..c851f6d5c3f 100644 --- a/jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java +++ b/jdk/test/java/security/Policy/ExtensiblePolicy/ExtensiblePolicyWithJarTest.java @@ -34,6 +34,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8050402 * @summary Check policy is extensible with user defined permissions * @library /lib/testlibrary /test/lib + * @build jdk.test.lib.util.JarUtils * @compile TVJar/TVPermission.java * @run main ExtensiblePolicyWithJarTest */ diff --git a/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java b/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java index f633576f4f0..3017262415a 100644 --- a/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java +++ b/jdk/test/java/security/SecureRandom/DrbgParametersSpec.java @@ -25,6 +25,8 @@ * @bug 8051408 8158534 * @summary Make sure DrbgParameters coded as specified * @library /test/lib + * @build jdk.test.lib.Asserts + * @run main DrbgParametersSpec */ import jdk.test.lib.Asserts; diff --git a/jdk/test/java/security/Signature/Offsets.java b/jdk/test/java/security/Signature/Offsets.java index 35a9b569acf..a21a7b313e8 100644 --- a/jdk/test/java/security/Signature/Offsets.java +++ b/jdk/test/java/security/Signature/Offsets.java @@ -42,6 +42,7 @@ import jdk.test.lib.RandomFactory; * generation, the test tries to verify signature with the above API * and passing in different signature offset (0, 33, 66, 99). * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main Offsets SUN NONEwithDSA * @run main Offsets SUN SHA1withDSA * @run main Offsets SUN SHA224withDSA diff --git a/jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java b/jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java index cf31ffd3122..47a9f4819b2 100644 --- a/jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java +++ b/jdk/test/javax/net/ssl/DTLS/DTLSIncorrectAppDataTest.java @@ -35,6 +35,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=DTLS * -Dtest.mode=norm DTLSIncorrectAppDataTest * @run main/othervm -Dtest.security.protocol=DTLS diff --git a/jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java b/jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java index de31945ab54..520a6590b46 100644 --- a/jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java +++ b/jdk/test/javax/net/ssl/DTLS/DTLSRehandshakeWithCipherChangeTest.java @@ -35,6 +35,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=DTLS * DTLSRehandshakeWithCipherChangeTest */ diff --git a/jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java b/jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java index 82f7df7d5d8..22fe13ab127 100644 --- a/jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java +++ b/jdk/test/javax/net/ssl/DTLS/DTLSSequenceNumberTest.java @@ -36,6 +36,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=DTLS * -Dtest.mode=norm DTLSSequenceNumberTest * @run main/othervm -Dtest.security.protocol=DTLS diff --git a/jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java b/jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java index 98fb334a4ff..4fab3a839da 100644 --- a/jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java +++ b/jdk/test/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithCipherChangeTest.java @@ -35,6 +35,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=DTLSv1.0 * DTLSv10RehandshakeWithCipherChangeTest */ diff --git a/jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java b/jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java index d154c27d331..23da9a2ab5b 100644 --- a/jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java +++ b/jdk/test/javax/net/ssl/TLS/TLSRehandshakeWithCipherChangeTest.java @@ -35,6 +35,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=TLS TLSRehandshakeWithCipherChangeTest */ diff --git a/jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java b/jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java index c7a8a8cf5ec..65491312ca5 100644 --- a/jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java +++ b/jdk/test/javax/net/ssl/TLSv1/TLSRehandshakeWithCipherChangeTest.java @@ -35,6 +35,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=TLSv1 TLSRehandshakeWithCipherChangeTest */ diff --git a/jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java b/jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java index d94b2e65eda..bb12218ba7e 100644 --- a/jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java +++ b/jdk/test/javax/net/ssl/TLSv11/TLSRehandshakeWithCipherChangeTest.java @@ -35,6 +35,7 @@ * java.security.jgss/sun.security.krb5.internal.crypto * java.security.jgss/sun.security.krb5.internal.ktab * java.base/sun.security.util + * @build jdk.test.lib.RandomFactory * @run main/othervm -Dtest.security.protocol=TLSv1.1 TLSRehandshakeWithCipherChangeTest */ diff --git a/jdk/test/jdk/security/jarsigner/Spec.java b/jdk/test/jdk/security/jarsigner/Spec.java index 07e46851e6f..1b3a12c7419 100644 --- a/jdk/test/jdk/security/jarsigner/Spec.java +++ b/jdk/test/jdk/security/jarsigner/Spec.java @@ -30,6 +30,8 @@ * java.base/sun.security.provider.certpath * jdk.jartool * jdk.crypto.ec + * @build jdk.test.lib.util.JarUtils + * @run main Spec */ import com.sun.jarsigner.ContentSigner; diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java index be761a789a7..62cbc93e492 100644 --- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java +++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java @@ -32,7 +32,9 @@ * @summary Redirect problem with HttpsURLConnection using a proxy * @modules java.base/sun.net.www * @library .. /test/lib - * @build HttpCallback TestHttpsServer ClosedChannelList + * @build jdk.test.lib.NetworkConfiguration + * jdk.test.lib.Platform + * HttpCallback TestHttpsServer ClosedChannelList * HttpTransaction TunnelProxy * @key intermittent * @run main/othervm B6216082 diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java index 8393a4ef4a2..eeb1150464e 100644 --- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java +++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.java @@ -39,6 +39,12 @@ import jdk.test.lib.process.ProcessTools; * that serves http POST method requests in secure channel, and a client * that makes https POST request through a proxy. * @library /test/lib + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @compile OriginServer.java ProxyTunnelServer.java * @run main/othervm PostThruProxy */ diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java index daf75bc65dc..0c6c06facaf 100644 --- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java +++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.java @@ -39,6 +39,12 @@ import jdk.test.lib.process.ProcessTools; * http POST method requests in secure channel, and a client that * makes https POST request through a proxy. * @library /test/lib + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @compile OriginServer.java ProxyTunnelServer.java * @run main/othervm -Djdk.http.auth.tunneling.disabledSchemes= PostThruProxyWithAuth */ diff --git a/jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java b/jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java index 2af75f452ad..16a59d65dc2 100644 --- a/jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java +++ b/jdk/test/sun/net/www/protocol/jar/GetContentTypeTest.java @@ -25,9 +25,13 @@ * @test * @bug 4274624 * @library /test/lib - * @build GetContentType GetContentTypeTest + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform * jdk.test.lib.process.* + * GetContentType GetContentTypeTest * @run main/othervm GetContentTypeTest * @summary Test JarURLConnection.getContentType would * would return default "content/unknown" diff --git a/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java b/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java index 977034603a0..7867bc6f870 100644 --- a/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java +++ b/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java @@ -27,10 +27,14 @@ * @library /test/lib * /lib/testlibrary * @modules jdk.compiler - * @build src.test.src.TestDriver JarUtils - * jdk.test.lib.compiler.CompilerUtils + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform * jdk.test.lib.process.* + * src.test.src.TestDriver JarUtils * @summary various resource and classloading bugs related to jar files * @run main/othervm TestDriver */ diff --git a/jdk/test/sun/nio/cs/FindDecoderBugs.java b/jdk/test/sun/nio/cs/FindDecoderBugs.java index 6868ce297ec..175a22c4723 100644 --- a/jdk/test/sun/nio/cs/FindDecoderBugs.java +++ b/jdk/test/sun/nio/cs/FindDecoderBugs.java @@ -26,6 +26,7 @@ * @bug 6380723 * @summary Decode many byte sequences in many ways (use -Dseed=X to set PRNG seed) * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main/timeout=1800 FindDecoderBugs * @author Martin Buchholz * @key randomness diff --git a/jdk/test/sun/nio/cs/FindEncoderBugs.java b/jdk/test/sun/nio/cs/FindEncoderBugs.java index 091686593f1..77bb3ba094d 100644 --- a/jdk/test/sun/nio/cs/FindEncoderBugs.java +++ b/jdk/test/sun/nio/cs/FindEncoderBugs.java @@ -26,6 +26,7 @@ * @bug 6233345 6381699 6381702 6381705 6381706 * @summary Encode many char sequences in many ways * @library /test/lib + * @build jdk.test.lib.RandomFactory * @run main/timeout=1200 FindEncoderBugs * @author Martin Buchholz * @key randomness diff --git a/jdk/test/sun/security/ec/SignatureOffsets.java b/jdk/test/sun/security/ec/SignatureOffsets.java index 288ca39731e..3570258c861 100644 --- a/jdk/test/sun/security/ec/SignatureOffsets.java +++ b/jdk/test/sun/security/ec/SignatureOffsets.java @@ -35,6 +35,7 @@ import java.security.SignatureException; * generation, the test tries to verify signature with the above API * and passing in different signature offset (0, 33, 66, 99). * @library /test/lib + * @build jdk.test.lib.RandomFactory * @compile ../../../java/security/Signature/Offsets.java * @run main SignatureOffsets SunEC NONEwithECDSA * @run main SignatureOffsets SunEC SHA1withECDSA diff --git a/jdk/test/sun/security/krb5/auto/ModuleName.java b/jdk/test/sun/security/krb5/auto/ModuleName.java index 499d35ac3a1..fb59d33789b 100644 --- a/jdk/test/sun/security/krb5/auto/ModuleName.java +++ b/jdk/test/sun/security/krb5/auto/ModuleName.java @@ -27,6 +27,12 @@ * @summary GSSContext type when jdk.security.jgss is not available * @library /test/lib * @compile -XDignore.symbol.file ModuleName.java + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main/othervm ModuleName */ diff --git a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java index d138d928289..6b14f144841 100644 --- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java +++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java @@ -26,6 +26,7 @@ * @bug 7152176 8168518 8172017 * @summary More krb5 tests * @library ../../../../java/security/testlibrary/ /test/lib + * @build jdk.test.lib.Platform * @run main/othervm/timeout=300 ReplayCacheTestProc */ diff --git a/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh b/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh index 0d9a7d7a129..59907d5c7bd 100644 --- a/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh +++ b/jdk/test/sun/security/krb5/auto/rcache_usemd5.sh @@ -24,6 +24,7 @@ # @test # @bug 8168518 # @library ../../../../java/security/testlibrary/ /test/lib +# @build jdk.test.lib.Platform # @run main/othervm/timeout=300 -Djdk.krb5.rcache.useMD5=true # -Dtest.service=host ReplayCacheTestProc # @summary testing jdk.krb5.rcache.useMD5. This action is put in a separate diff --git a/jdk/test/sun/security/mscapi/SignatureOffsets.java b/jdk/test/sun/security/mscapi/SignatureOffsets.java index e0d2a816fda..bff9620dc74 100644 --- a/jdk/test/sun/security/mscapi/SignatureOffsets.java +++ b/jdk/test/sun/security/mscapi/SignatureOffsets.java @@ -35,6 +35,7 @@ import java.security.SignatureException; * generation, the test tries to verify signature with the above API * and passing in different signature offset (0, 33, 66, 99). * @library /test/lib + * @build jdk.test.lib.RandomFactory * @compile ../../../java/security/Signature/Offsets.java * @requires os.family == "windows" * @run main SignatureOffsets SunMSCAPI NONEwithRSA diff --git a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java index 9ffab3d5051..9662db995d2 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java @@ -29,6 +29,7 @@ * @library .. * @library /test/lib * @modules jdk.crypto.cryptoki + * @build jdk.test.lib.RandomFactory * @run main/othervm -Djava.security.debug=sunpkcs11 TestKeyPairGenerator * @run main/othervm -Djava.security.debug=sunpkcs11 TestKeyPairGenerator * sm TestKeyPairGenerator.policy diff --git a/jdk/test/sun/security/rsa/SignatureOffsets.java b/jdk/test/sun/security/rsa/SignatureOffsets.java index bebaa8ba1f8..c8700225853 100644 --- a/jdk/test/sun/security/rsa/SignatureOffsets.java +++ b/jdk/test/sun/security/rsa/SignatureOffsets.java @@ -35,6 +35,7 @@ import java.security.SignatureException; * generation, the test tries to verify signature with the above API * and passing in different signature offset (0, 33, 66, 99). * @library /test/lib + * @build jdk.test.lib.RandomFactory * @compile ../../../java/security/Signature/Offsets.java * @run main SignatureOffsets SunRsaSign MD2withRSA * @run main SignatureOffsets SunRsaSign MD5withRSA diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java index 2a6ffb2d135..b0e0a9e1248 100644 --- a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java +++ b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java @@ -50,6 +50,12 @@ import jdk.test.lib.process.ProcessTools; * @test * @summary Verify the restrictions for certificate path on JSSE with custom trust store. * @library /test/lib + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @compile JSSEClient.java * @run main/othervm -Djava.security.debug=certpath TLSRestrictions DEFAULT * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C1 diff --git a/jdk/test/sun/security/ssl/rsa/SignatureOffsets.java b/jdk/test/sun/security/ssl/rsa/SignatureOffsets.java index 9b761d3a6fc..9f3110cae21 100644 --- a/jdk/test/sun/security/ssl/rsa/SignatureOffsets.java +++ b/jdk/test/sun/security/ssl/rsa/SignatureOffsets.java @@ -35,6 +35,7 @@ import java.security.SignatureException; * generation, the test tries to verify signature with the above API * and passing in different signature offset (0, 33, 66, 99). * @library /test/lib + * @build jdk.test.lib.RandomFactory * @compile ../../../../java/security/Signature/Offsets.java * @run main SignatureOffsets SunJSSE MD2withRSA * @run main SignatureOffsets SunJSSE MD5withRSA diff --git a/jdk/test/sun/security/tools/jarsigner/AltProvider.java b/jdk/test/sun/security/tools/jarsigner/AltProvider.java index f44f9e42213..e2c8e093042 100644 --- a/jdk/test/sun/security/tools/jarsigner/AltProvider.java +++ b/jdk/test/sun/security/tools/jarsigner/AltProvider.java @@ -27,6 +27,15 @@ * @summary -providerPath, -providerClass, -addprovider, and -providerArg * @library /test/lib * @modules java.base/jdk.internal.misc + * @build jdk.test.lib.util.JarUtils + * jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * @run main AltProvider */ import jdk.test.lib.JDKToolLauncher; diff --git a/jdk/test/sun/security/tools/jarsigner/Options.java b/jdk/test/sun/security/tools/jarsigner/Options.java index ed2dda9ba96..bf736e47cfa 100644 --- a/jdk/test/sun/security/tools/jarsigner/Options.java +++ b/jdk/test/sun/security/tools/jarsigner/Options.java @@ -31,6 +31,8 @@ * jdk.jartool/sun.security.tools.jarsigner * java.base/sun.security.pkcs * java.base/sun.security.x509 + * @build jdk.test.lib.util.JarUtils + * @run main Options */ import com.sun.jarsigner.ContentSigner; diff --git a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java index 795ec89eb0b..dac7d43923f 100644 --- a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java +++ b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java @@ -68,6 +68,14 @@ import sun.security.x509.X500Name; * java.base/sun.security.tools.keytool * @library /lib/testlibrary * @library /test/lib + * @build jdk.test.lib.util.JarUtils + * jdk.test.lib.SecurityTools + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main/timeout=600 TimestampCheck */ public class TimestampCheck { diff --git a/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java b/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java index 8c07047586a..79d9f1ad267 100644 --- a/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java +++ b/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java @@ -36,6 +36,7 @@ import jdk.test.lib.util.JarUtils; * java.base/sun.security.util * java.base/sun.security.x509 * java.management + * @build jdk.test.lib.util.JarUtils * @run main TsacertOptionTest */ public class TsacertOptionTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/Warning.java b/jdk/test/sun/security/tools/jarsigner/Warning.java index c4760c488fc..a2dfd582f95 100644 --- a/jdk/test/sun/security/tools/jarsigner/Warning.java +++ b/jdk/test/sun/security/tools/jarsigner/Warning.java @@ -35,6 +35,8 @@ import java.util.Arrays; * @bug 8024302 8026037 8130132 * @summary warnings, errors and -strict * @library /lib/testlibrary /test/lib + * @build jdk.test.lib.util.JarUtils + * @run main Warning */ public class Warning { diff --git a/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java b/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java index 2051c2525b3..4097c02e6c2 100644 --- a/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java +++ b/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java @@ -26,6 +26,13 @@ * @bug 8047305 8075618 * @summary Tests jarsigner tool and JarSigner API work with multi-release JAR files. * @library /test/lib + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main MVJarSigningTest */ diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java index 2e0bac3f740..dc19edb3571 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/AliasNotInStoreTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for aliasNotInStore warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main AliasNotInStoreTest */ public class AliasNotInStoreTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java index f0d45d7750a..a2a081bf655 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/BadExtendedKeyUsageTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for badExtendedKeyUsage warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main BadExtendedKeyUsageTest */ public class BadExtendedKeyUsageTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java index 2a3c79a6a63..7a1e243c31b 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java @@ -30,6 +30,7 @@ import jdk.test.lib.util.JarUtils; * @summary Test for badKeyUsage warning * @library /lib/testlibrary /test/lib ../ * @ignore until 8026393 is fixed + * @build jdk.test.lib.util.JarUtils * @run main BadKeyUsageTest */ public class BadKeyUsageTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java index 742b36f5bb0..1dd605caebc 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/BadNetscapeCertTypeTest.java @@ -33,6 +33,7 @@ import java.util.Base64; * @bug 8024302 8026037 * @summary Test for badNetscapeCertType warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main BadNetscapeCertTypeTest */ public class BadNetscapeCertTypeTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java index 197a4137538..d46bc065af0 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/ChainNotValidatedTest.java @@ -31,6 +31,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for chainNotValidated warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main ChainNotValidatedTest */ public class ChainNotValidatedTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java index 10d6f9358a9..99595905b66 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiredCertTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for hasExpiredCert warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main HasExpiredCertTest */ public class HasExpiredCertTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java index be936dcbec3..a991ebcba89 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/HasExpiringCertTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for hasExpiringCert warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main HasExpiringCertTest */ public class HasExpiringCertTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java index a4ffdae18d6..17653478891 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/HasUnsignedEntryTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for hasUnsignedEntry warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main HasUnsignedEntryTest */ public class HasUnsignedEntryTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java index 73ccb0e6562..07aa895ab3a 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/MultipleWarningsTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Checks if jarsigner prints appropriate warnings * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main MultipleWarningsTest */ public class MultipleWarningsTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java index 5fda7782fd6..ac506f42bb1 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/NoTimestampTest.java @@ -30,6 +30,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Checks warnings if -tsa and -tsacert options are not specified * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main NoTimestampTest */ public class NoTimestampTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java index 041b715d46b..d4e8982f2f7 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/NotSignedByAliasTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for notSignedByAlias warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main NotSignedByAliasTest */ public class NotSignedByAliasTest extends Test { diff --git a/jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java b/jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java index a63ab253e96..937082c16a9 100644 --- a/jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java +++ b/jdk/test/sun/security/tools/jarsigner/warnings/NotYetValidCertTest.java @@ -29,6 +29,7 @@ import jdk.test.lib.util.JarUtils; * @bug 8024302 8026037 * @summary Test for notYetValidCert warning * @library /lib/testlibrary /test/lib ../ + * @build jdk.test.lib.util.JarUtils * @run main NotYetValidCertTest */ public class NotYetValidCertTest extends Test { diff --git a/jdk/test/sun/security/tools/keytool/ImportPrompt.java b/jdk/test/sun/security/tools/keytool/ImportPrompt.java index 50bd690371e..ab61b04b93d 100644 --- a/jdk/test/sun/security/tools/keytool/ImportPrompt.java +++ b/jdk/test/sun/security/tools/keytool/ImportPrompt.java @@ -33,6 +33,14 @@ import java.security.KeyStore; * @bug 8172975 * @summary SecurityTools.keytool() needs to accept user input * @library /test/lib + * @build jdk.test.lib.SecurityTools + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * @run main ImportPrompt */ public class ImportPrompt { diff --git a/jdk/test/sun/security/tools/keytool/PrintSSL.java b/jdk/test/sun/security/tools/keytool/PrintSSL.java index 2f4a4ff8b59..ea9c6147af3 100644 --- a/jdk/test/sun/security/tools/keytool/PrintSSL.java +++ b/jdk/test/sun/security/tools/keytool/PrintSSL.java @@ -26,6 +26,13 @@ * @bug 6480981 8160624 * @summary keytool should be able to import certificates from remote SSL server * @library /test/lib + * @build jdk.test.lib.SecurityTools + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main/othervm PrintSSL */ diff --git a/jdk/test/sun/security/tools/keytool/ReadJar.java b/jdk/test/sun/security/tools/keytool/ReadJar.java index ef6d1c868b9..464936cfc07 100644 --- a/jdk/test/sun/security/tools/keytool/ReadJar.java +++ b/jdk/test/sun/security/tools/keytool/ReadJar.java @@ -26,6 +26,15 @@ * @bug 6890872 8168882 * @summary keytool -printcert to recognize signed jar files * @library /test/lib + * @build jdk.test.lib.SecurityTools + * jdk.test.lib.util.JarUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * @run main ReadJar */ import java.nio.file.Files; diff --git a/jdk/test/sun/security/tools/keytool/WeakAlg.java b/jdk/test/sun/security/tools/keytool/WeakAlg.java index bb7ae777371..d570a79e800 100644 --- a/jdk/test/sun/security/tools/keytool/WeakAlg.java +++ b/jdk/test/sun/security/tools/keytool/WeakAlg.java @@ -30,6 +30,13 @@ * @modules java.base/sun.security.tools.keytool * java.base/sun.security.tools * java.base/sun.security.util + * @build jdk.test.lib.SecurityTools + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run main/othervm/timeout=600 -Duser.language=en -Duser.country=US WeakAlg */ diff --git a/jdk/test/tools/jar/InputFilesTest.java b/jdk/test/tools/jar/InputFilesTest.java index e853dafa03a..3dc08293a76 100644 --- a/jdk/test/tools/jar/InputFilesTest.java +++ b/jdk/test/tools/jar/InputFilesTest.java @@ -30,6 +30,8 @@ * demonstrating identical behavior to JDK 8 jar tool. * @library /test/lib * @modules jdk.jartool + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run testng InputFilesTest */ diff --git a/jdk/test/tools/jar/ReleaseBeforeFiles.java b/jdk/test/tools/jar/ReleaseBeforeFiles.java index 8272eb44273..4aaa8df7aa4 100644 --- a/jdk/test/tools/jar/ReleaseBeforeFiles.java +++ b/jdk/test/tools/jar/ReleaseBeforeFiles.java @@ -29,6 +29,8 @@ * not the --release option is preceded by a file name. * @library /test/lib * @modules jdk.jartool/sun.tools.jar + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run testng ReleaseBeforeFiles */ diff --git a/jdk/test/tools/jar/compat/CLICompatibility.java b/jdk/test/tools/jar/compat/CLICompatibility.java index 21cf815a573..e32287d5690 100644 --- a/jdk/test/tools/jar/compat/CLICompatibility.java +++ b/jdk/test/tools/jar/compat/CLICompatibility.java @@ -50,7 +50,9 @@ import static org.testng.Assert.assertTrue; * @test * @bug 8170952 * @library /lib/testlibrary /test/lib - * @build jdk.testlibrary.JDKToolFinder + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * jdk.testlibrary.JDKToolFinder * @run testng CLICompatibility * @summary Basic test for compatibility of CLI options */ diff --git a/jdk/test/tools/jar/mmrjar/Basic.java b/jdk/test/tools/jar/mmrjar/Basic.java index 7a9cdaa46c7..22a7a927357 100644 --- a/jdk/test/tools/jar/mmrjar/Basic.java +++ b/jdk/test/tools/jar/mmrjar/Basic.java @@ -30,6 +30,8 @@ * jdk.compiler * jdk.jartool * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run testng Basic */ diff --git a/jdk/test/tools/jar/modularJar/Basic.java b/jdk/test/tools/jar/modularJar/Basic.java index 9b81495a0f1..183afdeb787 100644 --- a/jdk/test/tools/jar/modularJar/Basic.java +++ b/jdk/test/tools/jar/modularJar/Basic.java @@ -50,7 +50,9 @@ import static java.lang.System.out; * @library /lib/testlibrary /test/lib * @modules jdk.compiler * jdk.jartool - * @build jdk.testlibrary.JDKToolFinder + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * jdk.testlibrary.JDKToolFinder * @compile Basic.java * @run testng Basic * @summary Tests for plain Modular jars & Multi-Release Modular jars diff --git a/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java b/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java index f08422061f1..6f17f895dab 100644 --- a/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java +++ b/jdk/test/tools/jar/multiRelease/ApiValidatorTest.java @@ -28,7 +28,14 @@ * @modules java.base/jdk.internal.misc * jdk.compiler * jdk.jartool - * @build MRTestBase + * @build jdk.test.lib.util.FileUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * MRTestBase * @run testng/timeout=1200 ApiValidatorTest */ diff --git a/jdk/test/tools/jar/multiRelease/Basic.java b/jdk/test/tools/jar/multiRelease/Basic.java index 37f50d2403b..d46ee791f4f 100644 --- a/jdk/test/tools/jar/multiRelease/Basic.java +++ b/jdk/test/tools/jar/multiRelease/Basic.java @@ -27,7 +27,14 @@ * @modules java.base/jdk.internal.misc * jdk.compiler * jdk.jartool - * @build MRTestBase + * @build jdk.test.lib.util.FileUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * MRTestBase * @run testng Basic */ diff --git a/jdk/test/tools/jar/multiRelease/Basic1.java b/jdk/test/tools/jar/multiRelease/Basic1.java index e01ce8fe2f8..9f86eb029cd 100644 --- a/jdk/test/tools/jar/multiRelease/Basic1.java +++ b/jdk/test/tools/jar/multiRelease/Basic1.java @@ -27,8 +27,13 @@ * @modules java.base/jdk.internal.misc * jdk.compiler * jdk.jartool - * @build jdk.test.lib.JDKToolFinder jdk.test.lib.Utils - * @build MRTestBase + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* + * MRTestBase * @run testng Basic1 */ diff --git a/jdk/test/tools/jar/multiRelease/RuntimeTest.java b/jdk/test/tools/jar/multiRelease/RuntimeTest.java index 7de864c26a9..e739dccabf4 100644 --- a/jdk/test/tools/jar/multiRelease/RuntimeTest.java +++ b/jdk/test/tools/jar/multiRelease/RuntimeTest.java @@ -26,6 +26,13 @@ * @summary Test Multi-Release jar usage in runtime * @library /test/lib * @modules jdk.compiler + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng RuntimeTest */ diff --git a/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java b/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java index a61f592f55d..1841fed5181 100644 --- a/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java +++ b/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java @@ -29,9 +29,14 @@ * @library /test/lib * @modules java.base/jdk.internal.jimage * java.base/jdk.internal.module - * @build jdk.test.lib.process.* + * @build jdk.test.lib.Utils + * jdk.test.lib.Asserts + * jdk.test.lib.JDKToolFinder + * jdk.test.lib.JDKToolLauncher + * jdk.test.lib.Platform + * jdk.test.lib.process.* * @run testng JLinkMultiReleaseJarTest -*/ + */ import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java index 15babb5ad33..ca0584f2b93 100644 --- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java +++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java @@ -42,8 +42,10 @@ import static org.testng.Assert.*; * @test * @library /lib/testlibrary /test/lib * @modules jdk.compiler jdk.jlink - * @build CompiledVersionTest jdk.testlibrary.ProcessTools - * jdk.test.lib.compiler.CompilerUtils + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform + * CompiledVersionTest jdk.testlibrary.ProcessTools * @run testng CompiledVersionTest */ diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java index 6c849f37785..827b88be58e 100644 --- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java +++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java @@ -48,8 +48,10 @@ import static org.testng.Assert.*; * @modules jdk.compiler jdk.jlink * @modules java.base/jdk.internal.module * @modules java.base/jdk.internal.org.objectweb.asm - * @build ModuleTargetHelper UserModuleTest jdk.testlibrary.ProcessTools - * jdk.test.lib.compiler.CompilerUtils + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform + * ModuleTargetHelper UserModuleTest jdk.testlibrary.ProcessTools * @run testng UserModuleTest */ diff --git a/jdk/test/tools/jmod/JmodNegativeTest.java b/jdk/test/tools/jmod/JmodNegativeTest.java index 3bc2359c2cd..30205067b0e 100644 --- a/jdk/test/tools/jmod/JmodNegativeTest.java +++ b/jdk/test/tools/jmod/JmodNegativeTest.java @@ -27,6 +27,8 @@ * @modules jdk.compiler * jdk.jlink * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform * @run testng JmodNegativeTest * @summary Negative tests for jmod */ diff --git a/jdk/test/tools/jmod/JmodTest.java b/jdk/test/tools/jmod/JmodTest.java index ffd3a903a49..d6a80deaec7 100644 --- a/jdk/test/tools/jmod/JmodTest.java +++ b/jdk/test/tools/jmod/JmodTest.java @@ -29,6 +29,8 @@ * @modules jdk.compiler * jdk.jlink * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform * @run testng/othervm -Djava.io.tmpdir=. JmodTest */ diff --git a/jdk/test/tools/jmod/hashes/HashesTest.java b/jdk/test/tools/jmod/hashes/HashesTest.java index e71efe91bc5..867927685d4 100644 --- a/jdk/test/tools/jmod/hashes/HashesTest.java +++ b/jdk/test/tools/jmod/hashes/HashesTest.java @@ -31,6 +31,8 @@ * jdk.compiler * jdk.jartool * jdk.jlink + * @build jdk.test.lib.compiler.ModuleInfoMaker + * jdk.test.lib.compiler.CompilerUtils * @run testng HashesTest */ diff --git a/jdk/test/tools/launcher/LauncherMessageTest.java b/jdk/test/tools/launcher/LauncherMessageTest.java index 6643f122ea1..ff1ee640bf8 100644 --- a/jdk/test/tools/launcher/LauncherMessageTest.java +++ b/jdk/test/tools/launcher/LauncherMessageTest.java @@ -25,6 +25,8 @@ * @test * @bug 8167063 * @library /test/lib + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils * @run main LauncherMessageTest * @summary LauncherHelper should not throw JNI error for LinkageError */ diff --git a/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java b/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java index 66c4930c0ca..716e0bf0ec0 100644 --- a/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java +++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java @@ -27,7 +27,9 @@ * @summary Basic argument validation for --add-exports * @library /lib/testlibrary /test/lib * @modules jdk.compiler - * @build jdk.testlibrary.* + * @build jdk.test.lib.compiler.ModuleInfoMaker + * jdk.test.lib.compiler.CompilerUtils + * jdk.testlibrary.* * @run testng AddExportsTestWarningError */ diff --git a/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java b/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java index 079acccf400..d1c69378acf 100644 --- a/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java +++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java @@ -27,8 +27,10 @@ * @summary Basic argument validation for --add-reads * @library /lib/testlibrary /test/lib * @modules jdk.compiler - * @build AddReadsTestWarningError + * @build jdk.test.lib.compiler.ModuleInfoMaker + * @build jdk.test.lib.compiler.CompilerUtils * @build jdk.testlibrary.* + * @build AddReadsTestWarningError * @run testng AddReadsTestWarningError */ diff --git a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java index aad3bd8d40b..29acb1f77a4 100644 --- a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java +++ b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java @@ -28,6 +28,8 @@ * @library /lib/testlibrary /test/lib * @modules jdk.compiler * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.util.FileUtils + * jdk.test.lib.Platform * @run testng PatchSystemModules */ From 77a5de508903975dcd620d97ceb0f9a81996fb93 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Mon, 12 Jun 2017 12:45:52 -0700 Subject: [PATCH 077/130] 8181762: add explicit @build actions for jdk.test.lib classes in all :tier3 tests Reviewed-by: alanb --- .../javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java index 3b722971385..e2eb71d6fec 100644 --- a/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java +++ b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java @@ -32,6 +32,7 @@ * (number of pages, sizes, colors). Use -Dseed=X to set * the random generator seed. * + * @build jdk.test.lib.RandomFactory * @run main MultiPageTest * @key randomness */ From b20212e8cee2d4c07ff3595f8623ac746115121e Mon Sep 17 00:00:00 2001 From: John Jiang Date: Mon, 12 Jun 2017 21:56:38 -0700 Subject: [PATCH 078/130] 8179564: Missing @bug for tests added with JDK-8165367 Add @bug 8165367 Reviewed-by: weijun --- .../sun/security/ssl/CertPathRestrictions/TLSRestrictions.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java index b0e0a9e1248..fad928f5503 100644 --- a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java +++ b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java @@ -48,6 +48,7 @@ import jdk.test.lib.process.ProcessTools; /* * @test + * @bug 8165367 * @summary Verify the restrictions for certificate path on JSSE with custom trust store. * @library /test/lib * @build jdk.test.lib.Utils From 58eac96b16c1010bd61e169ac521a9e9e6cb95f1 Mon Sep 17 00:00:00 2001 From: Ron Pressler Date: Tue, 13 Jun 2017 01:34:30 +0300 Subject: [PATCH 079/130] 8161207: remove extra MethodHandle subclass in MethodHandleImpl Add intrinsic name to LambdaForm.NamedFunction, but keep IntrinsicMethodHandle; interim solution Co-authored-by: Vlaidmir Ivanov Reviewed-by: psandoz --- .../classes/java/lang/invoke/LambdaForm.java | 25 +++++++++++++------ .../java/lang/invoke/LambdaFormEditor.java | 7 +++--- .../java/lang/invoke/MethodHandleImpl.java | 17 ++++++------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java index bde94381ddc..efb7e9490dd 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java @@ -1092,13 +1092,24 @@ class LambdaForm { final MemberName member; private @Stable MethodHandle resolvedHandle; @Stable MethodHandle invoker; + private final MethodHandleImpl.Intrinsic intrinsicName; NamedFunction(MethodHandle resolvedHandle) { - this(resolvedHandle.internalMemberName(), resolvedHandle); + this(resolvedHandle.internalMemberName(), resolvedHandle, MethodHandleImpl.Intrinsic.NONE); + } + NamedFunction(MethodHandle resolvedHandle, MethodHandleImpl.Intrinsic intrinsic) { + this(resolvedHandle.internalMemberName(), resolvedHandle, intrinsic); } NamedFunction(MemberName member, MethodHandle resolvedHandle) { + this(member, resolvedHandle, MethodHandleImpl.Intrinsic.NONE); + } + NamedFunction(MemberName member, MethodHandle resolvedHandle, MethodHandleImpl.Intrinsic intrinsic) { this.member = member; this.resolvedHandle = resolvedHandle; + this.intrinsicName = intrinsic; + assert(resolvedHandle == null || + resolvedHandle.intrinsicName() == MethodHandleImpl.Intrinsic.NONE || + resolvedHandle.intrinsicName() == intrinsic) : resolvedHandle.intrinsicName() + " != " + intrinsic; // The following assert is almost always correct, but will fail for corner cases, such as PrivateInvokeTest. //assert(!isInvokeBasic(member)); } @@ -1111,6 +1122,7 @@ class LambdaForm { // necessary to pass BigArityTest this.member = Invokers.invokeBasicMethod(basicInvokerType); } + this.intrinsicName = MethodHandleImpl.Intrinsic.NONE; assert(isInvokeBasic(member)); } @@ -1263,8 +1275,7 @@ class LambdaForm { } public MethodHandleImpl.Intrinsic intrinsicName() { - return resolvedHandle == null ? MethodHandleImpl.Intrinsic.NONE - : resolvedHandle.intrinsicName(); + return intrinsicName; } } @@ -1741,15 +1752,15 @@ class LambdaForm { Name[] idNames = new Name[] { argument(0, L_TYPE), argument(1, type) }; idForm = new LambdaForm(2, idNames, 1, Kind.IDENTITY); idForm.compileToBytecode(); - idFun = new NamedFunction(idMem, MethodHandleImpl.makeIntrinsic( - idMem.getInvocationType(), idForm, MethodHandleImpl.Intrinsic.IDENTITY)); + idFun = new NamedFunction(idMem, SimpleMethodHandle.make(idMem.getInvocationType(), idForm), + MethodHandleImpl.Intrinsic.IDENTITY); Object zeValue = Wrapper.forBasicType(btChar).zero(); Name[] zeNames = new Name[] { argument(0, L_TYPE), new Name(idFun, zeValue) }; zeForm = new LambdaForm(1, zeNames, 1, Kind.ZERO); zeForm.compileToBytecode(); - zeFun = new NamedFunction(zeMem, MethodHandleImpl.makeIntrinsic( - zeMem.getInvocationType(), zeForm, MethodHandleImpl.Intrinsic.ZERO)); + zeFun = new NamedFunction(zeMem, SimpleMethodHandle.make(zeMem.getInvocationType(), zeForm), + MethodHandleImpl.Intrinsic.ZERO); } LF_zero[ord] = zeForm; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java index e066a60838c..542500efc3f 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -541,7 +541,7 @@ class LambdaFormEditor { // adjust the arguments MethodHandle aload = MethodHandles.arrayElementGetter(erasedArrayType); for (int i = 0; i < arrayLength; i++) { - Name loadArgument = new Name(aload, spreadParam, i); + Name loadArgument = new Name(new NamedFunction(aload, Intrinsic.ARRAY_LOAD), spreadParam, i); buf.insertExpression(exprPos + i, loadArgument); buf.replaceParameterByCopy(pos + i, exprPos + i); } @@ -604,7 +604,8 @@ class LambdaFormEditor { for (int i = 0; i < collectorArity; i++) { newParams[i] = new Name(pos + i, argType); } - Name callCombiner = new Name(arrayCollector, (Object[]) /*...*/ newParams); + Name callCombiner = new Name(new NamedFunction(arrayCollector, Intrinsic.NEW_ARRAY), + (Object[]) /*...*/ newParams); // insert the new expression int exprPos = lambdaForm.arity(); diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index a12fa138252..d6222f99cc5 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -592,7 +592,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; names[nameCursor++] = new Name(getFunction(NF_checkSpreadArgument), array, spreadArgCount); for (int j = 0; j < spreadArgCount; i++, j++) { indexes[i] = nameCursor; - names[nameCursor++] = new Name(aload, array, j); + names[nameCursor++] = new Name(new NamedFunction(aload, Intrinsic.ARRAY_LOAD), array, j); } } else if (i < indexes.length) { indexes[i] = argIndex; @@ -937,7 +937,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; names[PROFILE] = new Name(getFunction(NF_profileBoolean), names[CALL_TEST], names[GET_COUNTERS]); } // call selectAlternative - names[SELECT_ALT] = new Name(getConstantHandle(MH_selectAlternative), names[TEST], names[GET_TARGET], names[GET_FALLBACK]); + names[SELECT_ALT] = new Name(new NamedFunction(getConstantHandle(MH_selectAlternative), Intrinsic.SELECT_ALTERNATIVE), names[TEST], names[GET_TARGET], names[GET_FALLBACK]); // call target or fallback invokeArgs[0] = names[SELECT_ALT]; @@ -1008,7 +1008,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; Object[] args = new Object[invokeBasic.type().parameterCount()]; args[0] = names[GET_COLLECT_ARGS]; System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT-ARG_BASE); - names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.GUARD_WITH_CATCH), args); + names[BOXED_ARGS] = new Name(new NamedFunction(invokeBasic, Intrinsic.GUARD_WITH_CATCH), args); // t_{i+1}:L=MethodHandleImpl.guardWithCatch(target:L,exType:L,catcher:L,t_{i}:L); Object[] gwcArgs = new Object[] {names[GET_TARGET], names[GET_CLASS], names[GET_CATCHER], names[BOXED_ARGS]}; @@ -1896,7 +1896,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; Object[] args = new Object[invokeBasic.type().parameterCount()]; args[0] = names[GET_COLLECT_ARGS]; System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT - ARG_BASE); - names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.LOOP), args); + names[BOXED_ARGS] = new Name(new NamedFunction(invokeBasic, Intrinsic.LOOP), args); // t_{i+1}:L=MethodHandleImpl.loop(localTypes:L,clauses:L,t_{i}:L); Object[] lArgs = @@ -2133,7 +2133,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; Object[] args = new Object[invokeBasic.type().parameterCount()]; args[0] = names[GET_COLLECT_ARGS]; System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT-ARG_BASE); - names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.TRY_FINALLY), args); + names[BOXED_ARGS] = new Name(new NamedFunction(invokeBasic, Intrinsic.TRY_FINALLY), args); // t_{i+1}:L=MethodHandleImpl.tryFinally(target:L,exType:L,catcher:L,t_{i}:L); Object[] tfArgs = new Object[] {names[GET_TARGET], names[GET_CLEANUP], names[BOXED_ARGS]}; @@ -2225,9 +2225,8 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "fillNewTypedArray", MethodType.methodType(Object[].class, Object[].class, Integer.class, Object[].class)); case MH_selectAlternative: - return makeIntrinsic(IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "selectAlternative", - MethodType.methodType(MethodHandle.class, boolean.class, MethodHandle.class, MethodHandle.class)), - Intrinsic.SELECT_ALTERNATIVE); + return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "selectAlternative", + MethodType.methodType(MethodHandle.class, boolean.class, MethodHandle.class, MethodHandle.class)); case MH_countedLoopPred: return IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "countedLoopPredicate", MethodType.methodType(boolean.class, int.class, int.class)); From 5ebd531f92805aa6a6d633af105a0bac290e1c19 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Tue, 13 Jun 2017 11:09:59 -0400 Subject: [PATCH 080/130] 8086005: Define __STDC_xxx_MACROS config macros globally via build system Moved macro definitions to hotspot build configuration Reviewed-by: erikj, eosterlund --- common/autoconf/flags.m4 | 7 ++++++- common/autoconf/generated-configure.sh | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 9bc4b485000..fa9bcdc785c 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -910,7 +910,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER], $2CFLAGS_JDK="[$]$2CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" elif test "x$TOOLCHAIN_TYPE" = xxlc; then - $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT -D__STDC_FORMAT_MACROS" + $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT" $2CFLAGS_JDK="[$]$2CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then @@ -975,6 +975,11 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER], fi fi + # Always enable optional macros for VM. + $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_FORMAT_MACROS" + $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_LIMIT_MACROS" + $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_CONSTANT_MACROS" + # Setup target OS define. Use OS target name but in upper case. OPENJDK_$1_OS_UPPERCASE=`$ECHO $OPENJDK_$1_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D$OPENJDK_$1_OS_UPPERCASE" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index c9d0e858b28..37a67f88323 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -5148,7 +5148,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1496941901 +DATE_WHEN_GENERATED=1497366236 ############################################################################### # @@ -51424,7 +51424,7 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" elif test "x$TOOLCHAIN_TYPE" = xxlc; then - JVM_CFLAGS="$JVM_CFLAGS -D_REENTRANT -D__STDC_FORMAT_MACROS" + JVM_CFLAGS="$JVM_CFLAGS -D_REENTRANT" CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then @@ -51489,6 +51489,11 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA fi fi + # Always enable optional macros for VM. + JVM_CFLAGS="$JVM_CFLAGS -D__STDC_FORMAT_MACROS" + JVM_CFLAGS="$JVM_CFLAGS -D__STDC_LIMIT_MACROS" + JVM_CFLAGS="$JVM_CFLAGS -D__STDC_CONSTANT_MACROS" + # Setup target OS define. Use OS target name but in upper case. OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE" @@ -52252,7 +52257,7 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" elif test "x$TOOLCHAIN_TYPE" = xxlc; then - OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_REENTRANT -D__STDC_FORMAT_MACROS" + OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D_REENTRANT" OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then @@ -52317,6 +52322,11 @@ $as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLA fi fi + # Always enable optional macros for VM. + OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D__STDC_FORMAT_MACROS" + OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D__STDC_LIMIT_MACROS" + OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS -D__STDC_CONSTANT_MACROS" + # Setup target OS define. Use OS target name but in upper case. OPENJDK_BUILD_OS_UPPERCASE=`$ECHO $OPENJDK_BUILD_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="$OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK -D$OPENJDK_BUILD_OS_UPPERCASE" From bfe58ed881b2101b42893e092a67f9f633de2800 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Tue, 13 Jun 2017 11:21:09 -0700 Subject: [PATCH 081/130] 8181464: Invalid lambda in annotation causes NPE in Lint.augment Reviewed-by: mcimadamore --- .../com/sun/tools/javac/comp/Annotate.java | 23 ++++++++--- .../com/sun/tools/javac/comp/MemberEnter.java | 4 +- .../tools/javac/resources/compiler.properties | 6 +-- .../test/tools/javac/8002286/T8002286.out | 3 +- langtools/test/tools/javac/T8181464/Anno.java | 26 +++++++++++++ .../test/tools/javac/T8181464/Anno2.java | 26 +++++++++++++ .../tools/javac/T8181464/AnnoProcessor.java | 36 ++++++++++++++++++ .../LambdaInAnnotationsCausesNPETest1.java | 11 ++++++ .../LambdaInAnnotationsCausesNPETest1.out | 2 + .../LambdaInAnnotationsCausesNPETest2.java | 11 ++++++ .../LambdaInAnnotationsCausesNPETest2.out | 2 + .../LambdaInAnnotationsCausesNPETest3.java | 15 ++++++++ .../LambdaInAnnotationsCausesNPETest3.out | 2 + .../javac/annotations/neg/AnonSubclass.out | 2 +- .../test/tools/javac/annotations/neg/Z15.out | 2 +- .../annotations/neg/pkg/package-info.out | 2 +- .../tools/javac/diags/examples.not-yet.txt | 2 +- .../examples/AnnoValueMustBeClassLiteral.java | 4 +- .../examples/AnnotationMustBeConstant.java | 37 ++++++++++++++++++ .../examples/AnnotationMustBeConstant2.java | 33 ++++++++++++++++ .../diags/examples/AttrMustBeConstant.java | 4 +- .../EnumAnnoValueMustBeEnumConst.java | 4 +- .../EnumAnnoValueMustBeEnumConst2.java | 38 +++++++++++++++++++ .../Source.out | 2 +- 24 files changed, 273 insertions(+), 24 deletions(-) create mode 100644 langtools/test/tools/javac/T8181464/Anno.java create mode 100644 langtools/test/tools/javac/T8181464/Anno2.java create mode 100644 langtools/test/tools/javac/T8181464/AnnoProcessor.java create mode 100644 langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.java create mode 100644 langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.out create mode 100644 langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.java create mode 100644 langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.out create mode 100644 langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.java create mode 100644 langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.out create mode 100644 langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant.java create mode 100644 langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant2.java create mode 100644 langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst2.java diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java index 9fe870af7a1..9fe62b72da1 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java @@ -42,6 +42,7 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; import com.sun.tools.javac.util.List; import javax.tools.JavaFileObject; + import java.util.*; import static com.sun.tools.javac.code.Flags.SYNTHETIC; @@ -56,8 +57,10 @@ import static com.sun.tools.javac.tree.JCTree.Tag.ANNOTATION; import static com.sun.tools.javac.tree.JCTree.Tag.ASSIGN; import static com.sun.tools.javac.tree.JCTree.Tag.IDENT; import static com.sun.tools.javac.tree.JCTree.Tag.NEWARRAY; + import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag; + /** Enter annotations onto symbols and types (and trees). * * This is also a pseudo stage in the compiler taking care of scheduling when annotations are @@ -565,6 +568,20 @@ public class Annotate { return new Attribute.Error(((JCAnnotation)tree).annotationType.type); } + MemberEnter.InitTreeVisitor initTreeVisitor = new MemberEnter.InitTreeVisitor() { + // the methods below are added to allow class literals on top of constant expressions + @Override + public void visitTypeIdent(JCPrimitiveTypeTree that) {} + + @Override + public void visitTypeArray(JCArrayTypeTree that) {} + }; + tree.accept(initTreeVisitor); + if (!initTreeVisitor.result) { + log.error(tree.pos(), Errors.ExpressionNotAllowableAsAnnotationValue); + return new Attribute.Error(syms.errType); + } + if (expectedElementType.isPrimitive() || (types.isSameType(expectedElementType, syms.stringType) && !expectedElementType.hasTag(TypeTag.ERROR))) { return getAnnotationPrimitiveValue(expectedElementType, tree, env); @@ -614,12 +631,6 @@ public class Annotate { } } - // Class literals look like field accesses of a field named class - // at the tree level - if (TreeInfo.name(tree) != names._class) { - log.error(tree.pos(), "annotation.value.must.be.class.literal"); - return new Attribute.Error(syms.errType); - } return new Attribute.Class(types, (((JCFieldAccess) tree).selected).type); } diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java index 8db5f0899e0..3b3f28de586 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -345,7 +345,7 @@ public class MemberEnter extends JCTree.Visitor { Tag.LT, Tag.LE, Tag.GT, Tag.GE, Tag.EQ, Tag.NE, Tag.BITAND, Tag.BITXOR, Tag.BITOR, Tag.AND, Tag.OR); - private boolean result = true; + boolean result = true; @Override public void visitTree(JCTree tree) { diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index fd556b010b8..e525a6bff58 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -129,15 +129,15 @@ compiler.err.annotation.type.not.applicable.to.type=\ compiler.err.annotation.value.must.be.annotation=\ annotation value must be an annotation -compiler.err.annotation.value.must.be.class.literal=\ - annotation value must be a class literal - compiler.err.annotation.value.must.be.name.value=\ annotation values must be of the form ''name=value'' compiler.err.annotation.value.not.allowable.type=\ annotation value not of an allowable type +compiler.err.expression.not.allowable.as.annotation.value=\ + expression not allowed as annotation value + compiler.err.anon.class.impl.intf.no.args=\ anonymous class implements interface; cannot have arguments diff --git a/langtools/test/tools/javac/8002286/T8002286.out b/langtools/test/tools/javac/8002286/T8002286.out index dd533236d43..2843d58ece7 100644 --- a/langtools/test/tools/javac/8002286/T8002286.out +++ b/langtools/test/tools/javac/8002286/T8002286.out @@ -1,3 +1,2 @@ T8002286.java:8:22: compiler.err.cant.resolve.location.args: kindname.method, value, , , (compiler.misc.location: kindname.annotation, T8002286.Anno, null) -T8002286.java:8:11: compiler.err.cant.resolve.location.args: kindname.method, nonExistent, , , (compiler.misc.location: kindname.class, T8002286, null) -2 errors +1 error diff --git a/langtools/test/tools/javac/T8181464/Anno.java b/langtools/test/tools/javac/T8181464/Anno.java new file mode 100644 index 00000000000..f5eb9652815 --- /dev/null +++ b/langtools/test/tools/javac/T8181464/Anno.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +@interface Anno { + Class> value(); +} diff --git a/langtools/test/tools/javac/T8181464/Anno2.java b/langtools/test/tools/javac/T8181464/Anno2.java new file mode 100644 index 00000000000..fa7dc6bc98a --- /dev/null +++ b/langtools/test/tools/javac/T8181464/Anno2.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +@interface Anno2 { + String value(); +} diff --git a/langtools/test/tools/javac/T8181464/AnnoProcessor.java b/langtools/test/tools/javac/T8181464/AnnoProcessor.java new file mode 100644 index 00000000000..f122d13da89 --- /dev/null +++ b/langtools/test/tools/javac/T8181464/AnnoProcessor.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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.util.Set; +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.element.TypeElement; + +@SupportedAnnotationTypes("*") +public class AnnoProcessor extends AbstractProcessor { + @Override + public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) { + return false; + } +} diff --git a/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.java b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.java new file mode 100644 index 00000000000..2c547136e59 --- /dev/null +++ b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.java @@ -0,0 +1,11 @@ +/* @test /nodynamiccopyright/ + * @bug 8181464 + * @summary Invalid lambda in annotation causes NPE in Lint.augment + * @modules java.compiler + * jdk.compiler + * @compile Anno.java AnnoProcessor.java + * @compile/fail/ref=LambdaInAnnotationsCausesNPETest1.out -XDrawDiagnostics -processor AnnoProcessor -proc:only LambdaInAnnotationsCausesNPETest1.java + */ + +@Anno(value = x -> x) +class LambdaInAnnotationsCausesNPETest1 {} diff --git a/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.out b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.out new file mode 100644 index 00000000000..c0f241b3d9f --- /dev/null +++ b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest1.out @@ -0,0 +1,2 @@ +LambdaInAnnotationsCausesNPETest1.java:10:15: compiler.err.expression.not.allowable.as.annotation.value +1 error diff --git a/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.java b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.java new file mode 100644 index 00000000000..190a79d69ab --- /dev/null +++ b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.java @@ -0,0 +1,11 @@ +/* @test /nodynamiccopyright/ + * @bug 8181464 + * @summary Invalid lambda in annotation causes NPE in Lint.augment + * @modules java.compiler + * jdk.compiler + * @compile Anno.java AnnoProcessor.java + * @compile/fail/ref=LambdaInAnnotationsCausesNPETest2.out -XDrawDiagnostics -processor AnnoProcessor -proc:only LambdaInAnnotationsCausesNPETest2.java + */ + +@Anno(value = (String x) -> x) +class LambdaInAnnotationsCausesNPETest2 {} diff --git a/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.out b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.out new file mode 100644 index 00000000000..96cd8cf1983 --- /dev/null +++ b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest2.out @@ -0,0 +1,2 @@ +LambdaInAnnotationsCausesNPETest2.java:10:15: compiler.err.expression.not.allowable.as.annotation.value +1 error diff --git a/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.java b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.java new file mode 100644 index 00000000000..8fec5261ce3 --- /dev/null +++ b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.java @@ -0,0 +1,15 @@ +/* @test /nodynamiccopyright/ + * @bug 8181464 + * @summary Invalid lambda in annotation causes NPE in Lint.augment + * @modules java.compiler + * jdk.compiler + * @compile Anno2.java AnnoProcessor.java + * @compile/fail/ref=LambdaInAnnotationsCausesNPETest3.out -XDrawDiagnostics -processor AnnoProcessor -proc:only LambdaInAnnotationsCausesNPETest3.java + */ + +@Anno2(value = LambdaInAnnotationsCausesNPETest3.m(x -> x)) +class LambdaInAnnotationsCausesNPETest3 { + static String m(Class> target) { + return null; + } +} diff --git a/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.out b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.out new file mode 100644 index 00000000000..c4c560908ff --- /dev/null +++ b/langtools/test/tools/javac/T8181464/LambdaInAnnotationsCausesNPETest3.out @@ -0,0 +1,2 @@ +LambdaInAnnotationsCausesNPETest3.java:10:51: compiler.err.expression.not.allowable.as.annotation.value +1 error diff --git a/langtools/test/tools/javac/annotations/neg/AnonSubclass.out b/langtools/test/tools/javac/annotations/neg/AnonSubclass.out index 48984a89f78..dd2661e0961 100644 --- a/langtools/test/tools/javac/annotations/neg/AnonSubclass.out +++ b/langtools/test/tools/javac/annotations/neg/AnonSubclass.out @@ -1,2 +1,2 @@ -AnonSubclass.java:10:15: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: java.lang.Object, java.lang.String) +AnonSubclass.java:10:15: compiler.err.expression.not.allowable.as.annotation.value 1 error diff --git a/langtools/test/tools/javac/annotations/neg/Z15.out b/langtools/test/tools/javac/annotations/neg/Z15.out index 587b6b62755..c9baea83212 100644 --- a/langtools/test/tools/javac/annotations/neg/Z15.out +++ b/langtools/test/tools/javac/annotations/neg/Z15.out @@ -1,2 +1,2 @@ -Z15.java:11:36: compiler.err.attribute.value.must.be.constant +Z15.java:11:36: compiler.err.expression.not.allowable.as.annotation.value 1 error diff --git a/langtools/test/tools/javac/annotations/neg/pkg/package-info.out b/langtools/test/tools/javac/annotations/neg/pkg/package-info.out index 11c16e592e3..c383621eb59 100644 --- a/langtools/test/tools/javac/annotations/neg/pkg/package-info.out +++ b/langtools/test/tools/javac/annotations/neg/pkg/package-info.out @@ -1,2 +1,2 @@ -package-info.java:11:20: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: java.lang.Object, java.lang.String) +package-info.java:11:20: compiler.err.expression.not.allowable.as.annotation.value 1 error diff --git a/langtools/test/tools/javac/diags/examples.not-yet.txt b/langtools/test/tools/javac/diags/examples.not-yet.txt index a34685dd48b..2fd24874f12 100644 --- a/langtools/test/tools/javac/diags/examples.not-yet.txt +++ b/langtools/test/tools/javac/diags/examples.not-yet.txt @@ -1,7 +1,7 @@ compiler.err.already.annotated # internal compiler error? compiler.err.already.defined.this.unit # seems to be masked by compiler.err.duplicate.class -compiler.err.annotation.value.not.allowable.type # cannot happen: precluded by complete type-specific tests compiler.err.bad.functional.intf.anno # seems to be masked by compiler.err.annotation.type.not.applicable +compiler.err.annotation.value.not.allowable.type # should be detected in advance by the annotation value visitor compiler.err.cant.read.file # (apt.JavaCompiler?) compiler.err.cant.select.static.class.from.param.type compiler.err.dc.unterminated.string # cannot happen diff --git a/langtools/test/tools/javac/diags/examples/AnnoValueMustBeClassLiteral.java b/langtools/test/tools/javac/diags/examples/AnnoValueMustBeClassLiteral.java index e36d7b46277..8dce57887fe 100644 --- a/langtools/test/tools/javac/diags/examples/AnnoValueMustBeClassLiteral.java +++ b/langtools/test/tools/javac/diags/examples/AnnoValueMustBeClassLiteral.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ * questions. */ -// key: compiler.err.annotation.value.must.be.class.literal +// key: compiler.err.expression.not.allowable.as.annotation.value @interface Anno { Class value(); diff --git a/langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant.java b/langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant.java new file mode 100644 index 00000000000..b9b9fcda2e9 --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +// key: compiler.err.expression.not.allowable.as.annotation.value + +import java.util.function.*; + +@interface Anno { + String value(); +} + +@Anno(value = AnnotationMustBeConstant.m(x -> x)) +class AnnotationMustBeConstant { + static String m(Function f) { + return null; + } +} diff --git a/langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant2.java b/langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant2.java new file mode 100644 index 00000000000..954606615d0 --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/AnnotationMustBeConstant2.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +// key: compiler.err.attribute.value.must.be.constant + +@T(a = AnnotationMustBeConstant2.x) +@interface T { + int a(); +} + +class AnnotationMustBeConstant2 { + static int x; +} diff --git a/langtools/test/tools/javac/diags/examples/AttrMustBeConstant.java b/langtools/test/tools/javac/diags/examples/AttrMustBeConstant.java index 5156fdf15ff..76305a7b932 100644 --- a/langtools/test/tools/javac/diags/examples/AttrMustBeConstant.java +++ b/langtools/test/tools/javac/diags/examples/AttrMustBeConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ * questions. */ -// key: compiler.err.attribute.value.must.be.constant +// key: compiler.err.expression.not.allowable.as.annotation.value @interface Anno { String value(); diff --git a/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst.java b/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst.java index ca7b5e39f3a..16ecfc2fde7 100644 --- a/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst.java +++ b/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,7 @@ * questions. */ -// key: compiler.err.enum.annotation.must.be.enum.constant +// key: compiler.err.expression.not.allowable.as.annotation.value enum E { A, B, C } diff --git a/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst2.java b/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst2.java new file mode 100644 index 00000000000..e7e02c4539e --- /dev/null +++ b/langtools/test/tools/javac/diags/examples/EnumAnnoValueMustBeEnumConst2.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +// key: compiler.err.enum.annotation.must.be.enum.constant + +enum E { + A, + B; + + public static final E e = A; +} + +@interface Anno { + E value(); +} + +@Anno(E.e) +class EnumAnnoValueMustBeEnumConstant { } diff --git a/langtools/test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Source.out b/langtools/test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Source.out index 4440550e4f7..c8cd72c4422 100644 --- a/langtools/test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Source.out +++ b/langtools/test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Source.out @@ -3,5 +3,5 @@ Generated.java:3:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.t Generated.java:4:22: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, E) Generated.java:5:37: compiler.err.annotation.not.valid.for.type: int Generated.java:6:32: compiler.err.annotation.value.not.allowable.type -Generated.java:7:35: compiler.err.annotation.value.must.be.class.literal +Generated.java:7:35: compiler.err.expression.not.allowable.as.annotation.value 6 errors From efb4e963d67d362c386b458c9cc2f64832535703 Mon Sep 17 00:00:00 2001 From: Robert Field Date: Tue, 13 Jun 2017 12:31:28 -0700 Subject: [PATCH 082/130] 8180306: jshell tool: /help -- confusing identifier in feedback mode examples 8179048: jshell tool: /help -- references to "/reset or /reload" should add /env 8179046: jshell tool: /help /edit is missing -all and -start 8181950: jshell tests: longer help documentation breaks tests because of paging Reviewed-by: jlahoda --- .../jshell/tool/ConsoleIOContext.java | 18 ++++++++++- .../jshell/tool/resources/l10n.properties | 31 +++++++++++-------- .../jshell/MergedTabShiftTabCommandTest.java | 3 ++ 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java index ed3ad8c3cc5..223fe7758b1 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java @@ -43,7 +43,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; -import java.util.function.BooleanSupplier; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -962,6 +961,7 @@ class ConsoleIOContext extends IOContext { this.input = input; } + @Override public boolean isRaw() { try { return getSettings().get("-a").contains("-icanon"); @@ -1053,12 +1053,23 @@ class ConsoleIOContext extends IOContext { private static final class TestTerminal extends TerminalSupport { private final StopDetectingInputStream input; + private final int height; public TestTerminal(StopDetectingInputStream input) throws Exception { super(true); setAnsiSupported(false); setEchoEnabled(false); this.input = input; + int h = DEFAULT_HEIGHT; + try { + String hp = System.getProperty("test.terminal.height"); + if (hp != null && !hp.isEmpty()) { + h = Integer.parseInt(hp); + } + } catch (Throwable ex) { + // ignore + } + this.height = h; } @Override @@ -1066,6 +1077,11 @@ class ConsoleIOContext extends IOContext { return input.setInputStream(super.wrapInIfNeeded(in)); } + @Override + public int getHeight() { + return height; + } + } private interface SuspendableTerminal { diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties index e67778189f6..5618b4ca4bd 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties +++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties @@ -249,6 +249,11 @@ If no editor has been set, a simple editor will be launched.\n\ Edit the snippets with the specified snippet ids\n\n\ /edit