Program: 68986
Project: 68986
Buggy source:
@RequestMapping(value="String_Node_Str",method=POST,consumes=APPLICATION_JSON_UTF8_VALUE,produces=APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<?> register(@Valid @RequestBody RegisterRequest registerRequest,@Context HttpServletRequest httpServletRequest) throws BaseException {
  String ipAddress=httpServletRequest.getHeader("String_Node_Str");
  if (ipAddress == null)   ipAddress=httpServletRequest.getRemoteAddr();
  LOG.info("String_Node_Str",ipAddress,registerRequest.getEmail());
  URI uri=null;
  try {
    String emailConfirmationToken=null;
    Optional<Investor> oInvestor=investorRepository.findOptionalByEmail(registerRequest.getEmail());
    if (oInvestor.isPresent()) {
      emailConfirmationToken=oInvestor.get().getEmailConfirmationToken();
    }
 else {
      emailConfirmationToken=generateRandomUUID();
      oInvestor=Optional.of(createInvestor(registerRequest.getEmail(),emailConfirmationToken,ipAddress));
      Investor investor=oInvestor.get();
      investorRepository.save(investor);
      LOG.debug("String_Node_Str" + investor.getEmail() + "String_Node_Str"+ investor.getEmailConfirmationToken());
    }
    if (oInvestor.isPresent() && oInvestor.get().getWalletAddress() != null && oInvestor.get().getPayInBitcoinPublicKey() != null && oInvestor.get().getPayInEtherPublicKey() != null) {
      fileQueueService.addSummaryEmail(oInvestor.get());
      return ResponseEntity.ok().build();
    }
 else {
      uri=buildUri(emailConfirmationToken);
      fileQueueService.addConfirmationEmail(oInvestor.get(),uri);
      return ResponseEntity.created(uri).build();
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e.getMessage(),e.getCause());
    throw new UnexpectedException();
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=POST,consumes=APPLICATION_JSON_UTF8_VALUE,produces=APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<?> register(@Valid @RequestBody RegisterRequest registerRequest,@Context HttpServletRequest httpServletRequest) throws BaseException {
  String ipAddress=httpServletRequest.getHeader("String_Node_Str");
  if (ipAddress == null)   ipAddress=httpServletRequest.getRemoteAddr();
  LOG.info("String_Node_Str",ipAddress,registerRequest.getEmail());
  try {
    String emailConfirmationToken=null;
    Optional<Investor> oInvestor=investorRepository.findOptionalByEmail(registerRequest.getEmail());
    if (oInvestor.isPresent()) {
      emailConfirmationToken=oInvestor.get().getEmailConfirmationToken();
    }
 else {
      emailConfirmationToken=generateRandomUUID();
      oInvestor=Optional.of(createInvestor(registerRequest.getEmail(),emailConfirmationToken,ipAddress));
      Investor investor=oInvestor.get();
      investorRepository.save(investor);
      LOG.debug("String_Node_Str" + investor.getEmail() + "String_Node_Str"+ investor.getEmailConfirmationToken());
    }
    if (oInvestor.isPresent() && oInvestor.get().getWalletAddress() != null && oInvestor.get().getPayInBitcoinPublicKey() != null && oInvestor.get().getPayInEtherPublicKey() != null) {
      fileQueueService.addSummaryEmail(oInvestor.get());
      return ResponseEntity.ok().build();
    }
 else {
      URI uri=new URI(frontendUrl);
      fileQueueService.addConfirmationEmail(oInvestor.get(),uri);
      return ResponseEntity.created(uri).build();
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e.getMessage(),e.getCause());
    throw new UnexpectedException();
  }
}