Skip to content

Commit

Permalink
fix Class.newInstance deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dwickern committed Nov 1, 2023
1 parent 3aaba56 commit 41af609
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/play/modules/swagger/SwaggerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SwaggerPluginImpl @Inject()(environment: Environment, configuration: Confi
lazy val swaggerSpecFilter: Option[SwaggerSpecFilter] = config.filterClass match {
case Some(e) if e.nonEmpty =>
try {
val filter = environment.classLoader.loadClass(e).newInstance.asInstanceOf[SwaggerSpecFilter]
val filter = environment.classLoader.loadClass(e).getDeclaredConstructor().newInstance().asInstanceOf[SwaggerSpecFilter]
logger.debug("Setting swagger.filter to %s".format(e))
Some(filter)
} catch {
Expand Down

0 comments on commit 41af609

Please sign in to comment.