-deprecation help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: -deprecation help

  1. #1
    Join Date
    Mar 2004
    Posts
    24

    -deprecation help

    when i compile my code, it says tool completed successfully along with another message, i tried to run my applet but it wont load.

    this is what it says when i compile the code:

    Note: C:\Documents and Settings\Desktop\Dijkstra's Algorithm\GraphAlgorithm.java uses or overrides a deprecated API.
    Note: Recompile with -deprecation for details.

    Tool completed successfully

    what is a deprecated API and how do i get round this??

    i'm using Textpad if that helps.

  2. #2
    Join Date
    Feb 2004
    Posts
    541
    "deprecated" means that the method you are attempting to use used to be a valid one, but Sun have decided to replace it with a different method for one reason or another. If you go to Sun's website and read the API for the method or class you're attempting to use it will tell you which method has replaced it. Go to google and search, Sun's API is usually the first link it suggests i've found.

  3. #3
    Join Date
    Feb 2004
    Posts
    808
    you should avoid using deprecated APIs because they may disappear from the spec without warning, leaving you witha non-working program. to get information about what exactly it is youre using, that is deprecated, do:

    javac -deprecation GraphAlgorithm.java

    here is what happened when i threw a Thread.stop() method into a test class:

    Yalla.java:115: non-static method stop() cannot be referenced from a static context
    Thread.stop();
    ^
    Yalla.java:115: warning: stop() in java.lang.Thread has been deprecated
    Thread.stop();
    ^
    1 error
    1 warning
    So i now know that stop() has been deprecated, and what class it is in. I can go to java.sun.com api and look at how i should do things now..
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  4. #4
    Join Date
    Mar 2004
    Posts
    24
    how do i do:

    javac -deprecation GraphAlgorithm.java

    using textpad?

  5. #5
    Join Date
    Feb 2004
    Posts
    808
    ha ha.. okay

    first, i would nip over to www.ultraedit.com and get a real text editor.. its more configurable than textpad (i installed textpad just to have a look, and check that i wasnt being overly cruel..)

    with your existing textpad you can switch on deprecation by merely editing the preferences... at the bottom of the prefs/config screen, in the list on the left if a [+] Tools icon. click the [+]
    in the Compile java item that has appeared, change the contents of the filename box (from to):

    $File
    -deprecation $File

    but, like i say.. i recommend ultraedit more strongly..
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

  6. #6
    Join Date
    Feb 2004
    Posts
    541
    What is it that you think textpad is missing? It's what I always use and haven't had any problems with it, but since it's all i've ever used maybe i'm missing out on something and don't even realise it

  7. #7
    Join Date
    Feb 2004
    Posts
    808
    actually, i may have been a little harsh on TextPad.. ive looked at nearly every menu function, and it's more or less the same as UltraEdit, certainly better value for money if you are buying it

    There are a few UE finctions that I cannot see in textpad, that I use quite frequently:

    reindenting entire files
    sorting file contents
    rectangluar selection of file data (similar to dos)
    replace in files
    match brace (it's more clear in UE; it selects the entire region, TP skips around)
    docking of some windows (like tool output)

    im sure if i had to use textpad, and ue was not available, i wouldnt have too much of a problem with it - it's sure done a lot since i last looked at it (and it seems geared to users of the more vile unix editors, vi, vim etc...)
    note; the tool configuration in some regards is a lot better than UE's, in that you can specify a regexp to match the output.. im not sure where UE is configured to do this..
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center