<commit_before>/*
 * $Id$
 */
package org.xins.client;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.xins.util.MandatoryArgumentChecker;

/**
 * Call target group that tries to call the underlying function callers in
 * order.
 *
 * @version $Revision$ $Date$
 * @author <NAME> (<a href="mailto:<EMAIL>"><EMAIL></a>)
 *
 * @since XINS 0.41
 */
final class OrderedCallTargetGroup extends CallTargetGroup {

   //-------------------------------------------------------------------------
   // Class fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Class functions
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Constructors
   //-------------------------------------------------------------------------

   /**
    * Constructs a new <code>OrderedCallTargetGroup</code>.
    *
    * @param members
    *    the members of this group, cannot be <code>null</code>.
    *
    * @throws IllegalArgumentException
    *    if <code>members == null</code>.
    */
   OrderedCallTargetGroup(List members) throws IllegalArgumentException {
      super(ORDERED_TYPE, members);
   }


   //-------------------------------------------------------------------------
   // Fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Methods
   //-------------------------------------------------------------------------

   CallResult callImpl(String sessionID,
                       String functionName,
                       Map    parameters)
   throws IllegalArgumentException, IOException, InvalidCallResultException {

      List members = getMembers();
      int count = (members == null) ? 0 : members.size();
      Object result;
      int i = 0;
      do {
         FunctionCaller caller = (FunctionCaller) members.get(i);
         result = tryCall(caller, sessionID, functionName, parameters);
         i++;
      } while (result instanceof Throwable && i < count);

      return callImplResult(result);
   }
}<commit_msg>File layout.<commit_after>/*
 * $Id$
 */
package org.xins.client;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.xins.util.MandatoryArgumentChecker;

/**
 * Call target group that tries to call the underlying function callers in
 * order.
 *
 * @version $Revision$ $Date$
 * @author <NAME> (<a href="mailto:<EMAIL>"><EMAIL></a>)
 *
 * @since XINS 0.41
 */
final class OrderedCallTargetGroup extends CallTargetGroup {

   //-------------------------------------------------------------------------
   // Class fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Class functions
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Constructors
   //-------------------------------------------------------------------------

   /**
    * Constructs a new <code>OrderedCallTargetGroup</code>.
    *
    * @param members
    *    the members of this group, cannot be <code>null</code>.
    *
    * @throws IllegalArgumentException
    *    if <code>members == null</code>.
    */
   OrderedCallTargetGroup(List members) throws IllegalArgumentException {
      super(ORDERED_TYPE, members);
   }


   //-------------------------------------------------------------------------
   // Fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Methods
   //-------------------------------------------------------------------------

   CallResult callImpl(String sessionID, String functionName, Map parameters)
   throws IllegalArgumentException, IOException, InvalidCallResultException {

      List members = getMembers();
      int count = (members == null) ? 0 : members.size();
      Object result;
      int i = 0;
      do {
         FunctionCaller caller = (FunctionCaller) members.get(i);
         result = tryCall(caller, sessionID, functionName, parameters);
         i++;
      } while (result instanceof Throwable && i < count);

      return callImplResult(result);
   }
}
{'fraction_non_alphanumeric': 0.4039807524059493, 'fraction_numerical': 0.0021872265966754157, 'mean_word_length': 0.9360711261642676, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4442466', 'n_tokens_mistral': 959, 'n_tokens_neox': 921, 'n_words': 235}