You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by Arjuna Wijeyekoon <ar...@gmail.com> on 2006/11/09 03:25:20 UTC

deprecating methods

Usually method deprecation is done like:
/**
 * @deprecated use the foobar method instead
 */
public void foo()



In addition , do we have to do:
/**
 * @deprecated use the foobar method instead
 */
@Deprecated
public void foo()


??

Re: Re: deprecating methods

Posted by Simon Lessard <si...@gmail.com>.
Adding it is more purism than anything else I agree. However, it is a Java 5
standard, it makes Eclipse happier and allow to do some runtime check to see
if a method is deprecated or not. The latter is not of much use for
Trinidad, but adding @Deprecated takes about 3 seconds and there's no
refactoring to do as I added it for all deprecated items when I did the Java
5 patches (unless I missed some), so it's only needed for newly deprecated
methods.


~ Simon

On 11/9/06, Adam Winer <aw...@gmail.com> wrote:
>
> It's not obvious to me that, in this case, the annotation actually
> adds anything.  Is there a practical gain from adding the @Deprecated
> annotation, or is it just somehow better form?
>
> -- Adam
>
>
> On 11/8/06, Simon Lessard <si...@gmail.com> wrote:
> > I would say yes as annotations are the way to go now.
> >
> > Regards,
> >
> > ~Simon
> >
> > On 11/8/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> > >
> > > Usually method deprecation is done like:
> > > /**
> > > * @deprecated use the foobar method instead
> > > */
> > > public void foo()
> > >
> > >
> > >
> > > In addition , do we have to do:
> > > /**
> > > * @deprecated use the foobar method instead
> > > */
> > > @Deprecated
> > > public void foo()
> > >
> > >
> > > ??
> > >
> >
> >
>

Re: Re: deprecating methods

Posted by Adam Winer <aw...@gmail.com>.
It's not obvious to me that, in this case, the annotation actually
adds anything.  Is there a practical gain from adding the @Deprecated
annotation, or is it just somehow better form?

-- Adam


On 11/8/06, Simon Lessard <si...@gmail.com> wrote:
> I would say yes as annotations are the way to go now.
>
> Regards,
>
> ~Simon
>
> On 11/8/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> >
> > Usually method deprecation is done like:
> > /**
> > * @deprecated use the foobar method instead
> > */
> > public void foo()
> >
> >
> >
> > In addition , do we have to do:
> > /**
> > * @deprecated use the foobar method instead
> > */
> > @Deprecated
> > public void foo()
> >
> >
> > ??
> >
>
>

Re: deprecating methods

Posted by Simon Lessard <si...@gmail.com>.
I would say yes as annotations are the way to go now.

Regards,

~Simon

On 11/8/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
>
> Usually method deprecation is done like:
> /**
> * @deprecated use the foobar method instead
> */
> public void foo()
>
>
>
> In addition , do we have to do:
> /**
> * @deprecated use the foobar method instead
> */
> @Deprecated
> public void foo()
>
>
> ??
>