diff --git a/core/src/main/java/org/bitcoinj/core/PeerEventListener.java b/core/src/main/java/org/bitcoinj/core/PeerEventListener.java index c9a68905..998edfdb 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerEventListener.java +++ b/core/src/main/java/org/bitcoinj/core/PeerEventListener.java @@ -31,7 +31,7 @@ public interface PeerEventListener { * * @param peerAddresses the set of discovered {@link PeerAddress}es */ - public void onPeersDiscovered(Set peerAddresses); + void onPeersDiscovered(Set peerAddresses); // TODO: Fix the Block/FilteredBlock type hierarchy so we can avoid the stupid typeless API here. /** @@ -45,7 +45,7 @@ public interface PeerEventListener { * @param filteredBlock if non-null, the object that wraps the block header passed as the block param. * @param blocksLeft the number of blocks left to download */ - public void onBlocksDownloaded(Peer peer, Block block, @Nullable FilteredBlock filteredBlock, int blocksLeft); + void onBlocksDownloaded(Peer peer, Block block, @Nullable FilteredBlock filteredBlock, int blocksLeft); /** * Called when a download is started with the initial number of blocks to be downloaded. @@ -53,7 +53,7 @@ public interface PeerEventListener { * @param peer the peer receiving the block * @param blocksLeft the number of blocks left to download */ - public void onChainDownloadStarted(Peer peer, int blocksLeft); + void onChainDownloadStarted(Peer peer, int blocksLeft); /** * Called when a peer is connected. If this listener is registered to a {@link Peer} instead of a {@link PeerGroup}, @@ -62,7 +62,7 @@ public interface PeerEventListener { * @param peer * @param peerCount the total number of connected peers */ - public void onPeerConnected(Peer peer, int peerCount); + void onPeerConnected(Peer peer, int peerCount); /** * Called when a peer is disconnected. Note that this won't be called if the listener is registered on a @@ -73,7 +73,7 @@ public interface PeerEventListener { * @param peer * @param peerCount the total number of connected peers */ - public void onPeerDisconnected(Peer peer, int peerCount); + void onPeerDisconnected(Peer peer, int peerCount); /** *

Called when a message is received by a peer, before the message is processed. The returned message is @@ -84,12 +84,12 @@ public interface PeerEventListener { *

Note that this will never be called if registered with any executor other than * {@link org.bitcoinj.utils.Threading#SAME_THREAD}

*/ - public Message onPreMessageReceived(Peer peer, Message m); + Message onPreMessageReceived(Peer peer, Message m); /** * Called when a new transaction is broadcast over the network. */ - public void onTransaction(Peer peer, Transaction t); + void onTransaction(Peer peer, Transaction t); /** *

Called when a peer receives a getdata message, usually in response to an "inv" being broadcast. Return as many @@ -99,5 +99,5 @@ public interface PeerEventListener { * {@link org.bitcoinj.utils.Threading#SAME_THREAD}

*/ @Nullable - public List getData(Peer peer, GetDataMessage m); + List getData(Peer peer, GetDataMessage m); } diff --git a/core/src/main/java/org/bitcoinj/core/PeerFilterProvider.java b/core/src/main/java/org/bitcoinj/core/PeerFilterProvider.java index cc5bebd1..ebc72076 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerFilterProvider.java +++ b/core/src/main/java/org/bitcoinj/core/PeerFilterProvider.java @@ -28,7 +28,7 @@ public interface PeerFilterProvider { * Blocks with timestamps before this time will only have headers downloaded. 0 requires that all blocks be * downloaded, and thus this should default to {@link System#currentTimeMillis()}/1000. */ - public long getEarliestKeyCreationTime(); + long getEarliestKeyCreationTime(); /** * Called on all registered filter providers before getBloomFilterElementCount and getBloomFilter are called. @@ -37,23 +37,23 @@ public interface PeerFilterProvider { * all of them will be specified. So the provider must use consistent state. There is guaranteed to be a matching * call to endBloomFilterCalculation that can be used to e.g. unlock a lock. */ - public void beginBloomFilterCalculation(); + void beginBloomFilterCalculation(); /** * Gets the number of elements that will be added to a bloom filter returned by * {@link PeerFilterProvider#getBloomFilter(int, double, long)} */ - public int getBloomFilterElementCount(); + int getBloomFilterElementCount(); /** * Gets a bloom filter that contains all the necessary elements for the listener to receive relevant transactions. * Default value should be an empty bloom filter with the given size, falsePositiveRate, and nTweak. */ - public BloomFilter getBloomFilter(int size, double falsePositiveRate, long nTweak); + BloomFilter getBloomFilter(int size, double falsePositiveRate, long nTweak); /** Whether this filter provider depends on the server updating the filter on all matches */ - public boolean isRequiringUpdateAllBloomFilter(); + boolean isRequiringUpdateAllBloomFilter(); - public void endBloomFilterCalculation(); + void endBloomFilterCalculation(); } diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java index daee11f9..e9dde0d8 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java +++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java @@ -1056,7 +1056,7 @@ public class PeerGroup implements TransactionBroadcaster { } } - public static enum FilterRecalculateMode { + public enum FilterRecalculateMode { SEND_IF_CHANGED, FORCE_SEND_FOR_REFRESH, DONT_SEND, diff --git a/core/src/main/java/org/bitcoinj/core/RejectMessage.java b/core/src/main/java/org/bitcoinj/core/RejectMessage.java index 0d0edf2b..02bc644f 100644 --- a/core/src/main/java/org/bitcoinj/core/RejectMessage.java +++ b/core/src/main/java/org/bitcoinj/core/RejectMessage.java @@ -26,7 +26,7 @@ public class RejectMessage extends Message { private static final long serialVersionUID = -5246995579800334336L; private String message, reason; - public static enum RejectCode { + public enum RejectCode { /** The message was not able to be parsed */ MALFORMED((byte) 0x01), /** The message described an invalid object */ diff --git a/core/src/main/java/org/bitcoinj/core/TransactionBag.java b/core/src/main/java/org/bitcoinj/core/TransactionBag.java index a5149f8b..305850d7 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionBag.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionBag.java @@ -26,17 +26,17 @@ import java.util.Map; */ public interface TransactionBag { /** Returns true if this wallet contains a public key which hashes to the given hash. */ - public boolean isPubKeyHashMine(byte[] pubkeyHash); + boolean isPubKeyHashMine(byte[] pubkeyHash); /** Returns true if this wallet is watching transactions for outputs with the script. */ - public boolean isWatchedScript(Script script); + boolean isWatchedScript(Script script); /** Returns true if this wallet contains a keypair with the given public key. */ - public boolean isPubKeyMine(byte[] pubkey); + boolean isPubKeyMine(byte[] pubkey); /** Returns true if this wallet knows the script corresponding to the given hash. */ - public boolean isPayToScriptHashMine(byte[] payToScriptHash); + boolean isPayToScriptHashMine(byte[] payToScriptHash); /** Returns transactions from a specific pool. */ - public Map getTransactionPool(WalletTransaction.Pool pool); + Map getTransactionPool(WalletTransaction.Pool pool); } diff --git a/core/src/main/java/org/bitcoinj/core/TransactionBroadcaster.java b/core/src/main/java/org/bitcoinj/core/TransactionBroadcaster.java index d4b7991d..da6c1877 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionBroadcaster.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionBroadcaster.java @@ -22,5 +22,5 @@ package org.bitcoinj.core; */ public interface TransactionBroadcaster { /** Broadcast the given transaction on the network */ - public TransactionBroadcast broadcastTransaction(final Transaction tx); + TransactionBroadcast broadcastTransaction(final Transaction tx); } diff --git a/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java b/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java index d4717261..970df248 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionConfidence.java @@ -160,7 +160,7 @@ public class TransactionConfidence implements Serializable { */ public interface Listener { /** An enum that describes why a transaction confidence listener is being invoked (i.e. the class of change). */ - public enum ChangeReason { + enum ChangeReason { /** * Occurs when the type returned by {@link org.bitcoinj.core.TransactionConfidence#getConfidenceType()} * has changed. For example, if a PENDING transaction changes to BUILDING or DEAD, then this reason will @@ -182,7 +182,7 @@ public class TransactionConfidence implements Serializable { */ SEEN_PEERS, } - public void onConfidenceChanged(TransactionConfidence confidence, ChangeReason reason); + void onConfidenceChanged(TransactionConfidence confidence, ChangeReason reason); } // This is used to ensure that confidence objects which aren't referenced from anywhere but which have an event diff --git a/core/src/main/java/org/bitcoinj/core/WalletExtension.java b/core/src/main/java/org/bitcoinj/core/WalletExtension.java index cd36c1ea..a47c5e34 100644 --- a/core/src/main/java/org/bitcoinj/core/WalletExtension.java +++ b/core/src/main/java/org/bitcoinj/core/WalletExtension.java @@ -28,17 +28,17 @@ package org.bitcoinj.core; */ public interface WalletExtension { /** Returns a Java package/class style name used to disambiguate this extension from others. */ - public String getWalletExtensionID(); + String getWalletExtensionID(); /** * If this returns true, the mandatory flag is set when the wallet is serialized and attempts to load it without * the extension being in the wallet will throw an exception. This method should not change its result during * the objects lifetime. */ - public boolean isWalletExtensionMandatory(); + boolean isWalletExtensionMandatory(); /** Returns bytes that will be saved in the wallet. */ - public byte[] serializeWalletExtension(); + byte[] serializeWalletExtension(); /** Loads the contents of this object from the wallet. */ - public void deserializeWalletExtension(Wallet containingWallet, byte[] data) throws Exception; + void deserializeWalletExtension(Wallet containingWallet, byte[] data) throws Exception; } diff --git a/core/src/main/java/org/bitcoinj/crypto/EncryptableItem.java b/core/src/main/java/org/bitcoinj/crypto/EncryptableItem.java index c860daed..798bb944 100644 --- a/core/src/main/java/org/bitcoinj/crypto/EncryptableItem.java +++ b/core/src/main/java/org/bitcoinj/crypto/EncryptableItem.java @@ -27,17 +27,19 @@ import javax.annotation.Nullable; */ public interface EncryptableItem { /** Returns whether the item is encrypted or not. If it is, then {@link #getSecretBytes()} will return null. */ - public boolean isEncrypted(); + boolean isEncrypted(); /** Returns the raw bytes of the item, if not encrypted, or null if encrypted or the secret is missing. */ - @Nullable public byte[] getSecretBytes(); + @Nullable + byte[] getSecretBytes(); /** Returns the initialization vector and encrypted secret bytes, or null if not encrypted. */ - @Nullable public EncryptedData getEncryptedData(); + @Nullable + EncryptedData getEncryptedData(); /** Returns an enum constant describing what algorithm was used to encrypt the key or UNENCRYPTED. */ - public Protos.Wallet.EncryptionType getEncryptionType(); + Protos.Wallet.EncryptionType getEncryptionType(); /** Returns the time in seconds since the UNIX epoch at which this encryptable item was first created/derived. */ - public long getCreationTimeSeconds(); + long getCreationTimeSeconds(); } diff --git a/core/src/main/java/org/bitcoinj/crypto/KeyCrypter.java b/core/src/main/java/org/bitcoinj/crypto/KeyCrypter.java index 67322351..3662c903 100644 --- a/core/src/main/java/org/bitcoinj/crypto/KeyCrypter.java +++ b/core/src/main/java/org/bitcoinj/crypto/KeyCrypter.java @@ -39,7 +39,7 @@ public interface KeyCrypter extends Serializable { * Return the EncryptionType enum value which denotes the type of encryption/ decryption that this KeyCrypter * can understand. */ - public EncryptionType getUnderstoodEncryptionType(); + EncryptionType getUnderstoodEncryptionType(); /** * Create a KeyParameter (which typically contains an AES key) @@ -47,14 +47,14 @@ public interface KeyCrypter extends Serializable { * @return KeyParameter The KeyParameter which typically contains the AES key to use for encrypting and decrypting * @throws KeyCrypterException */ - public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException; + KeyParameter deriveKey(CharSequence password) throws KeyCrypterException; /** * Decrypt the provided encrypted bytes, converting them into unencrypted bytes. * * @throws KeyCrypterException if decryption was unsuccessful. */ - public byte[] decrypt(EncryptedData encryptedBytesToDecode, KeyParameter aesKey) throws KeyCrypterException; + byte[] decrypt(EncryptedData encryptedBytesToDecode, KeyParameter aesKey) throws KeyCrypterException; /** * Encrypt the supplied bytes, converting them into ciphertext. @@ -62,5 +62,5 @@ public interface KeyCrypter extends Serializable { * @return encryptedPrivateKey An encryptedPrivateKey containing the encrypted bytes and an initialisation vector. * @throws KeyCrypterException if encryption was unsuccessful */ - public EncryptedData encrypt(byte[] plainBytes, KeyParameter aesKey) throws KeyCrypterException; + EncryptedData encrypt(byte[] plainBytes, KeyParameter aesKey) throws KeyCrypterException; } diff --git a/core/src/main/java/org/bitcoinj/crypto/TrustStoreLoader.java b/core/src/main/java/org/bitcoinj/crypto/TrustStoreLoader.java index 6aa7331a..39238f03 100644 --- a/core/src/main/java/org/bitcoinj/crypto/TrustStoreLoader.java +++ b/core/src/main/java/org/bitcoinj/crypto/TrustStoreLoader.java @@ -32,12 +32,12 @@ import java.security.KeyStoreException; * Windows, etc. */ public interface TrustStoreLoader { - public KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException; + KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException; - public static final String DEFAULT_KEYSTORE_TYPE = KeyStore.getDefaultType(); - public static final String DEFAULT_KEYSTORE_PASSWORD = "changeit"; + String DEFAULT_KEYSTORE_TYPE = KeyStore.getDefaultType(); + String DEFAULT_KEYSTORE_PASSWORD = "changeit"; - public class DefaultTrustStoreLoader implements TrustStoreLoader { + class DefaultTrustStoreLoader implements TrustStoreLoader { @Override public KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException { @@ -96,7 +96,7 @@ public interface TrustStoreLoader { } } - public class FileTrustStoreLoader implements TrustStoreLoader { + class FileTrustStoreLoader implements TrustStoreLoader { private final File path; public FileTrustStoreLoader(@Nonnull File path) throws FileNotFoundException { diff --git a/core/src/main/java/org/bitcoinj/net/ProtobufParser.java b/core/src/main/java/org/bitcoinj/net/ProtobufParser.java index 812afd02..64a441a3 100644 --- a/core/src/main/java/org/bitcoinj/net/ProtobufParser.java +++ b/core/src/main/java/org/bitcoinj/net/ProtobufParser.java @@ -51,11 +51,11 @@ public class ProtobufParser extends AbstractTim */ public interface Listener { /** Called when a new protobuf is received from the remote side. */ - public void messageReceived(ProtobufParser handler, MessageType msg); + void messageReceived(ProtobufParser handler, MessageType msg); /** Called when the connection is opened and available for writing data to. */ - public void connectionOpen(ProtobufParser handler); + void connectionOpen(ProtobufParser handler); /** Called when the connection is closed and no more data should be provided. */ - public void connectionClosed(ProtobufParser handler); + void connectionClosed(ProtobufParser handler); } // The callback listener diff --git a/core/src/main/java/org/bitcoinj/net/StreamParserFactory.java b/core/src/main/java/org/bitcoinj/net/StreamParserFactory.java index 9fcfe55b..50f1625f 100644 --- a/core/src/main/java/org/bitcoinj/net/StreamParserFactory.java +++ b/core/src/main/java/org/bitcoinj/net/StreamParserFactory.java @@ -28,5 +28,6 @@ public interface StreamParserFactory { * @param inetAddress The client's (IP) address * @param port The remote port on the client side */ - @Nullable public StreamParser getNewParser(InetAddress inetAddress, int port); + @Nullable + StreamParser getNewParser(InetAddress inetAddress, int port); } diff --git a/core/src/main/java/org/bitcoinj/protocols/channels/IPaymentChannelClient.java b/core/src/main/java/org/bitcoinj/protocols/channels/IPaymentChannelClient.java index 692911f4..398cf2ce 100644 --- a/core/src/main/java/org/bitcoinj/protocols/channels/IPaymentChannelClient.java +++ b/core/src/main/java/org/bitcoinj/protocols/channels/IPaymentChannelClient.java @@ -132,7 +132,7 @@ public interface IPaymentChannelClient { * @param expireTime The time, in seconds, when this channel will be closed by the server. Note this is in absolute time, i.e. seconds since 1970-01-01T00:00:00. * @return true if the proposed time is acceptable false otherwise. */ - public boolean acceptExpireTime(long expireTime); + boolean acceptExpireTime(long expireTime); /** *

Indicates the channel has been successfully opened and diff --git a/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServer.java b/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServer.java index 5484d98d..6db3178b 100644 --- a/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServer.java +++ b/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServer.java @@ -75,7 +75,7 @@ public class PaymentChannelServer { * *

Called while holding a lock on the {@link PaymentChannelServer} object - be careful about reentrancy

*/ - public void sendToClient(Protos.TwoWayChannelMessage msg); + void sendToClient(Protos.TwoWayChannelMessage msg); /** *

Requests that the connection to the client be closed

@@ -85,7 +85,7 @@ public class PaymentChannelServer { * @param reason The reason for the closure, see the individual values for more details. * It is usually safe to ignore this value. */ - public void destroyConnection(CloseReason reason); + void destroyConnection(CloseReason reason); /** *

Triggered when the channel is opened and payments can begin

@@ -94,7 +94,7 @@ public class PaymentChannelServer { * * @param contractHash A unique identifier which represents this channel (actually the hash of the multisig contract) */ - public void channelOpen(Sha256Hash contractHash); + void channelOpen(Sha256Hash contractHash); /** *

Called when the payment in this channel was successfully incremented by the client

@@ -107,7 +107,7 @@ public class PaymentChannelServer { * @return A future that completes with the ack message that will be included in the PaymentAck message to the client. Use null for no ack message. */ @Nullable - public ListenableFuture paymentIncrease(Coin by, Coin to, @Nullable ByteString info); + ListenableFuture paymentIncrease(Coin by, Coin to, @Nullable ByteString info); } private final ServerConnection conn; diff --git a/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerListener.java b/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerListener.java index 286d7014..a33ca0c1 100644 --- a/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerListener.java +++ b/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerListener.java @@ -58,12 +58,13 @@ public class PaymentChannelServerListener { /** * A factory which generates connection-specific event handlers. */ - public static interface HandlerFactory { + public interface HandlerFactory { /** * Called when a new connection completes version handshake to get a new connection-specific listener. * If null is returned, the connection is immediately closed. */ - @Nullable public ServerConnectionEventHandler onNewConnection(SocketAddress clientAddress); + @Nullable + ServerConnectionEventHandler onNewConnection(SocketAddress clientAddress); } private class ServerHandler { diff --git a/core/src/main/java/org/bitcoinj/signers/TransactionSigner.java b/core/src/main/java/org/bitcoinj/signers/TransactionSigner.java index 884cd335..1662850d 100644 --- a/core/src/main/java/org/bitcoinj/signers/TransactionSigner.java +++ b/core/src/main/java/org/bitcoinj/signers/TransactionSigner.java @@ -38,7 +38,7 @@ public interface TransactionSigner { * This class wraps transaction proposed to complete keeping a metadata that may be updated, used and effectively * shared by transaction signers. */ - public class ProposedTransaction { + class ProposedTransaction { public final Transaction partialTx; @@ -57,7 +57,7 @@ public interface TransactionSigner { } } - public static class MissingSignatureException extends RuntimeException { + class MissingSignatureException extends RuntimeException { } /** diff --git a/core/src/main/java/org/bitcoinj/utils/TaggableObject.java b/core/src/main/java/org/bitcoinj/utils/TaggableObject.java index 36eac85d..65469fa7 100644 --- a/core/src/main/java/org/bitcoinj/utils/TaggableObject.java +++ b/core/src/main/java/org/bitcoinj/utils/TaggableObject.java @@ -32,5 +32,5 @@ public interface TaggableObject { void setTag(String tag, ByteString value); /** Returns a copy of all the tags held by this object. */ - public Map getTags(); + Map getTags(); } diff --git a/core/src/main/java/org/bitcoinj/wallet/CoinSelector.java b/core/src/main/java/org/bitcoinj/wallet/CoinSelector.java index d0a80a15..b62d67ea 100644 --- a/core/src/main/java/org/bitcoinj/wallet/CoinSelector.java +++ b/core/src/main/java/org/bitcoinj/wallet/CoinSelector.java @@ -17,5 +17,5 @@ public interface CoinSelector { * this call and can be edited freely. See the docs for CoinSelection to learn more, or look a the implementation * of {@link DefaultCoinSelector}. */ - public CoinSelection select(Coin target, List candidates); + CoinSelection select(Coin target, List candidates); } diff --git a/core/src/main/java/org/bitcoinj/wallet/EncryptableKeyChain.java b/core/src/main/java/org/bitcoinj/wallet/EncryptableKeyChain.java index a4e9103c..0a178100 100644 --- a/core/src/main/java/org/bitcoinj/wallet/EncryptableKeyChain.java +++ b/core/src/main/java/org/bitcoinj/wallet/EncryptableKeyChain.java @@ -33,19 +33,19 @@ public interface EncryptableKeyChain extends KeyChain { * * @return The derived key, in case you wish to cache it for future use. */ - public EncryptableKeyChain toEncrypted(CharSequence password); + EncryptableKeyChain toEncrypted(CharSequence password); /** * Returns a new keychain holding identical/cloned keys to this chain, but encrypted under the given key. * Old keys and keychains remain valid and so you should ensure you don't accidentally hold references to them. */ - public EncryptableKeyChain toEncrypted(KeyCrypter keyCrypter, KeyParameter aesKey); + EncryptableKeyChain toEncrypted(KeyCrypter keyCrypter, KeyParameter aesKey); /** * Decrypts the key chain with the given password. See {@link #toDecrypted(org.spongycastle.crypto.params.KeyParameter)} * for details. */ - public EncryptableKeyChain toDecrypted(CharSequence password); + EncryptableKeyChain toDecrypted(CharSequence password); /** * Decrypt the key chain with the given AES key and whatever {@link KeyCrypter} is already set. Note that if you @@ -56,12 +56,12 @@ public interface EncryptableKeyChain extends KeyChain { * create from a password) * @throws KeyCrypterException Thrown if the wallet decryption fails. If so, the wallet state is unchanged. */ - public EncryptableKeyChain toDecrypted(KeyParameter aesKey); + EncryptableKeyChain toDecrypted(KeyParameter aesKey); - public boolean checkPassword(CharSequence password); - public boolean checkAESKey(KeyParameter aesKey); + boolean checkPassword(CharSequence password); + boolean checkAESKey(KeyParameter aesKey); /** Returns the key crypter used by this key chain, or null if it's not encrypted. */ @Nullable - public KeyCrypter getKeyCrypter(); + KeyCrypter getKeyCrypter(); } diff --git a/core/src/main/java/org/bitcoinj/wallet/KeyBag.java b/core/src/main/java/org/bitcoinj/wallet/KeyBag.java index 231db858..bb8b6126 100644 --- a/core/src/main/java/org/bitcoinj/wallet/KeyBag.java +++ b/core/src/main/java/org/bitcoinj/wallet/KeyBag.java @@ -32,7 +32,7 @@ public interface KeyBag { * @return ECKey object or null if no such key was found. */ @Nullable - public ECKey findKeyFromPubHash(byte[] pubkeyHash); + ECKey findKeyFromPubHash(byte[] pubkeyHash); /** * Locates a keypair from the keychain given the raw public key bytes. @@ -40,7 +40,7 @@ public interface KeyBag { * @return ECKey or null if no such key was found. */ @Nullable - public ECKey findKeyFromPubKey(byte[] pubkey); + ECKey findKeyFromPubKey(byte[] pubkey); /** * Locates a redeem data (redeem script and keys) from the keychain given the hash of the script. @@ -50,6 +50,6 @@ public interface KeyBag { * Returns RedeemData object or null if no such data was found. */ @Nullable - public RedeemData findRedeemDataFromScriptHash(byte[] scriptHash); + RedeemData findRedeemDataFromScriptHash(byte[] scriptHash); } diff --git a/core/src/main/java/org/bitcoinj/wallet/KeyChain.java b/core/src/main/java/org/bitcoinj/wallet/KeyChain.java index 33119780..85e50379 100644 --- a/core/src/main/java/org/bitcoinj/wallet/KeyChain.java +++ b/core/src/main/java/org/bitcoinj/wallet/KeyChain.java @@ -35,9 +35,9 @@ import java.util.concurrent.Executor; */ public interface KeyChain { /** Returns true if the given key is in the chain. */ - public boolean hasKey(ECKey key); + boolean hasKey(ECKey key); - public enum KeyPurpose { + enum KeyPurpose { RECEIVE_FUNDS, CHANGE, REFUND, @@ -45,38 +45,38 @@ public interface KeyChain { } /** Obtains a number of key/s intended for the given purpose. The chain may create new key/s, derive, or re-use an old one. */ - public List getKeys(KeyPurpose purpose, int numberOfKeys); + List getKeys(KeyPurpose purpose, int numberOfKeys); /** Obtains a key intended for the given purpose. The chain may create a new key, derive one, or re-use an old one. */ - public ECKey getKey(KeyPurpose purpose); + ECKey getKey(KeyPurpose purpose); /** Returns a list of keys serialized to the bitcoinj protobuf format. */ - public List serializeToProtobuf(); + List serializeToProtobuf(); /** Adds a listener for events that are run when keys are added, on the user thread. */ - public void addEventListener(KeyChainEventListener listener); + void addEventListener(KeyChainEventListener listener); /** Adds a listener for events that are run when keys are added, on the given executor. */ - public void addEventListener(KeyChainEventListener listener, Executor executor); + void addEventListener(KeyChainEventListener listener, Executor executor); /** Removes a listener for events that are run when keys are added. */ - public boolean removeEventListener(KeyChainEventListener listener); + boolean removeEventListener(KeyChainEventListener listener); /** Returns the number of keys this key chain manages. */ - public int numKeys(); + int numKeys(); /** * Returns the number of elements this chain wishes to insert into the Bloom filter. The size passed to * {@link #getFilter(int, double, long)} should be at least this large. */ - public int numBloomFilterEntries(); + int numBloomFilterEntries(); /** *

Returns the earliest creation time of keys in this chain, in seconds since the epoch. This can return zero * if at least one key does not have that data (was created before key timestamping was implemented). If there * are no keys in the wallet, {@link Long#MAX_VALUE} is returned.

*/ - public long getEarliestKeyCreationTime(); + long getEarliestKeyCreationTime(); /** *

Gets a bloom filter that contains all of the public keys from this chain, and which will provide the given @@ -90,5 +90,5 @@ public interface KeyChain { *

See the docs for {@link org.bitcoinj.core.BloomFilter#BloomFilter(int, double, long)} for a brief * explanation of anonymity when using bloom filters, and for the meaning of these parameters.

*/ - public BloomFilter getFilter(int size, double falsePositiveRate, long tweak); + BloomFilter getFilter(int size, double falsePositiveRate, long tweak); } diff --git a/core/src/main/java/org/bitcoinj/wallet/RiskAnalysis.java b/core/src/main/java/org/bitcoinj/wallet/RiskAnalysis.java index f61133af..17a69c2c 100644 --- a/core/src/main/java/org/bitcoinj/wallet/RiskAnalysis.java +++ b/core/src/main/java/org/bitcoinj/wallet/RiskAnalysis.java @@ -32,15 +32,15 @@ import java.util.List; *

A factory interface is provided. The wallet will use this to analyze new pending transactions.

*/ public interface RiskAnalysis { - public enum Result { + enum Result { OK, NON_FINAL, NON_STANDARD } - public Result analyze(); + Result analyze(); - public interface Analyzer { - public RiskAnalysis create(Wallet wallet, Transaction tx, List dependencies); + interface Analyzer { + RiskAnalysis create(Wallet wallet, Transaction tx, List dependencies); } } diff --git a/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java b/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java index 76c019d7..35e2e5d3 100644 --- a/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java +++ b/core/src/main/java/org/bitcoinj/wallet/WalletFiles.java @@ -58,12 +58,12 @@ public class WalletFiles { * Called on the auto-save thread when a new temporary file is created but before the wallet data is saved * to it. If you want to do something here like adjust permissions, go ahead and do so. */ - public void onBeforeAutoSave(File tempFile); + void onBeforeAutoSave(File tempFile); /** * Called on the auto-save thread after the newly created temporary file has been filled with data and renamed. */ - public void onAfterAutoSave(File newlySavedFile); + void onAfterAutoSave(File newlySavedFile); } public WalletFiles(final Wallet wallet, File file, long delay, TimeUnit delayTimeUnit) {