Program: 186382
Project: 186382
Buggy source:
public void run(){
  if (options == null) {
    throw new NullPointerException("String_Node_Str");
  }
  boolean tmpResult=false;
  try {
    options.log("String_Node_Str",options.getKsType());
    final KeyStore ks=KeyStore.getInstance(options.getKsType());
    InputStream ksInputStream=null;
    if (!StringUtils.isEmpty(options.getKsFile())) {
      options.log("String_Node_Str",options.getKsFile());
      ksInputStream=new FileInputStream(options.getKsFile());
    }
    ks.load(ksInputStream,options.getKsPasswd());
    options.log("String_Node_Str");
    String tmpAlias=options.getKeyAliasX();
    if (tmpAlias == null || tmpAlias.length() == 0) {
      tmpAlias=(String)ks.aliases().nextElement();
    }
    options.log("String_Node_Str");
    final PrivateKey key=(PrivateKey)ks.getKey(tmpAlias,options.getKeyPasswdX());
    options.log("String_Node_Str");
    final Certificate[] chain=ks.getCertificateChain(tmpAlias);
    options.log("String_Node_Str",options.getInFile());
    PdfReader reader;
    try {
      reader=new PdfReader(options.getInFile());
    }
 catch (    Exception e) {
      try {
        reader=new PdfReader(options.getInFile(),new byte[0]);
      }
 catch (      Exception e2) {
        reader=new PdfReader(options.getInFile(),options.getPdfOwnerPwdStr().getBytes());
      }
    }
    options.log("String_Node_Str",options.getOutFile());
    final FileOutputStream fout=new FileOutputStream(options.getOutFile());
    options.log("String_Node_Str");
    final PdfStamper stp=PdfStamper.createSignature(reader,fout,'\0',null,options.isAppendX());
    if (options.isEncryptedX()) {
      options.log("String_Node_Str");
      final int tmpRight=options.getRightPrinting().getRight() | (options.isRightCopy() ? PdfWriter.ALLOW_COPY : 0) | (options.isRightAssembly() ? PdfWriter.ALLOW_ASSEMBLY : 0)| (options.isRightFillIn() ? PdfWriter.ALLOW_FILL_IN : 0)| (options.isRightScreanReaders() ? PdfWriter.ALLOW_SCREENREADERS : 0)| (options.isRightModifyAnnotations() ? PdfWriter.ALLOW_MODIFY_ANNOTATIONS : 0)| (options.isRightModifyContents() ? PdfWriter.ALLOW_MODIFY_CONTENTS : 0);
      stp.setEncryption(true,options.getPdfUserPwdStr(),options.getPdfOwnerPwdStr(),tmpRight);
    }
    final PdfSignatureAppearance sap=stp.getSignatureAppearance();
    sap.setCrypto(key,chain,null,PdfSignatureAppearance.WINCER_SIGNED);
    if (!StringUtils.isEmpty(options.getReason())) {
      options.log("String_Node_Str",options.getReason());
      sap.setReason(options.getReason());
    }
    if (!StringUtils.isEmpty(options.getLocation())) {
      options.log("String_Node_Str",options.getLocation());
      sap.setLocation(options.getLocation());
    }
    options.log("String_Node_Str");
    sap.setCertificationLevel(options.getCertLevelX().getLevel());
    if (options.isVisible()) {
      options.log("String_Node_Str");
      options.log("String_Node_Str");
      sap.setAcro6Layers(true);
      final String tmpImgPath=options.getImgPath();
      if (tmpImgPath != null) {
        options.log("String_Node_Str",tmpImgPath);
        final Image img=Image.getInstance(tmpImgPath);
        options.log("String_Node_Str");
        sap.setSignatureGraphic(img);
      }
      final String tmpBgImgPath=options.getBgImgPath();
      if (tmpBgImgPath != null) {
        options.log("String_Node_Str",tmpBgImgPath);
        final Image img=Image.getInstance(tmpBgImgPath);
        options.log("String_Node_Str");
        sap.setImage(img);
      }
      options.log("String_Node_Str");
      sap.setImageScale(options.getBgImgScale());
      options.log("String_Node_Str");
      sap.setLayer2Text(options.getL2Text());
      options.log("String_Node_Str");
      sap.setLayer4Text(options.getL4Text());
      options.log("String_Node_Str");
      sap.setRender(options.getRenderMode().getRender());
      options.log("String_Node_Str");
      sap.setVisibleSignature(new Rectangle(options.getPositionLLX(),options.getPositionLLY(),options.getPositionURX(),options.getPositionURY()),options.getPage(),null);
    }
    options.log("String_Node_Str");
    stp.close();
    options.log("String_Node_Str");
    fout.close();
    tmpResult=true;
  }
 catch (  Exception e) {
    options.log("String_Node_Str");
    e.printStackTrace(options.getPrintWriter());
  }
catch (  OutOfMemoryError e) {
    e.printStackTrace(options.getPrintWriter());
    options.log("String_Node_Str");
  }
  options.log("String_Node_Str" + (tmpResult ? "String_Node_Str" : "String_Node_Str"));
  options.fireSignerFinishedEvent(tmpResult);
}

Fixed version (ground truth):
public void run(){
  if (options == null) {
    throw new NullPointerException("String_Node_Str");
  }
  boolean tmpResult=false;
  try {
    options.log("String_Node_Str",options.getKsType());
    final KeyStore ks=KeyStore.getInstance(options.getKsType());
    InputStream ksInputStream=null;
    if (!StringUtils.isEmpty(options.getKsFile())) {
      options.log("String_Node_Str",options.getKsFile());
      ksInputStream=new FileInputStream(options.getKsFile());
    }
    ks.load(ksInputStream,options.getKsPasswd());
    options.log("String_Node_Str");
    String tmpAlias=options.getKeyAliasX();
    if (tmpAlias == null || tmpAlias.length() == 0) {
      final String tmpAliases[]=KeyStoreUtils.getKeyAliases(options);
      if (tmpAliases != null && tmpAliases.length > 0) {
        tmpAlias=tmpAliases[0];
      }
    }
    options.log("String_Node_Str");
    final PrivateKey key=(PrivateKey)ks.getKey(tmpAlias,options.getKeyPasswdX());
    options.log("String_Node_Str");
    final Certificate[] chain=ks.getCertificateChain(tmpAlias);
    options.log("String_Node_Str",options.getInFile());
    PdfReader reader;
    try {
      reader=new PdfReader(options.getInFile());
    }
 catch (    Exception e) {
      try {
        reader=new PdfReader(options.getInFile(),new byte[0]);
      }
 catch (      Exception e2) {
        reader=new PdfReader(options.getInFile(),options.getPdfOwnerPwdStr().getBytes());
      }
    }
    options.log("String_Node_Str",options.getOutFile());
    final FileOutputStream fout=new FileOutputStream(options.getOutFile());
    options.log("String_Node_Str");
    final PdfStamper stp=PdfStamper.createSignature(reader,fout,'\0',null,options.isAppendX());
    if (options.isEncryptedX()) {
      options.log("String_Node_Str");
      final int tmpRight=options.getRightPrinting().getRight() | (options.isRightCopy() ? PdfWriter.ALLOW_COPY : 0) | (options.isRightAssembly() ? PdfWriter.ALLOW_ASSEMBLY : 0)| (options.isRightFillIn() ? PdfWriter.ALLOW_FILL_IN : 0)| (options.isRightScreanReaders() ? PdfWriter.ALLOW_SCREENREADERS : 0)| (options.isRightModifyAnnotations() ? PdfWriter.ALLOW_MODIFY_ANNOTATIONS : 0)| (options.isRightModifyContents() ? PdfWriter.ALLOW_MODIFY_CONTENTS : 0);
      stp.setEncryption(true,options.getPdfUserPwdStr(),options.getPdfOwnerPwdStr(),tmpRight);
    }
    final PdfSignatureAppearance sap=stp.getSignatureAppearance();
    sap.setCrypto(key,chain,null,PdfSignatureAppearance.WINCER_SIGNED);
    if (!StringUtils.isEmpty(options.getReason())) {
      options.log("String_Node_Str",options.getReason());
      sap.setReason(options.getReason());
    }
    if (!StringUtils.isEmpty(options.getLocation())) {
      options.log("String_Node_Str",options.getLocation());
      sap.setLocation(options.getLocation());
    }
    options.log("String_Node_Str");
    sap.setCertificationLevel(options.getCertLevelX().getLevel());
    if (options.isVisible()) {
      options.log("String_Node_Str");
      options.log("String_Node_Str");
      sap.setAcro6Layers(true);
      final String tmpImgPath=options.getImgPath();
      if (tmpImgPath != null) {
        options.log("String_Node_Str",tmpImgPath);
        final Image img=Image.getInstance(tmpImgPath);
        options.log("String_Node_Str");
        sap.setSignatureGraphic(img);
      }
      final String tmpBgImgPath=options.getBgImgPath();
      if (tmpBgImgPath != null) {
        options.log("String_Node_Str",tmpBgImgPath);
        final Image img=Image.getInstance(tmpBgImgPath);
        options.log("String_Node_Str");
        sap.setImage(img);
      }
      options.log("String_Node_Str");
      sap.setImageScale(options.getBgImgScale());
      options.log("String_Node_Str");
      sap.setLayer2Text(options.getL2Text());
      options.log("String_Node_Str");
      sap.setLayer4Text(options.getL4Text());
      options.log("String_Node_Str");
      sap.setRender(options.getRenderMode().getRender());
      options.log("String_Node_Str");
      sap.setVisibleSignature(new Rectangle(options.getPositionLLX(),options.getPositionLLY(),options.getPositionURX(),options.getPositionURY()),options.getPage(),null);
    }
    options.log("String_Node_Str");
    stp.close();
    options.log("String_Node_Str");
    fout.close();
    tmpResult=true;
  }
 catch (  Exception e) {
    options.log("String_Node_Str");
    e.printStackTrace(options.getPrintWriter());
  }
catch (  OutOfMemoryError e) {
    e.printStackTrace(options.getPrintWriter());
    options.log("String_Node_Str");
  }
  options.log("String_Node_Str" + (tmpResult ? "String_Node_Str" : "String_Node_Str"));
  options.fireSignerFinishedEvent(tmpResult);
}