aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/ArrayInc1CE.java
blob: 5ebd861123c83c9de63600e3ab57a88cb570a7c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * @testcase PR#715 PUREJAVA incrementing objects, arrays
 */
public class ArrayIncCE {
    private static int[] IRA = new int[]{0,1,2};
    private static Object OBJECT = new Object();
    static int[] getIRA() { return IRA; }
    static Object getObject() { return null; }

    public void testObjectIncrementingCE() {
        int i = 0;
        Object object = new Object();
        String[] sra = new String[]{""};
        //++getIRA();       // CE prefix ++ not applied to int[]
        //++getObject();    // CE prefix ++ not applied to Object
        //getIRA()++;       // CE postfix ++ not applied to int[]
        //getObject()++;    // CE postfix ++ not applied to Object
        IRA += 1;         // CE + not applied to int[], int
        //getIRA() += 1;    // CE + not applied to int[], int
        object += 1;      // CE + not applied to Object, int
        //getObject() += 1; // CE + not applied to Object, int
        i = +IRA;         // CE unary + not applied to int[]
        i = +getIRA();    // CE unary + not applied to int[]
        sra += "bad concat"; // CE string + not applied to String[], String
        //"1" += sra[0];    // CE no literal on lhs
    }
}