Program: 1696
Project: 1696
Buggy source:
public void generateExtension(String classPackageFolder,URL descriptorUrl) throws IOException {
  String descriptorUrlStr=descriptorUrl.toString();
  String descriptorFolderURL=descriptorUrlStr.substring(0,descriptorUrlStr.length() - PACKAGEFILE_DESCRIPTOR.length());
  InputStream descriptorStream=descriptorUrl.openStream();
  Properties descriptorProperties=new Properties();
  descriptorProperties.load(descriptorStream);
  String type=descriptorProperties.getProperty("String_Node_Str");
  if (type == null) {
    type="String_Node_Str";
  }
  String id=descriptorProperties.getProperty("String_Node_Str");
  if (id == null) {
    id=descriptorFolderURL.substring(0,descriptorFolderURL.length() - 1);
    id=id.substring(id.lastIndexOf('/') + 1);
  }
  String version=descriptorProperties.getProperty("String_Node_Str");
  if (version == null) {
    version="String_Node_Str";
  }
  File packageFile;
  String directory=descriptorProperties.getProperty("String_Node_Str");
  String fileName=descriptorProperties.getProperty("String_Node_Str");
  if (directory == null) {
    if (fileName == null) {
      packageFile=new File(this.defaultDirectory,URLEncoder.encode(id + '-' + version+ '.'+ type,"String_Node_Str"));
    }
 else {
      packageFile=new File(this.defaultDirectory,fileName);
    }
  }
 else {
    if (fileName == null) {
      fileName=URLEncoder.encode(id + '-' + version+ '.'+ type,"String_Node_Str");
    }
    packageFile=new File(this.workingDirectory,directory);
    packageFile=new File(packageFile,fileName);
  }
  packageFile.getParentFile().mkdirs();
  FileOutputStream fos=new FileOutputStream(packageFile);
  try {
    ZipOutputStream zos;
    if (type.equals("String_Node_Str")) {
      Manifest manifest=new Manifest();
      manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION,"String_Node_Str");
      zos=new JarOutputStream(fos,manifest);
    }
 else {
      zos=new ZipOutputStream(fos);
    }
    try {
      for (      Vfs.File resourceFile : Vfs.fromURL(new URL(descriptorFolderURL)).getFiles()) {
        if (!resourceFile.getRelativePath().equals(PACKAGEFILE_DESCRIPTOR)) {
          addZipEntry(classPackageFolder,resourceFile,zos,type);
        }
      }
    }
  finally {
      zos.close();
    }
    this.extensionsFiles.put(new ExtensionId(id,version),packageFile);
  }
  finally {
    fos.close();
  }
}

Fixed version (ground truth):
public void generateExtension(String classPackageFolder,URL descriptorUrl) throws IOException {
  String descriptorUrlStr=descriptorUrl.toString();
  String descriptorFolderURL=descriptorUrlStr.substring(0,descriptorUrlStr.length() - PACKAGEFILE_DESCRIPTOR.length());
  Properties descriptorProperties=new Properties();
  InputStream descriptorStream=descriptorUrl.openStream();
  try {
    descriptorProperties.load(descriptorStream);
  }
  finally {
    descriptorStream.close();
  }
  String type=descriptorProperties.getProperty("String_Node_Str");
  if (type == null) {
    type="String_Node_Str";
  }
  String id=descriptorProperties.getProperty("String_Node_Str");
  if (id == null) {
    id=descriptorFolderURL.substring(0,descriptorFolderURL.length() - 1);
    id=id.substring(id.lastIndexOf('/') + 1);
  }
  String version=descriptorProperties.getProperty("String_Node_Str");
  if (version == null) {
    version="String_Node_Str";
  }
  File packageFile;
  String directory=descriptorProperties.getProperty("String_Node_Str");
  String fileName=descriptorProperties.getProperty("String_Node_Str");
  if (directory == null) {
    if (fileName == null) {
      packageFile=new File(this.defaultDirectory,URLEncoder.encode(id + '-' + version+ '.'+ type,"String_Node_Str"));
    }
 else {
      packageFile=new File(this.defaultDirectory,fileName);
    }
  }
 else {
    if (fileName == null) {
      fileName=URLEncoder.encode(id + '-' + version+ '.'+ type,"String_Node_Str");
    }
    packageFile=new File(this.workingDirectory,directory);
    packageFile=new File(packageFile,fileName);
  }
  packageFile.getParentFile().mkdirs();
  FileOutputStream fos=new FileOutputStream(packageFile);
  try {
    ZipOutputStream zos;
    if (type.equals("String_Node_Str")) {
      Manifest manifest=new Manifest();
      manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION,"String_Node_Str");
      zos=new JarOutputStream(fos,manifest);
    }
 else {
      zos=new ZipOutputStream(fos);
    }
    try {
      for (      Vfs.File resourceFile : Vfs.fromURL(new URL(descriptorFolderURL)).getFiles()) {
        if (!resourceFile.getRelativePath().equals(PACKAGEFILE_DESCRIPTOR)) {
          addZipEntry(classPackageFolder,resourceFile,zos,type);
        }
      }
    }
  finally {
      zos.close();
    }
    this.extensionsFiles.put(new ExtensionId(id,version),packageFile);
  }
  finally {
    fos.close();
  }
}