Skip to content

Commit 9a48f69

Browse files
Fix Javadocs and implement their aggregation [ECR-3329]: (#1006)
- Fix broken Javadocs. - Also add a script to generate aggregated Javadocs for published modules. As each has its unique root package, it is easier to see which class (or package) is in which module. The Javadoc links are to be changed in all projects as part of the release procedure.
1 parent 3660c25 commit 9a48f69

7 files changed

Lines changed: 38 additions & 15 deletions

File tree

exonum-java-binding/common/src/main/java/com/exonum/binding/common/blockchain/TransactionLocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static TransactionLocation valueOf(long height, long indexInBlock) {
4747
/**
4848
* Provides a Gson type adapter for this class.
4949
*
50-
* @see com.exonum.binding.common.serialization.json.TransactionLocationAdapterFactory
50+
* @see com.exonum.binding.common.serialization.json.CommonTypeAdapterFactory
5151
*/
5252
public static TypeAdapter<TransactionLocation> typeAdapter(Gson gson) {
5353
return new AutoValue_TransactionLocation.GsonTypeAdapter(gson);

exonum-java-binding/common/src/main/java/com/exonum/binding/common/proofs/list/CheckedListProof.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* A proof that some elements exist in a proof list.
2424
* Example usage:
25-
* <pre><code>
25+
* <pre>{@code
2626
* HashCode expectedRootHash = // get a known root hash from block proof //
2727
* UncheckedListProof proof = new UncheckedListProofAdapter(rootProofNode, serializer);
2828
* // Check the proof
@@ -32,7 +32,7 @@
3232
* // Get and use elements
3333
* NavigableMap value = checkedProof.getElements();
3434
* }
35-
* </code></pre>
35+
* }</pre>
3636
*/
3737
public interface CheckedListProof<E> extends CheckedProof {
3838
/**

exonum-java-binding/common/src/main/java/com/exonum/binding/common/proofs/map/CheckedMapProof.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* In case of incorrect proof all methods (except for getStatus and compareWithRootHash)
2727
* throw IllegalStateException.
2828
* Example usage:
29-
* <pre><code>
29+
* <pre>{@code
3030
* ByteString key = "The key for which I want a proved value".getBytes();
3131
* HashCode expectedRootHash = // get a known root hash from block proof //
3232
* UncheckedMapProof proof = requestProofForKey(key);
@@ -37,7 +37,7 @@
3737
* // Get and use the value(s)
3838
* ByteString value = checked.get(key);
3939
* }
40-
* </code></pre>
40+
* }</pre>
4141
*/
4242
public interface CheckedMapProof extends CheckedProof {
4343
/**

exonum-java-binding/core/src/main/java/com/exonum/binding/core/service/Service.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ default List<HashCode> getStateHashes(Snapshot snapshot) {
106106
* and you have an endpoint «/timestamp», use «/timestamp» as the endpoint name when defining
107107
* the handler and it will be available by path «/api/services/timestamping/timestamp»:
108108
*
109-
* <pre><code>
109+
* <pre>{@code
110110
* router.get("/timestamp").handler((rc) -> {
111111
* rc.response().end("2019-04-01T10:15:30+02:00[Europe/Kiev]");
112112
* });
113-
* </code></pre>
113+
* }</pre>
114114
*
115115
* @param node a set-up Exonum node, providing an interface to access
116116
* the current blockchain state and submit transactions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
# Builds an archive with Javadocs from published artifacts.
3+
# The archive is put in './target/site'
4+
5+
# Fail immediately in case of errors and/or unset variables
6+
set -eu -o pipefail
7+
8+
# Build the Javadocs
9+
mvn clean javadoc:aggregate -Dmaven.javadoc.skip=false \
10+
`# Include only the published artifacts. As package filtering wildcards are rather limited,\
11+
it is more convenient to specify the list of projects:` \
12+
--projects com.exonum.binding:exonum-java-binding-parent,common,core,testkit,time-oracle
13+
14+
# Create an archive to be published
15+
TARGET="${PWD}/target/site/"
16+
cd "${TARGET}"
17+
18+
ARCHIVE_NAME="java-binding-apidocs.tgz"
19+
tar cvaf ${ARCHIVE_NAME} "apidocs/"
20+
21+
echo "[INFO] Javadoc archive created in ${TARGET}/${ARCHIVE_NAME}"

exonum-java-binding/testkit/src/main/java/com/exonum/binding/testkit/EmulatedNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ public EmulatedNode(int validatorId, KeyPair serviceKeyPair) {
4444
}
4545

4646
/**
47-
* Returns a node type - either {@link EmulatedNodeType.VALIDATOR} or
48-
* {@link EmulatedNodeType.AUDITOR}.
47+
* Returns a node type - either {@link EmulatedNodeType#VALIDATOR} or
48+
* {@link EmulatedNodeType#AUDITOR}.
4949
*/
5050
public EmulatedNodeType getNodeType() {
5151
return validatorId.isPresent() ? EmulatedNodeType.VALIDATOR : EmulatedNodeType.AUDITOR;
5252
}
5353

5454
/**
55-
* Returns a validator id if this node is a validator or {@link OptionalInt.EMPTY} is this is an
56-
* auditor node.
55+
* Returns a validator id if this node is a validator or {@link OptionalInt#empty()} if this is
56+
* an auditor node.
5757
*/
5858
public OptionalInt getValidatorId() {
5959
return validatorId;

exonum-java-binding/testkit/src/main/java/com/exonum/binding/testkit/TestKit.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.exonum.binding.core.service.Service;
3737
import com.exonum.binding.core.service.ServiceModule;
3838
import com.exonum.binding.core.service.adapters.UserServiceAdapter;
39+
import com.exonum.binding.core.storage.database.Fork;
3940
import com.exonum.binding.core.storage.database.Snapshot;
4041
import com.exonum.binding.core.storage.indices.KeySetIndexProxy;
4142
import com.exonum.binding.core.storage.indices.MapIndex;
@@ -49,6 +50,7 @@
4950
import com.google.common.collect.Streams;
5051
import com.google.inject.Guice;
5152
import com.google.inject.Injector;
53+
import io.vertx.ext.web.Router;
5254
import java.util.ArrayList;
5355
import java.util.HashMap;
5456
import java.util.List;
@@ -68,13 +70,13 @@
6870
* state.
6971
*
7072
* <p>Only the emulated node has a pool of unconfirmed transactions where a service can submit new
71-
* transaction messages through {@linkplain Node#submitTransaction(RawTransaction)}; or the test
73+
* transaction messages through {@link Node#submitTransaction(RawTransaction)}; or the test
7274
* code through {@link #createBlockWithTransactions(TransactionMessage...)}. All transactions
7375
* from the pool are committed when a new block is created with {@link #createBlock()}.
7476
*
75-
* <p>When TestKit is created, Exonum blockchain instance is initialized - service instances are
76-
* {@linkplain UserServiceAdapter#initialize(long) initialized} and genesis block is committed.
77-
* Then the {@linkplain UserServiceAdapter#mountPublicApiHandler(long) public API handlers} are
77+
* <p>When TestKit is created, Exonum blockchain instance is initialized — service instances are
78+
* {@linkplain Service#initialize(Fork) initialized} and genesis block is committed.
79+
* Then the {@linkplain Service#createPublicApiHandlers(Node, Router) public API handlers} are
7880
* created.
7981
*
8082
* @see <a href="https://exonum.com/doc/version/0.11/get-started/test-service/">TestKit documentation</a>

0 commit comments

Comments
 (0)