Small cleanups / changes amassed over time
- Small javadoc fixes - Simplifications - Move logException method from StringUtils to ExceptionUtils
This commit is contained in:
@@ -33,4 +33,14 @@ public final class ExceptionUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the information from a Throwable as string, retaining the type and its message.
|
||||
*
|
||||
* @param th the throwable to process
|
||||
* @return string with the type of the Throwable and its message, e.g. "[IOException]: Could not open stream"
|
||||
*/
|
||||
public static String formatException(Throwable th) {
|
||||
return "[" + th.getClass().getSimpleName() + "]: " + th.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,17 +66,6 @@ public final class StringUtils {
|
||||
return str == null || str.trim().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the information from a Throwable as string, retaining the type and its message.
|
||||
*
|
||||
* @param th The throwable to process
|
||||
*
|
||||
* @return String with the type of the Throwable and its message, e.g. "[IOException]: Could not open stream"
|
||||
*/
|
||||
public static String formatException(Throwable th) {
|
||||
return "[" + th.getClass().getSimpleName() + "]: " + th.getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the given needle is in the middle of the haystack, i.e. that the haystack
|
||||
* contains the needle and that it is not at the very start or end.
|
||||
|
||||
Reference in New Issue
Block a user