6
votes

Using eclipse, when I enter the following:

public enum Foo {
    A(Integer.);
    private final Integer integer;

    private Foo(Integer integer) {
        this.integer = integer;
    }
}

And position my cursor after Integer. and ask for content assist (^space) I get nothing. In fact content assist does not seem to work at all inside enum constant argument lists.

Is this a known problem or expected behaviour? If the latter, why?

EDIT: I'm wondering if this is a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395604

If so I'm amazed that such an obvious thing hasn't been fixed in the past 5 years with the number of Java developers using Eclipse.

1

1 Answers

3
votes

Yes, you're right, it is a known bug or at least a missing feature of the Eclipse Java IDE:

Eclipse Bug 395604 - Code assist does not work after anonymous class inside in an array initializer

In the last 5 years, there have been only a few votes for this bug and also only very few comments, so it doesn't seem to be particularly important for most users. I voted for the bug and added a comment with a link to your question. Eclipse is open source and the bug is tagged with helpwanted. So any Java developer is welcome to make Eclipse a little bit better by implementing this.