Program: 24612
Project: 24612
Buggy source:
/** 
 * This method persists a new wallet transaction to the database.
 * @param row The  {@link Node} containing the transaction data.
 * @param apiKey The apiKey used to retrieve this transaction from the API.
 * @param brokerRelation The level of the broker relation skill.
 * @param accounting The level of the accounting skill.
 * @return True if the transaction was persisted, or false if it was not.
 */
@Transactional boolean persistChangeData(Node row,ApiKey apiKey,int brokerRelation,int accounting){
  Session session=getDatabase().getCurrentSession();
  try {
    Timestamp currentTime=TimeUtils.convertToTimestamp(row.getAttribute("String_Node_Str"));
    long transactionID=Long.parseLong(row.getAttribute("String_Node_Str"));
    long quantity=Long.parseLong(row.getAttribute("String_Node_Str"));
    String typeName=row.getAttribute("String_Node_Str");
    long typeId=Long.parseLong(row.getAttribute("String_Node_Str"));
    BigDecimal price=BigDecimal.valueOf(Float.parseFloat(row.getAttribute("String_Node_Str")));
    long clientId=Long.parseLong(row.getAttribute("String_Node_Str"));
    String clientName=row.getAttribute("String_Node_Str");
    long stationId=Long.parseLong(row.getAttribute("String_Node_Str"));
    String stationName=row.getAttribute("String_Node_Str");
    boolean isBuy=("String_Node_Str").equals(row.getAttribute("String_Node_Str"));
    boolean isPersonal=("String_Node_Str").equals(row.getAttribute("String_Node_Str"));
    BigDecimal corporationStanding=getCorporationStanding(apiKey,stationId);
    BigDecimal factionStanding=getFactionStanding(apiKey,stationId);
    BigDecimal taxes=(BigDecimal.valueOf(0.01).subtract(BigDecimal.valueOf(0.0005).multiply(BigDecimal.valueOf(brokerRelation)))).divide(BigDecimal.valueOf(Math.exp(((BigDecimal.valueOf(0.1).multiply(factionStanding)).add(BigDecimal.valueOf(0.04).multiply(corporationStanding)).doubleValue()))),3,RoundingMode.HALF_UP);
    if (!isBuy) {
      taxes=taxes.add(BigDecimal.valueOf(0.01).subtract(BigDecimal.valueOf(0.001).multiply(BigDecimal.valueOf(accounting))));
    }
    WalletTransaction transaction=(WalletTransaction)session.get(WalletTransaction.class,transactionID);
    if (transaction == null) {
      BigDecimal actualPrice=price;
      if (isBuy) {
        actualPrice=price.negate();
      }
      transaction=new WalletTransaction();
      transaction.setTransactionId(transactionID);
      transaction.setTransactionDateTime(currentTime);
      transaction.setCharacterId(apiKey.getCharacterId());
      transaction.setQuantity(quantity);
      transaction.setRemaining(quantity);
      transaction.setTypeName(typeName);
      transaction.setTypeId(typeId);
      transaction.setPrice(actualPrice);
      transaction.setTaxes(taxes.multiply(price.abs()).negate());
      transaction.setClientId(clientId);
      transaction.setClientName(clientName);
      transaction.setStationId(stationId);
      transaction.setStationName(stationName);
      transaction.setPersonal(isPersonal);
      session.save(transaction);
      return true;
    }
  }
 catch (  Exception e) {
    LOG.error(e.getLocalizedMessage(),e);
    dialog.setVisible(true);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * This method persists a new wallet transaction to the database.
 * @param row The  {@link Node} containing the transaction data.
 * @param apiKey The apiKey used to retrieve this transaction from the API.
 * @param brokerRelation The level of the broker relation skill.
 * @param accounting The level of the accounting skill.
 * @return True if the transaction was persisted, or false if it was not.
 */
@Transactional boolean persistChangeData(Node row,ApiKey apiKey,int brokerRelation,int accounting){
  Session session=getDatabase().getCurrentSession();
  try {
    Timestamp currentTime=TimeUtils.convertToTimestamp(row.getAttribute("String_Node_Str"));
    long transactionID=Long.parseLong(row.getAttribute("String_Node_Str"));
    long quantity=Long.parseLong(row.getAttribute("String_Node_Str"));
    String typeName=row.getAttribute("String_Node_Str");
    long typeId=Long.parseLong(row.getAttribute("String_Node_Str"));
    BigDecimal price=BigDecimal.valueOf(Float.parseFloat(row.getAttribute("String_Node_Str")));
    long clientId=Long.parseLong(row.getAttribute("String_Node_Str"));
    String clientName=row.getAttribute("String_Node_Str");
    long stationId=Long.parseLong(row.getAttribute("String_Node_Str"));
    String stationName=row.getAttribute("String_Node_Str");
    boolean isBuy=("String_Node_Str").equals(row.getAttribute("String_Node_Str"));
    boolean isPersonal=("String_Node_Str").equals(row.getAttribute("String_Node_Str"));
    double corporationStanding=getCorporationStanding(apiKey,stationId);
    double factionStanding=getFactionStanding(apiKey,stationId);
    double brokerFees=(0.01 - 0.0005 * brokerRelation / Math.pow(2.0,0.14 * factionStanding + 0.06 * corporationStanding));
    double marketTax=0.0;
    if (!isBuy) {
      marketTax+=0.01 - 0.0005 * accounting;
    }
    WalletTransaction transaction=(WalletTransaction)session.get(WalletTransaction.class,transactionID);
    if (transaction == null) {
      BigDecimal actualPrice=price;
      if (isBuy) {
        actualPrice=price.negate();
      }
      transaction=new WalletTransaction();
      transaction.setTransactionId(transactionID);
      transaction.setTransactionDateTime(currentTime);
      transaction.setCharacterId(apiKey.getCharacterId());
      transaction.setQuantity(quantity);
      transaction.setRemaining(quantity);
      transaction.setTypeName(typeName);
      transaction.setTypeId(typeId);
      transaction.setPrice(actualPrice);
      transaction.setTaxes(BigDecimal.valueOf(brokerFees + marketTax).multiply(price.abs()).negate());
      transaction.setClientId(clientId);
      transaction.setClientName(clientName);
      transaction.setStationId(stationId);
      transaction.setStationName(stationName);
      transaction.setPersonal(isPersonal);
      session.save(transaction);
      return true;
    }
  }
 catch (  Exception e) {
    LOG.error(e.getLocalizedMessage(),e);
    dialog.setVisible(true);
  }
  return false;
}