@@ -1117,20 +1117,14 @@ public SELF hasNoParentRaw() {
1117
1117
* </p>
1118
1118
*
1119
1119
* 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);
1123
1125
*
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>
1134
1128
*
1135
1129
* @param expectedSize the expected {@code Path} file size in bytes
1136
1130
* @return {@code this} assertion object
@@ -1912,27 +1906,26 @@ private String readPath(Charset charset) {
1912
1906
1913
1907
/**
1914
1908
* Verifies that the actual {@code Path} has given extension.
1915
- *
1916
1909
* <p>
1917
1910
* Example:
1918
1911
* <pre><code class='java'> Path path = Paths.get("file.java");
1919
1912
*
1920
- * // assertion will pass
1913
+ * // assertion succeeds:
1921
1914
* assertThat(path).hasExtension("java");
1922
1915
*
1923
- * // assertion will fail
1916
+ * // assertion fails:
1924
1917
* assertThat(path).hasExtension("png");</code></pre>
1925
1918
*
1926
- * @param expected the expected extension, without the {@code '.'}.
1919
+ * @param expectedExtension the expected extension, without the {@code '.'}.
1927
1920
* @return {@code this} assertion object.
1928
1921
* @throws NullPointerException if the expected extension is {@code null}.
1929
1922
* @throws AssertionError if the actual {@code Path} is {@code null}.
1930
1923
* @throws AssertionError if the actual {@code Path} is not a regular file.
1931
1924
* @throws AssertionError if the actual {@code Path} does not have the expected extension.
1932
1925
* @since 3.21.0
1933
1926
*/
1934
- public SELF hasExtension (String expected ) {
1935
- paths .assertHasExtension (info , actual , expected );
1927
+ public SELF hasExtension (String expectedExtension ) {
1928
+ paths .assertHasExtension (info , actual , expectedExtension );
1936
1929
return myself ;
1937
1930
}
1938
1931
0 commit comments