Tidy up fillInStackTrace implementations (#62555)

Removes the unnecessary `synchronized` introduced in #62433 and adjusts
the others to return `this` not `null` as required by the parent
method's Javadocs.
This commit is contained in:
David Turner 2020-09-18 08:25:50 +01:00
parent c83d8ce78e
commit 06d5d360f9
7 changed files with 6 additions and 9 deletions

View File

@ -41,6 +41,6 @@ public class NotMasterException extends ElasticsearchException {
@Override
public Throwable fillInStackTrace() {
return null;
return this;
}
}

View File

@ -59,7 +59,7 @@ public class VersionConflictEngineException extends EngineException {
}
@Override
public synchronized Throwable fillInStackTrace() {
public Throwable fillInStackTrace() {
// This is on the hot path for updates; stack traces are expensive to compute and not very useful for VCEEs, so don't fill it in.
return this;
}

View File

@ -38,6 +38,6 @@ public class NodeDisconnectedException extends ConnectTransportException {
@Override
public Throwable fillInStackTrace() {
return null;
return this;
}
}

View File

@ -35,7 +35,7 @@ public class NotSerializableTransportException extends TransportException {
@Override
public Throwable fillInStackTrace() {
return null;
return this;
}
private static String buildMessage(Throwable t) {

View File

@ -34,7 +34,4 @@ public class ReceiveTimeoutTransportException extends ActionTransportException {
super(in);
}
// @Override public Throwable fillInStackTrace() {
// return fillStack();
// }
}

View File

@ -48,6 +48,6 @@ public class RemoteTransportException extends ActionTransportException implement
@Override
public Throwable fillInStackTrace() {
// no need for stack trace here, we always have cause
return null;
return this;
}
}

View File

@ -38,6 +38,6 @@ public class ResponseHandlerFailureTransportException extends TransportException
@Override
public Throwable fillInStackTrace() {
return null;
return this;
} // why is this?
}