Program: 29936
Project: 29936
Buggy source:
/** 
 * <p> This method returns the list of Names of the existing Templates. </p>
 * @param serviceType Acceptable value is "JavaEE", "Database" "LoadBalancer".If set to NULL, all service type will be returned.
 * @return	<code>List<String></code>  Returns the list of names of the template.
 */
public static List<String> getTemplateList(String type){
  List<String> tList=new ArrayList();
  try {
    List<String> virts=RestUtil.getChildNameList(REST_URL + "String_Node_Str");
    for (    String virtType : virts) {
      List<String> virtInstances=RestUtil.getChildNameList(REST_URL + "String_Node_Str" + virtType);
      if ((virtInstances != null) && (virtInstances.size() > 0)) {
        String templateEndpoint=REST_URL + "String_Node_Str" + virtType+ "String_Node_Str"+ virtInstances.get(0)+ "String_Node_Str";
        if (RestUtil.doesProxyExist(templateEndpoint)) {
          Map<String,String> templateEndpoints=RestUtil.getChildMap(templateEndpoint);
          for (          String oneT : templateEndpoints.keySet()) {
            Map<String,String> tempIndexes=RestUtil.getChildMap(templateEndpoints.get(oneT) + "String_Node_Str");
            for (            String oneI : tempIndexes.keySet()) {
              Map attrs=RestUtil.getAttributesMap(tempIndexes.get(oneI));
              if ("String_Node_Str".equals(attrs.get("String_Node_Str")) && type.equals(attrs.get("String_Node_Str"))) {
                tList.add(oneT);
              }
            }
          }
        }
      }
    }
  }
 catch (  Exception ex) {
  }
  return tList;
}

Fixed version (ground truth):
/** 
 * <p> This method returns the list of Names of the existing Templates. </p>
 * @param serviceType Acceptable value is "JavaEE", "Database" "LoadBalancer".If set to NULL, all service type will be returned.
 * @return	<code>List<String></code>  Returns the list of names of the template.
 */
public static List<String> getTemplateList(String type){
  List<String> tList=new ArrayList();
  try {
    List<String> virts=RestUtil.getChildNameList(REST_URL + "String_Node_Str");
    for (    String virtType : virts) {
      List<String> virtInstances=RestUtil.getChildNameList(REST_URL + "String_Node_Str" + virtType);
      if ((virtInstances != null) && (virtInstances.size() > 0)) {
        String templateEndpoint=REST_URL + "String_Node_Str" + virtType+ "String_Node_Str"+ virtInstances.get(0)+ "String_Node_Str";
        if (RestUtil.doesProxyExist(templateEndpoint)) {
          Map<String,String> templateEndpoints=RestUtil.getChildMap(templateEndpoint);
          for (          Map.Entry<String,String> endpointE : templateEndpoints.entrySet()) {
            Map<String,String> tempIndexes=RestUtil.getChildMap(endpointE.getValue() + "String_Node_Str");
            for (            Map.Entry<String,String> indexE : tempIndexes.entrySet()) {
              Map attrs=RestUtil.getAttributesMap(indexE.getValue());
              if ("String_Node_Str".equals(attrs.get("String_Node_Str")) && type.equals(attrs.get("String_Node_Str"))) {
                tList.add(endpointE.getKey());
              }
            }
          }
        }
      }
    }
  }
 catch (  Exception ex) {
  }
  return tList;
}