One import static to rule them all

Kevin Bourrillion kevinb at google.com
Wed Feb 6 16:28:41 PST 2013


I have been promised that this won't work -- that to invoke a static method
on an interface one *must* refer to the exact interface it was defined on,
not a subtype, not an instance.  Can someone please confirm this is true?



On Wed, Feb 6, 2013 at 4:06 PM, Remi Forax <forax at univ-mlv.fr> wrote:

> I wonder if we should not create one artificial interface that extends
> Collector, FlatMapper, etc,
> i.e. every interfaces that declare static methods that can be used by the
> Stream API
> just because it will be easier to do an import static on this interface.
>
> interface StaticDefaults   // better name needed
>   extends Collector<Void, Void>, FlatMapper<Void,Void> {
> }
>
> otherwise, every Java projects will define its own one.
>
> cheers,
> Rémi
>
>


-- 
Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com


More information about the lambda-libs-spec-observers mailing list