mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-04 05:00:31 +00:00
8006078: [findbugs] java.lang.management.ThreadInfo returns mutable objects
Cloned the array before returning to caller. Reviewed-by: dholmes, fparain
This commit is contained in:
parent
ff33d165a6
commit
e935e7cb1e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -554,7 +554,7 @@ public class ThreadInfo {
|
||||
* @return an array of {@code StackTraceElement} objects of the thread.
|
||||
*/
|
||||
public StackTraceElement[] getStackTrace() {
|
||||
return stackTrace;
|
||||
return stackTrace.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -868,7 +868,7 @@ public class ThreadInfo {
|
||||
* @since 1.6
|
||||
*/
|
||||
public MonitorInfo[] getLockedMonitors() {
|
||||
return lockedMonitors;
|
||||
return lockedMonitors.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -885,7 +885,7 @@ public class ThreadInfo {
|
||||
* @since 1.6
|
||||
*/
|
||||
public LockInfo[] getLockedSynchronizers() {
|
||||
return lockedSynchronizers;
|
||||
return lockedSynchronizers.clone();
|
||||
}
|
||||
|
||||
private static final StackTraceElement[] NO_STACK_TRACE =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user