开发者

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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜