You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

A.java 1004B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*******************************************************************************
  2. * Copyright (c) 2010 Contributors
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Andy Clement - Repro test case
  10. * Abraham Nevado
  11. *******************************************************************************/
  12. class AtomicAction {
  13. int status() { return 1; }
  14. int commit(int n) { return 1; }
  15. }
  16. public class A {
  17. public static void main(String []argv) {
  18. System.out.println("It WORKS");
  19. }
  20. AtomicAction f;
  21. public void m() {
  22. switch (f.status()) {
  23. case 1:
  24. throw new RuntimeException("abc");
  25. case 2:
  26. f.commit(1);
  27. return;
  28. }
  29. switch (f.commit(1)) {
  30. case 1:
  31. throw new RuntimeException();
  32. }
  33. }
  34. }