Update on JEP-286 (Local Variable Type Inference)

Brian Goetz brian.goetz at oracle.com
Wed Dec 14 22:30:34 UTC 2016


> PROVIDING FEEDBACK
>
> To keep the signal-to-noise ratio to an acceptable level, we're asking 
> people to provide (constructive) feedback through the following 
> survey, whose results will be made public.
>
> https://www.surveymonkey.com/r/FBT9WYP

I have closed the survey.  The survey responses are available in full here:

     https://www.surveymonkey.com/results/SM-6X5CDVJF/

We received 25 responses.  The largest bucket was "general support", 
either for the feature in general, or the specific choices about syntax 
(var only).  The next largest bucket was the "Saddenz, no val" bucket; 
we knew that some people would be disappointed by this choice.  
(Including one elaborate plea for "val only.")  Along with a few "please 
reconsider, I don't like it."

Questions included:

Q: Will "final var" work?
A: Yes.

Q: Can we have a Lisp-inspired "let" expression?
A: Maybe someday, but that's not the focus of this exploration.

Q: How does it work with boxing?  If I say "var x = 42", what do we infer?
A: The type of `42` is `int`, so we infer `x` as `int`.  Boxing 
conversions only comes into play when strictly needed (assigning to a 
reference type, or in method invocations), and is not needed here.

Q: Was a simple IDE plugin considered?
A: Not by us (we don't control all the Java IDEs.)

Q: Did you consider reusing just the "final" keyword?
A: Yes.




More information about the platform-jep-discuss mailing list