Fix typo in the last changelog entry.
[official-gcc.git] / libjava / testsuite / libjava.lang / err5.java
blobf9e95b635048da29f1b365672544a0e5c8b5080a
1 /*--------------------------------------------------------------------------*/
2 /* file_name : err5.java */
3 /* : */
4 /* Cause : Evaluation order of method argument is not correct. */
5 /* : */
6 /* Message : NG */
7 /* : a:[1]-->[2] */
8 /* : b:[3]-->[3] */
9 /* : c:[2]-->[2] */
10 /* : */
11 /* Note : JLS 15.6 Evaluation Order */
12 /* S15.6.4 Argument Lists are Evaluated Left-to-Right(p309) */
13 /* [Each argument expression appears to be fully evaluated */
14 /* before any part of any argument expression to its right.] */
15 /*--------------------------------------------------------------------------*/
17 public class err5 {
18 public static void main(String[] args) {
19 int x = 1;
21 err5 obj = new err5();
22 obj.print(x, x = 3, x = 2);
25 void print(int a, int b, int c) {
26 if ( a == 1 && b == 3 && c == 2 ) {
27 System.out.println("OK");
28 } else {
29 System.out.println("NG");
30 System.out.println("a:[1]-->["+a+"]");
31 System.out.println("b:[3]-->["+b+"]");
32 System.out.println("c:[2]-->["+c+"]");