Skip to content

Commit 534c118

Browse files
committed
reword @PMMBN javdoc
1 parent baf72d1 commit 534c118

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

mug/src/main/java/com/google/mu/annotations/ParametersMustMatchByName.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232
* new Profile(currentUser.getId(), currentUser.getName())
3333
* }</pre>
3434
*
35-
* But it will fail to compile if the constructor were defined as {@code
36-
* record Profile(String userName, String userId)}. The {@code currentUser.getId()} expression
37-
* matches the {@code userId} parameter name because the effective tokens of {@code
38-
* currentUser.getId()} is {@code ["current", "user", "id"]} ("get" and "is" prefixes are ignored),
39-
* which includes as a subsequence the {@code ["user", "id"]} tokens from {@code userId}.
35+
* But if you changed the constructor signature to {@code
36+
* record Profile(String userName, String userId)}. it will fail to compile because the parameter
37+
* name doesn't match the provided arguments.
38+
*
39+
* <p>The {@code currentUser.getId()} expression matches the {@code userId} parameter name
40+
* because the effective tokens of {@code currentUser.getId()} is {@code ["current", "user", "id"]}
41+
* ("get" and "is" prefixes are ignored). It includes as a subsequence the {@code ["user", "id"]}
42+
* tokens from {@code userId}.
4043
*
4144
* <p>If the argument expression is indeed as expected despite not matching the parameter name,
4245
* you can always add an explicit comment to tell the compiler <em>and the code readers</em> that:

0 commit comments

Comments
 (0)