public class Utility extends Object
Constructor and Description |
---|
Utility() |
Modifier and Type | Method and Description |
---|---|
static <E> List<E> |
copy(List<E> list)
Synchronizes on the list and then returns a copy of the list that is safe to iterate over.
|
static <K,V> Map<K,V> |
copy(Map<K,V> map)
Synchronizes on the map and then returns a copy of the map that is safe to iterate over.
|
static <T extends Throwable & SensibleClone<T>> |
fixStackTrace(T throwable) |
static String |
makeStackTrace(Throwable throwable)
Deprecated.
use logging library instead for logging stack traces somewhere
|
public static <T extends Throwable & SensibleClone<T>> T fixStackTrace(T throwable)
public static String makeStackTrace(Throwable throwable)
throwable
- public static <E> List<E> copy(List<E> list)
Collections.synchronizedList(List)
.list
- The list, which may not be null
public static <K,V> Map<K,V> copy(Map<K,V> map)
Collections.synchronizedMap(Map)
map
- The map, which may not be null
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.