Improved:  Fix some bugs Spotbugs reports
Removes repeated conditional tests
@@ -261,7 +261,6 @@ public class BOMNode {
.filterByDate(inDate).queryList());
}
newNode = substituteNode(oneChildNode, productFeatures, genericLinkRules);
- if (newNode.equals(oneChildNode)) {
// If no substitution has been done (no valid rule applied),
// we try to search for a generic node-rule
List<GenericValue> genericNodeRules = EntityQuery.use(delegator).from("ProductManufacturingRule")
@@ -270,7 +269,6 @@ public class BOMNode {
.filterByDate(inDate).queryList();
newNode = null;
newNode = substituteNode(oneChildNode, productFeatures, genericNodeRules);
- if (newNode.equals(oneChildNode)) {
// If no substitution has been done (no valid rule applied),
// we try to set the default (first) node-substitution
// if (UtilValidate.isNotEmpty(genericNodeRules)) {
@@ -322,8 +320,6 @@ public class BOMNode {
}
// -----------------------------------------------------------
}
- }
- }
} // end of if (isVirtual())
return newNode;
}
