Пример #1
0
 /**
  * Process a node as part of this search.
  *
  * @param node the next node encountered in the search
  * @param worklist if non-null, {@code node} will be added to this list. Otherwise, {@code node}
  *     is treated as a candidate result.
  * @return true if the search should continue, false if a definitive {@link #result} has been
  *     found
  */
 private boolean process(ValueNode node, NodeWorkList worklist) {
   if (node.isAlive()) {
     if (worklist == null) {
       if (result == null) {
         // Initial candidate result: continue search
         result = node;
       } else if (result != node) {
         // Conflicts with existing candidate: stop search with null result
         result = null;
         return false;
       }
     } else {
       worklist.add(node);
     }
   }
   return true;
 }