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.

TriTestMethodLookup.java 592B

1234567891011121314151617181920
  1. import org.aspectj.testing.Tester;
  2. class TriTestMethodLookup {
  3. static String foo(byte b) { return "byte"; }
  4. static String foo(short s) { return "short"; }
  5. static final int byteAsInt = 127;
  6. static final int shortAsInt = 128;
  7. static byte byteType = 0;
  8. static short shortType = 0;
  9. static boolean notTrue = false;
  10. public static void main(String[] args) {
  11. Tester.checkEqual(foo(notTrue ? byteType : byteAsInt), "byte", "lub(byte, 127) --> byte");
  12. Tester.checkEqual(foo(notTrue ? shortType : shortAsInt),"short", "lub(short, 128) --> short");
  13. }
  14. }