Administrator
|
Why not at the next release ? But sometimes it's better to keep it forever (working with API is hard)... So I think each case should
be discussed... My 2 cents Jacques From: <[hidden email]> > Author: lektran > Date: Sat Aug 30 13:05:40 2008 > New Revision: 690573 > > URL: http://svn.apache.org/viewvc?rev=690573&view=rev > Log: > Added deprecation flags to the old jsp based worker methods, any thoughts on how long a method should be deprecated for before we > can remove it? > > Modified: > ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java > ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java > ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java > ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java > ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java > ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/project/ProjectWorker.java > ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java > > Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java (original) > +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java Sat Aug 30 13:05:40 2008 > @@ -49,6 +49,7 @@ > private static int decimals = UtilNumber.getBigDecimalScale("invoice.decimals"); > private static int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding"); > > + /** @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 @@ > } > > /** TODO: REMOVE (DEJ 20030301): This is the OLD style and should be removed when the eCommerce and party mgr JSPs are */ > + /** @deprecated */ > public static void getPaymentMethodAndRelated(PageContext pageContext, String partyId, > String paymentMethodAttr, String creditCardAttr, String eftAccountAttr, String paymentMethodIdAttr, String > curContactMechIdAttr, > String donePageAttr, String tryEntityAttr) { > > Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java (original) > +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java Sat Aug 30 13:05:40 2008 > @@ -20,9 +20,7 @@ > package org.ofbiz.party.contact; > > import java.util.Collection; > -import java.util.HashMap; > import java.util.Iterator; > -import java.util.LinkedList; > import java.util.List; > import java.util.Map; > > @@ -40,7 +38,6 @@ > import org.ofbiz.entity.GenericEntityException; > import org.ofbiz.entity.GenericValue; > import org.ofbiz.entity.condition.EntityCondition; > -import org.ofbiz.entity.condition.EntityExpr; > import org.ofbiz.entity.util.EntityUtil; > > /** > @@ -50,6 +47,7 @@ > > public static final String module = ContactMechWorker.class.getName(); > > + /** @deprecated */ > public static void getPartyContactMechValueMaps(PageContext pageContext, String partyId, boolean showOld, String > partyContactMechValueMapsAttr) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > List<Map<String, Object>> partyContactMechValueMaps = getPartyContactMechValueMaps(delegator, partyId, showOld); > @@ -205,6 +203,7 @@ > } > > > + /** @deprecated */ > public static void getOrderContactMechValueMaps(PageContext pageContext, String orderId, String orderContactMechValueMapsAttr) > { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > List<Map<String, GenericValue>> maps = getOrderContactMechValueMaps(delegator, orderId); > > Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java (original) > +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java Sat Aug 30 13:05:40 2008 > @@ -20,7 +20,6 @@ > package org.ofbiz.party.party; > > import java.sql.Timestamp; > -import java.util.Iterator; > import java.util.List; > import java.util.Locale; > import java.util.Map; > @@ -84,6 +83,7 @@ > return result; > } > > + /** @deprecated */ > public static void getPartyOtherValues(PageContext pageContext, String partyId, String partyAttr, String personAttr, String > partyGroupAttr) { > Map<String, GenericValue> partyMap = getPartyOtherValues(pageContext.getRequest(), partyId, partyAttr, personAttr, > partyGroupAttr); > for (Map.Entry<String, GenericValue> e: partyMap.entrySet()) { > > Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) > +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Sat Aug 30 13:05:40 2008 > @@ -41,8 +41,6 @@ > import org.ofbiz.entity.GenericEntityException; > import org.ofbiz.entity.GenericValue; > import org.ofbiz.entity.condition.EntityCondition; > -import org.ofbiz.entity.condition.EntityConditionList; > -import org.ofbiz.entity.condition.EntityExpr; > import org.ofbiz.entity.condition.EntityOperator; > import org.ofbiz.entity.util.EntityUtil; > import org.ofbiz.product.product.ProductWorker; > @@ -54,6 +52,7 @@ > > public static final String module = CategoryWorker.class.getName(); > > + /** @deprecated */ > public static String getCatalogTopCategory(PageContext pageContext, String defaultTopCategory) { > return getCatalogTopCategory(pageContext.getRequest(), defaultTopCategory); > } > @@ -85,6 +84,7 @@ > return topCatName; > } > > + /** @deprecated */ > public static void getCategoriesWithNoParent(PageContext pageContext, String attributeName) { > getCategoriesWithNoParent(pageContext.getRequest(), attributeName); > } > @@ -113,6 +113,7 @@ > request.setAttribute(attributeName, results); > } > > + /** @deprecated */ > public static void getRelatedCategories(PageContext pageContext, String attributeName, boolean limitView) { > getRelatedCategories(pageContext.getRequest(), attributeName, limitView); > } > @@ -130,6 +131,7 @@ > getRelatedCategories(request, attributeName, requestId, limitView); > } > > + /** @deprecated */ > public static void getRelatedCategories(PageContext pageContext, String attributeName, String parentId, boolean limitView) { > getRelatedCategories(pageContext.getRequest(), attributeName, parentId, limitView); > } > @@ -145,6 +147,7 @@ > request.setAttribute(attributeName, categories); > } > > + /** @deprecated */ > public static List getRelatedCategoriesRet(PageContext pageContext, String attributeName, String parentId, boolean limitView) > { > return getRelatedCategoriesRet(pageContext.getRequest(), attributeName, parentId, limitView); > } > @@ -270,6 +273,7 @@ > return andCond; > } > > + /** @deprecated */ > public static void setTrail(PageContext pageContext, String currentCategory) { > setTrail(pageContext.getRequest(), currentCategory); > } > @@ -347,6 +351,7 @@ > setTrail(request, crumb); > } > > + /** @deprecated */ > public static List getTrail(PageContext pageContext) { > return getTrail(pageContext.getRequest()); > } > @@ -357,6 +362,7 @@ > return crumb; > } > > + /** @deprecated */ > public static List setTrail(PageContext pageContext, List crumb) { > return setTrail(pageContext.getRequest(), crumb); > } > @@ -367,6 +373,7 @@ > return crumb; > } > > + /** @deprecated */ > public static boolean checkTrailItem(PageContext pageContext, String category) { > return checkTrailItem(pageContext.getRequest(), category); > } > @@ -380,6 +387,7 @@ > return false; > } > > + /** @deprecated */ > public static String lastTrailItem(PageContext pageContext) { > return lastTrailItem(pageContext.getRequest()); > } > > Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java (original) > +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductWorker.java Sat Aug 30 13:05:40 2008 > @@ -53,6 +53,7 @@ > public static final String module = ProductWorker.class.getName(); > public static final String resource = "ProductUiLabels"; > > + /** @deprecated */ > public static void getProduct(PageContext pageContext, String attributeName) { > getProduct(pageContext, attributeName, null); > } > @@ -151,6 +152,7 @@ > } > } > > + /** @deprecated */ > public static void getProduct(PageContext pageContext, String attributeName, String productId) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > ServletRequest request = pageContext.getRequest(); > @@ -297,6 +299,7 @@ > return available; > } > > + /** @deprecated */ > public static void getAssociatedProducts(PageContext pageContext, String productAttributeName, String assocPrefix) { > GenericValue product = (GenericValue) pageContext.getAttribute(productAttributeName); > > > Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/project/ProjectWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/project/ProjectWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/project/ProjectWorker.java (original) > +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/project/ProjectWorker.java Sat Aug 30 13:05:40 2008 > @@ -20,7 +20,6 @@ > package org.ofbiz.workeffort.project; > > import java.util.Collection; > -import java.util.Iterator; > > import javax.servlet.jsp.PageContext; > > @@ -43,6 +42,7 @@ > > public static final String module = ProjectWorker.class.getName(); > > + /** @deprecated */ > public static void getAssignedProjects(PageContext pageContext, String projectsAttrName) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin"); > @@ -70,6 +70,7 @@ > pageContext.setAttribute(projectsAttrName, validWorkEfforts); > } > > + /** @deprecated */ > public static void getAllAssignedProjects(PageContext pageContext, String projectsAttrName) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin"); > @@ -94,6 +95,7 @@ > pageContext.setAttribute(projectsAttrName, validWorkEfforts); > } > > + /** @deprecated */ > public static void getAllProjectPhases(PageContext pageContext, String phasesAttrName) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin"); > @@ -141,6 +143,7 @@ > pageContext.setAttribute(phasesAttrName, validWorkEfforts); > } > > + /** @deprecated */ > public static void getAllPhaseTasks(PageContext pageContext, String tasksAttrName) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin"); > @@ -187,6 +190,7 @@ > pageContext.setAttribute(tasksAttrName, validWorkEfforts); > } > > + /** @deprecated */ > public static void getTaskNotes(PageContext pageContext, String notesAttrName) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin"); > > Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java > URL: > http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java?rev=690573&r1=690572&r2=690573&view=diff > ============================================================================== > --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java (original) > +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java Sat Aug 30 13:05:40 2008 > @@ -41,7 +41,7 @@ > > public static final String module = WorkEffortWorker.class.getName(); > > - // TODO: REMOVE this method when JSPs/etc are moved to FreeMarker; this is replaced by a corresponding service > + /** @deprecated */ > public static void getWorkEffort(PageContext pageContext, String workEffortIdAttrName, String workEffortAttrName, String > partyAssignsAttrName, > String canViewAttrName, String tryEntityAttrName, String currentStatusAttrName) { > GenericDelegator delegator = (GenericDelegator) pageContext.getRequest().getAttribute("delegator"); > @@ -125,12 +125,15 @@ > pageContext.setAttribute(currentStatusAttrName, currentStatus); > } > > + /** @deprecated */ > public static void getMonthWorkEffortEvents(PageContext pageContext, String attributeName) {} > > + /** @deprecated */ > public static void getActivityContext(PageContext pageContext, String workEffortId) { > getActivityContext(pageContext, workEffortId, "activityContext"); > } > > + /** @deprecated */ > public static void getActivityContext(PageContext pageContext, String workEffortId, String attribute) { > LocalDispatcher dispatcher = (LocalDispatcher) pageContext.getRequest().getAttribute("dispatcher"); > GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin"); > > |
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. |
Administrator
|
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" <[hidden email]> To: <[hidden email]> 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. > |
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 |
Administrator
|
From: "Adam Heath" <[hidden email]>
To: <[hidden email]> 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 |
Free forum by Nabble | Edit this page |