@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static String getStackTraceString(final Throwable t) { VerifyArgument.notNull(t, "t"); try (final ByteArrayOutputStream stream = new ByteArrayOutputStream(1024); final PrintWriter writer = new PrintWriter(stream)) { t.printStackTrace(writer); writer.flush(); stream.flush(); return StringUtilities.trimRight(stream.toString()); } catch (Throwable ignored) { return t.toString(); } } }
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static String getStackTraceString(final Throwable t) { VerifyArgument.notNull(t, "t"); try (final ByteArrayOutputStream stream = new ByteArrayOutputStream(1024); final PrintWriter writer = new PrintWriter(stream)) { t.printStackTrace(writer); writer.flush(); stream.flush(); return StringUtilities.trimRight(stream.toString()); } catch (final Throwable ignored) { return t.toString(); } }
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static String getStackTraceString(final Throwable t) { VerifyArgument.notNull(t, "t"); try (final ByteArrayOutputStream stream = new ByteArrayOutputStream(1024); final PrintWriter writer = new PrintWriter(stream)) { t.printStackTrace(writer); writer.flush(); stream.flush(); return StringUtilities.trimRight(stream.toString()); } catch (Throwable ignored) { return t.toString(); } } }
String debugToString() { if (isNull()) { return "Null"; } final String text = StringUtilities.trimRight(getText())/*.replace("\t", "").replace("\n", " ")*/; return text.length() > 1000 ? text.substring(0, 97) + "..." : text; }
String debugToString() { if (isNull()) { return "Null"; } final String text = StringUtilities.trimRight(getText())/*.replace("\t", "").replace("\n", " ")*/; return text.length() > 1000 ? text.substring(0, 97) + "..." : text; }
String debugToString() { if (isNull()) { return "Null"; } final String text = StringUtilities.trimRight(getText())/*.replace("\t", "").replace("\n", " ")*/; return text.length() > 1000 ? text.substring(0, 97) + "..." : text; }
public static String trimAndRemoveRight(final String value, final String suffix, final boolean ignoreCase) { VerifyArgument.notNull(value, "value"); final String trimmedValue = value.trim(); final String result = removeRight(trimmedValue, suffix, ignoreCase); //noinspection StringEquality if (result == trimmedValue) { return trimmedValue; } return trimRight(result); }
public static String trimAndRemoveRight(final String value, final char[] removeChars) { VerifyArgument.notNull(value, "value"); final String trimmedValue = value.trim(); final String result = removeRight(trimmedValue, removeChars); //noinspection StringEquality if (result == trimmedValue) { return trimmedValue; } return trimRight(result); }
public static String trimAndRemoveRight(final String value, final char[] removeChars) { VerifyArgument.notNull(value, "value"); final String trimmedValue = value.trim(); final String result = removeRight(trimmedValue, removeChars); //noinspection StringEquality if (result == trimmedValue) { return trimmedValue; } return trimRight(result); }
public static String trimAndRemoveRight(final String value, final String suffix, final boolean ignoreCase) { VerifyArgument.notNull(value, "value"); final String trimmedValue = value.trim(); final String result = removeRight(trimmedValue, suffix, ignoreCase); //noinspection StringEquality if (result == trimmedValue) { return trimmedValue; } return trimRight(result); }
public static String trimAndRemoveRight(final String value, final char[] removeChars) { VerifyArgument.notNull(value, "value"); final String trimmedValue = value.trim(); final String result = removeRight(trimmedValue, removeChars); //noinspection StringEquality if (result == trimmedValue) { return trimmedValue; } return trimRight(result); }
public static String trimAndRemoveRight(final String value, final String suffix, final boolean ignoreCase) { VerifyArgument.notNull(value, "value"); final String trimmedValue = value.trim(); final String result = removeRight(trimmedValue, suffix, ignoreCase); //noinspection StringEquality if (result == trimmedValue) { return trimmedValue; } return trimRight(result); }