Program: 13147
Project: 13147
Buggy source:
@Override public Promise<ActionResponse,ResourceException> actionInstance(Context context,ActionRequest request){
  try {
    String alias=request.getContent().get("String_Node_Str").asString();
    if (ACTION_GENERATE_CERT.equalsIgnoreCase(request.getAction()) || ACTION_GENERATE_CSR.equalsIgnoreCase(request.getAction())) {
      if (alias == null) {
        return new BadRequestException("String_Node_Str").asPromise();
      }
      String algorithm=request.getContent().get("String_Node_Str").defaultTo(DEFAULT_ALGORITHM).asString();
      String signatureAlgorithm=request.getContent().get("String_Node_Str").defaultTo(DEFAULT_SIGNATURE_ALGORITHM).asString();
      int keySize=request.getContent().get("String_Node_Str").defaultTo(DEFAULT_KEY_SIZE).asInteger();
      JsonValue result=null;
      if (ACTION_GENERATE_CERT.equalsIgnoreCase(request.getAction())) {
        if (store.getStore().containsAlias(alias)) {
          return new ConflictException("String_Node_Str" + alias + "String_Node_Str").asPromise();
        }
 else {
          logger.info("String_Node_Str",alias);
          String domainName=request.getContent().get("String_Node_Str").required().asString();
          String validFrom=request.getContent().get("String_Node_Str").asString();
          String validTo=request.getContent().get("String_Node_Str").asString();
          Pair<X509Certificate,PrivateKey> pair=generateCertificate(domainName,algorithm,keySize,signatureAlgorithm,validFrom,validTo);
          Certificate cert=pair.getKey();
          PrivateKey key=pair.getValue();
          logger.debug("String_Node_Str",alias);
          store.getStore().setEntry(alias,new KeyStore.PrivateKeyEntry(key,new Certificate[]{cert}),new KeyStore.PasswordProtection(store.getPassword().toCharArray()));
          store.store();
          manager.reload();
          saveStore();
          result=returnCertificate(alias,cert);
          if (request.getContent().get("String_Node_Str").defaultTo(false).asBoolean()) {
            result.put("String_Node_Str",getKeyMap(key));
          }
        }
      }
 else {
        Pair<PKCS10CertificationRequest,PrivateKey> csr=generateCSR(alias,algorithm,signatureAlgorithm,keySize,request.getContent());
        result=returnCertificateRequest(alias,csr.getKey());
        if (request.getContent().get("String_Node_Str").defaultTo(false).asBoolean()) {
          result.put("String_Node_Str",getKeyMap(csr.getRight()));
        }
      }
      return Responses.newActionResponse(result).asPromise();
    }
 else {
      return new BadRequestException("String_Node_Str" + request.getAction()).asPromise();
    }
  }
 catch (  Exception e) {
    return new InternalServerErrorException(e).asPromise();
  }
}

Fixed version (ground truth):
@Override public Promise<ActionResponse,ResourceException> actionInstance(Context context,ActionRequest request){
  try {
    String alias=request.getContent().get("String_Node_Str").asString();
    if (ACTION_GENERATE_CERT.equalsIgnoreCase(request.getAction()) || ACTION_GENERATE_CSR.equalsIgnoreCase(request.getAction())) {
      if (alias == null) {
        return new BadRequestException("String_Node_Str").asPromise();
      }
      String algorithm=request.getContent().get("String_Node_Str").defaultTo(DEFAULT_ALGORITHM).asString();
      String signatureAlgorithm=request.getContent().get("String_Node_Str").defaultTo(DEFAULT_SIGNATURE_ALGORITHM).asString();
      int keySize=request.getContent().get("String_Node_Str").defaultTo(DEFAULT_KEY_SIZE).asInteger();
      JsonValue result=null;
      if (ACTION_GENERATE_CERT.equalsIgnoreCase(request.getAction())) {
        if (store.getStore().containsAlias(alias)) {
          return new ConflictException("String_Node_Str" + alias + "String_Node_Str").asPromise();
        }
 else {
          logger.info("String_Node_Str",alias);
          String domainName=request.getContent().get("String_Node_Str").required().asString();
          String validFrom=request.getContent().get("String_Node_Str").asString();
          String validTo=request.getContent().get("String_Node_Str").asString();
          Pair<X509Certificate,PrivateKey> pair=generateCertificate(domainName,algorithm,keySize,signatureAlgorithm,validFrom,validTo);
          Certificate cert=pair.getKey();
          PrivateKey key=pair.getValue();
          logger.debug("String_Node_Str",alias);
          store.getStore().setEntry(alias,new KeyStore.PrivateKeyEntry(key,new Certificate[]{cert}),new KeyStore.PasswordProtection(store.getPassword().toCharArray()));
          store.store();
          manager.reload();
          saveStore();
          result=returnCertificate(alias,cert);
          if (request.getContent().get("String_Node_Str").defaultTo(false).asBoolean()) {
            result.put("String_Node_Str",getKeyMap(key));
          }
        }
      }
 else {
        Pair<PKCS10CertificationRequest,PrivateKey> csr=generateCSR(alias,algorithm,signatureAlgorithm,keySize,request.getContent());
        result=returnCertificateRequest(alias,csr.getKey());
        if (request.getContent().get("String_Node_Str").defaultTo(false).asBoolean()) {
          result.put("String_Node_Str",getKeyMap(csr.getRight()));
        }
      }
      return Responses.newActionResponse(result).asPromise();
    }
 else {
      return new BadRequestException("String_Node_Str" + request.getAction()).asPromise();
    }
  }
 catch (  JsonValueException e) {
    return new BadRequestException(e.getMessage(),e).asPromise();
  }
catch (  Exception e) {
    return new InternalServerErrorException(e).asPromise();
  }
}