whirlwin
whirlwin

Reputation: 16541

Eclipse removes import in use

I'm using Eclipse Galileo and I have a small problem.

Inside one of my classes (lets call it Foo)I have an import of an enum DBAction in another package DB.

With the import already specified in the code, it works fine, but whenever I press Shift+Ctrl+O (Organize imports) it removes that import, thus breaking my code.

Here is some of the code (with placeholder names):

package foo.bar.baz;

import foo.bar.DB.DBAction;
// Other imports.

// Constructor

// I use the DBAction (enum) here
public void onClick(View view) {
    if (view == btnAddEvent)
        new EventDialog(DBAction.INSERT);
}

This is Android, but I think it's not an Android specific problem.

Are there any ways to fix this bug?

Upvotes: 3

Views: 1518

Answers (1)

Torsten
Torsten

Reputation: 6204

This usually happens when the class/package referenced in the import is not available on the classpath of the project.

Upvotes: 2

Related Questions