Reports methods without parameter clauses that override Java methods with mutator-like names.

Scala allows overriding parameterless Java methods without parameter clauses. This is mainly to allow Scala code to override Java accessor methods the same way as Scala accessor methods. Namely without parameter clause and thereby adhere to the uniform access principle, which says that the client code should not be affected by the decision to implement an attribute as a field or method.

For methods with side effects, however, it is convention to have an empty parameter clause. This would be in accordance with the Liskov substitution principle, whereby, when an overridden method has side effects, the overriding method must also be declared as a method with side effects.

The quick-fix adds an empty parameter clause.

Example:


  import java.util

  class Test extends util.ArrayList[String] {
    override def clear: Unit = ???
  }

After the quick-fix is applied:


  import java.util

  class Test extends util.ArrayList[String] {
    override def clear(): Unit = ???
  }