jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java
changeset 42106 90fc3dc00723
parent 40184 aed163cc3cc2
child 45004 ea3137042a61
child 44858 7183899b064b
equal deleted inserted replaced
42105:d04ede5f10e7 42106:90fc3dc00723
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   552      * is permitted to return a zero-length array from this method.
   552      * is permitted to return a zero-length array from this method.
   553      *
   553      *
   554      * @return an array of {@code StackTraceElement} objects of the thread.
   554      * @return an array of {@code StackTraceElement} objects of the thread.
   555      */
   555      */
   556     public StackTraceElement[] getStackTrace() {
   556     public StackTraceElement[] getStackTrace() {
   557         return stackTrace;
   557         return stackTrace.clone();
   558     }
   558     }
   559 
   559 
   560     /**
   560     /**
   561      * Tests if the thread associated with this {@code ThreadInfo}
   561      * Tests if the thread associated with this {@code ThreadInfo}
   562      * is suspended.  This method returns {@code true} if
   562      * is suspended.  This method returns {@code true} if
   866      *         the object monitors locked by the thread.
   866      *         the object monitors locked by the thread.
   867      *
   867      *
   868      * @since 1.6
   868      * @since 1.6
   869      */
   869      */
   870     public MonitorInfo[] getLockedMonitors() {
   870     public MonitorInfo[] getLockedMonitors() {
   871         return lockedMonitors;
   871         return lockedMonitors.clone();
   872     }
   872     }
   873 
   873 
   874     /**
   874     /**
   875      * Returns an array of {@link LockInfo} objects, each of which
   875      * Returns an array of {@link LockInfo} objects, each of which
   876      * represents an <a href="LockInfo.html#OwnableSynchronizer">ownable
   876      * represents an <a href="LockInfo.html#OwnableSynchronizer">ownable
   883      *         the ownable synchronizers locked by the thread.
   883      *         the ownable synchronizers locked by the thread.
   884      *
   884      *
   885      * @since 1.6
   885      * @since 1.6
   886      */
   886      */
   887     public LockInfo[] getLockedSynchronizers() {
   887     public LockInfo[] getLockedSynchronizers() {
   888         return lockedSynchronizers;
   888         return lockedSynchronizers.clone();
   889     }
   889     }
   890 
   890 
   891     private static final StackTraceElement[] NO_STACK_TRACE =
   891     private static final StackTraceElement[] NO_STACK_TRACE =
   892         new StackTraceElement[0];
   892         new StackTraceElement[0];
   893 }
   893 }