Program: 13024
Project: 13024
Buggy source:
/** 
 * Finds the assets from the current classpath.
 * @param brmsBaseUrl
 * @param pkgName
 * @param userId
 * @param password
 */
private void addAssetsToPackageToBRMSFromClasspath(String brmsBaseUrl,String pkgName,String userId,String password) throws Exception {
  String urlStr=brmsBaseUrl + "String_Node_Str" + pkgName+ "String_Node_Str";
  String dir="String_Node_Str" + pkgName;
  Credentials credentials=new UsernamePasswordCredentials(userId,password);
  DefaultHttpClient httpClient=new DefaultHttpClient();
  httpClient.getCredentialsProvider().setCredentials(AuthScope.ANY,credentials);
  ClientExecutor clientExecutor=new ApacheHttpClient4Executor(httpClient);
  fac=new ClientRequestFactory(clientExecutor,new URI(urlStr));
  URL url=this.getClass().getResource(dir);
  if (url == null)   throw new Exception("String_Node_Str" + dir + "String_Node_Str");
  String path=url.toURI().getSchemeSpecificPart();
  File srampPackageDir=new File(path);
  if (srampPackageDir.exists()) {
    FilenameFilter droolsFiles=new FilenameFilter(){
      @Override public boolean accept(      File file,      String name){
        return !name.startsWith("String_Node_Str");
      }
    }
;
    File[] fileList=srampPackageDir.listFiles(droolsFiles);
    for (    File file : fileList) {
      ClientRequest addAssetRequest=fac.createRequest(urlStr);
      InputStream is=file.toURI().toURL().openStream();
      print("String_Node_Str" + file.getName() + "String_Node_Str"+ urlStr);
      uploadToBrms(file.getName(),is,addAssetRequest);
    }
  }
 else   if (path.indexOf("String_Node_Str") > 0) {
    String[] paths=path.split("String_Node_Str");
    Enumeration<JarEntry> en=new JarFile(new File(new URI(paths[0]))).entries();
    while (en.hasMoreElements()) {
      JarEntry entry=en.nextElement();
      String name=entry.getName();
      if (!entry.isDirectory() && !name.contains("String_Node_Str") && name.startsWith(dir.substring(1))) {
        String fileName=name.substring(name.lastIndexOf("String_Node_Str") + 1,name.length());
        InputStream is=this.getClass().getResourceAsStream("String_Node_Str" + name);
        ClientRequest addAssetRequest=fac.createRequest(urlStr);
        print("String_Node_Str" + name + "String_Node_Str"+ urlStr);
        uploadToBrms(fileName,is,addAssetRequest);
      }
    }
  }
  String urlCompile=brmsBaseUrl + "String_Node_Str" + pkgName+ "String_Node_Str";
  ClientRequest compileRequest=fac.createRequest(urlCompile);
  ClientResponse<InputStream> compileResponse=compileRequest.get(InputStream.class);
  if (compileResponse.getStatus() == 200) {
    print("String_Node_Str");
  }
 else {
    System.err.println(compileResponse.getStatus() + "String_Node_Str" + compileResponse.getResponseStatus().getReasonPhrase());
  }
}

Fixed version (ground truth):
/** 
 * Finds the assets from the current classpath.
 * @param brmsBaseUrl
 * @param pkgName
 * @param userId
 * @param password
 */
private void addAssetsToPackageToBRMSFromClasspath(String brmsBaseUrl,String pkgName,String userId,String password) throws Exception {
  String urlStr=brmsBaseUrl + "String_Node_Str" + pkgName+ "String_Node_Str";
  String dir="String_Node_Str" + pkgName;
  URL url=this.getClass().getResource(dir);
  if (url == null)   throw new Exception("String_Node_Str" + dir + "String_Node_Str");
  String path=url.toURI().getSchemeSpecificPart();
  File srampPackageDir=new File(path);
  if (srampPackageDir.exists()) {
    FilenameFilter droolsFiles=new FilenameFilter(){
      @Override public boolean accept(      File file,      String name){
        return !name.startsWith("String_Node_Str");
      }
    }
;
    File[] fileList=srampPackageDir.listFiles(droolsFiles);
    for (    File file : fileList) {
      ClientRequest addAssetRequest=fac.createRequest(urlStr);
      InputStream is=file.toURI().toURL().openStream();
      print("String_Node_Str" + file.getName() + "String_Node_Str"+ urlStr);
      uploadToBrms(file.getName(),is,addAssetRequest);
    }
  }
 else   if (path.indexOf("String_Node_Str") > 0) {
    String[] paths=path.split("String_Node_Str");
    Enumeration<JarEntry> en=new JarFile(new File(new URI(paths[0]))).entries();
    while (en.hasMoreElements()) {
      JarEntry entry=en.nextElement();
      String name=entry.getName();
      if (!entry.isDirectory() && !name.contains("String_Node_Str") && name.startsWith(dir.substring(1))) {
        String fileName=name.substring(name.lastIndexOf("String_Node_Str") + 1,name.length());
        InputStream is=this.getClass().getResourceAsStream("String_Node_Str" + name);
        ClientRequest addAssetRequest=fac.createRequest(urlStr);
        print("String_Node_Str" + name + "String_Node_Str"+ urlStr);
        uploadToBrms(fileName,is,addAssetRequest);
      }
    }
  }
}