Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Increasing the accessibility of overridden or hidden methods permits a malicious subclass to offer wider access to the restricted method than was originally intended.

Wiki Markup
            According to the Java Language Specification \[[JLS 2005|AA. Bibliography#JLS 05]\], Section 8.4.8.3, "Requirements in Overriding and Hiding" 

...

Overridden/hidden method modifier

Overriding/hiding method modifier

public

public

protected

protected or public

default

default or protected or public

private

Cannot be overridden

...

Noncompliant Code Example

...