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 voidcloseSilently(Closeable out) static voidstatic voidstatic voidcloseSilently(Reader in) static voidstatic voidstatic voidstatic voidcloseSilently(ZipFile zip) static StringcommonPrefix(String s1, String s2) static intcompare(int x, int y) return sign of x - ystatic intcompare(long x, long y) return sign of x - ystatic <T> Set<T> static <E> Estatic Stringstatic Stringstatic ReadergetFileReader(File filename) static ReadergetFileReader(String filename) static WritergetFileWriter(String filename) static MessageDigeststatic Stringstatic ReadergetReader(InputStream in) static WritergetWriter(OutputStream out) static Stringstatic <K,V> Map <K, V> immutableMap(Map<K, V> map) static booleanisPowerOfTwo(int i) static booleanisPowerOfTwo(long i) static IOExceptionmakeIOException(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> booleannullSafeEquals(T o1, T o2) static intstatic Stringstatic Threadstatic ThreadrunInDameonThread(Runnable r, String name) static voidstatic intsign(int x) static Threadstatic voidthrowIOException(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)
-