Skip to content

Commit

Permalink
SegwitAddress, LegacyAddress, package-info.java: don't link to classe…
Browse files Browse the repository at this point in the history
…s outside base in JavaDoc
  • Loading branch information
schildbach committed Aug 29, 2024
1 parent 3a45d13 commit 3e07d43
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/base/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public interface Address extends Comparable<Address> {
/**
* Construct an {@link Address} that represents the public part of the given {@link ECKey}.
* Construct an {@link Address} that represents the public part of the given {@code ECKey}.
*
* @param params
* network this address is valid for
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/org/bitcoinj/base/LegacyAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class LegacyAddress implements Address {
/**
* Private constructor. Use {@link #fromBase58(String, Network)},
* {@link #fromPubKeyHash(Network, byte[])}, {@link #fromScriptHash(Network, byte[])} or
* {@link ECKey#toAddress(ScriptType, Network)}.
* {@code ECKey#toAddress(ScriptType, Network)}.
*
* @param network
* network this address is valid for
Expand Down Expand Up @@ -113,15 +113,15 @@ public static LegacyAddress fromPubKeyHash(Network network, byte[] hash160) thro
}

/**
* Construct a {@link LegacyAddress} that represents the public part of the given {@link ECKey}. Note that an address is
* Construct a {@link LegacyAddress} that represents the public part of the given {@code ECKey}. Note that an address is
* derived from a hash of the public key and is not the public key itself.
*
* @param params
* network this address is valid for
* @param key
* only the public part is used
* @return constructed address
* @deprecated Use {@link ECKey#toAddress(ScriptType, Network)}
* @deprecated Use {@code ECKey#toAddress(ScriptType, Network)}
*/
@Deprecated
public static LegacyAddress fromKey(NetworkParameters params, ECKey key) {
Expand Down Expand Up @@ -175,7 +175,7 @@ else if (version == network.legacyP2SHHeader())
}

/**
* Get the network this address works on. Use of {@link BitcoinNetwork} is preferred to use of {@link NetworkParameters}
* Get the network this address works on. Use of {@link BitcoinNetwork} is preferred to use of {@code NetworkParameters}
* when you need to know what network an address is for.
* @return the Network.
*/
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/bitcoinj/base/SegwitAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* <a href="https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki">BIP173</a> for details.</p>
*
* <p>However, you don't need to care about the internals. Use {@link #fromBech32(String, Network)},
* {@link #fromHash(org.bitcoinj.base.Network, byte[])} or {@link ECKey#toAddress(ScriptType, Network)}
* {@link #fromHash(org.bitcoinj.base.Network, byte[])} or {@code ECKey#toAddress(ScriptType, Network)}
* to construct a native segwit address.</p>
*/
public class SegwitAddress implements Address {
Expand Down Expand Up @@ -133,7 +133,7 @@ private static Network normalizeNetwork(Network network) {

/**
* Private constructor. Use {@link #fromBech32(String, Network)},
* {@link #fromHash(Network, byte[])} or {@link ECKey#toAddress(ScriptType, Network)}.
* {@link #fromHash(Network, byte[])} or {@code ECKey#toAddress(ScriptType, Network)}.
*
* @param network
* network this address is valid for
Expand Down Expand Up @@ -320,23 +320,23 @@ public static SegwitAddress fromProgram(Network network, int witnessVersion, byt
}

/**
* Construct a {@link SegwitAddress} that represents the public part of the given {@link ECKey}. Note that an
* Construct a {@link SegwitAddress} that represents the public part of the given {@code ECKey}. Note that an
* address is derived from a hash of the public key and is not the public key itself.
*
* @param params
* network this address is valid for
* @param key
* only the public part is used
* @return constructed address
* @deprecated Use {@link ECKey#toAddress(ScriptType, org.bitcoinj.base.Network)}
* @deprecated Use {@code ECKey#toAddress(ScriptType, org.bitcoinj.base.Network)}
*/
@Deprecated
public static SegwitAddress fromKey(NetworkParameters params, ECKey key) {
return (SegwitAddress) key.toAddress(ScriptType.P2WPKH, params.network());
}

/**
* Get the network this address works on. Use of {@link BitcoinNetwork} is preferred to use of {@link NetworkParameters}
* Get the network this address works on. Use of {@link BitcoinNetwork} is preferred to use of {@code NetworkParameters}
* when you need to know what network an address is for.
* @return the Network.
*/
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/base/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* </ul>
* <p>
* <b>Temporary exception:</b> In the 0.17 release, we are allowing some dependencies on other packages, e.g. to
* {@link org.bitcoinj.core.NetworkParameters} or to Guava <i>provided</i> that those references are in <b>deprecated</b> methods.
* {@code org.bitcoinj.core.NetworkParameters} or to Guava <i>provided</i> that those references are in <b>deprecated</b> methods.
* This smooths migration by allowing users to, for example, replace {@code import org.bitcoinj.core.Address} with
* {@code import org.bitcoinj.base.Address} as first step of conversion and then remove usages of the deprecated methods
* of {@code Address} in a second step.
Expand Down

0 comments on commit 3e07d43

Please sign in to comment.