Adam Heath wrote:
[email protected] wrote:
Author: jleroux
Date: Wed Jan 27 08:59:25 2010
New Revision: 903571
URL: http://svn.apache.org/viewvc?rev=903571&view=rev
Log:
After Adam's remark about formatting (actually mostly about Double instead of double), Sascha
provided a new patch which was still not well formatted. So I decided to use the same formatting
than in getPropertyValue. Even if it does not follow the "brackets around blocks rule"
Sun convention. I have explained this a bit to Sascha at
https://issues.apache.org/jira/browse/OFBIZ-3425 "Extend getPropertyNumber, Default Value"
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=903571&r1=903570&r2=903571&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 Wed
Jan 27 08:59:25 2010
@@ -118,13 +118,13 @@
return value;
}
- public static double getPropertyNumber(String resource, String name, Double defaultValue) {
+ public static double getPropertyNumber(String resource, String name,
double defaultValue) {
double value = getPropertyNumber(resource, name);
- if(value == 0.00000){
- return defaultValue;
- }
- return value;
+ if (value == 0.00000)
+ return defaultValue;
+ else
+ return value;
}
public static double getPropertyNumber(String resource, String name) {
Actually, this is still broken. What happens if I put 0.00000 into
the property file? Suddenly, the default will be returned.
It would also be helpful to give these methods more meaningful names,
like getPropertyAsDouble.
-Adrian