Skip to content

Commit cd2ce82

Browse files
Javadoc improvements
1 parent daf13ee commit cd2ce82

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ public SELF contains(CharSequence... values) {
665665
* Verifies that the actual {@code CharSequence} contains any of the given values.
666666
* <p>
667667
* Example:
668-
* <pre><code class='java'> // assertions will pass
668+
* <pre><code class='java'> // assertion succeeds
669669
* assertThat(&quot;Gandalf the grey&quot;).containsAnyOf(&quot;grey&quot;, &quot;black&quot;);
670670
*
671-
* // assertions will fail
671+
* // assertion fails
672672
* assertThat(&quot;Gandalf the grey&quot;).containsAnyOf(&quot;white&quot;, &quot;black&quot;);</code></pre>
673673
*
674674
* @param values the values to look for.

src/main/java/org/assertj/core/api/AbstractPathAssert.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,20 +1117,14 @@ public SELF hasNoParentRaw() {
11171117
* </p>
11181118
*
11191119
* Examples:
1120-
* <pre><code class="java"> // Given the following empty paths
1121-
* /root/sub-dir-1/foo.ext
1122-
* /root/sub-dir-1/bar.ext
1120+
* <pre><code class="java">
1121+
* Path foxPath = Files.write(Paths.get("/fox.txt"), "The Quick Brown Fox.".getBytes());
1122+
*
1123+
* // this assertion succeeds
1124+
* assertThat(foxPath).hasSize(20);
11231125
*
1124-
* Path emptyPath = Paths.get("/root/sub-dir-1/foo.ext")
1125-
* Path nonEmptyPath = Files.write(Paths.get("/root/sub-dir-1/bar.ext"),
1126-
* "The Quick Brown Fox.".getBytes());
1127-
* // the following assertions pass
1128-
* assertThat(emptyPath).hasSize(0);
1129-
* assertThat(nonEmptyPath).hasSize(20);
1130-
*
1131-
* // the following assertions fail
1132-
* assertThat(emptyPath).hasSize(5);
1133-
* assertThat(nonEmptyPath).hasSize(0);</code></pre>
1126+
* // this assertion fails
1127+
* assertThat(foxPath).hasSize(3);</code></pre>
11341128
*
11351129
* @param expectedSize the expected {@code Path} file size in bytes
11361130
* @return {@code this} assertion object
@@ -1912,27 +1906,26 @@ private String readPath(Charset charset) {
19121906

19131907
/**
19141908
* Verifies that the actual {@code Path} has given extension.
1915-
*
19161909
* <p>
19171910
* Example:
19181911
* <pre><code class='java'> Path path = Paths.get(&quot;file.java&quot;);
19191912
*
1920-
* // assertion will pass
1913+
* // assertion succeeds:
19211914
* assertThat(path).hasExtension(&quot;java&quot;);
19221915
*
1923-
* // assertion will fail
1916+
* // assertion fails:
19241917
* assertThat(path).hasExtension(&quot;png&quot;);</code></pre>
19251918
*
1926-
* @param expected the expected extension, without the {@code '.'}.
1919+
* @param expectedExtension the expected extension, without the {@code '.'}.
19271920
* @return {@code this} assertion object.
19281921
* @throws NullPointerException if the expected extension is {@code null}.
19291922
* @throws AssertionError if the actual {@code Path} is {@code null}.
19301923
* @throws AssertionError if the actual {@code Path} is not a regular file.
19311924
* @throws AssertionError if the actual {@code Path} does not have the expected extension.
19321925
* @since 3.21.0
19331926
*/
1934-
public SELF hasExtension(String expected) {
1935-
paths.assertHasExtension(info, actual, expected);
1927+
public SELF hasExtension(String expectedExtension) {
1928+
paths.assertHasExtension(info, actual, expectedExtension);
19361929
return myself;
19371930
}
19381931

0 commit comments

Comments
 (0)