Program: 134837
Project: 134837
Buggy source:
/** 
 * This method finds files in "Components" and "Containers"  directories and sub-directories. It then extracts "implLang"  properties, and compares. Error messages are displayed if Components.xml's implLang and Containers.xml's implLang don't match. Returns 'true' if error is found, false otherwise added by panta@naoj 2009/10/05 
 */
protected boolean checkImplLangMatch(File compFolder,File contFolder){
  CDBChecker cdbchecker=new CDBChecker();
  File[] files=compFolder.listFiles();
  search:   for (int x=0; x < files.length; x++) {
    if (foundErr) {
      break search;
    }
    if (files[x].isDirectory()) {
      if (!files[x].getName().equals("String_Node_Str")) {
        checkImplLangMatch(files[x],contFolder);
      }
    }
 else {
      String ext="String_Node_Str";
      int iExt=files[x].getName().lastIndexOf("String_Node_Str");
      ext=files[x].getName().substring(iExt + 1,files[x].getName().length());
      if (!ext.equals("String_Node_Str")) {
        continue;
      }
      DocumentBuilderFactory dbfComp=DocumentBuilderFactory.newInstance();
      DocumentBuilder dbComp=null;
      try {
        dbComp=dbfComp.newDocumentBuilder();
      }
 catch (      ParserConfigurationException e) {
        e.printStackTrace();
      }
      Document docComp=null;
      try {
        docComp=dbComp.parse(files[x]);
      }
 catch (      SAXException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
      docComp.getDocumentElement().normalize();
      NodeList compNodeList=docComp.getElementsByTagName("String_Node_Str");
      if (compNodeList.getLength() == 0) {
        compNodeList=docComp.getElementsByTagName("String_Node_Str");
        if (compNodeList.getLength() == 0) {
          continue;
        }
      }
      for (int j=0; j < compNodeList.getLength(); j++) {
        Element elm=(Element)compNodeList.item(j);
        String compName=null;
        String implLang=null;
        String tempContainersFolder=null;
        compName=elm.getAttribute("String_Node_Str");
        implLang=elm.getAttribute("String_Node_Str");
        if (!compName.equals("String_Node_Str") && !files[x].getName().equals("String_Node_Str")) {
          if (!(compName + "String_Node_Str").equals(files[x].getName())) {
            System.out.print("String_Node_Str");
            System.out.print("String_Node_Str" + files[x]);
            System.out.print("String_Node_Str" + compName + "String_Node_Str");
            System.out.print("String_Node_Str" + files[x].getName() + "String_Node_Str");
            foundErr=true;
            break search;
          }
        }
        if (compName.equals("String_Node_Str")) {
          if (implLang.equals("String_Node_Str") || implLang.equals("String_Node_Str")) {
            continue;
          }
          if (elm.getAttribute("String_Node_Str").equals("String_Node_Str") || elm.getAttribute("String_Node_Str").equals("String_Node_Str")) {
            continue;
          }
        }
 else {
          if (implLang.equals("String_Node_Str")) {
            System.out.println("String_Node_Str" + files[x]);
            System.out.print("String_Node_Str" + compName);
            foundErr=true;
            break search;
          }
        }
        tempContainersFolder=containersFolder + "String_Node_Str" + elm.getAttribute("String_Node_Str");
        DocumentBuilderFactory dbfCont=DocumentBuilderFactory.newInstance();
        DocumentBuilder dbCont=null;
        try {
          dbCont=dbfCont.newDocumentBuilder();
        }
 catch (        ParserConfigurationException e) {
          e.printStackTrace();
        }
        Document docCont=null;
        try {
          File contFile=new File(tempContainersFolder + "String_Node_Str" + new File(tempContainersFolder).getName()+ "String_Node_Str");
          if (contFile.exists()) {
            docCont=dbCont.parse(contFile);
            docCont.getDocumentElement().normalize();
            NodeList contNodeList=docCont.getElementsByTagName("String_Node_Str");
            for (int k=0; k < contNodeList.getLength(); k++) {
              Element elmCont=(Element)contNodeList.item(k);
              if (implLang.equals(elmCont.getAttribute("String_Node_Str"))) {
              }
 else {
                System.out.println("String_Node_Str" + files[x]);
                System.out.print("String_Node_Str" + compName + "String_Node_Str");
                foundErr=true;
                break search;
              }
            }
          }
 else {
            System.out.print("String_Node_Str" + files[x]);
            System.out.print("String_Node_Str" + new File(tempContainersFolder));
            System.out.println("String_Node_Str");
            foundErr=true;
            break search;
          }
        }
 catch (        SAXException e) {
          e.printStackTrace();
        }
catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
  return foundErr;
}

Fixed version (ground truth):
/** 
 * This method finds files in "Components" and "Containers"  directories and sub-directories. It then extracts "implLang"  properties, and compares. Error messages are displayed if Components.xml's implLang and Containers.xml's implLang don't match. Returns 'true' if error is found, false otherwise added by panta@naoj 2009/10/05 
 */
protected boolean checkImplLangMatch(File compFolder,File contFolder){
  CDBChecker cdbchecker=new CDBChecker();
  File[] files=compFolder.listFiles();
  search:   for (int x=0; x < files.length; x++) {
    if (foundErr) {
      break search;
    }
    if (files[x].isDirectory()) {
      if (!files[x].getName().equals("String_Node_Str")) {
        checkImplLangMatch(files[x],contFolder);
      }
    }
 else {
      String ext="String_Node_Str";
      int iExt=files[x].getName().lastIndexOf("String_Node_Str");
      ext=files[x].getName().substring(iExt + 1,files[x].getName().length());
      if (!ext.equals("String_Node_Str")) {
        continue;
      }
      DocumentBuilderFactory dbfComp=DocumentBuilderFactory.newInstance();
      DocumentBuilder dbComp=null;
      try {
        dbComp=dbfComp.newDocumentBuilder();
      }
 catch (      ParserConfigurationException e) {
        e.printStackTrace();
      }
      Document docComp=null;
      try {
        docComp=dbComp.parse(files[x]);
      }
 catch (      SAXException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
      docComp.getDocumentElement().normalize();
      NodeList compNodeList=docComp.getElementsByTagName("String_Node_Str");
      if (compNodeList.getLength() == 1) {
        String compName=((Element)compNodeList.item(0)).getAttribute("String_Node_Str");
        if (!compName.equals("String_Node_Str") && !files[x].getName().equals("String_Node_Str")) {
          if (!(compName + "String_Node_Str").equals(files[x].getName())) {
            System.out.print("String_Node_Str");
            System.out.print("String_Node_Str" + files[x]);
            System.out.print("String_Node_Str" + compName + "String_Node_Str");
            System.out.print("String_Node_Str" + files[x].getName() + "String_Node_Str");
            foundErr=true;
            break search;
          }
        }
      }
      if (compNodeList.getLength() == 0) {
        compNodeList=docComp.getElementsByTagName("String_Node_Str");
        if (compNodeList.getLength() == 0) {
          continue;
        }
      }
      for (int j=0; j < compNodeList.getLength(); j++) {
        Element elm=(Element)compNodeList.item(j);
        String compName=null;
        String implLang=null;
        String tempContainersFolder=null;
        compName=elm.getAttribute("String_Node_Str");
        implLang=elm.getAttribute("String_Node_Str");
        if (compName.equals("String_Node_Str")) {
          if (implLang.equals("String_Node_Str") || implLang.equals("String_Node_Str")) {
            continue;
          }
          if (elm.getAttribute("String_Node_Str").equals("String_Node_Str") || elm.getAttribute("String_Node_Str").equals("String_Node_Str")) {
            continue;
          }
        }
 else {
          if (implLang.equals("String_Node_Str")) {
            System.out.println("String_Node_Str" + files[x]);
            System.out.print("String_Node_Str" + compName);
            foundErr=true;
            break search;
          }
        }
        tempContainersFolder=containersFolder + "String_Node_Str" + elm.getAttribute("String_Node_Str");
        DocumentBuilderFactory dbfCont=DocumentBuilderFactory.newInstance();
        DocumentBuilder dbCont=null;
        try {
          dbCont=dbfCont.newDocumentBuilder();
        }
 catch (        ParserConfigurationException e) {
          e.printStackTrace();
        }
        Document docCont=null;
        try {
          File contFile=new File(tempContainersFolder + "String_Node_Str" + new File(tempContainersFolder).getName()+ "String_Node_Str");
          if (contFile.exists()) {
            docCont=dbCont.parse(contFile);
            docCont.getDocumentElement().normalize();
            NodeList contNodeList=docCont.getElementsByTagName("String_Node_Str");
            for (int k=0; k < contNodeList.getLength(); k++) {
              Element elmCont=(Element)contNodeList.item(k);
              if (implLang.equals(elmCont.getAttribute("String_Node_Str"))) {
              }
 else {
                System.out.println("String_Node_Str" + files[x]);
                System.out.print("String_Node_Str" + compName + "String_Node_Str");
                foundErr=true;
                break search;
              }
            }
          }
 else {
            System.out.print("String_Node_Str" + files[x]);
            System.out.print("String_Node_Str" + new File(tempContainersFolder));
            System.out.println("String_Node_Str");
            foundErr=true;
            break search;
          }
        }
 catch (        SAXException e) {
          e.printStackTrace();
        }
catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
  return foundErr;
}