From the issue tracker

Richard Warburton richard.warburton at gmail.com
Thu Aug 15 06:26:47 PDT 2013


Hi,

https://java.net/jira/browse/**JSR_335-5<https://java.net/jira/browse/JSR_335-5>
> Summary: What shoudl the specified toString behavior of lambdas be?
> Disposition: no decision reached
>

Has a decision been made about toString() on method references?  That seems
like something where it would be possible to provide a nice, usable String
format.

I think this kind of issue is quite important from a debugging point of
view, since many IDEs use 'toString()' as their default method of
formatting many values in "expression" or "variables" views is to use
toString().  One of the annoying issues if you're trying to debug callback
heavy code is identifying which callback is being referenced where.
 Anonymous inner classes don't provide a toString() by default that lets
you locate the code very well.  Eg: in order to locate "Foo$4 at 31232" I
would have to look for the 4th anonymous inner class in the class Foo.  I'm
sure there are several ways to skin the cat, but if the serialisation
format provided the line number at which the lambda expression starts as
part of its toString() it would make things like much easier.

regards,

  Dr. Richard Warburton

  http://insightfullogic.com
  @RichardWarburto <http://twitter.com/richardwarburto>


More information about the lambda-spec-observers mailing list