Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Javadoc warnings and enforce them #172

Merged
merged 1 commit into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading