Remove unnecessary variant of detailedMessage

This commit is contained in:
Ryan Ernst 2016-06-29 11:25:23 -07:00
parent 8b533b7ca9
commit b3daf7d683
2 changed files with 4 additions and 23 deletions

View File

@ -94,18 +94,9 @@ public final class ExceptionsHelper {
*/
@Deprecated
public static String detailedMessage(Throwable t) {
return detailedMessage(t, false, 0);
}
/**
* @deprecated Don't swallow exceptions, allow them to propagate.
*/
@Deprecated
public static String detailedMessage(Throwable t, boolean newLines, int initialCounter) {
if (t == null) {
return "Unknown";
}
int counter = initialCounter + 1;
if (t.getCause() != null) {
StringBuilder sb = new StringBuilder();
while (t != null) {
@ -115,21 +106,11 @@ public final class ExceptionsHelper {
sb.append(t.getMessage());
sb.append("]");
}
if (!newLines) {
sb.append("; ");
}
sb.append("; ");
t = t.getCause();
if (t != null) {
if (newLines) {
sb.append("\n");
for (int i = 0; i < counter; i++) {
sb.append("\t");
}
} else {
sb.append("nested: ");
}
sb.append("nested: ");
}
counter++;
}
return sb.toString();
} else {

View File

@ -1086,7 +1086,7 @@ public class StoreTests extends ESTestCase {
String uuid = Store.CORRUPTED + UUIDs.randomBase64UUID();
try (IndexOutput output = dir.createOutput(uuid, IOContext.DEFAULT)) {
CodecUtil.writeHeader(output, Store.CODEC, Store.VERSION_STACK_TRACE);
output.writeString(ExceptionsHelper.detailedMessage(exception, true, 0));
output.writeString(ExceptionsHelper.detailedMessage(exception));
output.writeString(ExceptionsHelper.stackTrace(exception));
CodecUtil.writeFooter(output);
}
@ -1102,7 +1102,7 @@ public class StoreTests extends ESTestCase {
try (IndexOutput output = dir.createOutput(uuid, IOContext.DEFAULT)) {
CodecUtil.writeHeader(output, Store.CODEC, Store.VERSION_START);
output.writeString(ExceptionsHelper.detailedMessage(exception, true, 0));
output.writeString(ExceptionsHelper.detailedMessage(exception));
CodecUtil.writeFooter(output);
}
try {