Skip to content

No code completion for constructor invocation of local classes #9199

@nmatt

Description

@nmatt

Apache NetBeans version

Apache NetBeans 28

What happened

For local classes, code completion for the class name works, but for constructor invocations (new expressions) no code completion is offered.

Language / Project Type / NetBeans Component

No response

How to reproduce

Example:

class Example
{
    static class NonLocalClass { int a; int b; NonLocalClass(int a, int b) { } }
    record NonLocalRecord(int a, int b) { }

    void method()
    {
        class LocalClass { int a; int b; LocalClass(int a, int b) { } }
        record LocalRecord(int a, int b) { }
        
        new LocalClass   // <– code completion here
    }
}

=> No argument-list code completion for the local classes is offered, in contrast to constructor invocations of nonlocal classes.

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

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions