Static method access dilemma and proposal: @NotInherited

Stephen Colebourne scolebourne at joda.org
Thu Jun 27 15:42:38 PDT 2013


On 27 June 2013 22:17, Zhong Yu <zhong.j.yu at gmail.com> wrote:
> Stephen, would it be more accurate to say that what you want is
> actually non-"overridable". It's not a problem that B inherits foo()
> from A. It is a problem that B may introduce its own foo(), therefore
> the meaning of `B.foo()` is a little uncertain.

No, its specifically that anyone reading B.foo() instead of A.foo()
would/could misunderstand what the code meant.

I actually made the mistake myself, ie.with my own API. My call wasn't
type checked because it was being directly passed to an
assertEquals(Object,Object) in a test case.

Stephen


More information about the lambda-dev mailing list