Skip to content

Code completion does not offer overriding toString() when a super interface has declared it #9469

Description

@nmatt

Apache NetBeans version

Apache NetBeans 30

What happened

Within a Java class that implements an interface which declares the standard toString() method (like for example the java.lang.CharSequence interface does), code completion does not offer overriding Object::toString().

Language / Project Type / NetBeans Component

Java, Code completion

How to reproduce

class Example
{
    interface Interface { public String toString(); }    
    static class Impl implements Interface {  }
}

Within the Impl class, invoke code completion => overriding toString() is not offered.

Remove either toString() in Interface, or remove implements Interface from Impl => overriding toString() is now offered.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows

JDK

17

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions