[patch] 6646584 Compound assignment with Byte, Short and Character
Peter Ahé
peter at ahe.dk
Thu Jan 3 06:22:53 PST 2008
It is not a bug. See http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.26.2
and http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7
. There is no unboxing conversion from int to, for example, Short. I
think this is deliberate, as it would require a narrowing primitive
conversion from int to short and a possible loss of information. See: http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.3
See also: http://blogs.sun.com/ahe/entry/contributing_to_javac
Cheers,
Peter
On Jan 3, 2008, at 2:12 PM, Dmytro Sheyko wrote:
> Sure,
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6646584
>
> From: peter.ahe at gmail.com
> To: dmytro_sheyko at hotmail.com
> Subject: Re: [patch] 6646584 Compound assignment with Byte, Short
> and Character
> Date: Thu, 3 Jan 2008 13:57:52 +0100
> CC: compiler-dev at openjdk.java.net
>
> I cannot access the bug report. Could someone provide a link?
>
> Cheers,
> Peter
>
> Sent from my iPhone
>
> On Jan 3, 2008, at 13:35, Dmytro Sheyko <dmytro_sheyko at hotmail.com>
> wrote:
>
> Hi,
>
> Attached patch that is to fix bug#6646584
>
> Problem description:
> Javac forbids compound assignment if lhs is of type Byte, Short,
> Character.
>
> Express yourself instantly with MSN Messenger! MSN Messenger
More information about the compiler-dev
mailing list