Remove the synchronized flag of fillInStackTrace method to improve performance while throwing exception. (#10031)

Motivation:

The method body of fillInStackTrace method of TimeoutException class in FixedChannelPool.java is so simple (just return this) that there is no need to be marked as synchronized.

Modification:

Remove the synchronized flag of fillInStackTrace method.

Result:
It can improve performance slightly while throwing a TimeoutException.
This commit is contained in:
feijermu 2020-02-16 01:30:44 +08:00 committed by GitHub
parent d348ae9e7a
commit 862efc618c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,7 +197,7 @@ public class FixedChannelPool extends SimpleChannelPool {
task.promise.setFailure(new TimeoutException(
"Acquire operation took longer then configured maximum time") {
@Override
public synchronized Throwable fillInStackTrace() {
public Throwable fillInStackTrace() {
return this;
}
});