You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2008/09/02 18:33:42 UTC

Re: svn commit: r690573 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/payment/ party/src/org/ofbiz/party/contact/ party/src/org/ofbiz/party/party/ product/src/org/ofbiz/product/category/ product/src/org/ofbiz/product/product/ workeffo

Jacques Le Roux wrote:
>> +    /** @deprecated */
>>     public static void getPartyPaymentMethodValueMaps(PageContext
>> pageContext, String partyId, boolean showOld, String
>> paymentMethodValueMapsAttr) {
>>         GenericDelegator delegator = (GenericDelegator)
>> pageContext.getRequest().getAttribute("delegator");
>>         List paymentMethodValueMaps =
>> getPartyPaymentMethodValueMaps(delegator, partyId, showOld);
>> @@ -92,6 +93,7 @@
>>     }

Use @Deprecated instead.

Re: svn commit: r690573 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/payment/ party/src/org/ofbiz/party/contact/ party/src/org/ofbiz/party/party/ product/src/org/ofbiz/product/category/ product/src/org/ofbiz/product/product/ workeffo

Posted by Jacques Le Roux <ja...@les7arts.com>.
From: "Adam Heath" <do...@brainfood.com>
To: <de...@ofbiz.apache.org>
Sent: Tuesday, September 02, 2008 7:45 PM
Subject: Re: svn commit: r690573 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/payment/ 
party/src/org/ofbiz/party/contact/ party/src/org/ofbiz/party/party/ product/src/org/ofbiz/product/category/ 
product/src/org/ofbiz/product/product/ workeffo


> Jacques Le Roux wrote:
>> Thanks Adam,
>>
>> I did not notice it, and only replicated the old @deprecated comment.
>> There are 45 such changes (@deprecated comment without any javaDoc
>> information) to do in current code. If everybody agree I will do
>> it. In other words I will replace /** @deprecated */  by  @Deprecated
>>
>> But reading in
>> http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/deprecation/deprecation.html
>>
>>
>> _I notice :_
>> You are strongly recommended to use the Javadoc @deprecated tag with
>> appropriate comments explaining how to use the new API. This ensures
>> developers will have a workable migration path from the old API to the
>> new API. For more information, see Using the @deprecated Javadoc Tag.
>> NOTE: The Java Language Specification requires compilers to issue
>> warnings when classes, methods, or fields marked with the @Deprecated
>> annotation are used. Compilers are not required by the Java Language
>> Specification to issue warnings when classes, methods, or fields marked
>> with the @deprecated Javadoc tag are accessed, although the Sun
>> compilers currently do so. However, there is no guarantee that the Sun
>> compiler will always issue such warnings.
>
> Then why did they add a @Deprecated, if @Deprecated is itself @Deprecated?
>
> /me shoots someone

LOL, it's not the same thing. Take the time (when you will have some, you seem a bit stressed ;o) to read.
In "one word"
@Deprecated is for the compiler and renders warnings in log (all compilers)
/* @deprecated with some comment to explain in API */ is for the JavaDoc (all compilers). But for now it renders warnings in log 
too. Not all compilers (non-Sun) render such warnings and nothing guarantee Sun will continue in future.

Jacques


Re: svn commit: r690573 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/payment/ party/src/org/ofbiz/party/contact/ party/src/org/ofbiz/party/party/ product/src/org/ofbiz/product/category/ product/src/org/ofbiz/product/product/ workeffo

Posted by Adam Heath <do...@brainfood.com>.
Jacques Le Roux wrote:
> Thanks Adam,
> 
> I did not notice it, and only replicated the old @deprecated comment.
> There are 45 such changes (@deprecated comment without any javaDoc
> information) to do in current code. If everybody agree I will do
> it. In other words I will replace /** @deprecated */  by  @Deprecated
> 
> But reading in
> http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/deprecation/deprecation.html
> 
> 
> _I notice :_
> You are strongly recommended to use the Javadoc @deprecated tag with
> appropriate comments explaining how to use the new API. This ensures
> developers will have a workable migration path from the old API to the
> new API. For more information, see Using the @deprecated Javadoc Tag.
> NOTE: The Java Language Specification requires compilers to issue
> warnings when classes, methods, or fields marked with the @Deprecated
> annotation are used. Compilers are not required by the Java Language
> Specification to issue warnings when classes, methods, or fields marked
> with the @deprecated Javadoc tag are accessed, although the Sun
> compilers currently do so. However, there is no guarantee that the Sun
> compiler will always issue such warnings.

Then why did they add a @Deprecated, if @Deprecated is itself @Deprecated?

/me shoots someone

Re: svn commit: r690573 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/payment/ party/src/org/ofbiz/party/contact/ party/src/org/ofbiz/party/party/ product/src/org/ofbiz/product/category/ product/src/org/ofbiz/product/product/ workeffo

Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks Adam,

I did not notice it, and only replicated the old @deprecated comment.
There are 45 such changes (@deprecated comment without any javaDoc information) to do in current code. If everybody agree I will do
it. In other words I will replace /** @deprecated */  by  @Deprecated

But reading in
http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/deprecation/deprecation.html

_I notice :_
You are strongly recommended to use the Javadoc @deprecated tag with appropriate comments explaining how to use the new API. This 
ensures developers will have a workable migration path from the old API to the new API. For more information, see Using the 
@deprecated Javadoc Tag.
NOTE: The Java Language Specification requires compilers to issue warnings when classes, methods, or fields marked with the 
@Deprecated annotation are used. Compilers are not required by the Java Language Specification to issue warnings when classes, 
methods, or fields marked with the @deprecated Javadoc tag are accessed, although the Sun compilers currently do so. However, there 
is no guarantee that the Sun compiler will always issue such warnings.

As I often say, when maintaining an API, you have to maintain the doc also... Else you are alone to rush in fog (sometimes it's nice 
;o)...

Jacques

From: "Adam Heath" <do...@brainfood.com>
To: <de...@ofbiz.apache.org>
Sent: Tuesday, September 02, 2008 6:33 PM
Subject: Re: svn commit: r690573 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/payment/
party/src/org/ofbiz/party/contact/ party/src/org/ofbiz/party/party/ product/src/org/ofbiz/product/category/
product/src/org/ofbiz/product/product/ workeffo


> Jacques Le Roux wrote:
>>> +    /** @deprecated */
>>>     public static void getPartyPaymentMethodValueMaps(PageContext
>>> pageContext, String partyId, boolean showOld, String
>>> paymentMethodValueMapsAttr) {
>>>         GenericDelegator delegator = (GenericDelegator)
>>> pageContext.getRequest().getAttribute("delegator");
>>>         List paymentMethodValueMaps =
>>> getPartyPaymentMethodValueMaps(delegator, partyId, showOld);
>>> @@ -92,6 +93,7 @@
>>>     }
>
> Use @Deprecated instead.
>