- changed status to invalid
instanceMethods returns inherited methods with lower visibility than interface method
Issue #152
invalid
When a non-public method is inherited from by a class that implements an interface that defines the same method, that method must be overridden to lift the visibility to public
. Therefore, the inherited method can not be the target of a virtual call anymore. Therefore, it should not be returned by Project.instanceMethods for interfaces/abstract classes that inherit it without overriding it.
This currently happens for java.text.AttributedCharacterIterator
that inherits protected Object clone()
from java.lang.Object
but implementors of AttributedCharacterIterator must override it because that extends java.text.CharacterIterator
that defines (public) Object clone()
.
Comments (2)
-
repo owner -
repo owner - removed version
Removing version: 1.1.0 (automated comment)
- Log in to comment
though the following code is not valid Java, it is valid bytecode and instanceMethods does the correct thing:
In this scenario, main can successfully be executed and "Top.m" will be printed.