tags:

views:

94

answers:

3

We have an internal Java library, that for legacy reasons, needs to be compiled using Java 1.4. However, this lib has gone through several versions, the latter of which have had certain methods and objects deprecated. For client support reasons, the code needs to use some of these deprecated methods/objects. As such, we always keep the latest lib on the build path of our projects (in Eclipse).

I would like to

@SuppressWarnings("deprecation");

Though, do to the aforementioned 1.4 dependency, this is not possible.

Is there a way for me to remove the warnings, if only from my Eclipse Problems view, and somewhat cleanup my development environment?

Thanks, Cheers, Patrick

+2  A: 

If you're not concerned about deprecation anywhere in that project, you could always give it custom project compilation settings and set it to ignore deprecation. It's not ideal, but it may well be better for you in this case than living with the deprecation warnings - it means you'll be able to spot ones in your other projects more easily.

Jon Skeet
A: 

You could treat it as a standalone project. If its legacy you won't need to update often. In your main project use the JAR created with a link to the source so you still see that. That way it won't be compiled so it won't create warnings all the time.

Peter Lawrey
+6  A: 

Is there a way for me to remove the warnings, if only from my Eclipse Problems view, and somewhat cleanup my development environment?

You can configure the Java Compiler to ignore the Deprecated Warnings. I'd suggest to configure this setting for the specific project, not globally. To do so, right-click on your project and go to Properties > Java Compiler > Errors/Warnings. Click Enable project specific settings and then unfold Deprecated and restricted API and select Ignore for Deprecated API.

alt text

This will disable all deprecated warnings though.

Pascal Thivent
+1. Clear answer (even if a.yfrog.com is blocked at work by the firewall... hint: imageshack.us is not ;) )
VonC
@VonC Thanks. Regarding yfrog.com, the tool I'm using for screenshots switched to from imageshack.us to it, not me :) But it offers some alternatives. Would imagebanana.com be better?.
Pascal Thivent
@Pascal: well, at least imagebanana.com is not blocked ;)
VonC
Thank you! My OCD can subside now that the little yellow squigglies have gone away.
P. Deters