Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ArrayIncCE.java 860B

123456789101112131415161718192021222324
  1. /**
  2. * @testcase PR#715 PUREJAVA incrementing objects, arrays
  3. */
  4. public class ArrayIncCE {
  5. private static int[] IRA = new int[]{0,1,2};
  6. private static Object OBJECT = new Object();
  7. static int[] getIRA() { return IRA; }
  8. static Object getObject() { return null; }
  9. public void testObjectIncrementingCE() {
  10. int i = 0;
  11. Object object = new Object();
  12. String[] sra = new String[]{""};
  13. ++getIRA(); // CE prefix ++ not applied to int[]
  14. ++getObject(); // CE prefix ++ not applied to Object
  15. getIRA()++; // CE postfix ++ not applied to int[]
  16. getObject()++; // CE postfix ++ not applied to Object
  17. getIRA() += 1; // CE + not applied to int[], int
  18. getObject() += 1; // CE + not applied to Object, int
  19. "1" += sra[0]; // CE no literal on lhs
  20. }
  21. }