Scala IntelliJ warning "dynamic invocation could be replaced with a constructor invocation"

Viewed 271

Why does Intellij give this warning, what does it mean, how can I make it better ?

import akka.actor.Props

object Router {
  def props(config: Config, addresses: Set[Address]): Props =
    Props(classOf[Router], config, addresses)
    // "dynamic invocation could be replaced with a constructor invocation"

If I the Props inplace I get a different warning.

system.actorOf(Props(classOf[Router], config, addresses))
// could be replaced with factory method call

Thanks

1 Answers
Related