From 6fbfd16face46225e14dfaa45f8e41e3d20208fc Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 31 Jan 2020 15:51:47 +0100 Subject: [PATCH] Remove deprecated methods from HttpRequestHandler --- .../play/api/http/HttpRequestHandler.scala | 47 ------------------- project/BuildSettings.scala | 5 +- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/core/play/src/main/scala/play/api/http/HttpRequestHandler.scala b/core/play/src/main/scala/play/api/http/HttpRequestHandler.scala index ddc960fb132..a0b98d32672 100644 --- a/core/play/src/main/scala/play/api/http/HttpRequestHandler.scala +++ b/core/play/src/main/scala/play/api/http/HttpRequestHandler.scala @@ -19,7 +19,6 @@ import play.api.OptionalDevContext import play.core.j.JavaHandler import play.core.j.JavaHandlerComponents import play.core.j.JavaHttpRequestHandlerDelegate -import play.core.DefaultWebCommands import play.core.WebCommands import play.utils.Reflect @@ -117,21 +116,6 @@ class DefaultHttpRequestHandler( this(webCommands, optDevContext.devContext, router, errorHandler, configuration, filters.filters) } - @deprecated("Use the main DefaultHttpRequestHandler constructor", "2.7.0") - def this(router: Router, errorHandler: HttpErrorHandler, configuration: HttpConfiguration, filters: HttpFilters) = { - this(new DefaultWebCommands, None, router, errorHandler, configuration, filters.filters) - } - - @deprecated("Use the main DefaultHttpRequestHandler constructor", "2.7.0") - def this( - router: Router, - errorHandler: HttpErrorHandler, - configuration: HttpConfiguration, - filters: EssentialFilter* - ) = { - this(new DefaultWebCommands, None, router, errorHandler, configuration, filters) - } - private val context = configuration.context.stripSuffix("/") /** Work out whether a path is handled by this application. */ @@ -220,18 +204,6 @@ class DefaultHttpRequestHandler( } } - /** - * Apply any filters to the given handler. - */ - @deprecated("Use filterHandler(RequestHeader, Handler) instead", "2.6.0") - protected def filterHandler(next: RequestHeader => Handler): (RequestHeader => Handler) = { - (request: RequestHeader) => - next(request) match { - case action: EssentialAction if inContext(request.path) => filterAction(action) - case handler => handler - } - } - /** * Update the given handler so that when the handler is run any filters will also be run. The * default behavior is to wrap all [[play.api.mvc.EssentialAction]]s by calling `filterAction`, but to leave @@ -299,25 +271,6 @@ class JavaCompatibleHttpRequestHandler( this(webCommands, optDevContext.devContext, router, errorHandler, configuration, filters.filters, handlerComponents) } - @deprecated("Use the main JavaCompatibleHttpRequestHandler constructor", "2.7.0") - def this( - router: Router, - errorHandler: HttpErrorHandler, - configuration: HttpConfiguration, - filters: HttpFilters, - handlerComponents: JavaHandlerComponents - ) = { - this( - new DefaultWebCommands, - new OptionalDevContext(None), - router, - errorHandler, - configuration, - filters, - handlerComponents - ) - } - // This is a Handler that, when evaluated, converts its underlying JavaHandler into // another handler. private class MapJavaHandler(nextHandler: Handler) extends Handler.Stage { diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index 6beaa86bb35..df0d2a2270c 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -202,7 +202,10 @@ object BuildSettings { (organization.value %% moduleName.value % version).cross(cross) }.toSet, mimaBinaryIssueFilters ++= Seq( - // Add mima filters here + // Remove deprecated methods from HttpRequestHandler + ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.http.DefaultHttpRequestHandler.filterHandler"), + ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.http.DefaultHttpRequestHandler.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.http.JavaCompatibleHttpRequestHandler.this"), ), unmanagedSourceDirectories in Compile += { val suffix = CrossVersion.partialVersion(scalaVersion.value) match {