In HttpServletRequest, we added a new method #getPushBuilder.
And there is a “default” implementation of returning a NoOpPushBuilder, which is an no-op.
And in this moment, the NoOpPushBuilder.method(“”) even does not throw IllegalArgumentException as specified in javadoc.
Do we really want to have the default implementation in the HttpServletRequest#getPushBuilder?
Pros:
Any implementation of previous version of HttpServletRequest will compile with this new HttpServletRequest interface.
Cons:
If a framework updated to Servlet 4.0, then it is possible to “forget to update” the implementation of HttpServletRequest#getPushBuilder in some of the classes. And the runtime will pick up the NoOpPushBuilder which may not be desired.
Should we remove the “default” implementation in HttpServletRequest#getPushBuilder?
Please let me know your comment.
Thanks.
Shing Wai Chan