deprecated

Deprecate in Java 1.6

£可爱£侵袭症+ 提交于 2019-12-21 20:26:27
问题 In Java 1.5, to deprecate a method you would: @Deprecated int foo(int bar) { } Compiling this in Java 1.6 results in the following: Syntax error, annotations are only available if source level is 1.5 Any ideas? 回答1: You have to tell the compiler to use 1.6: javac -source 1.6 Or equivalent for your IDE/build system (as others have suggested). 回答2: First, its @Deprecated , and second - double-check if you are really compiling with Java 1.6. What are you using? javac? Eclipse? If using javac,

NSString cString is Deprecated. What is the alternative?

风格不统一 提交于 2019-12-21 09:21:07
问题 I've got another newbie question. I've written a piece of code that converts a NSString to NSMutableData in order to simulate a webService result. It turns out however that cString is deprecated. Can you help me replace it? Here's my code. NSString *testXMLDataString = @"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" etc.... "</SOAP-ENV:Envelope>"; //Replace webData Received from the web service with the test Data NSMutableData *testXMLData = [NSMutableData dataWithBytes:[testXMLDataString

How to get rid of g++ hash_map deprecation warning?

不羁岁月 提交于 2019-12-21 09:19:22
问题 When I compile a c++ application I'm writing that makes use of hash_map, I get this warning on g++ 4.3.2: You are using the deprecated header . To eliminate this warning, use an ANSI-standard header file or use hte -Wno-deprecated compiler flag. 9> #include <ext/hash_map> What include replaces this? I've searched for a while on google, and can't find anything except for people having similar problems, but no solution. 回答1: My very first Google hit for "g++ hash_map deprecated" takes me to a

Intellij idea deprecated no strikeout/strikethrough

允我心安 提交于 2019-12-21 07:45:29
问题 I'm using IntelliJ idea v12. When I import a project, there shows the strikeout/strikethrough line on the method which has the annotation @Deprecated , but I use alt + enter and disable. So, how can I re-active this feature? Thanks! I want to display that strikethrough! 回答1: Open Settings -> Type Inspections to go to inspection settings -> Type Deprecated to find out all deprecated related inspection settings -> Check Deprecated API usage . 回答2: IntelliJ had a bug in 2018.3, 2018.2.2 (182

Android checkbox state_enabled

北城以北 提交于 2019-12-21 07:05:53
问题 the xml element "enabled" for a checkbox is deprecated. Eclipse tells me to use state_enabled instead. I tried to add android:state_enabled="false" to my checkbox within my xml instead of android:enabled="false" But it doesn't show any effect. The latter one does the desired. I don't want to use a deprecated method. Am I doing something wrong? Thanks. 回答1: This thread discusses this. Romain Guy says it is not deprecated but perhaps some bug/issue in Eclipse or the ADT editor causes it to show

Which things around case classes will be removed after Scala 2.9 exactly?

杀马特。学长 韩版系。学妹 提交于 2019-12-21 04:32:12
问题 I know that the are some changes planned regarding case classes, like disallowing inheritance between them: scala> case class Foo() defined class Foo scala> case class Bar() extends Foo() <console>:9: warning: case class `class Bar' has case ancestor `class Foo'. Case-to-case inheritance has potentially dangerous bugs which are unlikely to be fixed. You are strongly encouraged to instead use extractors to pattern match on non-leaf nodes. case class Bar() extends Foo() ^ defined class Bar or

Deprecation warning: #apply_finder_options

纵饮孤独 提交于 2019-12-21 04:01:04
问题 I get DEPRECATION WARNING: #apply_finder_options is deprecated. when trying this in my user.rb : def User.search(search, page) paginate page: page, per_page: 10, conditions: ['name LIKE ?', "%#{search}%"], order: 'name' end Called through UsersController : def index @users = User.search(params[:search], params[:page]) end The pagination is done with the will_paginate gem. What is triggering the warning and how can I fix it? Been trying some googling, but I find the docs not too comprehensive!

alternative to deprecated UITableViewCell setText?

送分小仙女□ 提交于 2019-12-21 03:10:53
问题 Code in the book Beginning iPhone Development (by Dave Mark & Jeff LaMarche) assigns to the UITableViewCell text property: UITableViewCell *cell = ... ... cell.text = ... This assignment brings up a "'setText' is deprecated..." warning. What should I use as an alternative? Also, how do I open the long URL in the warning (in Xcode) without retyping the whole thing? 回答1: try: cell.textLabel.text = @"test"; (Ah, it's nice to be answer 3.0 SDK questions now) 回答2: Deprecated suggests that you

Read logs using the new swift os_log api

落花浮王杯 提交于 2019-12-20 09:38:23
问题 Deprecated in iOS 10.0: os_log(3) has replaced asl(3) So iOS 10.0 apparently deprecates the asl (Apple System Log) api and replaces it with the very limited os_log api. I use something similar to the code snippet below to read out log writes for the running app to show in a uitextview in app - and now it is full of deprecation warnings. Does anyone know of a way to read the printed log using the new os_log api? Because I only see an api for writing (https://developer.apple.com/reference/os

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

女生的网名这么多〃 提交于 2019-12-20 08:24:09
问题 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 .keyCode is provided for compatibility only and that the latest version of the DOM Events Specification recommend using the .key property instead. The problem is that .key is not supported by browsers, so what should we using? Is there something I