@SuppressWarnings("deprecation") is not working as described in the Tutoria

@SuppressWarnings("deprecation") is not suppressing warnings when I compile the below code on SDK 1.6.0. This code is copied straight from the Java Tutorial page at http://java.sun.com/docs/books/tutorial/java/javaOO/QandE/annotations-answers.html
Any hints would be appreciated.
Thank you,
Andrew Bloss
public class MyHouse implements House {
    @SuppressWarnings("deprecation")
    public void open() {}
    public void openFrontDoor() {}
    public void openBackDoor() {}
}I get the message
"MyHouse.java uses or overrides a deprecated API."
I copied both the interface and the code from the tutorial page. The message does appear if I replace
@SuppressWarnings("deprecation") with
@Deprecated.
The interfac is
public interface House {
     * @deprecated use of open is discouraged, use
     * openFrontDoor or openBackDoor instead.
    @Deprecated
    public void open();
    public void openFrontDoor();
    public void openBackDoor();
}

You have, as far as I can tell, found a bug in Sun's compiler.
Java language Specification 3rd edition, p#9.6.1.6, says:
9.6.1.6 Deprecated
A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists. A Java compiler must produce a warning when a deprecated type, method, field, or constructor is used (overridden, invoked, or referenced by name) unless:
The use is within an entity that itself is is annotated with the annotation @Deprecated; or
The declaration and use are both within the same outermost class; or
The use site is within an entity that is annotated to suppress the warning with the annotation @SuppressWarnings("deprecation")
Use of the annotation @Deprecated on a local variable declaration or on a parameter declaration has no effect.
Using Java 6, I verified that the following code issues a warning when compiled:
interface House {
     * @deprecated use of open is discouraged, use
     * openFrontDoor or openBackDoor instead.
    @Deprecated
    public void open();
    public void openFrontDoor();
    public void openBackDoor();
class MyHouse implements House {
    @SuppressWarnings("deprecation")
    public void open() {}
    public void openFrontDoor() {}
    public void openBackDoor() {}
}The compiler produced these results:
Note: Xy.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.This bug (resolved in Mustang) may be involved.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6394563

Similar Messages

  • Example in Data Modeler Tutorial does not work as described

    Using Oracle Data Developer 4, I cannot get the example on https://docs.oracle.com/cd/E57998_01/doc.41/e57984/tut_data_modeling.htm#DMDUG36173 to work as described. The Foreign Key fields in the logical model are not generated. They are only generated in the relational model when I develop the logical model. However, the names follow the template {table}_{table}_ID, which will cause problems for long table names. Now I have two questions:
    1. How can get the foreign key fields to be generated in the logical model, as descibed in the tutorial?
    2. Where can I see the default naming rules for generated fields used by the program and where can I change them? - I found a description how this works in Version 3, but these options do not exist anymore in Version 4.

    2. Where can I see the default naming rules for generated fields used by the program and where can I change them? - I found a description how this works in Version 3, but these options do not exist anymore in Version 4.
    In version 4 the template definitions are defined in the properties for the Design.
    Right-click on the Browser entry for your Design and select Properties.
    In the tree in the left panel of the Design Properties dialog, expand Settings, then expand Naming Standard and select Templates to display the Template definitions.
    David

  • HT1202 The manual mode to transfer music to my iTune from my iPhone does not work as described. When I click on Manually manage... it displays the warning message that all music on my iPhone will be erased and replaced by iTune music.

    The manual mode to transfer music to my iTune from my iPhone does not work as described. When I click on Manually manage... it displays the warning message that all music on my iPhone will be erased and replaced by iTune music.
    How can I transfer my music to a second computer iTune?
    Thanks,

    See this user tip
    Syncing iPhone to a "New" Computer or replacing a "crashed" Hard Drive

  • Macbook Pro 2011 DVI HDMI out does not work with TV when the power cable is connected

    My Macbook Pro (Early 2011) DVI HDMI out does not work with TV when the power cable is connected. If get the blue screen and then can use the macbook but nothing is displayed on the TV. If i go into display I can see that there are two screens but nothing displayed on the TV. If i take the power cable out at this point the TV shows the second desktop as expected. If i then reconnect the cable, the screen flickers, as though it is being affected by the power cable, and the screen goes blank on the TV. Only if i remove the DVI cable do i get the blue screen again. If i remove the power cable and reconnect it will do it every single time, so i cannot see it being a TV issue or a minor glitch.
    I have had this working previously but at the minute it seems to not be playing ball....any thoughts
    Thanks
    Dan

    BUMP
    Any ideas?

  • My DVR security sofware that I access remotely uses a "dvr .ocx" file....when I try it in Firefox , either the latest non beta (3.6.1.5) or the new beta version (4.0 rc) it will NOT work as it says the plugin is missing... it works in IE 8,but not IE9...

    My machine is Top of the range (my Company builds them so it had better be :) )
    Amd 1100t , 8gb ram , Windows 7 64 bit etc, etc...
    The is not a hardware problem , but a software problem with FF...Any help would be appreciated as I hate using IE 8 for anything at all :( but I have to keep it on my machines just to run my remote security cameras at my Computer shop ???
    Original question...as question length is limited ...not very bright that limit by the way :(
    "My DVR security sofware that I access remotely uses a "dvr .ocx" file....when I try it in Firefox , either the latest non beta (3.6.1.5) or the new beta version (4.0 rc) it will NOT work as it says the plugin is missing... it works in IE 8 (unfortunately) but not IE9...
    As I own a Computer company I am fairly computer literate but cannot find a plugin that allows this to work in Firefox.... but I would have expected it to work in the new Firefox :(
    All the best, Brett :)

    The longer this thread continues, the more ancillary comments you throw in that aren't directly pertinent to your problem with your DVR software not working with Firefox 4.0. Sorry, I don't intend to continue with this discussion.
    I do agree that ''something'' needs to be done better with regards to plugins for Firefox, but I do disagree with you as to whose responsibility that ''something'' is.

  • TS3694 I performed an iOS 7 software update on my iPhone yesterday, and now the phone is not working at all. The iPhone screen shows to connect to iTunes to restore. I've have done this, and still the iPhone is not working. What going on?

    I performed an iOS 7 software update on my iPhone yesterday, and now the phone is not working at all. The iPhone screen shows to connect to iTunes to restore. I've have done this, and still the iPhone is not working. What going on?

    I have no idea what may have caused your MacBook to stop working, but from your description it kind of sounds like it may have started before you ran Software Update and installed the new Apps. Just the general slow feeling and bugginess is what tips me off. You said that you weren't sure if you had closed all open windows, that doesn't matter if the computer restarts itself. It automatically closes all other open applications when restarting.
    As to your data being retrievable, if when you take it in they do a fresh install of the OS, then no, it will not be unless you want to pay several thousand dollars to a software retrieval company.
    I am glad to hear that you have taken into the Apple Store to get it fixed, and that you have all of your purchased music backed up to your iPod. You should be able to just transfer it all back to iTunes once you get your computer back should it be necessary.
    As a side note, the proper place for this topic would probably in the MacBook forums, not iTunes since there is no evidence that iTunes started the issue.

  • The Horizontal & vertical scroll is not visible or not working when i run the form in Forms 6i.

    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    In this form , there are 5 canvas namely
    CANVAS2 - Stacked Canvas
    PASS - Content Canvas
    MAT_RATES - Content Canvas
    DATE - Content Canvas
    PREVIOUS - Content Canvas
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.

    Vijetha wrote:
    Hi all,
    The Horizontal & vertical scroll is not visible or not working when i run the form.
    I have set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the WINDOW Property.
    I have  set "Show Horizontal Scroll Bar" to "Yes" and  "Show Vertical Scroll Bar" to "Yes" in the STACKED CANVAS Property .
    But still the Horizontal and Vertical Scroll Bar is not working when i run the Form.
    Help me with this please. How do i make it visible??
    Oracle Forms 6i..
    Thank You.
    hello vijetha,
    window and canvas show scroll bar when it need.
    You should show block property
    and set block scroll bar
    hope this helps..
    Hamid

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

  • My mac's keyboard is not working with my mac.the green light blinks and i cannot get onto my mac. everything on the support questions does not help because i cant go on the mac and i cant sign in

    my mac's keyboard is not working with my mac.the green light blinks and i cannot get onto my mac. everything on the support questions does not help because i cant go on the mac and i cant sign in

    If you can't sign in, then you can't troubleshoot and/or pair the keyboard until after that........ so, for that, you will need to borrow someone's USB wired keyboard in order to get signed in and to the Keyboard Bluetooth Preferences.

  • Hi i have a ipod touch 4 generation 64gb and my camera is blocked and dose not work i cant update the ipod either

    hi i have a ipod touch 4 generation 64gb and my camera is blocked and dose not work i cant update the ipod either

    Try:
    - Reset the iOS device. Nothing will be lost       
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                                
    iOS: How to back up                                                                                     
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar

  • I bought Iproxify throught app store and it does not work. I contacted the creator but I have not had any answer. What can I do to get my money back? and please take him down.

    I bought IPROXIFY throught APP STORE and it does not work. I contacted the creator and he has not answered.
    How can I get my money back? and please take him down of your page as we (users) think that we are buying products that worked backed up by MAC.
    Looking forward for an answer in order to keep buying in APP Store

    This article may clear up some confusion you may have regarding third party developers and Apple.
    The Mac App Store Discussion, what is it for?

  • Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either.

    Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either. Anyone have a solution?

    Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either. Anyone have a solution?

  • The sound in my IPad is not working after I downloaded the new iOS 7. I tried to reset the IPad to no avail. Could anyone be so kind to help me?

    The sound in my IPad is not working after I downloaded the new iOS 7. I tried to reset the IPad to no avail. Could anyone be so kind to help me?

    I"m going to make the presumption that you've checked the volume and that you don't have it muted. One thing some have suggested is to go into the settings and reset all settings.
    It is kind of a drag because you wil have to retweak everything but it's helped for some.

  • After 04 months of purchase of iphone 5 the lock button is too hard. At times its not working at all. The phone has been purchased in USA now I'm not getting service in India. After all whats the point in spending so much amount without any service.

    After 04 months of purchase of iphone 5 the lock button is too hard. At times its not working at all. The phone has been purchased in USA now I'm not getting service in India. After all whats the point in spending so much amount without any service.

    The warranty says that Apple may restrict service of an iPhone to the country of sale, and any reliable salesperson will tell you that if you tell them that you plan to use the iPhone in another country. Such service restrictions are common with cellphones and are by no means limited to Apple's phones.
    Sorry, but if your iPhone requires service, you will need to send it to someone you know in the US who can get it serviced and then send it back to you.
    Regards.

  • Slider not working around 50% of the time.

    Hello,
    Slider not working around 50% of the time when I get a call. I hit the sleep button and home button several times and then it works.
    I've done the soft reset several times. I've restored settings completely 2 times.
    the screen is clean, my hands are clean, the wifi is off, the phone has not been dropped, it only happens when receiving a call and never happens when I'm just turing it on to access the menu. Bluetooth is off as well.
    Any ideas?

    this happened to me a week or so after buying my iPhone. Fixed it with a reboot... Simul holding home and on/off until apple appears on the screen . Been working for axweek ok now.

Maybe you are looking for

  • Install Adobe Photoshop Elements 11 to a new computer error

    I installed Adobe Photoshop Elements 11 in my computer before. Right now I'm not using that computer anymore and want to re-install the software to a new computer. I still have the redemption code but when I entered it, the software said it was redee

  • Navigate in XML tree

    Hi I use oracle 10g. what is the best tool to navigate in XML tree and to analize it.when I dont no the exact structure of the xml. for example I need to do some action like DFS search and to set whiget to each tag is dbms_xmldom is the only option o

  • Direction of middle eastern languages in properties file

    Hi, I am hoping someone can point me to an authoritative source or document specifying which direction the Hebrew / Arabic / Farsi text should be entered in java properties files. That is, does it follow the natural direction of the script (right-to-

  • Header Conditions Screen in Sales Order

    Hi!!, The issue is related to the fact that all the calculations are correct but the way it shows the prices at header and Item conditions screen is different. We mostly have Item pricing and the schema of the Pricing Procedure is such that it has gr

  • Wrt160n v3 slow connection on l2tp

    HI .I have speed 12M when I connect wrt160n v3 through l2tp, my speed down to 4M-5M. When i connect modem directly to computer I get speed 12M. any idea how I can solve this problem .