views:

41

answers:

2

I am wondering if it possible to, for example, set the warning level for unused import statements on files that end in *Impl.java?

I know I can use the @SupressWarnings annotations, but the files that I want excluded are built from another project. I simply want to ignore their problems...at least for the time being.

I don't see any customizable options that would achieve this and my Google-Fu is failing me.

I assume it is simply not an available option, but I thought I would ask the experts before I wrote it off completely.

Thanks!

+1  A: 

Go to Window > Preferences > Java > Compiler > Errors/Warnings
This menu gives you the option to choose which occurrences of events you want to treat as error/warning/not-at-all.

(There are more places where you can configure additional cases, e.g. Window > Preferences > Java Persistence > Errors/Warnings for the Java Persistence framework. To find them all use the in-menu search (top left corner in the preferences menu) and search for 'warning' or something like that.)

As far as I know it is not possible to specify any further conditions for the configuration of the warn levels.
Isn't it an option to just switch the option to 'ignore' for the time you work on this specific project?
A work around could be to have a second workspace just for that project. As eclipse saves its preferences workspace-wise this would not affect your other projects.

fgysin
right, I understand that. What I am looking for is additional levles of customization so I can say "Unused Import:Level Warning:*Impl.java"...kind of thing
northpole
@northpole: Just edited my post, to meet that point. But I don't think thats possible. :/
fgysin
I was pretty convinced from all the research I did that this was not possible, but I figured someone might know a trick or two on this site. Thanks for the reply though!
northpole
I ended up putting the imported application into it's own project. It works for the most part but required more effort than I had hoped for. However, thanks for the advice!
northpole
A: 

Perhaps keep those files in a different project. Set the project settings so it doesn't display the warnings. Than include this project in your current project. Not sure if it works and if this is what you wants but it might be a workaround.

Mark Baijens