Eclipse, completion of inner classes

I’ve got a class B defined as inner class for A

class A {
    static class B {
       // ...
    }
    // ...
}

I’m editing a third class C, and I need to declare a A.B object:

A.B something = new A.B(...);

If I use Eclipse’s code completion, and I let Eclipse infer the type of the expression, I get something like this:

import A;
import A.B;
// ...
class C {
    // ...
    void foo() {
        B something = new A.B(...);
    }
}

Is there a way to avoid this behavior and have eclipse using A.B instead of importing it?


Source: java

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.