• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Suppressing Deprecation Warnings

 
author
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JDK1.3.1.

I've written a class that implements the PreparedStatement interface, but the compiler complains that the setUnicodeStream() method is deprecated.

I'm not using the method, but I have to include it in order to implement the interface. I tried marking the method as /** @deprecated */ but this had no effect.

Does anyone know of a way to stop the warnings for this class only? (I don't want to turn off the warnings completely).
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me quickly give you a couple of supposed to's:

1) Deprecation warnings should be displayed when you use the -deprecation option of the compiler. Are you using a IDE that has that option set by default?

2) The @deprecated tag allows(not disallows) the compiler to issue deprecation warnings.
 
David Peterson
author
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think I explained well enough.

I am compiling with Ant. I have turned on 'deprecation warnings' because if any of my code is using deprecated methods then I want to be aware of that fact.

My issue is that I am never calling the deprecated methods in PreparedStatement, but I am still getting warnings just for implementing them. This seems crazy.

My IDE (Eclipse) is more sensible and stops reporting the warning if I put @deprecated as a javadoc tag before the implementation of the method, but the "javac" Ant task continues to report them.



Any bright ideas how to stop Ant reporting these false deprecation warnings, without turning them off completely?
[ August 20, 2004: Message edited by: David Peterson ]
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree that because you use the @deprecated tag for your implementation class, the warning should be for the consumer of your class not your class itself. I suspect that this is a short coming of javac(maybe they didn't consider abstract methods) and your Eclipse IDE has a unique feature to account for the above.
 
I can't take it! You are too smart for me! Here is the tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic