FileName is optional in StacktraceElement

This commit is contained in:
Simon Willnauer 2015-06-30 15:51:48 +02:00
parent 0ac8c1bc55
commit bbaf4710cb
1 changed files with 2 additions and 2 deletions

View File

@ -366,7 +366,7 @@ public class ElasticsearchException extends RuntimeException implements ToXConte
StackTraceElement[] stackTrace = new StackTraceElement[stackTraceElements]; StackTraceElement[] stackTrace = new StackTraceElement[stackTraceElements];
for (int i = 0; i < stackTraceElements; i++) { for (int i = 0; i < stackTraceElements; i++) {
final String declaringClasss = in.readString(); final String declaringClasss = in.readString();
final String fileName = in.readString(); final String fileName = in.readOptionalString();
final String methodName = in.readString(); final String methodName = in.readString();
final int lineNumber = in.readVInt(); final int lineNumber = in.readVInt();
stackTrace[i] = new StackTraceElement(declaringClasss,methodName, fileName, lineNumber); stackTrace[i] = new StackTraceElement(declaringClasss,methodName, fileName, lineNumber);
@ -388,7 +388,7 @@ public class ElasticsearchException extends RuntimeException implements ToXConte
out.writeVInt(stackTrace.length); out.writeVInt(stackTrace.length);
for (StackTraceElement element : stackTrace) { for (StackTraceElement element : stackTrace) {
out.writeString(element.getClassName()); out.writeString(element.getClassName());
out.writeString(element.getFileName()); out.writeOptionalString(element.getFileName());
out.writeString(element.getMethodName()); out.writeString(element.getMethodName());
out.writeVInt(element.getLineNumber()); out.writeVInt(element.getLineNumber());
} }