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 269208

Summary: Ctrl + Space on static method call offers no suggestion when followed by any annotation
Product: editor Reporter: abc159abc
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description abc159abc 2016-12-02 07:18:39 UTC
I have an interface with one method that I implement in a class.
In the class I want to instantiate a Logger (using SLF4J).
The jar are all presents on the classpath (through maven).

1. Create the interface and class:

public interface MyInterface {
    void doSomething();
}

public class MyClass implements MyInterface {
    @Override
    public void doSomething() {
        ...
    }
}

2. Get a logger instance right before the @Override:

public class MyClass implements MyInterface {
    // ---> I want to get the logger right here

    @Override
    public void doSomething() {

3. At the position indicated above, I start instantiating the logger (goal is to have: private static final Logger LOGGER = LoggerFactory.getLogger(MyClass.class)):

private static final Logger LOGGER = L// Suggestions stop working here. I should be offered several choices including LoggerFactory

4. Remove the @Override and try to get suggestions again. I will work as expected.
Comment 1 abc159abc 2016-12-02 13:35:32 UTC
Although I first encountered the problem for @Override, it happens for any annotation.