diff --git a/src/main/java/io/reactivex/Maybe.java b/src/main/java/io/reactivex/Maybe.java index a2e033acbc..9e468e9d6d 100644 --- a/src/main/java/io/reactivex/Maybe.java +++ b/src/main/java/io/reactivex/Maybe.java @@ -2193,6 +2193,10 @@ public final Single count() { * Returns a Maybe that emits the item emitted by the source Maybe or a specified default item * if the source Maybe is empty. *

+ * Note that the result Maybe is semantically equivalent to a {@code Single}, since it's guaranteed + * to emit exactly one item or an error. See {@link #toSingle(Object)} for a method with equivalent + * behavior which returns a {@code Single}. + *

* *

*
Scheduler:
diff --git a/src/test/java/io/reactivex/JavadocWording.java b/src/test/java/io/reactivex/JavadocWording.java index 627b2b1732..f8c881ee78 100644 --- a/src/test/java/io/reactivex/JavadocWording.java +++ b/src/test/java/io/reactivex/JavadocWording.java @@ -148,9 +148,11 @@ public void maybeDocRefersToMaybeTypes() throws Exception { for (;;) { int idx = m.javadoc.indexOf("Single", jdx); if (idx >= 0) { - if (!m.signature.contains("Single")) { + int j = m.javadoc.indexOf("#toSingle", jdx); + int k = m.javadoc.indexOf("{@code Single", jdx); + if (!m.signature.contains("Single") && (j + 3 != idx && k + 7 != idx)) { e.append("java.lang.RuntimeException: Maybe doc mentions Single but not in the signature\r\n at io.reactivex.") - .append("Maybe (Maybe.java:").append(m.javadocLine + lineNumber(m.javadoc, idx) - 1).append(")\r\n\r\n"); + .append("Maybe(Maybe.java:").append(m.javadocLine + lineNumber(m.javadoc, idx) - 1).append(")\r\n\r\n"); } jdx = idx + 6; } else {