Skip to content

Commit

Permalink
refactor for guava update
Browse files Browse the repository at this point in the history
  • Loading branch information
justinvforvendetta committed Aug 19, 2024
1 parent 58118fd commit 5b8cea3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
3 changes: 1 addition & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ compileJava {

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])

api 'com.google.guava:guava:20.0' //TODO ToStringHelper update for updating to ?
api 'com.google.guava:guava:21.0' //TODO ToStringHelper update for updating to ?
api 'com.google.code.findbugs:jsr305:3.0.2'
api 'com.madgag.spongycastle:core:1.58.0.0'
api 'com.lambdaworks:scrypt:1.4.0'
Expand Down
29 changes: 15 additions & 14 deletions core/src/main/java/com/vergepay/core/wallet/SendRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package com.vergepay.core.wallet;


import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.vergepay.core.coins.CoinType;
import com.vergepay.core.coins.Value;
import com.vergepay.core.messages.TxMessage;
Expand Down Expand Up @@ -184,17 +182,20 @@ public void setCompleted(boolean completed) {

@Override
public String toString() {
// print only the user-settable fields
ToStringHelper helper = Objects.toStringHelper(this).omitNullValues();
helper.add("emptyWallet", emptyWallet);
helper.add("changeAddress", changeAddress);
helper.add("fee", fee);
helper.add("feePerTxSize", feePerTxSize);
helper.add("ensureMinRequiredFee", ensureMinRequiredFee);
helper.add("signTransaction", signTransaction);
helper.add("aesKey", aesKey != null ? "set" : null); // careful to not leak the key
helper.add("coinSelector", coinSelector);
helper.add("shuffleOutputs", shuffleOutputs);
return helper.toString();
StringBuilder sb = new StringBuilder();
sb.append("SendRequest{");

if (emptyWallet) sb.append("emptyWallet=").append(emptyWallet).append(", ");
if (changeAddress != null) sb.append("changeAddress=").append(changeAddress).append(", ");
if (fee != null) sb.append("fee=").append(fee).append(", ");
if (feePerTxSize != null) sb.append("feePerTxSize=").append(feePerTxSize).append(", ");
sb.append("ensureMinRequiredFee=").append(ensureMinRequiredFee).append(", ");
sb.append("signTransaction=").append(signTransaction).append(", ");
if (aesKey != null) sb.append("aesKey=set, ");
if (coinSelector != null) sb.append("coinSelector=").append(coinSelector).append(", ");
sb.append("shuffleOutputs=").append(shuffleOutputs);

sb.append("}");
return sb.toString();
}
}

0 comments on commit 5b8cea3

Please sign in to comment.