SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Giriraj Bhojak wrote:So in my case I should comment out the variables rather than deleting them or adding @SuppressWarnings.
And should i also conclude that it is best to use them when deprecation is involved?
I'm a bit of a fundamentalist about this but I see @SuppressWarnings used to remove this sort of warning as a bad thing
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Cheers, Martijn,
Twitter.
Regards Tom Stevns, SCJP2
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Martijn Verburg wrote:I'd certainly recommend that every Java developer owns a copy of this book, it's a Gem.
SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Regards Tom Stevns, SCJP2
Not sure, but I think you are probably all right.Martin Vanyavchich wrote: . . . I hope I'm not violating any copyrights
Rob Prime wrote:Just make sure you write a comment to explain why you are sure the cast is safe.
Mike Simmons wrote:
Rob Prime wrote:Just make sure you write a comment to explain why you are sure the cast is safe.
Mmmh, here I disagree with Rob, as well as Josh Bloch whom Rob quotes. I would say, make sure it's clear, in the code, why the cast is safe. But often, if you reduce the scope of the @SuppressWarnings enough, it's already pretty %$#@ing obvious that the cast is safe, and you shouldn't need to justify that. The two previous code examples given by Rob are good examples of this. Which may be why they do not, in fact, contain comments justifying the casts. None are needed.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions