Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #37814

Re: Calling deprecated methods

Path csiph.com!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From Kiwi User <martin@mydomain.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Calling deprecated methods
Date Tue, 12 Dec 2017 16:31:51 +0000 (UTC)
Organization albasani.net
Lines 30
Message-ID <p0p09n$fed$1@news.albasani.net> (permalink)
References <b1215ae8-2a70-4220-b98a-6d25088c5ae6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace news.albasani.net tS5M3J0RXymYHV7sg/QEsKdYsMFqcM7USUvkaHIeVwATJLflexFTKZ1kHiq732Nm0Vsw+HJWoWJR7m+qQU8c6zmtTfUf/usPzuyrMGVIz9HTPpbsTxOT0XECQ1wjg2kJ
NNTP-Posting-Date Tue, 12 Dec 2017 16:31:51 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="P0I2AG8v2RRIN4nSUJUpDCnFAovb4AwSPEyKORHh7Qt0urbiA8prerBrGNVIOOaU/vrBz6p9BUco9Ly/QPgYLmklyTK/ep77EgYY0X66w5Km7XoccmMcyl4xdU+xXzuc"; mail-complaints-to="abuse@albasani.net"
User-Agent Pan/0.142 (He slipped to Sam a double gin; 01b5bf4 git.gnome.org/pan2)
Cancel-Lock sha1:06lwRmaXgxlBXFqwUwy2Oo6MS5c=
Xref csiph.com comp.lang.java.programmer:37814

Show key headers only | View raw


On Tue, 12 Dec 2017 08:09:11 -0800, Eric Douglas wrote:

> I always thought deprecating a method means there is a different method
> signature that is recommended to call that is going to do the same thing
> in a better way, and all calls to the old method should be changed asap?
>
Don't forget that a deprecated method isn't replaced by a drop-in 
replacement: if such a replacement is possible, you'd merely scrape out 
the old code and drop in the new. No deprecation needed. A good example 
would be upgrading a sort() method from the bubble sort to the quicksort 
algorithm.

Deprecated methods tend to have a revised API, i.e. returning a 
Collection or a List instead of an array, so you'd want to deprecate the 
older method as an indication that Java now provides better ways of 
handling data passed to or from the method, i.e. if our sort() method
now returns a List or Collection instead of Object[].
    
> Does it make sense to just keep calling the deprecated method and have
> to tell your compiler to ignore that, or why would Oracle deprecate
> their own method they're still calling?
>
Yes, they would and have deprecated their own methods, usually for the 
sort of reasons I've just used as examples.


-- 
Martin    | martin at
Gregorie  | gregorie
          | dot org

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Calling deprecated methods Eric Douglas <e.d.programmer@gmail.com> - 2017-12-12 08:09 -0800
  Re: Calling deprecated methods Kiwi User <martin@mydomain.invalid> - 2017-12-12 16:31 +0000
    Re: Calling deprecated methods Eric Douglas <e.d.programmer@gmail.com> - 2017-12-12 10:24 -0800
      Re: Calling deprecated methods Kiwi User <martin@mydomain.invalid> - 2017-12-12 20:05 +0000
        Re: Calling deprecated methods Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-12-12 15:41 -0500
          Re: Calling deprecated methods Kiwi User <martin@mydomain.invalid> - 2017-12-12 21:04 +0000
            Re: Calling deprecated methods Eric Douglas <e.d.programmer@gmail.com> - 2017-12-12 13:33 -0800
              Re: Calling deprecated methods Kiwi User <martin@mydomain.invalid> - 2017-12-12 22:41 +0000
                Re: Calling deprecated methods Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-12-12 17:57 -0500
                Re: Calling deprecated methods Eric Douglas <e.d.programmer@gmail.com> - 2017-12-13 04:51 -0800
                Re: Calling deprecated methods Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-12-13 08:21 -0500
                Re: Calling deprecated methods Eric Douglas <e.d.programmer@gmail.com> - 2017-12-13 05:40 -0800
                Re: Calling deprecated methods Kiwi User <martin@mydomain.invalid> - 2017-12-13 15:19 +0000
                Re: Calling deprecated methods Eric Douglas <e.d.programmer@gmail.com> - 2017-12-13 07:57 -0800
                Re: Calling deprecated methods Kiwi User <martin@mydomain.invalid> - 2017-12-13 17:30 +0000

csiph-web