RFR 8075207: Nashorn parser API returns StatementTree objects in out of order

A. Sundararajan sundararajan.athijegannathan at oracle.com
Mon Mar 16 11:30:06 UTC 2015


Hi,

Thanks for the review. Fixed to use method reference.

PS. Uploaded updated webrev for reference: 
http://cr.openjdk.java.net/~sundar/8075207/webrev.01/

Thanks,
-Sundar

On Monday 16 March 2015 04:10 PM, Remi Forax wrote:
> Hi Sundar,
> Looks good !
>
> just nitpicking, Java 8 introduces a method sort() on List so instead of
> Collections.sort(statList, (s1, s2)->(s1.getStart() - s2.getStart()));
>
> one can write
> statList.sort((s1, s2)->Integer.compare(s1.getStart(), s2.getStart()));
> (Integer.compare() is used avoid the overflow problem)
>
> or with a method reference,
> statList.sort(Comparator.comparingInt(Statement::getStart));
>
> cheers,
> Rémi
>
>
> On 03/16/2015 11:21 AM, A. Sundararajan wrote:
>> Please review http://cr.openjdk.java.net/~sundar/8075207/ for 
>> https://bugs.openjdk.java.net/browse/JDK-8075207
>>
>> PS. Piggybacking few @Override and other clean-ups..
>>
>> Thanks,
>> -Sundar
>



More information about the nashorn-dev mailing list