Fix unnecessary boxing and incorrect Serializable

Motivation:

- AbstractHttp2ConnectionHandlerBuilder.encoderEnforceMaxConcurrentStreams can be the primitive boolean
- SpdySession.StreamComparator should not be Serializable since SpdySession is not Serializable

Modifications:

Use boolean instead and remove Serializable

Result:

- Minor improvement for AbstractHttp2ConnectionHandlerBuilder
- StreamComparator is not Serializable any more
This commit is contained in:
Xiaoyan Lin 2015-12-30 21:44:42 -08:00 committed by Norman Maurer
parent 0b16c3c513
commit 0ae6f17285
2 changed files with 3 additions and 5 deletions

View File

@ -323,9 +323,7 @@ final class SpdySession {
}
}
private final class StreamComparator implements Comparator<Integer>, Serializable {
private static final long serialVersionUID = 1161471649740544848L;
private final class StreamComparator implements Comparator<Integer> {
StreamComparator() { }

View File

@ -94,7 +94,7 @@ public abstract class AbstractHttp2ConnectionHandlerBuilder<T extends Http2Conne
// * OK to use with server() and connection()
private Http2FrameLogger frameLogger;
private SensitivityDetector headerSensitivityDetector;
private Boolean encoderEnforceMaxConcurrentStreams;
private boolean encoderEnforceMaxConcurrentStreams;
/**
* Returns if HTTP headers should be validated according to
@ -268,7 +268,7 @@ public abstract class AbstractHttp2ConnectionHandlerBuilder<T extends Http2Conne
* would otherwise be exceeded.
*/
protected boolean encoderEnforceMaxConcurrentStreams() {
return encoderEnforceMaxConcurrentStreams != null ? encoderEnforceMaxConcurrentStreams : false;
return encoderEnforceMaxConcurrentStreams;
}
/**