Cannot apply multiple (implicit) conversions in assignment

Richard Kolb rjdkolb at gmail.com
Thu Apr 23 09:37:36 UTC 2015


Correcting my English :)

Hi Volker,

Thanks. I was hoping for more of an informal community talk before I go
there.To be honest I need to know I am not asking a uninformed question.

https://gist.github.com/rjdkolb/fb3a66aa2660b981949c
I've been looking at the javap bytecode I don't see why this is not
possible in createObjectLongAutoBoxing.

Long.valueOf() supports both a int and a long.
Perhaps the problem is more complex than that.

regards,
Richard

On 23 April 2015 at 11:36, Richard Kolb <rjdkolb at gmail.com> wrote:

> Hi Volker,
>
> Thanks. I was hoping for more of an informal community talk before I go
> there.To be honest I need to know I am not asking a uninformed question.
>
> https://gist.github.com/rjdkolb/fb3a66aa2660b981949c
> I've been looking at the javap bytecode I don't see what this is not
> possible in createObjectLongAutoBoxing.
>
> Long.valueOf() supports both a int and a long.
> Perhaps the problem is more complex than that.
>
> regards,
> Richard
>
>
> On 23 Apr 2015 10:25, "Volker Simonis" <volker.simonis at gmail.com> wrote:
>
>> Hi Richard,
>>
>> this is the wrong list for such kind of question. You probably want to
>> ask at compiler-dev at openjdk.java.net.
>>
>> Regards,
>> Volker
>>
>>
>> On Thu, Apr 23, 2015 at 9:58 AM, Richard Kolb <rjdkolb at gmail.com> wrote:
>> > Hello,
>> >
>> > I would like to start a discussion on a little issue on double
>> conversions
>> > in Java.
>> >
>> > Since Java 5 a simple boxing statement like this would fail :
>> > Long l = 250;
>> > And this passes :
>> > Long l = 250L;
>> >
>> > This has to do with the fact that a double conversion needs to take
>> place :
>> > https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.2
>> >
>> > For Java 9, is it possible to make the compiler clever enough to accept
>> > double conversions in cases like these ?
>> >
>> > thanks,
>> > Richard.
>>
>


More information about the adoption-discuss mailing list