-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
6u21
-
x86
-
windows_xp
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The specification of The Java Language Specification, Third Edition allows define the expression statement in following form:
f() || f();
Thus the following function f() should be valid
abstract public boolean f1();
public void f() {
f1() || f1();
}
But javac cannot compile it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try to compile following class:
public class SomeClass {
int n = 0;
public boolean f1() {
return n++ % 2 == 0;
}
public void f() {
f1() || f1();
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
compilation should be successful
ACTUAL -
We have 1 error.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
SomeClass.java:8: not a statement
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class SomeClass {
int n = 0;
public boolean f1() {
return n++ % 2 == 0;
}
public void f() {
f1() || f1();
}
}
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
The specification of The Java Language Specification, Third Edition allows define the expression statement in following form:
f() || f();
Thus the following function f() should be valid
abstract public boolean f1();
public void f() {
f1() || f1();
}
But javac cannot compile it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try to compile following class:
public class SomeClass {
int n = 0;
public boolean f1() {
return n++ % 2 == 0;
}
public void f() {
f1() || f1();
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
compilation should be successful
ACTUAL -
We have 1 error.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
SomeClass.java:8: not a statement
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class SomeClass {
int n = 0;
public boolean f1() {
return n++ % 2 == 0;
}
public void f() {
f1() || f1();
}
}
---------- END SOURCE ----------