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 256798 - Implement all abstract methods does not consider default method of the interface
Summary: Implement all abstract methods does not consider default method of the interface
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
Depends on: 258981
  Show dependency tree
Reported: 2015-11-26 08:10 UTC by Jachym_Vojtek
Modified: 2016-05-16 07:36 UTC (History)
0 users

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 Jachym_Vojtek 2015-11-26 08:10:56 UTC
Consider the example:
package testImplementDefaultMethodHint;

public class ImplementDefaultMethodHint {

    I i = new I() {


interface I {
    void x();
    void y();
    default void z() {}

1) Notice the hint offered on line where new instance of anonymous class is created.
2) When hint "Implement all abstract methods" is applied it does not add the method z()

I understand that z() in fact is not an abstract method. So technically this is maybe correct.

But what if I (ab)used default modifier to make an API compatible change in the interface I which had existed a long time before method z() was added? The default method is then the only possibility I had. And in this situation it is a method that I want to be implemented by classes that implement interface I.

How many other possibilities there are to find out that method z() can be implemented? Luckily there is code completion. But Generate Override Methods does not offer z(). Let's imagine that there are no sources for interface I available. Not easy situation to implement interface I properly, do you agree?
Comment 1 Svata Dedic 2016-05-16 07:36:21 UTC
Fixed by