Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

!!!!!!!!!! Deprecation in Java  RSS feed

 
John Brady
Greenhorn
Posts: 1
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a researcher looking into the deprecation mechanism of Java. We found that most developers when they encounter a deprecated feature, prefer not to react to it. That is they do not remove the reference to the deprecated feature and replace it with the recommended replacement. I was wondering as to why this might be the case? Is it a deficiency in the deprecation mechanism itself? Or do developers not have time. It would be awesome if some of the experienced heads here could fill out our survey to answer this: http://www.surveygizmo.com/s3/3754964/Deprecation-reaction
 
Tim Cooke
Sheriff
Posts: 3743
208
Clojure IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Done. It'd be great if you'd come back and share your findings with us.
 
Campbell Ritchie
Marshal
Posts: 54882
155
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Find a copy of Object Oriented Software Construction by Bertrand Meyer. Go through that and look for the OBSOLETE keyword. Meyer says you can mark a feature as obsolescent and then remove it six months later. I interpret that as meaning your app which has worked nicely for ten years stops working without warning or explanation after an upgrade. If you look at this thread from January last year, you will find a much better explanation from Tim Holloway.
In that old thread, Tim Holloway wrote:Deprecation allows the vendor to gracefully remove functionality so that instead of a fatal compile error, you get a deprecation warning, can safely put the amended app into production and can then update the app's source code at leisure, rather than in a flustered panic. OK, we all know that "leisure" means never, but still, the idea is sound.
I think OBSOLETE is the right keyword.
 
Pallavi Sadit
Ranch Hand
Posts: 46
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Until now, even though the API were marked as deprecated, they were never removed. So, developers were relaxed and comfortable to let things run the way they are and not go to the trouble of replacing them. But now , things have changed in Java as well with Java 9. See this JEP http://openjdk.java.net/jeps/277 . Now, the deprecated API which are marked with forRemoval = true, will be removed in the next major release. So, the developers will be forced to be attentive and replace them.
 
Tim Moores
Saloon Keeper
Posts: 3755
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
developers were relaxed and comfortable to let things run the way they are and not go to the trouble of replacing them.

That is troubling, though. The javadocs of quite a few deprecated APIs make it very clear that those APIs are deficient or downright buggy. Makes one wonder what else such developers don't pay attention to.
 
Stephan van Hulst
Saloon Keeper
Posts: 7470
133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm completing the survey now. I find it hard to answer some of the Agree/Disagree questions, because just selecting the option leaves out a lot of information. For instance, when asked whether I "Replace the deprecated call with functionality from the Java Development Kit (JDK)", I entered "Ocassionally". To me, that appears that I will often prefer the recommended alternative provided by the third party library. In reality, I will prefer to replace (non-)deprecated functionality from a third party library with that from the JDK when I have the opportunity, thereby reducing the amount of dependencies I have. This opportunity simply doesn't arrive so often. I find these types of questions work better if there's a field to explain the choice.

A silly question is: "I did not know/was not aware of the deprecation (lack of tools or documentation to make me aware)". How can I answer that question, if I wasn't aware of the deprecation?

Anyway, just completed it, good luck with the study.
 
Stephan van Hulst
Saloon Keeper
Posts: 7470
133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good reason for removing deprecated API usage: I don't like the strikethroughs that my editor shows
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!