Skip to content

Commit

Permalink
Merge pull request #10021 from mkurz/rm_deprecated_evo_code
Browse files Browse the repository at this point in the history
Remove deprecated methods from HttpRequestHandler
  • Loading branch information
mergify[bot] committed Feb 2, 2020
2 parents 2489931 + 6fbfd16 commit f277dee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 48 deletions.
47 changes: 0 additions & 47 deletions core/play/src/main/scala/play/api/http/HttpRequestHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f277dee

Please sign in to comment.