Program: 10494
Project: 10494
Buggy source:
/** 
 * Checks a RequirementsContext with Requirements from the RequirementsRegistry.
 * @param context
 * @return true if the list meets the requirements and context set
 */
public boolean check(RequirementsContext context){
  if (context.mode.getMode() == RequirementsMode.Mode.NONE || context.list.isEmpty()) {
    return true;
  }
  dB.echoDebug(ChatColor.YELLOW + "String_Node_Str",context.scriptName);
  dB.echoDebug("String_Node_Str",context.mode.toString());
  boolean firstReqMet=false;
  boolean firstReqChecked=false;
  int numberMet=0;
  for (  String reqEntry : context.list) {
    boolean negativeRequirement=false;
    if (reqEntry.startsWith("String_Node_Str")) {
      negativeRequirement=true;
      reqEntry=reqEntry.substring(1);
    }
    if (plugin.getRequirementRegistry().list().containsKey(reqEntry.split("String_Node_Str")[0])) {
      AbstractRequirement requirement=plugin.getRequirementRegistry().get(reqEntry.split("String_Node_Str")[0]);
      String[] arguments=null;
      if (reqEntry.split("String_Node_Str").length > 1) {
        arguments=plugin.getScriptEngine().getScriptBuilder().buildArgs(reqEntry.split("String_Node_Str",2)[1]);
      }
      List<String> argumentList=new ArrayList<String>();
      if (arguments != null) {
        argumentList=plugin.tagManager().fillArguments(arguments,context.player,plugin.getNPCRegistry().getDenizen(context.npc));
      }
      try {
        int numArguments=arguments == null ? 0 : arguments.length;
        if ((numArguments == 0 && requirement.requirementOptions.REQUIRED_ARGS > 0) || numArguments < requirement.requirementOptions.REQUIRED_ARGS) {
          throw new RequirementCheckException("String_Node_Str");
        }
        if (requirement.check(context,argumentList) != negativeRequirement) {
          if (!firstReqChecked) {
            firstReqMet=true;
            firstReqChecked=true;
          }
          numberMet++;
          dB.echoApproval("String_Node_Str" + requirement.getName() + "String_Node_Str"+ "String_Node_Str");
        }
 else {
          if (!firstReqChecked) {
            firstReqMet=false;
            firstReqChecked=true;
          }
          dB.echoApproval("String_Node_Str" + requirement.getName() + "String_Node_Str"+ "String_Node_Str");
        }
      }
 catch (      Throwable e) {
        if (e instanceof RequirementCheckException) {
          dB.echoError("String_Node_Str");
          dB.echoError("String_Node_Str" + requirement.getUsageHint());
        }
 else {
          dB.echoError("String_Node_Str" + requirement.getName() + "String_Node_Str");
          if (!dB.showStackTraces)           dB.echoError("String_Node_Str");
 else           e.printStackTrace();
        }
      }
    }
 else {
      dB.echoError("String_Node_Str" + reqEntry.split("String_Node_Str")[0] + "String_Node_Str");
    }
  }
  if (context.mode.getMode() == RequirementsMode.Mode.ALL && numberMet == context.list.size())   return true;
 else   if (context.mode.getMode() == RequirementsMode.Mode.ANY_NUM) {
    if (numberMet >= context.mode.modeInt)     return true;
 else     return false;
  }
 else   if (context.mode.getMode() == RequirementsMode.Mode.FIRST_AND_ANY_NUM) {
    if (firstReqMet) {
      if (numberMet > context.mode.modeInt)       return true;
 else       return false;
    }
 else     return false;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks a RequirementsContext with Requirements from the RequirementsRegistry.
 * @param context
 * @return true if the list meets the requirements and context set
 */
public boolean check(RequirementsContext context){
  if (context.mode.getMode() == RequirementsMode.Mode.NONE || context.list.isEmpty()) {
    return true;
  }
  dB.echoDebug(ChatColor.YELLOW + "String_Node_Str",context.scriptName);
  dB.echoDebug("String_Node_Str",context.mode.getMode().toString());
  boolean firstReqMet=false;
  boolean firstReqChecked=false;
  int numberMet=0;
  for (  String reqEntry : context.list) {
    boolean negativeRequirement=false;
    if (reqEntry.startsWith("String_Node_Str")) {
      negativeRequirement=true;
      reqEntry=reqEntry.substring(1);
    }
    if (plugin.getRequirementRegistry().list().containsKey(reqEntry.split("String_Node_Str")[0])) {
      AbstractRequirement requirement=plugin.getRequirementRegistry().get(reqEntry.split("String_Node_Str")[0]);
      String[] arguments=null;
      if (reqEntry.split("String_Node_Str").length > 1) {
        arguments=plugin.getScriptEngine().getScriptBuilder().buildArgs(reqEntry.split("String_Node_Str",2)[1]);
      }
      List<String> argumentList=new ArrayList<String>();
      if (arguments != null) {
        argumentList=plugin.tagManager().fillArguments(arguments,context.player,plugin.getNPCRegistry().getDenizen(context.npc));
      }
      try {
        int numArguments=arguments == null ? 0 : arguments.length;
        if ((numArguments == 0 && requirement.requirementOptions.REQUIRED_ARGS > 0) || numArguments < requirement.requirementOptions.REQUIRED_ARGS) {
          throw new RequirementCheckException("String_Node_Str");
        }
        if (requirement.check(context,argumentList) != negativeRequirement) {
          if (!firstReqChecked) {
            firstReqMet=true;
            firstReqChecked=true;
          }
          numberMet++;
          dB.echoApproval("String_Node_Str" + requirement.getName() + "String_Node_Str"+ "String_Node_Str");
        }
 else {
          if (!firstReqChecked) {
            firstReqMet=false;
            firstReqChecked=true;
          }
          dB.echoApproval("String_Node_Str" + requirement.getName() + "String_Node_Str"+ "String_Node_Str");
        }
      }
 catch (      Throwable e) {
        if (e instanceof RequirementCheckException) {
          dB.echoError("String_Node_Str");
          dB.echoError("String_Node_Str" + requirement.getUsageHint());
        }
 else {
          dB.echoError("String_Node_Str" + requirement.getName() + "String_Node_Str");
          if (!dB.showStackTraces)           dB.echoError("String_Node_Str");
 else           e.printStackTrace();
        }
      }
    }
 else {
      dB.echoError("String_Node_Str" + reqEntry.split("String_Node_Str")[0] + "String_Node_Str");
    }
  }
  if (context.mode.getMode() == RequirementsMode.Mode.ALL && numberMet == context.list.size())   return true;
 else   if (context.mode.getMode() == RequirementsMode.Mode.ANY_NUM) {
    if (numberMet >= context.mode.modeInt)     return true;
 else     return false;
  }
 else   if (context.mode.getMode() == RequirementsMode.Mode.FIRST_AND_ANY_NUM) {
    if (firstReqMet) {
      if (numberMet > context.mode.modeInt)       return true;
 else       return false;
    }
 else     return false;
  }
  return false;
}