|
[hidden email] wrote:
> Author: jleroux > Date: Tue Jan 26 12:30:02 2010 > New Revision: 903197 > > URL: http://svn.apache.org/viewvc?rev=903197&view=rev > Log: > A patch from Sascha Rodekamp "Extend getPropertyNumber, Default Value" (https://issues.apache.org/jira/browse/OFBIZ-3425) - OFBIZ-3425 > > Adds a method to have a default value to getPropertyNumber methods, can't hurt and maybe useful in some cases. > > > > Modified: > ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java > > Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=903197&r1=903196&r2=903197&view=diff > ============================================================================== > --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original) > +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java Tue Jan 26 12:30:02 2010 > @@ -118,6 +118,15 @@ > return value; > } > > + public static double getPropertyNumber(String resource, String name, Double defaultValue) { Why is this Double instead of double? > + double value = getPropertyNumber(resource, name); > + if(value == 0.00000){ > + return defaultValue; > + } > + > + return value; > + } > + > public static double getPropertyNumber(String resource, String name) { > String str = getPropertyValue(resource, name); > double strValue = 0.00000; > > |
|
[hidden email] wrote:
> Author: jleroux > Date: Tue Jan 26 12:30:02 2010 > New Revision: 903197 > > URL: http://svn.apache.org/viewvc?rev=903197&view=rev > Log: > A patch from Sascha Rodekamp "Extend getPropertyNumber, Default Value" (https://issues.apache.org/jira/browse/OFBIZ-3425) - OFBIZ-3425 > > Adds a method to have a default value to getPropertyNumber methods, can't hurt and maybe useful in some cases. > > > > Modified: > ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java > > Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=903197&r1=903196&r2=903197&view=diff > ============================================================================== > --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original) > +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java Tue Jan 26 12:30:02 2010 > @@ -118,6 +118,15 @@ > return value; > } > > + public static double getPropertyNumber(String resource, String name, Double defaultValue) { > + double value = getPropertyNumber(resource, name); > + if(value == 0.00000){ > + return defaultValue; > + } > + > + return value; The formatting is bad here, please be careful. > + } > + > public static double getPropertyNumber(String resource, String name) { > String str = getPropertyValue(resource, name); > double strValue = 0.00000; > > |
|
Administrator
|
From: "Adam Heath" <[hidden email]>
To: <[hidden email]> Sent: Tuesday, January 26, 2010 6:55 PM Subject: Re: svn commit: r903197 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java > [hidden email] wrote: >> Author: jleroux >> Date: Tue Jan 26 12:30:02 2010 >> New Revision: 903197 >> >> URL: http://svn.apache.org/viewvc?rev=903197&view=rev >> Log: >> A patch from Sascha Rodekamp "Extend getPropertyNumber, Default Value" (https://issues.apache.org/jira/browse/OFBIZ-3425) - >> OFBIZ-3425 >> >> Adds a method to have a default value to getPropertyNumber methods, can't hurt and maybe useful in some cases. >> >> >> >> Modified: >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java >> >> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=903197&r1=903196&r2=903197&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original) >> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java Tue Jan 26 12:30:02 2010 >> @@ -118,6 +118,15 @@ >> return value; >> } >> >> + public static double getPropertyNumber(String resource, String name, Double defaultValue) { >> + double value = getPropertyNumber(resource, name); >> + if(value == 0.00000){ >> + return defaultValue; >> + } >> + >> + return value; > > The formatting is bad here, please be careful. Right, and for the Double vs double I will ask the contribuor. I will also ask him to create a new patch, nothing better to learn, even if I agree I should have spotted them before Jacques >> + } >> + >> public static double getPropertyNumber(String resource, String name) { >> String str = getPropertyValue(resource, name); >> double strValue = 0.00000; >> >> > |
| Free forum by Nabble | Edit this page |
