Skip to content

Commit

Permalink
Migrate fully qualified names to using imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schildbach authored and schildbach committed Mar 11, 2018
1 parent 9e16d5f commit 4bbb7be
Show file tree
Hide file tree
Showing 92 changed files with 338 additions and 287 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/AbstractBlockChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* <p>An AbstractBlockChain implementation must be connected to a {@link BlockStore} implementation. The chain object
* by itself doesn't store any data, that's delegated to the store. Which store you use is a decision best made by
* reading the getting started guide, but briefly, fully validating block chains need fully validating stores. In
* the lightweight SPV mode, a {@link org.bitcoinj.store.SPVBlockStore} is the right choice.</p>
* the lightweight SPV mode, a {@link SPVBlockStore} is the right choice.</p>
*
* <p>This class implements an abstract class which makes it simple to create a BlockChain that does/doesn't do full
* verification. It verifies headers and is implements most of what is required to implement SPV mode, but
Expand All @@ -53,7 +53,7 @@
* <p>There are two subclasses of AbstractBlockChain that are useful: {@link BlockChain}, which is the simplest
* class and implements <i>simplified payment verification</i>. This is a lightweight and efficient mode that does
* not verify the contents of blocks, just their headers. A {@link FullPrunedBlockChain} paired with a
* {@link org.bitcoinj.store.H2FullPrunedBlockStore} implements full verification, which is equivalent to
* {@link H2FullPrunedBlockStore} implements full verification, which is equivalent to
* Bitcoin Core. To learn more about the alternative security models, please consult the articles on the
* website.</p>
*
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public Block(NetworkParameters params, long version, Sha256Hash prevBlockHash, S
* the system it was 50 coins per block, in late 2012 it went to 25 coins per block, and so on. The size of
* a coinbase transaction is inflation plus fees.</p>
*
* <p>The half-life is controlled by {@link org.bitcoinj.core.NetworkParameters#getSubsidyDecreaseBlockCount()}.
* <p>The half-life is controlled by {@link NetworkParameters#getSubsidyDecreaseBlockCount()}.
* </p>
*/
public Coin getBlockInflation(int height) {
Expand Down Expand Up @@ -815,7 +815,7 @@ public void setTime(long time) {
* Returns the difficulty of the proof of work that this block should meet encoded <b>in compact form</b>. The {@link
* BlockChain} verifies that this is not too easy by looking at the length of the chain when the block is added.
* To find the actual value the hash should be compared against, use
* {@link org.bitcoinj.core.Block#getDifficultyTargetAsInteger()}. Note that this is <b>not</b> the same as
* {@link Block#getDifficultyTargetAsInteger()}. Note that this is <b>not</b> the same as
* the difficulty value reported by the Bitcoin "getdifficulty" RPC that you may see on various block explorers.
* That number is the result of applying a formula to the underlying difficulty to normalize the minimum to 1.
* Calculating the difficulty that way is currently unsupported.
Expand Down
10 changes: 7 additions & 3 deletions core/src/main/java/org/bitcoinj/core/BlockChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@

import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.store.MemoryBlockStore;
import org.bitcoinj.store.SPVBlockStore;
import org.bitcoinj.wallet.Wallet;
import org.bitcoinj.wallet.WalletExtension;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -40,10 +44,10 @@ public class BlockChain extends AbstractBlockChain {
/**
* <p>Constructs a BlockChain connected to the given wallet and store. To obtain a {@link Wallet} you can construct
* one from scratch, or you can deserialize a saved wallet from disk using
* {@link Wallet#loadFromFile(java.io.File, WalletExtension...)}</p>
* {@link Wallet#loadFromFile(File, WalletExtension...)}</p>
*
* <p>For the store, you should use {@link org.bitcoinj.store.SPVBlockStore} or you could also try a
* {@link org.bitcoinj.store.MemoryBlockStore} if you want to hold all headers in RAM and don't care about
* <p>For the store, you should use {@link SPVBlockStore} or you could also try a
* {@link MemoryBlockStore} if you want to hold all headers in RAM and don't care about
* disk serialization (this is rare).</p>
*/
public BlockChain(Context context, Wallet wallet, BlockStore blockStore) throws BlockStoreException {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/core/BloomFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public BloomFilter(int elements, double falsePositiveRate, long randomNonce) {
* It should be a random value, however secureness of the random value is of no great consequence.</p>
*
* <p>updateFlag is used to control filter behaviour on the server (remote node) side when it encounters a hit.
* See {@link org.bitcoinj.core.BloomFilter.BloomUpdate} for a brief description of each mode. The purpose
* See {@link BloomFilter.BloomUpdate} for a brief description of each mode. The purpose
* of this flag is to reduce network round-tripping and avoid over-dirtying the filter for the most common
* wallet configurations.</p>
*/
Expand Down Expand Up @@ -270,7 +270,7 @@ public synchronized void merge(BloomFilter filter) {
}

/**
* Returns true if this filter will match anything. See {@link org.bitcoinj.core.BloomFilter#setMatchAll()}
* Returns true if this filter will match anything. See {@link BloomFilter#setMatchAll()}
* for when this can be a useful thing to do.
*/
public synchronized boolean matchesAll() {
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/org/bitcoinj/core/CheckpointManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.common.hash.Hashing;
import com.google.common.io.BaseEncoding;

import org.bitcoinj.store.SPVBlockStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -55,7 +56,7 @@
* </ol>
*
* <p>Checkpoints are used by the SPV {@link BlockChain} to initialize fresh
* {@link org.bitcoinj.store.SPVBlockStore}s. They are not used by fully validating mode, which instead has a
* {@link SPVBlockStore}s. They are not used by fully validating mode, which instead has a
* different concept of checkpoints that are used to hard-code the validity of blocks that violate BIP30 (duplicate
* coinbase transactions). Those "checkpoints" can be found in NetworkParameters.</p>
*
Expand Down
7 changes: 4 additions & 3 deletions core/src/main/java/org/bitcoinj/core/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.bitcoinj.core;

import org.bitcoinj.utils.ContextPropagatingThreadFactory;
import org.bitcoinj.wallet.SendRequest;
import org.slf4j.*;

Expand Down Expand Up @@ -119,7 +120,7 @@ public static Context get() {
}

/**
* Require that new threads use {@link #propagate(Context)} or {@link org.bitcoinj.utils.ContextPropagatingThreadFactory},
* Require that new threads use {@link #propagate(Context)} or {@link ContextPropagatingThreadFactory},
* rather than using a heuristic for the desired context.
*/
public static void enableStrictMode() {
Expand All @@ -145,7 +146,7 @@ public static Context getOrCreate(NetworkParameters params) {
* Sets the given context as the current thread context. You should use this if you create your own threads that
* want to create core BitcoinJ objects. Generally, if a class can accept a Context in its constructor and might
* be used (even indirectly) by a thread, you will want to call this first. Your task may be simplified by using
* a {@link org.bitcoinj.utils.ContextPropagatingThreadFactory}.
* a {@link ContextPropagatingThreadFactory}.
*/
public static void propagate(Context context) {
slot.set(checkNotNull(context));
Expand All @@ -162,7 +163,7 @@ public TxConfidenceTable getConfidenceTable() {
}

/**
* Returns the {@link org.bitcoinj.core.NetworkParameters} specified when this context was (auto) created. The
* Returns the {@link NetworkParameters} specified when this context was (auto) created. The
* network parameters defines various hard coded constants for a specific instance of a Bitcoin network, such as
* main net, testnet, etc.
*/
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/org/bitcoinj/core/ECKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public int hashCode() {

/**
* Signs the given hash and returns the R and S components as BigIntegers. In the Bitcoin protocol, they are
* usually encoded using ASN.1 format, so you want {@link org.bitcoinj.core.ECKey.ECDSASignature#toASN1()}
* usually encoded using ASN.1 format, so you want {@link ECKey.ECDSASignature#toASN1()}
* instead. However sometimes the independent components can be useful, for instance, if you're going to do
* further EC maths on them.
* @throws KeyCrypterException if this ECKey doesn't have a private part.
Expand All @@ -643,7 +643,7 @@ public ECDSASignature sign(Sha256Hash input) throws KeyCrypterException {

/**
* Signs the given hash and returns the R and S components as BigIntegers. In the Bitcoin protocol, they are
* usually encoded using DER format, so you want {@link org.bitcoinj.core.ECKey.ECDSASignature#encodeToDER()}
* usually encoded using DER format, so you want {@link ECKey.ECDSASignature#encodeToDER()}
* instead. However sometimes the independent components can be useful, for instance, if you're doing to do further
* EC maths on them.
*
Expand Down Expand Up @@ -1028,7 +1028,7 @@ public byte[] getPrivKeyBytes() {

/**
* Exports the private key in the form used by Bitcoin Core's "dumpprivkey" and "importprivkey" commands. Use
* the {@link org.bitcoinj.core.DumpedPrivateKey#toString()} method to get the string.
* the {@link DumpedPrivateKey#toString()} method to get the string.
*
* @param params The network this key is intended for use on.
* @return Private key bytes as a {@link DumpedPrivateKey}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
import org.bitcoinj.store.FullPrunedBlockStore;
import org.bitcoinj.utils.*;
import org.bitcoinj.wallet.Wallet;
import org.bitcoinj.wallet.WalletExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -59,7 +61,7 @@ public class FullPrunedBlockChain extends AbstractBlockChain {
/**
* Constructs a block chain connected to the given wallet and store. To obtain a {@link Wallet} you can construct
* one from scratch, or you can deserialize a saved wallet from disk using
* {@link Wallet#loadFromFile(java.io.File, WalletExtension...)}
* {@link Wallet#loadFromFile(File, WalletExtension...)}
*/
public FullPrunedBlockChain(Context context, Wallet wallet, FullPrunedBlockStore blockStore) throws BlockStoreException {
this(context, new ArrayList<Wallet>(), blockStore);
Expand All @@ -69,7 +71,7 @@ public FullPrunedBlockChain(Context context, Wallet wallet, FullPrunedBlockStore
/**
* Constructs a block chain connected to the given wallet and store. To obtain a {@link Wallet} you can construct
* one from scratch, or you can deserialize a saved wallet from disk using
* {@link Wallet#loadFromFile(java.io.File, WalletExtension...)}
* {@link Wallet#loadFromFile(File, WalletExtension...)}
*/
public FullPrunedBlockChain(NetworkParameters params, Wallet wallet, FullPrunedBlockStore blockStore) throws BlockStoreException {
this(Context.getOrCreate(params), wallet, blockStore);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public NetworkParameters getParams() {
/**
* Set the serializer for this message when deserialized by Java.
*/
private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();
if (null != params) {
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/org/bitcoinj/core/NetworkParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public int[] getAddrSeeds() {
return addrSeeds;
}

/** Returns discovery objects for seeds implementing the Cartographer protocol. See {@link org.bitcoinj.net.discovery.HttpDiscovery} for more info. */
/** Returns discovery objects for seeds implementing the Cartographer protocol. See {@link HttpDiscovery} for more info. */
public HttpDiscovery.Details[] getHttpSeeds() {
return httpSeeds;
}
Expand Down Expand Up @@ -317,7 +317,7 @@ public long getPacketMagic() {
}

/**
* First byte of a base58 encoded address. See {@link org.bitcoinj.core.LegacyAddress}. This is the same as acceptableAddressCodes[0] and
* First byte of a base58 encoded address. See {@link LegacyAddress}. This is the same as acceptableAddressCodes[0] and
* is the one used for "normal" addresses. Other types of address may be encountered with version codes found in
* the acceptableAddressCodes array.
*/
Expand All @@ -332,7 +332,7 @@ public int getP2SHHeader() {
return p2shHeader;
}

/** First byte of a base58 encoded dumped private key. See {@link org.bitcoinj.core.DumpedPrivateKey}. */
/** First byte of a base58 encoded dumped private key. See {@link DumpedPrivateKey}. */
public int getDumpedPrivateKeyHeader() {
return dumpedPrivateKeyHeader;
}
Expand Down Expand Up @@ -369,7 +369,7 @@ public BigInteger getMaxTarget() {
}

/**
* The key used to sign {@link org.bitcoinj.core.AlertMessage}s. You can use {@link org.bitcoinj.core.ECKey#verify(byte[], byte[], byte[])} to verify
* The key used to sign {@link AlertMessage}s. You can use {@link ECKey#verify(byte[], byte[], byte[])} to verify
* signatures using it.
*/
public byte[] getAlertSigningKey() {
Expand Down
Loading

0 comments on commit 4bbb7be

Please sign in to comment.