diff options
Diffstat (limited to 'tests/new/ArrayIncCE.java')
-rw-r--r-- | tests/new/ArrayIncCE.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/new/ArrayIncCE.java b/tests/new/ArrayIncCE.java new file mode 100644 index 000000000..0f809a0dc --- /dev/null +++ b/tests/new/ArrayIncCE.java @@ -0,0 +1,24 @@ + +/** + * @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 + getIRA() += 1; // CE + not applied to int[], int + getObject() += 1; // CE + not applied to Object, int + "1" += sra[0]; // CE no literal on lhs + } +} + |