Problem with method references

Stephen Colebourne scolebourne at joda.org
Fri Jan 14 09:35:03 PST 2011


On 14 January 2011 16:38, Brian Goetz <brian.goetz at oracle.com> wrote:
>> Something like:  new#Integer(int)
>
> I think we'd discussed
>
>   Integer#new(int)

:-)

<tangent>

Since there is talk of keeping the ref and immediate syntaxes the
same, perhaps we should consider adding a synonm for object
construction:

  Integer a = new Integer(2);
  Integer a = Integer.new(2);

I'd love to see that as it would make it much easier to discover
whether 'new' or a factory should be used when using an IDE.

  Integer a = Integer.<ctrl-space>   -> choice of 'new' or 'valueOf'

Going even further, there could be a way to make certain factories
used in place of 'new'.

</tangent>

Stephen


More information about the lambda-dev mailing list