Skip to content

Commit

Permalink
Issue #75 - Addressed doclint errors that break the build in JDK 1.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
npryce committed Nov 25, 2014
1 parent 67f0555 commit dbebced
Show file tree
Hide file tree
Showing 55 changed files with 111 additions and 188 deletions.
1 change: 0 additions & 1 deletion build.xml
Expand Up @@ -255,7 +255,6 @@
destdir="build/temp/@{modulename}-${version}-javadoc.jar.contents" author="true" version="true"
use="true" windowtitle="Hamcrest" source="${javaversion}" failonerror="yes" defaultexcludes="yes">
<classpath refid="cp-@{modulename}-main"/>
<arg value="-Xdoclint:none"/>
</javadoc>
<jar-module-component modulename="@{modulename}" suffix="-javadoc"/>
</sequential>
Expand Down
15 changes: 10 additions & 5 deletions hamcrest-api/src/main/java/org/hamcrest/Matcher.java
Expand Up @@ -3,27 +3,32 @@
package org.hamcrest;

/**
* <p>
* A matcher over acceptable values.
* A matcher is able to describe itself to give feedback when it fails.
* <p/>
* </p>
* <p>
* Matcher implementations should <b>NOT directly implement this interface</b>.
* Instead, <b>extend</b> the {@link BaseMatcher} abstract class,
* which will ensure that the Matcher API can grow to support
* new features and remain compatible with all Matcher implementations.
* <p/>
* </p>
* <p>
* For easy access to common Matcher implementations, use the static factory
* methods in {@link CoreMatchers}.
* <p/>
* </p>
* <p>
* N.B. Well designed matchers should be immutable.
*
* </p>
*
* @see CoreMatchers
* @see BaseMatcher
*/
public interface Matcher<T> extends SelfDescribing {

/**
* Evaluates the matcher for argument <var>item</var>.
* <p/>
*
* This method matches against Object, instead of the generic type T. This is
* because the caller of the Matcher does not know at runtime what the type is
* (because of type erasure with Java generics). It is down to the implementations
Expand Down
Expand Up @@ -6,7 +6,7 @@
* <pre>
* Matcher&lt;String&gt; aNonEmptyString = new CustomMatcher&lt;String&gt;("a non empty string") {
* public boolean matches(Object object) {
* return ((object instanceof String) && !((String) object).isEmpty();
* return ((object instanceof String) &amp;&amp; !((String) object).isEmpty();
* }
* };
* </pre>
Expand Down
7 changes: 0 additions & 7 deletions hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java
Expand Up @@ -40,7 +40,6 @@ public void describeTo(Description description) {

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand All @@ -51,7 +50,6 @@ public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) {

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand All @@ -62,7 +60,6 @@ public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) {

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand All @@ -76,7 +73,6 @@ public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T>

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand All @@ -91,7 +87,6 @@ public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T>

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand All @@ -107,7 +102,6 @@ public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T>

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand All @@ -124,7 +118,6 @@ public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T>

/**
* Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre>
*/
Expand Down
7 changes: 0 additions & 7 deletions hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java
Expand Up @@ -30,7 +30,6 @@ public void describeTo(Description description) {

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand All @@ -41,7 +40,6 @@ public static <T> AnyOf<T> anyOf(Iterable<Matcher<? super T>> matchers) {

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand All @@ -52,7 +50,6 @@ public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers) {

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand All @@ -66,7 +63,6 @@ public static <T> AnyOf<T> anyOf(Matcher<T> first, Matcher<? super T> second) {

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand All @@ -81,7 +77,6 @@ public static <T> AnyOf<T> anyOf(Matcher<T> first, Matcher<? super T> second, Ma

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand All @@ -97,7 +92,6 @@ public static <T> AnyOf<T> anyOf(Matcher<T> first, Matcher<? super T> second, Ma

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand All @@ -114,7 +108,6 @@ public static <T> AnyOf<T> anyOf(Matcher<T> first, Matcher<? super T> second, Ma

/**
* Creates a matcher that matches if the examined object matches <b>ANY</b> of the specified matchers.
* <p/>
* For example:
* <pre>assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))</pre>
*/
Expand Down
Expand Up @@ -42,7 +42,6 @@ private ArrayList<Matcher<? super T>> templatedListWith(Matcher<? super T> other

/**
* Creates a matcher that matches when both of the specified matchers match the examined object.
* <p/>
* For example:
* <pre>assertThat("fab", both(containsString("a")).and(containsString("b")))</pre>
*/
Expand All @@ -63,7 +62,6 @@ public CombinableMatcher<X> and(Matcher<? super X> other) {

/**
* Creates a matcher that matches when either of the specified matchers match the examined object.
* <p/>
* For example:
* <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre>
*/
Expand All @@ -81,4 +79,4 @@ public CombinableMatcher<X> or(Matcher<? super X> other) {
return new CombinableMatcher<X>(first).or(other);
}
}
}
}
Expand Up @@ -56,7 +56,6 @@ public void describeMismatch(Object item, Description description) {
/**
* Wraps an existing matcher, overriding its description with that specified. All other functions are
* delegated to the decorated matcher, including its mismatch description.
* <p/>
* For example:
* <pre>describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())</pre>
*
Expand Down
1 change: 0 additions & 1 deletion hamcrest-core/src/main/java/org/hamcrest/core/Every.java
Expand Up @@ -33,7 +33,6 @@ public void describeTo(Description description) {
* Creates a matcher for {@link Iterable}s that only matches when a single pass over the
* examined {@link Iterable} yields items that are all matched by the specified
* <code>itemMatcher</code>.
* <p/>
* For example:
* <pre>assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))</pre>
*
Expand Down
3 changes: 0 additions & 3 deletions hamcrest-core/src/main/java/org/hamcrest/core/Is.java
Expand Up @@ -40,7 +40,6 @@ public void describeMismatch(Object item, Description mismatchDescription) {
/**
* Decorates another Matcher, retaining its behaviour, but allowing tests
* to be slightly more expressive.
* <p/>
* For example:
* <pre>assertThat(cheese, is(equalTo(smelly)))</pre>
* instead of:
Expand All @@ -54,7 +53,6 @@ public static <T> Matcher<T> is(Matcher<T> matcher) {

/**
* A shortcut to the frequently used <code>is(equalTo(x))</code>.
* <p/>
* For example:
* <pre>assertThat(cheese, is(smelly))</pre>
* instead of:
Expand All @@ -68,7 +66,6 @@ public static <T> Matcher<T> is(T value) {

/**
* A shortcut to the frequently used <code>is(instanceOf(SomeClass.class))</code>.
* <p/>
* For example:
* <pre>assertThat(cheese, isA(Cheddar.class))</pre>
* instead of:
Expand Down
Expand Up @@ -61,7 +61,6 @@ public void describeTo(Description description) {
* examined {@link Iterable} yields at least one item that is matched by the specified
* <code>itemMatcher</code>. Whilst matching, the traversal of the examined {@link Iterable}
* will stop as soon as a matching item is found.
* <p/>
* For example:
* <pre>assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith("ba")))</pre>
*
Expand All @@ -78,7 +77,6 @@ public static <T> Matcher<Iterable<? super T>> hasItem(Matcher<? super T> itemMa
* examined {@link Iterable} yields at least one item that is equal to the specified
* <code>item</code>. Whilst matching, the traversal of the examined {@link Iterable}
* will stop as soon as a matching item is found.
* <p/>
* For example:
* <pre>assertThat(Arrays.asList("foo", "bar"), hasItem("bar"))</pre>
*
Expand All @@ -96,7 +94,6 @@ public static <T> Matcher<Iterable<? super T>> hasItem(T item) {
* examined {@link Iterable} yield at least one item that is matched by the corresponding
* matcher from the specified <code>itemMatchers</code>. Whilst matching, each traversal of
* the examined {@link Iterable} will stop as soon as a matching item is found.
* <p/>
* For example:
* <pre>assertThat(Arrays.asList("foo", "bar", "baz"), hasItems(endsWith("z"), endsWith("o")))</pre>
*
Expand All @@ -120,7 +117,6 @@ public static <T> Matcher<Iterable<T>> hasItems(Matcher<? super T>... itemMatche
* examined {@link Iterable} yield at least one item that is equal to the corresponding
* item from the specified <code>items</code>. Whilst matching, each traversal of the
* examined {@link Iterable} will stop as soon as a matching item is found.
* <p/>
* For example:
* <pre>assertThat(Arrays.asList("foo", "bar", "baz"), hasItems("baz", "foo"))</pre>
*
Expand Down
1 change: 0 additions & 1 deletion hamcrest-core/src/main/java/org/hamcrest/core/IsEqual.java
Expand Up @@ -79,7 +79,6 @@ private static boolean isArray(Object o) {
* it will match if both the operand and the examined object are arrays of the same length and
* contain items that are equal to each other (according to the above rules) <b>in the same
* indexes</b>.</p>
* <p/>
* For example:
* <pre>
* assertThat("foo", equalTo("foo"));
Expand Down
Expand Up @@ -65,8 +65,7 @@ public void describeTo(Description description) {
* the examined object.
*
* <p>The created matcher assumes no relationship between specified type and the examined object.</p>
* <p/>
* For example:
* For example:
* <pre>assertThat(new Canoe(), instanceOf(Paddlable.class));</pre>
*
*/
Expand All @@ -84,8 +83,7 @@ public static <T> Matcher<T> instanceOf(Class<?> type) {
* <p>The created matcher forces a relationship between specified type and the examined object, and should be
* used when it is necessary to make generics conform, for example in the JMock clause
* <code>with(any(Thing.class))</code></p>
* <p/>
* For example:
* For example:
* <pre>assertThat(new Canoe(), instanceOf(Canoe.class));</pre>
*
*/
Expand Down
2 changes: 0 additions & 2 deletions hamcrest-core/src/main/java/org/hamcrest/core/IsNot.java
Expand Up @@ -34,7 +34,6 @@ public void describeTo(Description description) {
/**
* Creates a matcher that wraps an existing matcher, but inverts the logic by which
* it will match.
* <p/>
* For example:
* <pre>assertThat(cheese, is(not(equalTo(smelly))))</pre>
*
Expand All @@ -48,7 +47,6 @@ public static <T> Matcher<T> not(Matcher<T> matcher) {

/**
* A shortcut to the frequently used <code>not(equalTo(x))</code>.
* <p/>
* For example:
* <pre>assertThat(cheese, is(not(smelly)))</pre>
* instead of:
Expand Down
4 changes: 0 additions & 4 deletions hamcrest-core/src/main/java/org/hamcrest/core/IsNull.java
Expand Up @@ -24,7 +24,6 @@ public void describeTo(Description description) {

/**
* Creates a matcher that matches if examined object is <code>null</code>.
* <p/>
* For example:
* <pre>assertThat(cheese, is(nullValue())</pre>
*
Expand All @@ -36,7 +35,6 @@ public static Matcher<Object> nullValue() {

/**
* A shortcut to the frequently used <code>not(nullValue())</code>.
* <p/>
* For example:
* <pre>assertThat(cheese, is(notNullValue()))</pre>
* instead of:
Expand All @@ -51,7 +49,6 @@ public static Matcher<Object> notNullValue() {
/**
* Creates a matcher that matches if examined object is <code>null</code>. Accepts a
* single dummy argument to facilitate type inference.
* <p/>
* For example:
* <pre>assertThat(cheese, is(nullValue(Cheese.class))</pre>
*
Expand All @@ -66,7 +63,6 @@ public static <T> Matcher<T> nullValue(Class<T> type) {
/**
* A shortcut to the frequently used <code>not(nullValue(X.class)). Accepts a
* single dummy argument to facilitate type inference.</code>.
* <p/>
* For example:
* <pre>assertThat(cheese, is(notNullValue(X.class)))</pre>
* instead of:
Expand Down
Expand Up @@ -21,7 +21,6 @@ protected boolean evalSubstringOf(String s) {
/**
* Creates a matcher that matches if the examined {@link String} contains the specified
* {@link String} anywhere.
* <p/>
* For example:
* <pre>assertThat("myStringOfNote", containsString("ring"))</pre>
*
Expand All @@ -37,7 +36,6 @@ public static Matcher<String> containsString(String substring) {
/**
* Creates a matcher that matches if the examined {@link String} contains the specified
* {@link String} anywhere, ignoring case.
* <p/>
* For example:
* <pre>assertThat("myStringOfNote", containsString("ring"))</pre>
*
Expand Down
Expand Up @@ -19,7 +19,6 @@ protected boolean evalSubstringOf(String s) {
/**
* Creates a matcher that matches if the examined {@link String} ends with the specified
* {@link String}.
* <p/>
* For example:
* <pre>assertThat("myStringOfNote", endsWith("Note"))</pre>
*
Expand All @@ -34,7 +33,6 @@ public static Matcher<String> endsWith(String suffix) {
/**
* Creates a matcher that matches if the examined {@link String} ends with the specified
* {@link String}, ignoring case.
* <p/>
* For example:
* <pre>assertThat("myStringOfNote", endsWith("Note"))</pre>
*
Expand Down
Expand Up @@ -15,9 +15,10 @@ public class StringStartsWith extends SubstringMatcher {
protected boolean evalSubstringOf(String s) { return converted(s).startsWith(converted(substring)); }

/**
* <p>
* Creates a matcher that matches if the examined {@link String} starts with the specified
* {@link String}.
* <p/>
* </p>
* For example:
* <pre>assertThat("myStringOfNote", startsWith("my"))</pre>
*
Expand All @@ -28,9 +29,10 @@ public class StringStartsWith extends SubstringMatcher {
public static Matcher<String> startsWith(String prefix) { return new StringStartsWith(false, prefix); }

/**
* <p>
* Creates a matcher that matches if the examined {@link String} starts with the specified
* {@link String}, ignoring case
* <p/>
* </p>
* For example:
* <pre>assertThat("myStringOfNote", startsWith("my"))</pre>
*
Expand Down

0 comments on commit dbebced

Please sign in to comment.