Questions tagged [deprecated]

Deprecation is a status applied to software features or language terms to indicate that they should be avoided, typically because they have been superseded. Use this tag for questions about deprecated features or how to deprecate features yourself (e.g. using annotations).

In the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded. Although deprecated features remain in the software, their use may raise warning messages recommending alternative practices, and deprecation may indicate that the feature will be removed in the future.

Features are deprecated—rather than immediately removed—in order to provide backward compatibility and give programmers who have used the feature time to bring their code into compliance with the new standard.

2508 questions
1256
votes
5 answers

How to mark a method as obsolete or deprecated?

How do I mark a method as obsolete or deprecated using C#?
Chris Ballance
  • 33,810
  • 26
  • 104
  • 151
738
votes
5 answers

Why is Java Vector (and Stack) class considered obsolete or deprecated?

Why is Java Vector considered a legacy class, obsolete or deprecated? Isn't its use valid when working with concurrency? And if I don't want to manually synchronize objects and just want to use a thread-safe collection without needing to make fresh…
fjsj
  • 10,995
  • 11
  • 41
  • 57
559
votes
4 answers

getResources().getColor() is deprecated

Using: buildToolsVersion "22.0.1" , targetSdkVersion 22 in my gradle file. I found that the useful getResources().getColor(R.color.color_name) is deprecated. What should I use instead?
David
  • 37,109
  • 32
  • 120
  • 141
511
votes
32 answers

UIDevice uniqueIdentifier deprecated - What to do now?

It has just come to light that the UIDevice uniqueIdentifier property is deprecated in iOS 5 and unavailable in iOS 7 and above. No alternative method or property appears to be available or forthcoming. Many of our existing apps are tightly…
Oliver Pearmain
  • 19,885
  • 13
  • 86
  • 90
397
votes
15 answers

Html.fromHtml deprecated in Android N

I am using Html.fromHtml to view html in a TextView. Spanned result = Html.fromHtml(mNews.getTitle()); ... ... mNewsTitle.setText(result); But Html.fromHtml is now deprecated in Android N+ What/How do I find the new way of doing this?
Aldasa
  • 4,551
  • 2
  • 21
  • 31
390
votes
5 answers

Rails I18n validation deprecation warning

I just updated to rails 4.0.2 and I'm getting this warning: [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to…
Mauricio Moraes
  • 7,255
  • 5
  • 39
  • 59
345
votes
10 answers

What are the alternatives now that the Google web search API has been deprecated?

Google Web Search API has been deprecated and replaced with Custom Search API (see http://code.google.com/apis/websearch/). I wanted to search the whole web but it looks like with the new API only custom sites can be searched. Is there a way to…
Dan
  • 9,681
  • 14
  • 55
  • 70
330
votes
6 answers

How to declare or mark a Java method as deprecated?

I would like to make one of my methods "deprecated" = not used anymore. But still I would like to have it in my API. I just want to show "warning" to anyone using that method. How can I achieve that?
Pavel Janicek
  • 14,128
  • 14
  • 53
  • 77
327
votes
20 answers

Replacement for deprecated sizeWithFont: in iOS 7?

In iOS 7, sizeWithFont: is now deprecated. How do I now pass in the UIFont object into the replacement method sizeWithAttributes:?
James Kuang
  • 10,710
  • 4
  • 28
  • 38
319
votes
10 answers

Subscribe is deprecated: Use an observer instead of an error callback

When I run the linter it says: subscribe is deprecated: Use an observer instead of an error callback Code from this angular app: this.userService.updateUser(data).pipe( tap(() => {bla bla bla}) ).subscribe( …
ismaestro
  • 7,561
  • 8
  • 37
  • 50
292
votes
10 answers

jQuery 1.9 .live() is not a function

I recently updated jQuery from 1.8 to 2.1. I suddenly discovered that the .live() stops working. I get the error TypeError: $(...).live is not a function. Is there any method I can use in place of .live()?
ngplayground
  • 20,365
  • 36
  • 94
  • 173
286
votes
11 answers

Replacements for deprecated JPMS modules with Java EE APIs

Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon: java.activation with javax.activation package java.corba with javax.activity, javax.rmi, javax.rmi.CORBA, and org.omg.* packages java.transaction with…
Nicolai Parlog
  • 47,972
  • 24
  • 125
  • 255
275
votes
9 answers

KeyboardEvent.keyCode deprecated. What does this mean in practice?

According to MDN, we should most definitely not be using the .keyCode property. It is deprecated: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode On W3 school, this fact is played down and there is only a side note saying that…
Jason210
  • 2,990
  • 2
  • 17
  • 18
270
votes
14 answers

Why is the Date constructor deprecated, and what do I use instead?

I come from the C# world, so not too experienced with Java yet. I was just told by Eclipse that Date was deprecated: Person p = new Person(); p.setDateOfBirth(new Date(1985, 1, 1)); Why? And what (especially in cases like above) should be used…
Svish
  • 152,914
  • 173
  • 462
  • 620
252
votes
17 answers

How to ignore deprecation warnings in Python

I keep getting this : DeprecationWarning: integer argument expected, got float How do I make this message go away? Is there a way to avoid warnings in Python?
Mohammed
  • 2,693
  • 2
  • 17
  • 8
1
2 3
99 100