Remove the synchronized flag of fillInStackTrace method to improve performance while creating exception instance. (#10033)

Motivation:

The method body of fillInStackTrace method of IllegalStateException class in SimpleChannelPool.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 creating a IllegalStateException instance.
This commit is contained in:
feijermu 2020-02-17 16:52:36 +08:00 committed by GitHub
parent 862efc618c
commit dcd62c2598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,7 +352,7 @@ public class SimpleChannelPool implements ChannelPool {
} else {
closeAndFail(channel, new IllegalStateException("ChannelPool full") {
@Override
public synchronized Throwable fillInStackTrace() {
public Throwable fillInStackTrace() {
return this;
}
}, promise);