This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271333

Summary: Missing hint for interface default method (since Java 8)
Product: java Reporter: Peter Nabbefeld <epdv>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: dtrebbien
Priority: P3    
Version: Dev   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Peter Nabbefeld 2017-08-20 20:31:09 UTC
If an interface method contains a body but is missing the "default" keyword, there's an error mark with a hint "interface abstract methods cannot have a body".

This is true before Java 8, but since then it should be sth. like "interface methods may only have a body when declared as default", providing the possibility to add the keyword.
Comment 1 Peter Nabbefeld 2017-08-21 05:45:07 UTC
Hm, probably this bug is related to maven, as I've found some other problems now when trying to compile (source format and compiler set to Java 8):
- "PluginConfig.java:[19,8] PluginConfig is not abstract and does not override abstract method getSpringConfigurationDelegate() in ServerPluginConfig"
- Due to some tutorials, without the "default" keyword the method should just be static.

So it seems, though I've set the project properties to use Java 8, maven doesn't use the correct Java version. Maybe a problem with the Super POM?
Comment 2 Peter Nabbefeld 2017-08-21 06:21:47 UTC
The description of static interface methods I found was incorrect, so interface methods for Java 8 should have a hint to either add "default" or "static".
Comment 3 Peter Nabbefeld 2017-08-21 06:55:36 UTC
Hm, the maven-only problem with compiling is no more reproducible, so only the hint should still be fixed.