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 - Missing hint for interface default method (since Java 8)
Summary: Missing hint for interface default method (since Java 8)
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: Dev
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2017-08-20 20:31 UTC by Peter Nabbefeld
Modified: 2017-11-24 00:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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):
- "[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.