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.

NonOverEagerConstantFolding.java 498B

12345678910111213141516171819202122232425262728
  1. import org.aspectj.testing.Tester;
  2. class NonOverEagerConstantFolding {
  3. public static final int i = 3;
  4. static boolean thingy = false;
  5. static NonOverEagerConstantFolding foo() {
  6. thingy = true;
  7. return null;
  8. }
  9. public static void main(String[] args) {
  10. int j = 3 + foo().i;
  11. Tester.check(thingy, "didn't evaluate expr part of field access expr");
  12. }
  13. }
  14. /*
  15. class Test {
  16. int i = 3;
  17. class C {
  18. C() {
  19. ++j;
  20. }
  21. int j = i + 2;
  22. }
  23. void foo() {
  24. new C();
  25. }
  26. }
  27. */