Skip to content

Commit

Permalink
javadoc fixes as requested by davidb
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyweston committed Sep 16, 2018
1 parent d105dc1 commit 0ea47da
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* regardless of the state of the object. This ensures that the object will always meet predefined conditions,
* and that methods may, therefore, always reference the object without the risk of making inaccurate presumptions."
*
* @see http://en.wikipedia.org/wiki/Class_invariant
* @see <a href="http://en.wikipedia.org/wiki/Class_invariant">Definition of "class invariant" on Wikipedia</a>
* @since 1.2
*/
public class ClassInvariantViolation extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ public static <V, E extends Exception> V wrapAnyException(Callable<V> callable,
}
}

/** @since 1.2 */
public static void throwAsRuntimeException(Exception throwable) {
throw new RuntimeException(throwable);
}

/** @since 1.2 */
public static <E extends RuntimeException> void throwException(Exception throwable, WithException<E> wrapper) throws E {
throw newException(wrapper, throwable).create();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public static <E extends Exception> WithException<E> with(Class<E> type) {
return new WithException<E>(type);
}

/** @since 1.2 */
public static <E extends Exception> WithException<E> as(Class<E> type) {
return new WithException<E>(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public Boolean waitingForCompletion(final Duration duration) {
return resetInterruptFlagWhen(awaitingTerminationIsInterrupted(duration));
}

/** @since 1.1 */
public Boolean waitingForShutdown(Timeout timeout) throws TimeoutException, InterruptedException {
if (executor == null)
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/**
* Annotation to mark a method as being potentially run concurrently.
* <p>
*
* @see com.google.code.tempusfugit.concurrency.ConcurrentTestRunner
* @see com.google.code.tempusfugit.concurrency.ConcurrentRule
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* <p>
* Based on the annotation of the same name by Brian Goetz and Tim Tim Peierls.
* <p/>
* </p>
* <p>
* Broadly intended for use in the same context as described by Goetz in Concurrency In Practice
* but with some attempt at type safety on the parameter types.
* <p/>
* </p>
* @see com.google.code.tempusfugit.concurrency.annotations.GuardedBy.Type
*/
@Documented
Expand All @@ -43,7 +45,7 @@
public static enum Type {
/** An intrinsic lock */
THIS,
/** An inner class disambiguation from {@link GuardedBy.Type.THIS} monitor, qualify with @{link GuardedBy#details} */
/** An inner class disambiguation from {@link GuardedBy.Type#THIS} monitor, qualify with @{link GuardedBy#details} */
@Deprecated INNER_CLASS_THIS,
/** A class monitor, qualify with {@link GuardedBy#details} */
CLASS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/**
* Annotation to highlight intermittently failing test methods or classes.
* <p>
*
* @see com.google.code.tempusfugit.concurrency.IntermittentTestRunner
*/
@Target({METHOD, TYPE})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Annotation to indicate that a method should be repeated.
* <p>
* Annotation to indicate that a method should be repeated.
* </p>
* @see com.google.code.tempusfugit.concurrency.RepeatingRule
*/
@Target(METHOD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ public static void assertThat(String message, Condition condition, Matcher<Boole
Assert.assertThat(message, condition.isSatisfied(), booleanMatcher);
}

/** Useful when waiting for an assertion in tests, for example;
* <p></p>
* <code>WaitFor.waitOrTimeout(assertion(limit, is(5)), timeout(millis(500)))</code>
* <p></p>
/** <p>
* Useful when waiting for an assertion in tests, for example;
* </p>
* <pre>WaitFor.waitOrTimeout(assertion(limit, is(5)), timeout(millis(500)))</pre>
* <p>
* Not that if the actual value isn't updated by some asynchronous code, the matcher may never match so it'd be
* pointless calling inside a <code>WaitFor.waitOrTimeout</code> call.
*
* </p>
* @param actual the actual value to compare
* @param matcher the matcher to compare with
* @param <T> the type of the value to compare
* @return a matcher condition to compare
* @since 1.1
* @deprecated use {@link #assertion(com.google.code.tempusfugit.concurrency.Callable, org.hamcrest.Matcher)} instead
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
import org.hamcrest.SelfDescribing;

/**
* <p>
* A lazy evaluation probe for specific value.
* <p></p>
* </p>
* <p>
* Implementations should implement {@link #describeTo(org.hamcrest.Description)} to describe the specific probe, for example, a probe to check 'the time on a clock'.
* <p></p>
* </p>
* @param <T> the value to lazily probe for
*/
public interface ProbeFor<T> extends Callable<T, RuntimeException>, SelfDescribing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ public final class Timeout {
private Duration duration;
private StopWatch timer;

/** @since 1.1 */
public static Timeout timeout(Duration duration) {
return new Timeout(duration);
}

/** @since 1.1 */
public static Timeout timeout(Duration duration, StopWatch stopWatch) {
return new Timeout(duration, stopWatch);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class Timer implements StopWatch {

/**
* Constructs and starts a stop watch.
* @since 1.2
* @param clock the clock to base the timer on
* */
public Timer(Clock clock) {
Date now = clock.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Get a random {@link Duration} up to a specified amount. Use with {@link Introduce} to apply a random sleep up to a
* given amount.
*
* @see {@link Introduce}
* @see Introduce
*/
public class UpTo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ public final class WaitFor {
private WaitFor() {
}

/** @since 1.1 */
public static void waitOrTimeout(Condition condition, Timeout timeout) throws InterruptedException, TimeoutException {
waitOrTimeout(condition, timeout, new ThreadSleep(SLEEP_PERIOD));
}

/** @since 1.1 */
public static void waitOrTimeout(Condition condition, Timeout timeout, Sleeper sleeper) throws TimeoutException, InterruptedException {
if (success(condition, timeout, sleeper))
return;
throw new TimeoutException();
}

/** @since 1.2 */
public static <T, E extends Exception> void waitOrTimeout(Condition condition, Callable<T, E> onTimeout, Timeout timeout) throws InterruptedException, E {
try {
waitOrTimeout(condition, timeout);
Expand All @@ -51,7 +48,6 @@ public static <T, E extends Exception> void waitOrTimeout(Condition condition, C
}
}

/** @since 1.2 */
public static void waitFor(SelfDescribingCondition condition, Timeout timeout) throws InterruptedException {
waitOrTimeout(condition, failOnTimeout(condition), timeout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public void waitUntil(StatePredicate predicate) throws InterruptedException {
/**
* Waits up to a timeout for a StatePredicate to become active. Fails the
* test if the timeout expires.
* @param predicate will wait up to the specified timeout for this predicate to become true
* @param timeoutMs timeout in millis
* @throws InterruptedException if the wait is interrupted by the interrupt flag being set elsewhere
*/
public void waitUntil(StatePredicate predicate, long timeoutMs) throws InterruptedException {
waitUntil(predicate, new FixedTimeout(timeoutMs));
Expand Down
27 changes: 9 additions & 18 deletions tempus-fugit.ipr
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
</component>
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="FacetAutodetectingManager">
<autodetection-disabled>
<facet-type id="BeanValidation" />
Expand All @@ -77,21 +74,7 @@
<option name="GENERATE_NO_WARNINGS" value="true" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/target/docs" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
Expand Down Expand Up @@ -223,6 +206,14 @@
</item>
</group>
</component>
<component name="ProjectCodeStyleConfiguration">
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Screen casting" />
<code_scheme name="Project" version="173">
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
</code_scheme>
</component>
<component name="ProjectDetails">
<option name="projectName" value="tempus-fugit" />
</component>
Expand Down

0 comments on commit 0ea47da

Please sign in to comment.