Program: 52399
Project: 52399
Buggy source:
public void performTest() throws Exception {
  CertificateFactory cf=CertificateFactory.getInstance("String_Node_Str","String_Node_Str");
  X509Certificate rootCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.rootCertBin));
  X509Certificate interCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.interCertBin));
  X509Certificate finalCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.finalCertBin));
  X509CRL rootCrl=(X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.rootCrlBin));
  X509CRL interCrl=(X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.interCrlBin));
  List list=new ArrayList();
  list.add(rootCert);
  list.add(interCert);
  list.add(finalCert);
  list.add(rootCrl);
  list.add(interCrl);
  CollectionCertStoreParameters ccsp=new CollectionCertStoreParameters(list);
  CertStore store=CertStore.getInstance("String_Node_Str",ccsp,"String_Node_Str");
  Date validDate=new Date(rootCrl.getThisUpdate().getTime() + 60 * 60 * 1000);
  List certchain=new ArrayList();
  certchain.add(finalCert);
  certchain.add(interCert);
  CertPath cp=CertificateFactory.getInstance("String_Node_Str","String_Node_Str").generateCertPath(certchain);
  Set trust=new HashSet();
  trust.add(new TrustAnchor(rootCert,null));
  CertPathValidator cpv=CertPathValidator.getInstance("String_Node_Str","String_Node_Str");
  PKIXParameters param=new PKIXParameters(trust);
  param.addCertStore(store);
  param.setDate(validDate);
  MyChecker checker=new MyChecker();
  param.addCertPathChecker(checker);
  PKIXCertPathValidatorResult result=(PKIXCertPathValidatorResult)cpv.validate(cp,param);
  PolicyNode policyTree=result.getPolicyTree();
  PublicKey subjectPublicKey=result.getPublicKey();
  if (checker.getCount() != 2) {
    fail("String_Node_Str");
  }
  if (!subjectPublicKey.equals(finalCert.getPublicKey())) {
    fail("String_Node_Str");
  }
  try {
    rootCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(AC_RAIZ_ICPBRASIL));
    interCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(AC_PR));
    finalCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(schefer));
    list=new ArrayList();
    list.add(rootCert);
    list.add(interCert);
    list.add(finalCert);
    ccsp=new CollectionCertStoreParameters(list);
    store=CertStore.getInstance("String_Node_Str",ccsp);
    validDate=new Date(finalCert.getNotBefore().getTime() + 60 * 60 * 1000);
    certchain=new ArrayList();
    certchain.add(finalCert);
    certchain.add(interCert);
    cp=CertificateFactory.getInstance("String_Node_Str","String_Node_Str").generateCertPath(certchain);
    trust=new HashSet();
    trust.add(new TrustAnchor(rootCert,null));
    cpv=CertPathValidator.getInstance("String_Node_Str","String_Node_Str");
    param=new PKIXParameters(trust);
    param.addCertStore(store);
    param.setRevocationEnabled(false);
    param.setDate(validDate);
    result=(PKIXCertPathValidatorResult)cpv.validate(cp,param);
    policyTree=result.getPolicyTree();
    subjectPublicKey=result.getPublicKey();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    if (!(e instanceof CertPathValidatorException && e.getMessage().startsWith("String_Node_Str"))) {
      fail("String_Node_Str",e);
    }
  }
  checkCircProcessing();
  checkPolicyProcessingAtDomainMatch();
  validateWithExtendedKeyUsage();
  testEmptyPath();
  checkInvalidCertPath();
}

Fixed version (ground truth):
public void performTest() throws Exception {
  CertificateFactory cf=CertificateFactory.getInstance("String_Node_Str","String_Node_Str");
  X509Certificate rootCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.rootCertBin));
  X509Certificate interCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.interCertBin));
  X509Certificate finalCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.finalCertBin));
  X509CRL rootCrl=(X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.rootCrlBin));
  X509CRL interCrl=(X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.interCrlBin));
  List list=new ArrayList();
  list.add(rootCert);
  list.add(interCert);
  list.add(finalCert);
  list.add(rootCrl);
  list.add(interCrl);
  CollectionCertStoreParameters ccsp=new CollectionCertStoreParameters(list);
  CertStore store=CertStore.getInstance("String_Node_Str",ccsp,"String_Node_Str");
  Date validDate=new Date(rootCrl.getThisUpdate().getTime() + 60 * 60 * 1000);
  List certchain=new ArrayList();
  certchain.add(finalCert);
  certchain.add(interCert);
  CertPath cp=CertificateFactory.getInstance("String_Node_Str","String_Node_Str").generateCertPath(certchain);
  Set trust=new HashSet();
  trust.add(new TrustAnchor(rootCert,null));
  CertPathValidator cpv=CertPathValidator.getInstance("String_Node_Str","String_Node_Str");
  PKIXParameters param=new PKIXParameters(trust);
  param.addCertStore(store);
  param.setDate(validDate);
  MyChecker checker=new MyChecker();
  param.addCertPathChecker(checker);
  PKIXCertPathValidatorResult result=(PKIXCertPathValidatorResult)cpv.validate(cp,param);
  PolicyNode policyTree=result.getPolicyTree();
  PublicKey subjectPublicKey=result.getPublicKey();
  if (checker.getCount() != 2) {
    fail("String_Node_Str");
  }
  if (!subjectPublicKey.equals(finalCert.getPublicKey())) {
    fail("String_Node_Str");
  }
  isTrue(result.getTrustAnchor().getTrustedCert().equals(rootCert));
  certchain.clear();
  certchain.add(finalCert);
  certchain.add(interCert);
  certchain.add(rootCert);
  cp=CertificateFactory.getInstance("String_Node_Str","String_Node_Str").generateCertPath(certchain);
  cpv=CertPathValidator.getInstance("String_Node_Str","String_Node_Str");
  param=new PKIXParameters(trust);
  param.addCertStore(store);
  param.setDate(validDate);
  result=(PKIXCertPathValidatorResult)cpv.validate(cp,param);
  isTrue(result.getTrustAnchor().getTrustedCert().equals(rootCert));
  try {
    rootCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(AC_RAIZ_ICPBRASIL));
    interCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(AC_PR));
    finalCert=(X509Certificate)cf.generateCertificate(new ByteArrayInputStream(schefer));
    list=new ArrayList();
    list.add(rootCert);
    list.add(interCert);
    list.add(finalCert);
    ccsp=new CollectionCertStoreParameters(list);
    store=CertStore.getInstance("String_Node_Str",ccsp);
    validDate=new Date(finalCert.getNotBefore().getTime() + 60 * 60 * 1000);
    certchain=new ArrayList();
    certchain.add(finalCert);
    certchain.add(interCert);
    cp=CertificateFactory.getInstance("String_Node_Str","String_Node_Str").generateCertPath(certchain);
    trust=new HashSet();
    trust.add(new TrustAnchor(rootCert,null));
    cpv=CertPathValidator.getInstance("String_Node_Str","String_Node_Str");
    param=new PKIXParameters(trust);
    param.addCertStore(store);
    param.setRevocationEnabled(false);
    param.setDate(validDate);
    result=(PKIXCertPathValidatorResult)cpv.validate(cp,param);
    policyTree=result.getPolicyTree();
    subjectPublicKey=result.getPublicKey();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    if (!(e instanceof CertPathValidatorException && e.getMessage().startsWith("String_Node_Str"))) {
      fail("String_Node_Str",e);
    }
  }
  checkCircProcessing();
  checkPolicyProcessingAtDomainMatch();
  validateWithExtendedKeyUsage();
  testEmptyPath();
  checkInvalidCertPath();
}