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


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

Re: Calling deprecated methods

Path csiph.com!news.bbs.geek.nz!.POSTED.agency.bbs.geek.nz!not-for-mail
From Kiwi User <martin@mydomain.invalid> (Kiwi User)
Newsgroups comp.lang.java.programmer
Subject Re: Calling deprecated methods
Date Tue, 12 Dec 2017 20:05:00 +1200
Organization fsxNet Usenet Gateway | bbs.geek.nz/#fsxNet
Message-ID <1547161071@f38.n261.z1.binkp.net> (permalink)
References <2761950898@f38.n261.z1.binkp.net>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info news.bbs.geek.nz; posting-host="M6YmRdZYyc42DJk0lNlt/X4dpP4dzvceBNabSmESN3E"; logging-data="1013"; mail-complaints-to="abuse@news.bbs.geek.nz"
User-Agent VSoup v1.2.9.47Beta [95/NT]
X-MailConverter SoupGate-Win32 v1.05
X-Comment-To Eric Douglas
Xref csiph.com comp.lang.java.programmer:37838

Show key headers only | View raw


On Tue, 12 Dec 2017 10:24:50 -0800, Eric Douglas wrote:

> On Tuesday, December 12, 2017 at 11:32:12 AM UTC-5, Kiwi User wrote:
>> 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[].
>>
> Sometimes you have to make a new method because you're changing the
> parameters or return value,
>
Thats what 'revised API' means. In C I'd call it a revised prototype.

> possible also just making a new method
> because better internals and some cases where the new guts just don't
> work and you have to stick with the old.
>
IMHO that's never a valid reason: you should have a test harness for the
class, and preferably a set of regression tests as well. The revised code
should not be checked into the VCS or made visible outside the revising
programmer's personal login environment until it has been (a) fully tested and
(b) if the method specs didn't change, has passed the current set of regression
 tests.

> The fact they deprecated a method isn't a problem.  The fact they're
> still calling it is questionable.  javax.swing.JTree calls
> java.awt.event.MouseEvent.getModifiers() which is marked deprecated in
> Java 9.
>
Agreed. At a minimum, everything in the package should use the replacement
class/method and preferably all code in the next release should use it too.

This is the "eat your own dogfood" principle and I'm suspicious of those who
don't stick to it.



--
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

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

csiph-web