Program: 50719
Project: 50719
Buggy source:
public void rebuildKnowledgeBaseViaKnowledgeBuilder(){
  guvnorProps=new Properties();
  try {
    KnowledgeBuilder kbuilder=KnowledgeBuilderFactory.newKnowledgeBuilder();
    if (guvnorUtils.guvnorExists()) {
      guvnorProps.load(BaseKnowledgeSessionBean.class.getResourceAsStream("String_Node_Str"));
      StringBuilder guvnorSBuilder=new StringBuilder();
      guvnorSBuilder.append(guvnorProps.getProperty(GuvnorConnectionUtils.GUVNOR_PROTOCOL_KEY));
      guvnorSBuilder.append("String_Node_Str");
      guvnorSBuilder.append(guvnorProps.getProperty(GuvnorConnectionUtils.GUVNOR_HOST_KEY));
      guvnorSBuilder.append("String_Node_Str");
      guvnorSBuilder.append(guvnorProps.getProperty(GuvnorConnectionUtils.GUVNOR_SUBDOMAIN_KEY));
      String guvnorURI=guvnorSBuilder.toString();
      List<String> packages=guvnorUtils.getPackageNames();
      if (packages.size() > 0) {
        for (        String pkg : packages) {
          GuvnorRestApi guvnorRestApi=new GuvnorRestApi(guvnorURI);
          try {
            InputStream binaryPackage=guvnorRestApi.getBinaryPackage(pkg);
            kbuilder.add(new InputStreamResource(binaryPackage),ResourceType.PKG);
            guvnorRestApi.close();
          }
 catch (          java.io.IOException y) {
            log.error("String_Node_Str" + pkg + "String_Node_Str"+ y);
          }
        }
      }
 else {
        log.warn("String_Node_Str");
      }
    }
 else     if (StringUtils.isNotEmpty(System.getProperty(IKnowledgeSession.CHANGE_SET_URLS))) {
      processEventListeners=System.getProperty(IKnowledgeSession.SPACE_DELIMITED_PROCESS_EVENT_LISTENERS).split("String_Node_Str");
      String[] changeSetUrls=System.getProperty(IKnowledgeSession.CHANGE_SET_URLS).split("String_Node_Str");
      for (      String changeSetUrl : changeSetUrls) {
        InputStream iStream=null;
        try {
          iStream=new FileInputStream(changeSetUrl);
          Resource rObj=new InputStreamResource(iStream);
          kbuilder.add(rObj,ResourceType.PKG);
        }
  finally {
          if (iStream != null)           iStream.close();
        }
      }
    }
 else {
      log.warn("String_Node_Str" + IKnowledgeSession.CHANGE_SET_URLS);
    }
    kbase=kbuilder.newKnowledgeBase();
    log.info("String_Node_Str");
  }
 catch (  RuntimeException x) {
    throw x;
  }
catch (  Exception x) {
    throw new RuntimeException(x);
  }
}

Fixed version (ground truth):
public synchronized void rebuildKnowledgeBaseViaKnowledgeBuilder(){
  guvnorProps=new Properties();
  try {
    KnowledgeBuilder kbuilder=KnowledgeBuilderFactory.newKnowledgeBuilder();
    if (guvnorUtils.guvnorExists()) {
      guvnorProps.load(BaseKnowledgeSessionBean.class.getResourceAsStream("String_Node_Str"));
      StringBuilder guvnorSBuilder=new StringBuilder();
      guvnorSBuilder.append(guvnorProps.getProperty(GuvnorConnectionUtils.GUVNOR_PROTOCOL_KEY));
      guvnorSBuilder.append("String_Node_Str");
      guvnorSBuilder.append(guvnorProps.getProperty(GuvnorConnectionUtils.GUVNOR_HOST_KEY));
      guvnorSBuilder.append("String_Node_Str");
      guvnorSBuilder.append(guvnorProps.getProperty(GuvnorConnectionUtils.GUVNOR_SUBDOMAIN_KEY));
      String guvnorURI=guvnorSBuilder.toString();
      List<String> packages=guvnorUtils.getPackageNames();
      if (packages.size() > 0) {
        for (        String pkg : packages) {
          GuvnorRestApi guvnorRestApi=new GuvnorRestApi(guvnorURI);
          try {
            InputStream binaryPackage=guvnorRestApi.getBinaryPackage(pkg);
            kbuilder.add(new InputStreamResource(binaryPackage),ResourceType.PKG);
            guvnorRestApi.close();
          }
 catch (          java.io.IOException y) {
            log.error("String_Node_Str" + pkg + "String_Node_Str"+ y);
          }
        }
      }
 else {
        log.warn("String_Node_Str");
      }
    }
 else     if (StringUtils.isNotEmpty(System.getProperty(IKnowledgeSession.CHANGE_SET_URLS))) {
      processEventListeners=System.getProperty(IKnowledgeSession.SPACE_DELIMITED_PROCESS_EVENT_LISTENERS).split("String_Node_Str");
      String[] changeSetUrls=System.getProperty(IKnowledgeSession.CHANGE_SET_URLS).split("String_Node_Str");
      for (      String changeSetUrl : changeSetUrls) {
        InputStream iStream=null;
        try {
          iStream=new FileInputStream(changeSetUrl);
          Resource rObj=new InputStreamResource(iStream);
          kbuilder.add(rObj,ResourceType.PKG);
        }
  finally {
          if (iStream != null)           iStream.close();
        }
      }
    }
 else {
      log.warn("String_Node_Str" + IKnowledgeSession.CHANGE_SET_URLS);
    }
    kbase=kbuilder.newKnowledgeBase();
    log.info("String_Node_Str");
  }
 catch (  RuntimeException x) {
    throw x;
  }
catch (  Exception x) {
    throw new RuntimeException(x);
  }
}