Skip to content

Commit

Permalink
Fixed broken references
Browse files Browse the repository at this point in the history
  • Loading branch information
cowwoc committed Jul 29, 2024
1 parent c94a0f5 commit 4d1b8a9
Show file tree
Hide file tree
Showing 273 changed files with 1,738 additions and 1,710 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ACCESS_TOKEN }}
with:
path-to-signatures: 'cla/version1/signatures/cla.json'
path-to-document: 'https://github.com/cowwoc/requirements.java/cla/version1/cla.md' # e.g. a CLA or a DCO document
path-to-document: 'https://github.com/cowwoc/requirements.java/blob/master/cla/version1/cla.md' # e.g. a CLA or a DCO document
# branch should not be protected
branch: 'main'
allowlist: cowwoc
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# <img src="docs/checklist.svg" width=64 height=64 alt="checklist"> Requirements API

[![API](https://img.shields.io/badge/api_docs-5B45D5.svg)](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/)
[![API](https://img.shields.io/badge/api_docs-5B45D5.svg)](https://cowwoc.github.io/requirements.java/10.0/docs/api/)
[![Changelog](https://img.shields.io/badge/changelog-A345D5.svg)](docs/Changelog.md)
[![javascript, typescript](https://img.shields.io/badge/other%20languages-javascript,%20typescript-457FD5.svg)](../../../requirements.js)

Expand All @@ -22,7 +22,7 @@ To get started, add this Maven dependency:
<dependency>
<groupId>com.github.cowwoc.requirements</groupId>
<artifactId>java</artifactId>
<version>9.0.0</version>
<version>10.0</version>
</dependency>
```

Expand All @@ -32,9 +32,9 @@ To get started, add this Maven dependency:
import java.util.List;
import java.util.StringJoiner;

import static com.github.cowwoc.requirements.java.DefaultJavaValidators.assumeThat;
import static com.github.cowwoc.requirements.java.DefaultJavaValidators.checkIf;
import static com.github.cowwoc.requirements.java.DefaultJavaValidators.requireThat;
import static com.github.cowwoc.requirements10.java.DefaultJavaValidators.assumeThat;
import static com.github.cowwoc.requirements10.java.DefaultJavaValidators.checkIf;
import static com.github.cowwoc.requirements10.java.DefaultJavaValidators.requireThat;

public final class Cake
{
Expand Down Expand Up @@ -152,10 +152,10 @@ This library offers the following features:
Designed for discovery using your favorite IDE's auto-complete feature.
The main entry points are:

* [requireThat(value, name)](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/DefaultJavaValidators.html#requireThat(T,java.lang.String)) for method preconditions.
* [assumeThat(value, name)](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/DefaultJavaValidators.html#assumeThat(T,java.lang.String)) for class invariants, method postconditions and private methods.
* [checkIfThat(value, name)](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/DefaultJavaValidators.html#checkIf(T,java.lang.String)) for multiple failures and customized error handling.
* [JavaValidators](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/JavaValidators.html) for custom configurations.
* [requireThat(value, name)](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/DefaultJavaValidators.html#requireThat(T,java.lang.String)) for method preconditions.
* [assumeThat(value, name)](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/DefaultJavaValidators.html#assumeThat(T,java.lang.String)) for class invariants, method postconditions and private methods.
* [checkIfThat(value, name)](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/DefaultJavaValidators.html#checkIf(T,java.lang.String)) for multiple failures and customized error handling.
* [JavaValidators](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/JavaValidators.html) for custom configurations.

The first three methods use a shared configuration, while `JavaValidators` allows you to create an independent
configuration.
Expand All @@ -164,9 +164,9 @@ configuration.
* `checkIf()` returns multiple validation failures at once. It is more flexible than the others, but its syntax
is more verbose.

Thrown exceptions may be configured using [ConfigurationUpdater.exceptionTransformer(Function)](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/ConfigurationUpdater.html#exceptionTransformer(java.util.function.Function)).
Thrown exceptions may be configured using [ConfigurationUpdater.exceptionTransformer(Function)](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/ConfigurationUpdater.html#exceptionTransformer(java.util.function.Function)).

See the [API documentation](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/) for more details.
See the [API documentation](https://cowwoc.github.io/requirements.java/10.0/docs/api/) for more details.

## Tips

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.cowwoc.requirements.annotation;
package com.github.cowwoc.requirements10.annotation;

import java.lang.annotation.Target;

Expand Down
5 changes: 3 additions & 2 deletions annotation/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
/**
* Annotations used by the library.
*/
module com.github.cowwoc.requirements.annotation
@SuppressWarnings("JavaModuleNaming")
module com.github.cowwoc.requirements10.annotation
{
exports com.github.cowwoc.requirements.annotation;
exports com.github.cowwoc.requirements10.annotation;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2017 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package com.github.cowwoc.requirements.benchmark.assertj;
package com.github.cowwoc.requirements10.benchmark.assertj;

import org.assertj.core.api.Assertions;
import org.assertj.core.api.SoftAssertions;
Expand Down
14 changes: 11 additions & 3 deletions benchmark/assertj/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
module com.github.cowwoc.requirements.benchmark.assertj
/*
* Copyright 2019 Gili Tzabari.
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* Benchmark of equivalent assertj functionality.
*/
@SuppressWarnings("JavaModuleNaming")
module com.github.cowwoc.requirements10.benchmark.assertj
{
requires jmh.core;
requires org.testng;
requires org.assertj.core;

exports com.github.cowwoc.requirements.benchmark.assertj to org.testng;
exports com.github.cowwoc.requirements.benchmark.assertj.jmh_generated to jmh.core;
exports com.github.cowwoc.requirements10.benchmark.assertj to org.testng;
exports com.github.cowwoc.requirements10.benchmark.assertj.jmh_generated to jmh.core;
}
4 changes: 2 additions & 2 deletions benchmark/assertj/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<appender-ref ref="STDOUT"/>
</root>
<logger name="org.testng" level="warn"/>
<logger name="terminal.internal.com.github.cowwoc.requirements10.java.Terminal" level="warn"/>
<logger name="util.internal.com.github.cowwoc.requirements10.java.Exceptions" level="warn"/>
<logger name="com.github.cowwoc.requirements10.java.internal.terminal.Terminal" level="warn"/>
<logger name="com.github.cowwoc.requirements10.java.internal.util.Exceptions" level="warn"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Copyright (c) 2017 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package com.github.cowwoc.requirements.benchmark.guava;
package com.github.cowwoc.requirements10.benchmark.guava;

import com.github.cowwoc.requirements.guava.DefaultGuavaValidators;
import com.github.cowwoc.requirements10.guava.DefaultGuavaValidators;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import org.openjdk.jmh.annotations.Benchmark;
Expand Down
16 changes: 12 additions & 4 deletions benchmark/guava/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
module com.github.cowwoc.requirements.benchmark.guava
/*
* Copyright 2019 Gili Tzabari.
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* Benchmark of the guava module.
*/
@SuppressWarnings("JavaModuleNaming")
module com.github.cowwoc.requirements10.benchmark.guava
{
requires jmh.core;
requires com.google.common;
requires org.testng;
requires com.github.cowwoc.requirements.guava;
requires com.github.cowwoc.requirements10.guava;
requires static com.google.errorprone.annotations;

exports com.github.cowwoc.requirements.benchmark.guava to org.testng;
exports com.github.cowwoc.requirements.benchmark.guava.jmh_generated to jmh.core;
exports com.github.cowwoc.requirements10.benchmark.guava to org.testng;
exports com.github.cowwoc.requirements10.benchmark.guava.jmh_generated to jmh.core;
}
2 changes: 1 addition & 1 deletion benchmark/guava/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<root level="debug">
<appender-ref ref="STDOUT"/>
</root>
<logger name="com.github.cowwoc.requirements.java.internal.terminal.Terminal" level="warn"/>
<logger name="com.github.cowwoc.requirements10.java.internal.terminal.Terminal" level="warn"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Copyright (c) 2017 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package com.github.cowwoc.requirements.benchmark.java;
package com.github.cowwoc.requirements10.benchmark.java;

import com.github.cowwoc.requirements.java.ConfigurationUpdater;
import com.github.cowwoc.requirements.java.JavaValidators;
import com.github.cowwoc.requirements10.java.ConfigurationUpdater;
import com.github.cowwoc.requirements10.java.JavaValidators;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.Scope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2019 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package com.github.cowwoc.requirements.benchmark.java;
package com.github.cowwoc.requirements10.benchmark.java;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
Expand All @@ -22,7 +22,7 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;

import static com.github.cowwoc.requirements.java.DefaultJavaValidators.assumeThat;
import static com.github.cowwoc.requirements10.java.DefaultJavaValidators.assumeThat;

@State(Scope.Benchmark)
@SuppressWarnings({"CanBeFinal", "LongLine", "FieldMayBeFinal"})
Expand Down
16 changes: 12 additions & 4 deletions benchmark/java/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
module com.github.cowwoc.requirements.benchmark.java
/*
* Copyright 2019 Gili Tzabari.
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* Benchmark of the Java module.
*/
@SuppressWarnings("JavaModuleNaming")
module com.github.cowwoc.requirements10.benchmark.java
{
requires jmh.core;
requires org.testng;
requires com.github.cowwoc.requirements.java;
requires com.github.cowwoc.requirements10.java;

exports com.github.cowwoc.requirements.benchmark.java to org.testng;
exports com.github.cowwoc.requirements.benchmark.java.jmh_generated to jmh.core;
exports com.github.cowwoc.requirements10.benchmark.java to org.testng;
exports com.github.cowwoc.requirements10.benchmark.java.jmh_generated to jmh.core;
}
4 changes: 2 additions & 2 deletions benchmark/java/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<appender-ref ref="STDOUT"/>
</root>
<logger name="org.testng" level="warn"/>
<logger name="com.github.cowwoc.requirements.java.internal.terminal.Terminal" level="warn"/>
<logger name="com.github.cowwoc.requirements.java.internal.util.Exceptions" level="warn"/>
<logger name="com.github.cowwoc.requirements10.java.internal.terminal.Terminal" level="warn"/>
<logger name="com.github.cowwoc.requirements10.java.internal.util.Exceptions" level="warn"/>
</configuration>
2 changes: 1 addition & 1 deletion benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<compilerArgs>
<arg>-Xdiags:verbose</arg>
<arg>-Werror</arg>
<arg>-Xlint:all,-requires-automatic,-processing</arg>
<arg>-Xlint:all,-requires-automatic,-processing,-module</arg>
</compilerArgs>
<annotationProcessorPaths>
<!-- WORKAROUND: https://issues.apache.org/jira/browse/MCOMPILER-369 -->
Expand Down
17 changes: 8 additions & 9 deletions build/src/main/resources/pmd-file-exclusions.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Must use consistent method name across all validators
validator.com.github.cowwoc.requirements10.java.PrimitiveBooleanValidator=BooleanGetMethodName
com.github.cowwoc.requirements10.java.validator.PrimitiveBooleanValidator=BooleanGetMethodName
# WORKAROUND: https://github.com/pmd/pmd/issues/4861
validator.internal.com.github.cowwoc.requirements10.java.JavaValidatorsImpl=UnusedPrivateMethod
com.github.cowwoc.requirements10.java.internal.validator.JavaValidatorsImpl=UnusedPrivateMethod
# WORKAROUND: https://github.com/pmd/pmd/issues/4910
message.internal.com.github.cowwoc.requirements10.java.ComparableMessages=ConsecutiveAppendsShouldReuse
com.github.cowwoc.requirements.java.internal.message.EqualMessages=ConsecutiveAppendsShouldReuse
com.github.cowwoc.requirements10.java.internal.message.ComparableMessages=ConsecutiveAppendsShouldReuse
# WORKAROUND: https://github.com/pmd/pmd/issues/4577
util.internal.com.github.cowwoc.requirements10.java.Exceptions=UseArraysAsList
com.github.cowwoc.requirements10.java.internal.util.Exceptions=UseArraysAsList
# Long URI
util.internal.com.github.cowwoc.requirements10.java.ReentrantStampedLock=CommentSize
com.github.cowwoc.requirements10.java.internal.util.ReentrantStampedLock=CommentSize
# Necessary evil when we cannot throw an exception or log an error
terminal.internal.com.github.cowwoc.requirements10.java.Terminal=SystemPrintln
com.github.cowwoc.requirements10.java.internal.terminal.Terminal=SystemPrintln
# WORKAROUND: https://github.com/pmd/pmd/issues/5043
validator.internal.com.github.cowwoc.requirements10.java.Doubles=LambdaCanBeMethodReference
com.github.cowwoc.requirements10.java.internal.validator.Doubles=LambdaCanBeMethodReference
# WORKAROUND: https://github.com/pmd/pmd/issues/5043
validator.internal.com.github.cowwoc.requirements10.java.Floats=LambdaCanBeMethodReference
com.github.cowwoc.requirements10.java.internal.validator.Floats=LambdaCanBeMethodReference
2 changes: 1 addition & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Minor updates involving cosmetic changes have been omitted from this list.
See https://github.com/cowwoc/requirements.java/commits/master for a full list.

## Version 9.1.0 - ?
## Version 10.0 - ?

* Breaking changes:
* Module and package names now contain a major version number
Expand Down
4 changes: 2 additions & 2 deletions docs/Features.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ requireThat(nameToAge, "nameToAge").
## String diff

When
a [String comparison](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/type/component/ObjectValidatorComponent#isEqualTo(java.lang.Object))
a [String comparison](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/type/component/ObjectValidatorComponent#isEqualTo(java.lang.Object))
fails, the library outputs a diff of the values being compared.

Depending on the terminal capability, you will see a [Textual](Textual_Diff.md) or a colored diff.
Expand All @@ -191,7 +191,7 @@ terminal.

The use of colors is disabled by default if stdin or stdout are redirected, even if ANSI colors are supported.
To enable colors,
invoke [GlobalConfiguration.terminalEncoding(TerminalEncoding)](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/GlobalConfiguration.html#terminalEncoding(terminal.com.github.cowwoc.requirements10.java.TerminalEncoding)).
invoke [GlobalConfiguration.terminalEncoding(TerminalEncoding)](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/GlobalConfiguration.html#terminalEncoding(com.github.cowwoc.requirements10.java.terminal.TerminalEncoding)).

## Returning the value after validation

Expand Down
8 changes: 4 additions & 4 deletions docs/Supported_Libraries.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Each module uses a separate class pair for validation. For example,
[DefaultJavaValidators](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/DefaultJavaValidators.html)
[DefaultJavaValidators](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/DefaultJavaValidators.html)
and
[JavaValidators](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/java/JavaValidators.html)
[JavaValidators](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/java/JavaValidators.html)
validate the core Java API. Similarly,
[DefaultGuavaValidators](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/guava/DefaultGuavaValidators.html)
[DefaultGuavaValidators](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/guava/DefaultGuavaValidators.html)
and
[GuavaValidators](https://cowwoc.github.io/requirements.java/9.0.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements/guava/GuavaValidators.html)
[GuavaValidators](https://cowwoc.github.io/requirements.java/10.0/docs/api/com.github.cowwoc.requirements.java/com/github/cowwoc/requirements10/guava/GuavaValidators.html)
validate the Guava API.

The following table lists validators for third-party libraries:
Expand Down
4 changes: 2 additions & 2 deletions guava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
</offlineLink>
</offlineLinks>
<excludePackageNames>
com.github.cowwoc.requirements.guava.internal,
com.github.cowwoc.requirements.guava.internal.*
com.github.cowwoc.requirements10.guava.internal,
com.github.cowwoc.requirements10.guava.internal.*
</excludePackageNames>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* Copyright (c) 2014 Gili Tzabari
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
package com.github.cowwoc.requirements.guava;
package com.github.cowwoc.requirements10.guava;

import com.github.cowwoc.requirements.annotation.CheckReturnValue;
import com.github.cowwoc.requirements.guava.internal.validator.GuavaValidatorsImpl;
import com.github.cowwoc.requirements.java.Configuration;
import com.github.cowwoc.requirements.java.ConfigurationUpdater;
import com.github.cowwoc.requirements.java.GlobalConfiguration;
import com.github.cowwoc.requirements.java.internal.scope.MainApplicationScope;
import com.github.cowwoc.requirements.java.internal.util.CloseableLock;
import com.github.cowwoc.requirements.java.internal.util.ReentrantStampedLock;
import com.github.cowwoc.requirements.java.validator.component.ValidatorComponent;
import com.github.cowwoc.requirements10.annotation.CheckReturnValue;
import com.github.cowwoc.requirements10.guava.internal.validator.GuavaValidatorsImpl;
import com.github.cowwoc.requirements10.java.Configuration;
import com.github.cowwoc.requirements10.java.ConfigurationUpdater;
import com.github.cowwoc.requirements10.java.GlobalConfiguration;
import com.github.cowwoc.requirements10.java.internal.scope.MainApplicationScope;
import com.github.cowwoc.requirements10.java.internal.util.CloseableLock;
import com.github.cowwoc.requirements10.java.internal.util.ReentrantStampedLock;
import com.github.cowwoc.requirements10.java.validator.component.ValidatorComponent;
import com.google.common.collect.Multimap;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.cowwoc.requirements.guava;
package com.github.cowwoc.requirements10.guava;

import com.github.cowwoc.requirements.java.ConfigurationUpdater;
import com.github.cowwoc.requirements10.java.ConfigurationUpdater;
import com.google.common.collect.Multimap;

import java.util.function.Function;
Expand Down
Loading

0 comments on commit 4d1b8a9

Please sign in to comment.