src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java
changeset 58223 778fc2dcbdaa
parent 58208 0f3c23c374a4
child 58348 c29e49148be7
--- a/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java	Wed Sep 18 17:31:35 2019 -0400
+++ b/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java	Wed Sep 18 20:49:13 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
      * @throws NullPointerException if {@code ids} is {@code null}
      * @throws IllegalArgumentException if any element in the input array
      *         {@code ids} is {@code <=} {@code 0}.
-     * @throws UnsupportedOperationException if the Java
+     * @throws java.lang.UnsupportedOperationException if the Java
      *         virtual machine implementation does not support CPU time
      *         measurement.
      *
@@ -95,7 +95,7 @@
      * @throws NullPointerException if {@code ids} is {@code null}
      * @throws IllegalArgumentException if any element in the input array
      *         {@code ids} is {@code <=} {@code 0}.
-     * @throws UnsupportedOperationException if the Java
+     * @throws java.lang.UnsupportedOperationException if the Java
      *         virtual machine implementation does not support CPU time
      *         measurement.
      *
@@ -109,44 +109,13 @@
 
     /**
      * Returns an approximation of the total amount of memory, in bytes,
-     * allocated in heap memory for the current thread.
-     * The returned value is an approximation because some Java virtual machine
-     * implementations may use object allocation mechanisms that result in a
-     * delay between the time an object is allocated and the time its size is
-     * recorded.
-     *
-     * <p>
-     * This is a convenience method for local management use and is
-     * equivalent to calling:
-     * <blockquote><pre>
-     *   {@link #getThreadAllocatedBytes getThreadAllocatedBytes}(Thread.currentThread().getId());
-     * </pre></blockquote>
-     *
-     * @return an approximation of the total memory allocated, in bytes, in
-     * heap memory for the current thread
-     * if thread memory allocation measurement is enabled;
-     * {@code -1} otherwise.
-     *
-     * @throws UnsupportedOperationException if the Java virtual
-     *         machine implementation does not support thread memory allocation
-     *         measurement.
-     *
-     * @see #isThreadAllocatedMemorySupported
-     * @see #isThreadAllocatedMemoryEnabled
-     * @see #setThreadAllocatedMemoryEnabled
-     * @since 14
-     */
-    public long getCurrentThreadAllocatedBytes();
-
-    /**
-     * Returns an approximation of the total amount of memory, in bytes,
-     * allocated in heap memory for the thread with the specified ID.
+     * allocated in heap memory for the thread of the specified ID.
      * The returned value is an approximation because some Java virtual machine
      * implementations may use object allocation mechanisms that result in a
      * delay between the time an object is allocated and the time its size is
      * recorded.
      * <p>
-     * If the thread with the specified ID is not alive or does not exist,
+     * If the thread of the specified ID is not alive or does not exist,
      * this method returns {@code -1}. If thread memory allocation measurement
      * is disabled, this method returns {@code -1}.
      * A thread is alive if it has been started and has not yet died.
@@ -158,13 +127,13 @@
      *
      * @param id the thread ID of a thread
      * @return an approximation of the total memory allocated, in bytes, in
-     * heap memory for the thread with the specified ID
-     * if the thread with the specified ID exists, the thread is alive,
+     * heap memory for a thread of the specified ID
+     * if the thread of the specified ID exists, the thread is alive,
      * and thread memory allocation measurement is enabled;
      * {@code -1} otherwise.
      *
      * @throws IllegalArgumentException if {@code id} {@code <=} {@code 0}.
-     * @throws UnsupportedOperationException if the Java virtual
+     * @throws java.lang.UnsupportedOperationException if the Java virtual
      *         machine implementation does not support thread memory allocation
      *         measurement.
      *
@@ -196,7 +165,7 @@
      * @throws NullPointerException if {@code ids} is {@code null}
      * @throws IllegalArgumentException if any element in the input array
      *         {@code ids} is {@code <=} {@code 0}.
-     * @throws UnsupportedOperationException if the Java virtual
+     * @throws java.lang.UnsupportedOperationException if the Java virtual
      *         machine implementation does not support thread memory allocation
      *         measurement.
      *
@@ -225,7 +194,7 @@
      * @return {@code true} if thread memory allocation measurement is enabled;
      *         {@code false} otherwise.
      *
-     * @throws UnsupportedOperationException if the Java virtual
+     * @throws java.lang.UnsupportedOperationException if the Java virtual
      *         machine does not support thread memory allocation measurement.
      *
      * @see #isThreadAllocatedMemorySupported
@@ -239,10 +208,10 @@
      * @param enable {@code true} to enable;
      *               {@code false} to disable.
      *
-     * @throws UnsupportedOperationException if the Java virtual
+     * @throws java.lang.UnsupportedOperationException if the Java virtual
      *         machine does not support thread memory allocation measurement.
      *
-     * @throws SecurityException if a security manager
+     * @throws java.lang.SecurityException if a security manager
      *         exists and the caller does not have
      *         ManagementPermission("control").
      *