line numbers policy change for "multiline" expressions

Remi Forax forax at univ-mlv.fr
Mon Jan 27 06:16:51 PST 2014


Hi Anna,
this change is unlikely be reverted, otherwise for a code like the one 
below,
the lambda body will not have the right line number.

list.stream()
      .filter(....)
      .map(x -> Integer.toString(x))
      .collect(...);

cheers,
Rémi

On 01/27/2014 12:32 PM, Anna Kozlova wrote:
> Hi all,
>
>   
>
> Sorry if it was already discussed.
>
>   
>
> Expressions which span over multiple lines are compiled to different lines
> and in previous versions they were all merged to the 'outer call' line.
>
>   
>
> E.g. for code
>
>   
>
> public static void main(String[] args) {
>
>       foo(bar1(),
>
>                bar());
>
> }
>
>   
>
> Jdk 7:
>
>   
>
> LINENUMBER 15 L1
>
>      INVOKESTATIC start/LineNumbers.bar1 ()Ljava/lang/String;
>
>      INVOKESTATIC start/LineNumbers.bar ()Ljava/lang/String;
>
>      INVOKESTATIC start/LineNumbers.foo
> (Ljava/lang/String;Ljava/lang/String;)V
>
>   
>
> Jdk 8:
>
>   
>
>    L1
>
>      LINENUMBER 15 L1
>
>      INVOKESTATIC start/LineNumbers.bar1 ()Ljava/lang/String;
>
>     L2
>
>      LINENUMBER 16 L2
>
>      INVOKESTATIC start/LineNumbers.bar ()Ljava/lang/String;
>
>     L3
>
>      LINENUMBER 15 L3
>
>      INVOKESTATIC start/LineNumbers.foo
> (Ljava/lang/String;Ljava/lang/String;)V
>
>   
>
> Currently this breaks our debugger and it would be great to know if this
> behavior won't change in the release version.
>
>   
>
> Thank you,
>
> Anna
>
>



More information about the lambda-dev mailing list