On Mon, 15 Jul 2024 15:47:50 GMT, Chen Liang <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java line 778:
>>
>>> 776: var newParameters = new TreeMap<Name, Integer>(new
>>> Comparator<>() {
>>> 777: public int compare(Name n1, Name n2) {
>>> 778: return n1.index() - n2.index();
>>
>> We don't have to call the method here and do the translation to "proper"
>> index here, or do we?
>
> Using `n1.offsetIndex - n2.offsetIndex` feels weird in an encapsulation POV.
> I will mark `offsetIndex` private to better indicate this being an
> implementation detail not to be relied on.
All right.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20178#discussion_r1678078244