Source:
<code>public List<RMNode> arrangeNodesForScriptExecution(final List<RMNode> nodes, List<SelectionScript> scripts, Map<String, Serializable> bindings) { long startTime = System.currentTimeMillis(); boolean scriptSpecified = scripts != null && scripts.size() > 0; if (!scriptSpecified) { return nodes; } HashMap<RMNode, Probability> intersectionMap = new LinkedHashMap<>(); for (RMNode rmnode : nodes) { boolean intersection = true; double intersectionProbability = 1; for (SelectionScript script : scripts) { SelectionScript scriptWithReplacedBindings = replaceBindings(script, bindings); String digest = ""; try { digest = new String(scriptWithReplacedBindings.digest()); } catch (NoSuchAlgorithmException e) { logger.error(e.getMessage(), e); } if (probabilities.containsKey(digest) && probabilities.get(digest).containsKey(rmnode.getNodeURL())) { double probability = probabilities.get(digest).get(rmnode.getNodeURL()).value(); <START> if (probability == 0) { <END> intersection = false; break; } else { intersectionProbability *= probability; } } else { intersectionProbability *= Probability.defaultValue(); } } if (intersection) { intersectionMap.put(rmnode, new Probability(intersectionProbability)); } } Set<RMNode> nodeSet = intersectionMap.keySet(); List<RMNode> res = new ArrayList<>(nodeSet.size()); res.addAll(nodeSet); Collections.sort(res, new NodeProbabilityComparator(intersectionMap)); if (logger.isDebugEnabled()) { logger.debug("The following nodes are selected for scripts execution (time is " + (System.currentTimeMillis() - startTime) + " ms) :"); if (res.size() > 0) { for (RMNode rmnode : res) { logger.debug(rmnode.getNodeURL() + " : probability " + intersectionMap.get(rmnode)); } } else { logger.debug("None"); } } return res; }</code><technical_language>suggestion if (Double.compare(probability, 0) < 0.000001) {</technical_language>

Target:
public List<RMNode> arrangeNodesForScriptExecution(final List<RMNode> nodes, List<SelectionScript> scripts, Map<String, Serializable> bindings) { long startTime = System.currentTimeMillis(); boolean scriptSpecified = scripts != null && scripts.size() > 0; if (!scriptSpecified) { return nodes; } HashMap<RMNode, Probability> intersectionMap = new LinkedHashMap<>(); for (RMNode rmnode : nodes) { boolean intersection = true; double intersectionProbability = 1; for (SelectionScript script : scripts) { SelectionScript scriptWithReplacedBindings = replaceBindings(script, bindings); String digest = ""; try { digest = new String(scriptWithReplacedBindings.digest()); } catch (NoSuchAlgorithmException e) { logger.error(e.getMessage(), e); } if (probabilities.containsKey(digest) && probabilities.get(digest).containsKey(rmnode.getNodeURL())) { double probability = probabilities.get(digest).get(rmnode.getNodeURL()).value(); if (Math.abs(probability - 0) < 0.0001) { intersection = false; break; } else { intersectionProbability *= probability; } } else { intersectionProbability *= Probability.defaultValue(); } } if (intersection) { intersectionMap.put(rmnode, new Probability(intersectionProbability)); } } Set<RMNode> nodeSet = intersectionMap.keySet(); List<RMNode> res = new ArrayList<>(nodeSet.size()); res.addAll(nodeSet); Collections.sort(res, new NodeProbabilityComparator(intersectionMap)); if (logger.isDebugEnabled()) { logger.debug("The following nodes are selected for scripts execution (time is " + (System.currentTimeMillis() - startTime) + " ms) :"); if (res.size() > 0) { res.forEach(rmnode -> { logger.debug(rmnode.getNodeURL() + " : probability " + intersectionMap.get(rmnode)); }); } else { logger.debug("None"); } } return res; }