Package edu.umd.cs.findbugs.util
Class Util
java.lang.Object
edu.umd.cs.findbugs.util.Util
- Author:
- William Pugh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K> List
<K> static <K> Set
<K> static void
closeSilently
(Closeable out) static void
static void
static void
closeSilently
(Reader in) static void
static void
static void
static void
closeSilently
(ZipFile zip) static String
commonPrefix
(String s1, String s2) static int
compare
(int x, int y) return sign of x - ystatic int
compare
(long x, long y) return sign of x - ystatic <T> Set
<T> static <E> E
static String
static String
static Reader
getFileReader
(File filename) static Reader
getFileReader
(String filename) static Writer
getFileWriter
(String filename) static MessageDigest
static String
static Reader
getReader
(InputStream in) static Writer
getWriter
(OutputStream out) static String
static <K,
V> Map <K, V> immutableMap
(Map<K, V> map) static boolean
isPowerOfTwo
(int i) static boolean
isPowerOfTwo
(long i) static IOException
makeIOException
(String msg, Throwable cause) static <K> ArrayList
<K> makeSmallArrayList
(List<K> m) static <K,
V> HashMap <K, V> makeSmallHashMap
(Map<K, V> m) static <K> HashSet
<K> makeSmallHashSet
(Collection<K> m) static <E> Set
<E> newSetFromMap
(Map<E, Boolean> m) Duplication 1.6 functionality of Collections.newSetFromMapstatic <T extends Comparable<? super T>>
intnullSafeCompareTo
(T o1, T o2) static <T> boolean
nullSafeEquals
(T o1, T o2) static int
static String
static Thread
static Thread
runInDameonThread
(Runnable r, String name) static void
static int
sign
(int x) static Thread
static void
throwIOException
(String msg, Throwable cause)
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
startDameonThread
-
runInDameonThread
-
runInDameonThread
-
sign
public static int sign(int x) -
compare
public static int compare(int x, int y) return sign of x - y -
compare
public static int compare(long x, long y) return sign of x - y -
setBitIteratable
-
setBitIterator
-
repeat
-
getNetworkErrorMessage
-
runLogAtShutdown
-
emptyOrNonnullSingleton
-
immutableMap
-
nullSafeHashcode
-
nullSafeEquals
-
nullSafeCompareTo
public static <T extends Comparable<? super T>> int nullSafeCompareTo(@CheckForNull T o1, @CheckForNull T o2) -
getReader
-
getFileReader
- Throws:
FileNotFoundException
-
getFileReader
- Throws:
FileNotFoundException
-
getWriter
-
getFileWriter
- Throws:
FileNotFoundException
-
closeSilently
-
closeSilently
-
closeSilently
-
closeSilently
-
closeSilently
-
closeSilently
-
closeSilently
-
closeSilently
-
getXMLType
- Throws:
IOException
-
makeIOException
-
getFileExtension
-
getFileExtensionIgnoringGz
-
throwIOException
- Throws:
IOException
-
first
- Parameters:
i
- the Iterable whose first element is to be retrieved- Returns:
- first element of iterable
-
commonPrefix
-
newSetFromMap
Duplication 1.6 functionality of Collections.newSetFromMap -
makeSmallHashMap
-
makeSmallHashSet
-
makeSmallArrayList
-
addTo
-
addTo
-
getMD5Digest
-
isPowerOfTwo
public static boolean isPowerOfTwo(int i) -
isPowerOfTwo
public static boolean isPowerOfTwo(long i)
-