[wildfly-dev] Java 8 API Warning

Darran Lofthouse darran.lofthouse at jboss.com
Fri Apr 17 09:03:12 EDT 2015


Quick warning for anyone developing using Java 8 but on projects still 
dependent on Java 7.

Normally this is fine, as an engineer you make sure you don't use any 
new language features or call new APIs and generally it all works.

With Java 8 there is one addition gotcha, Java 8 adds support for 
default method implementations on interfaces, to add to this some 
pre-existing methods have now been replaced with default 
implementations.  The side effect being it is easy to miss that you have 
a method missing from a class and it will not be picked up till it is 
compiled on Java 7.

e.g. On java.util.Iterator the remove method is now default so classes 
that implement this interface no longer need to implement that method 
unless they really are providing an implementation of that method.

Regards,
Darran Lofthouse.



More information about the wildfly-dev mailing list