0

I do not want the interfaces to have default methods in the code base owned by my team. Is it possible to compile with some specific flag which will error out for the same? I do not care about any dependencies having interface default methods.

  • How about parsing the interfaces for the keyword "default"? Or compiling the interfaces using an older compiler (this is only for checking) where default methods are not allowed. – prasad_ Sep 20 '18 at 02:52
  • I don't know of a way to do this. However, if there are many features of Java 8 which you don't want to use, then maybe consider using an earlier version of Java (not recommended though, as earlier versions may not be supported anymore). – Tim Biegeleisen Sep 20 '18 at 02:52
  • Can you not change your interfaces not to use `default` methods? – Scary Wombat Sep 20 '18 at 02:57
  • Are you allowed to use static methods in the interfaces? – prasad_ Sep 20 '18 at 03:12
  • The terms you have to enter into a search engine of your choice are “java code audit tools” or “checker frameworks” – Holger Sep 20 '18 at 05:59
  • @prasad_ Interface method implementations are the only thing from Java8 I do not want to be used. – Anant Mittal Sep 20 '18 at 23:31

0 Answers0