|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
Name: rmT116609 Date: 03/08/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
WindowsXP
A DESCRIPTION OF THE PROBLEM :
The following does not compile, while I belive it should.
Unfortunately the JSR does not say anything about compound assignments
public static void main(String[] args) {
Byte b = (byte)100;
// *= /= %= += -= <<= >>= >>>= &= ^= |=
b+=1; b-=1; b*=1; b/=1; b%=7; b<<=2; b>>=1; b>>>=1; b^=8; b|=2; b&=9;
}
Writing "b++", however works just fine.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile:
public static void main(String[] args) {
Byte b = (byte)100;
// *= /= %= += -= <<= >>= >>>= &= ^= |=
b+=1; b-=1; b*=1; b/=1; b%=7; b<<=2; b>>=1; b>>>=1; b^=8; b|=2; b&=9;
}
ERROR MESSAGES/STACK TRACES THAT OCCUR :
inconvertible types // found : int // required: java.lang.Byte
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Test {
public static void main(String[] args) {
Byte b = (byte)100;
// *= /= %= += -= <<= >>= >>>= &= ^= |=
b+=1; b-=1; b*=1; b/=1; b%=7; b<<=2; b>>=1; b>>>=1; b^=8; b|=2; b&=9;
}
}
---------- END SOURCE ----------
(Incident Review ID: 242329)
======================================================================
|