Program: 19613
Project: 19613
Buggy source:
public CreatePolicyRequest constructPolicyRequest(String policyType,String policyName,String policyDesc,List<String> resourceMap,List<String> globalSubjectDomainList,List<String> subjectInclusion,List<String> subjectGInclusion,List<String> subjectExclusion,List<String> subjectGExclusion,long effectDuration,long rolloverperiod,EffectType effect,String condition,boolean isActive,String policyBasedEmail,String subjectBasedEmail) throws Exception {
  CreatePolicyRequest createPolicyRequest=new CreatePolicyRequest();
  Target target=new Target();
  Policy policy=new Policy();
  System.out.println("String_Node_Str" + policyName);
  if (policyType == null || policyName == null) {
    throw new Exception("String_Node_Str");
  }
  cleanupPolicy(policyName,policyType);
  policy.setPolicyName(policyName);
  policy.setPolicyType(policyType);
  policy.setDescription(policyDesc);
  policy.setTarget(target);
  Resources resources=new Resources();
  target.setResources(resources);
  Subjects subjects=new Subjects();
  target.setSubjects(subjects);
  List<Resource> resourceList=resources.getResource();
  if (resourceMap != null) {
    Iterator<String> iterResourceMap=resourceMap.iterator();
    while (iterResourceMap.hasNext()) {
      Resource resource=new Resource();
      String entry=iterResourceMap.next();
      String[] str=entry.split("String_Node_Str");
      if (str.length > 2) {
        int operationIndex=2;
        Operation op=null;
        while (str.length < operationIndex) {
          Long operationId=createOpertionForResource(str[0],str[1],str[operationIndex++]);
          op=new Operation();
          op.setOperationId(operationId);
          resource.getOperation().add(op);
        }
      }
 else {
        Long resourceId=createResource(str[0],str[1]);
        resource.setResourceId(resourceId);
      }
      resource.setResourceType(str[0]);
      resource.setResourceName(str[1]);
      resourceList.add(resource);
    }
  }
  prepareSubject(subjectInclusion,true,subjects);
  prepareSubjectGroup(subjectGInclusion,true,subjects);
  if (policyType.equals("String_Node_Str")) {
    if (globalSubjectDomainList != null) {
      Iterator<String> iterDomainList=globalSubjectDomainList.iterator();
      while (iterDomainList.hasNext()) {
        Subject object=mapGlobalSubject(iterDomainList.next());
        subjects.getSubject().add(object);
      }
    }
    if (subjectExclusion != null) {
      prepareSubject(subjectExclusion,false,subjects);
    }
    if (subjectGExclusion != null) {
      prepareSubjectGroup(subjectGExclusion,false,subjects);
    }
  }
  if (policyType.equals("String_Node_Str"))   effect=EffectType.BLOCK;
 else   if (policyType.equals("String_Node_Str"))   effect=EffectType.ALLOW;
  if (!policyType.equals("String_Node_Str")) {
    Rule rule=getRuleObject(policyName,effectDuration,rolloverperiod,effect,condition);
    policy.getRule().add(rule);
  }
  createPolicyRequest.setPolicy(policy);
  return createPolicyRequest;
}

Fixed version (ground truth):
public CreatePolicyRequest constructPolicyRequest(String policyType,String policyName,String policyDesc,List<String> resourceMap,List<String> globalSubjectDomainList,List<String> subjectInclusion,List<String> subjectGInclusion,List<String> subjectExclusion,List<String> subjectGExclusion,long effectDuration,long rolloverperiod,EffectType effect,String condition,boolean isActive,String policyBasedEmail,String subjectBasedEmail) throws Exception {
  CreatePolicyRequest createPolicyRequest=new CreatePolicyRequest();
  Target target=new Target();
  Policy policy=new Policy();
  System.out.println("String_Node_Str" + policyName);
  if (policyType == null || policyName == null) {
    throw new Exception("String_Node_Str");
  }
  cleanupPolicy(policyName,policyType);
  policy.setPolicyName(policyName);
  policy.setPolicyType(policyType);
  policy.setDescription(policyDesc);
  policy.setTarget(target);
  Resources resources=new Resources();
  target.setResources(resources);
  Subjects subjects=new Subjects();
  target.setSubjects(subjects);
  List<Resource> resourceList=resources.getResource();
  if (resourceMap != null) {
    Iterator<String> iterResourceMap=resourceMap.iterator();
    while (iterResourceMap.hasNext()) {
      Resource resource=new Resource();
      String entry=iterResourceMap.next();
      String[] str=entry.split("String_Node_Str");
      if (str.length > 2) {
        int operationIndex=2;
        Operation op=null;
        int length=str.length;
        while (operationIndex < str.length) {
          Long operationId=createOpertionForResource(str[0],str[1],str[operationIndex++]);
          op=new Operation();
          op.setOperationId(operationId);
          resource.getOperation().add(op);
        }
      }
 else {
        Long resourceId=createResource(str[0],str[1]);
        resource.setResourceId(resourceId);
      }
      resource.setResourceType(str[0]);
      resource.setResourceName(str[1]);
      resourceList.add(resource);
    }
  }
  prepareSubject(subjectInclusion,true,subjects);
  prepareSubjectGroup(subjectGInclusion,true,subjects);
  if (policyType.equals("String_Node_Str")) {
    if (globalSubjectDomainList != null) {
      Iterator<String> iterDomainList=globalSubjectDomainList.iterator();
      while (iterDomainList.hasNext()) {
        Subject object=mapGlobalSubject(iterDomainList.next());
        subjects.getSubject().add(object);
      }
    }
    if (subjectExclusion != null) {
      prepareSubject(subjectExclusion,false,subjects);
    }
    if (subjectGExclusion != null) {
      prepareSubjectGroup(subjectGExclusion,false,subjects);
    }
  }
  if (policyType.equals("String_Node_Str"))   effect=EffectType.BLOCK;
 else   if (policyType.equals("String_Node_Str"))   effect=EffectType.ALLOW;
  if (!policyType.equals("String_Node_Str")) {
    Rule rule=getRuleObject(policyName,effectDuration,rolloverperiod,effect,condition);
    policy.getRule().add(rule);
  }
  createPolicyRequest.setPolicy(policy);
  return createPolicyRequest;
}