選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. }