You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by da...@apache.org on 2021/01/13 14:30:13 UTC
[ofbiz-framework] branch trunk updated: Improved: Minor changes to
reduce checkstyle warnings count
This is an automated email from the ASF dual-hosted git repository.
danwatford pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new d40081d Improved: Minor changes to reduce checkstyle warnings count
d40081d is described below
commit d40081dc864012211fb5583a6cffdbc11c89dd0e
Author: Daniel Watford <da...@watfordconsulting.com>
AuthorDate: Wed Jan 13 14:28:19 2021 +0000
Improved: Minor changes to reduce checkstyle warnings count
---
.../org/apache/ofbiz/base/util/UtilFormatOut.java | 8 ++++--
.../java/org/apache/ofbiz/base/util/UtilXml.java | 33 ++++++++++++++--------
.../widget/renderer/macro/MacroFormRenderer.java | 2 +-
3 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java
index 3024f09..87149fd 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilFormatOut.java
@@ -25,6 +25,8 @@ import java.util.Base64;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
+
+import com.ibm.icu.text.DecimalFormat;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.util.EntityUtilProperties;
@@ -154,10 +156,10 @@ public final class UtilFormatOut {
* @return A String with the formatted price
*/
public static String formatDecimalNumber(double number, String pattern, Locale locale) {
- com.ibm.icu.text.NumberFormat nf = com.ibm.icu.text.NumberFormat.getNumberInstance(locale);
+ DecimalFormat nf = (DecimalFormat) com.ibm.icu.text.NumberFormat.getNumberInstance(locale);
String nbParsing = "";
- ((com.ibm.icu.text.DecimalFormat) nf).applyPattern(pattern);
- ((com.ibm.icu.text.DecimalFormat) nf).toPattern();
+ nf.applyPattern(pattern);
+ nf.toPattern();
nbParsing = nf.format(number);
return nbParsing;
}
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
index 3d001d6..0f95828 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
@@ -674,7 +674,8 @@ public final class UtilXml {
Element childElement = (Element) node;
elements.add(childElement);
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return elements;
}
@@ -697,7 +698,8 @@ public final class UtilXml {
Element childElement = (Element) node;
elements.add(childElement);
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return elements;
}
@@ -722,7 +724,8 @@ public final class UtilXml {
Element childElement = (Element) node;
elements.add(childElement);
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return elements;
}
@@ -747,7 +750,8 @@ public final class UtilXml {
Element childElement = (Element) node;
elements.add(childElement);
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return elements;
}
@@ -765,7 +769,8 @@ public final class UtilXml {
if (node.getNodeType() == Node.ELEMENT_NODE || node.getNodeType() == Node.COMMENT_NODE) {
nodes.add(node);
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
return nodes;
}
@@ -785,7 +790,8 @@ public final class UtilXml {
return childElement;
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return null;
}
@@ -812,7 +818,8 @@ public final class UtilXml {
return childElement;
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return null;
}
@@ -839,7 +846,8 @@ public final class UtilXml {
Element childElement = (Element) node;
return childElement;
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return null;
}
@@ -865,7 +873,8 @@ public final class UtilXml {
return childElement;
}
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
}
return null;
}
@@ -930,7 +939,8 @@ public final class UtilXml {
if (textNode.getNodeType() == Node.CDATA_SECTION_NODE || textNode.getNodeType() == Node.TEXT_NODE) {
valueBuffer.append(textNode.getNodeValue());
}
- } while ((textNode = textNode.getNextSibling()) != null);
+ textNode = textNode.getNextSibling();
+ } while (textNode != null);
return valueBuffer.toString();
}
@@ -945,7 +955,8 @@ public final class UtilXml {
if (node.getNodeType() == Node.CDATA_SECTION_NODE || node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.COMMENT_NODE) {
valueBuffer.append(node.getNodeValue());
}
- } while ((node = node.getNextSibling()) != null);
+ node = node.getNextSibling();
+ } while (node != null);
return valueBuffer.toString();
}
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
index fd8aff4..c1bbb64 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
@@ -366,7 +366,7 @@ public final class MacroFormRenderer implements FormStringRenderer {
+ " Found Value [" + stepString + "] " + e.getMessage(), MODULE);
}
timeValues.append("[");
- for (int i = 0; i <= 59; ) {
+ for (int i = 0; i <= 59;) {
if (i != 0) {
timeValues.append(", ");
}