Bug 462175 - [content assist] Duplicate visibility modifier when generating constructor
Summary: [content assist] Duplicate visibility modifier when generating constructor
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-15 13:44 EDT by Lukas Eder CLA
Modified: 2024-03-03 02:46 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Eder CLA 2015-03-15 13:44:53 EDT
Consider the following stub:

----------------------------------------------
import java.util.AbstractList;

public class Test extends AbstractList<Object> {

    // Incomplete constructor here
    public T

    @Override
    public Object get(int index) {
        return null;
    }

    @Override
    public int size() {
        return 0;
    }
}
----------------------------------------------

When I hit Ctrl+Space on "public T", I'm presented with the option to generate a constructor. The result is the following:

----------------------------------------------
import java.util.AbstractList;

public class Test extends AbstractList<Object> {

    public public Test() {}

    @Override
    public Object get(int index) {
        return null;
    }

    @Override
    public int size() {
        return 0;
    }
}
----------------------------------------------

I would expect auto completion to understand that there is already a visibility modifier, and not generate another one.

Note, the AbstractList extension and the additional methods seem to have been necessary for the constructor generation template to be available. This might be a bug / missing feature per se, not sure.
Comment 1 Eclipse Genie CLA 2019-12-30 13:47:30 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Lukas Eder CLA 2020-03-20 11:34:02 EDT
This is still happening
Comment 3 Eclipse Genie CLA 2022-03-12 02:40:15 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2024-03-03 02:46:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.