Skip to content

Commit

Permalink
Fix Javadoc warnings and enforce them
Browse files Browse the repository at this point in the history
This fixes up warnings reported by the default doclet and forces javadoc
plugin to fail if any warnings are encountered.

Signed-off-by: Robert Varga <[email protected]>
  • Loading branch information
rovarga committed Jun 30, 2024
1 parent 2b9522e commit 240c6ba
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions triemap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<description>Java implementation of a concurrent trie hash map from Scala collections library</description>
<url>https://github.com/PantheonTechnologies/triemap</url>

<properties>
<maven.javadoc.failOnWarnings>true</maven.javadoc.failOnWarnings>
</properties>

<dependencies>
<dependency>
<groupId>biz.aQute.bnd</groupId>
Expand Down
4 changes: 4 additions & 0 deletions triemap/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* An implementation of {@link java.util.concurrent.ConcurrentMap} based on
* <a href="https://en.wikipedia.org/wiki/Ctrie">concurrent hash-trie</a>.
*/
module tech.pantheon.triemap {
exports tech.pantheon.triemap;

Expand Down
12 changes: 12 additions & 0 deletions triemap/src/main/java/tech/pantheon/triemap/TrieMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public abstract sealed class TrieMap<K, V> extends AbstractMap<K, V> implements
// Hidden on purpose
}

/**
* Create a new {@link MutableTrieMap}.
*
* @param <K> key type
* @param <V> value type
* @return A new {@link MutableTrieMap}.
*/
public static <K, V> MutableTrieMap<K, V> create() {
return new MutableTrieMap<>();
}
Expand Down Expand Up @@ -186,6 +193,11 @@ static final int computeHash(final Object key) {
return hash;
}

/**
* Replace this set with its {@link SerializationProxy}.
*
* @return {@link SerializationProxy}
*/
@java.io.Serial
final Object writeReplace() {
return new SerializationProxy(immutableSnapshot(), isReadOnly());
Expand Down
11 changes: 11 additions & 0 deletions triemap/src/main/java/tech/pantheon/triemap/TrieSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public abstract sealed class TrieSet<E> implements Set<E>, Serializable permits
set = map.createKeySet();
}

/**
* Create a new {@link MutableTrieSet}.
*
* @param <E> element type
* @return A new {@link MutableTrieSet}.
*/
public static <E> MutableTrieSet<E> create() {
return new MutableTrieSet<>(TrieMap.create());
}
Expand Down Expand Up @@ -193,6 +199,11 @@ public final String toString() {
return set.toString();
}

/**
* Replace this set with its {@link SerializedForm}.
*
* @return {@link SerializedForm}
*/
@java.io.Serial
final Object writeReplace() {
return new SerializedForm(this);
Expand Down

0 comments on commit 240c6ba

Please sign in to comment.