File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
mug/src/main/java/com/google/mu/annotations Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 3232 * new Profile(currentUser.getId(), currentUser.getName())
3333 * }</pre>
3434 *
35- * But if you changed the constructor signature to {@code
35+ * But if you change the constructor signature to {@code
3636 * record Profile(String userName, String userId)}. it will fail to compile because the parameter
37- * name doesn't match the provided arguments .
37+ * names no longer match the provided argument expressions, in order .
3838 *
3939 * <p>The {@code currentUser.getId()} expression matches the {@code userId} parameter name
4040 * because the effective tokens of {@code currentUser.getId()} is {@code ["current", "user", "id"]}
4141 * ("get" and "is" prefixes are ignored). It includes as a subsequence the {@code ["user", "id"]}
4242 * tokens from {@code userId}.
4343 *
44- * <p>If the argument expression is indeed as expected despite not matching the parameter name,
45- * you can always add an explicit comment to tell the compiler <em>and the code readers</em> that:
46- * "trust me, I know what I'm doing".
44+ * <p>Occasionally, if the argument expression is indeed as expected despite not matching the
45+ * parameter name, you can always add an explicit comment to tell the compiler
46+ * <em>and the code readers</em> that: "trust me, I know what I'm doing".
4747 *
4848 * <p>For example: <pre>
4949 * new Dimension(/* width */ list.get(0), /* height */ list.get(1));
You can’t perform that action at this time.
0 commit comments