@@ -97,18 +97,18 @@ <h1 title="Annotation Interface ParametersMustMatchByName" class="title">Annotat
9797 new Profile(currentUser.getId(), currentUser.getName())
9898 </ code > </ pre >
9999
100- But if you changed the constructor signature to < code >
100+ But if you change the constructor signature to < code >
101101 record Profile(String userName, String userId)</ code > . it will fail to compile because the parameter
102- name doesn't match the provided arguments .
102+ names no longer match the provided argument expressions, in order .
103103
104104 < p > The < code > currentUser.getId()</ code > expression matches the < code > userId</ code > parameter name
105105 because the effective tokens of < code > currentUser.getId()</ code > is < code > ["current", "user", "id"]</ code >
106106 ("get" and "is" prefixes are ignored). It includes as a subsequence the < code > ["user", "id"]</ code >
107107 tokens from < code > userId</ code > .
108108
109- < p > If the argument expression is indeed as expected despite not matching the parameter name,
110- you can always add an explicit comment to tell the compiler < em > and the code readers </ em > that:
111- "trust me, I know what I'm doing".
109+ < p > Occasionally, if the argument expression is indeed as expected despite not matching the
110+ parameter name, you can always add an explicit comment to tell the compiler
111+ < em > and the code readers </ em > that: "trust me, I know what I'm doing".
112112
113113 < p > For example: < pre >
114114 new Dimension(/* width */ list.get(0), /* height */ list.get(1));
0 commit comments