Public defender methods and static inner classes in interfaces?

David Walend david at
Wed Sep 8 10:27:15 PDT 2010

On Sep 8, 2010, at 8:59 AM, Jim Mayer wrote:

> One problem with the suggestion below (that 'private' be allowed on  
> classes inside interfaces) is that it won't play nicely with unit  
> testing frameworks such as JUnit.  JUnit conventions rely fairly  
> heavily on 'package' protection, and a 'private' class inside an  
> interface would be difficult to test.
> This may, or may not, matter in practice, but I hate to see us do  
> anything that makes unit testing harder.
> My own preference, at this point, would be to keep implementation  
> out of interfaces as much as possible, provide implementations in a  
> separate file, and hope that the defender method feature isn't  
> abused too much.

Jim, this is what I'm curious about. What do you see as abuse (vs.  
wise use)?

We can take this off list if no one else is interested. It's sure to  
stray into syntax.



More information about the lambda-dev mailing list