瀏覽代碼

tests for Bugzilla Bug 50641

   Better binary compatibility for advice method names
tags/v_preCompileLoopAlteration
jhugunin 20 年之前
父節點
當前提交
9e3a03d726

+ 17
- 0
tests/bugs/binaryCompat/Main.java 查看文件

@@ -0,0 +1,17 @@
public class Main {
public static void main(String[] args) {
try {
doit();
if (Trace.expectNoSuchMethodError) {
throw new RuntimeException("expected NoSuchMethodError");
}
} catch (NoSuchMethodError e) {
if (!Trace.expectNoSuchMethodError) throw e;
}
}
private static void doit() {
System.out.println("hello world");
}
}

+ 11
- 0
tests/bugs/binaryCompat/TraceRE.aj 查看文件

@@ -0,0 +1,11 @@
aspect Trace {
public static boolean expectNoSuchMethodError = true;
before(): execution(void main(..)) { // expect an error for incompatible binary change
System.out.println("enter");
}
after() returning: execution(void doit(..)) {
System.out.println("exit");
}
}

+ 11
- 0
tests/bugs/binaryCompat/TraceV1.aj 查看文件

@@ -0,0 +1,11 @@
aspect Trace {
public static boolean expectNoSuchMethodError = false;
before(): execution(void doit(..)) {
System.out.println("enter");
}
after() returning: execution(void doit(..)) {
System.out.println("exit");
}
}

+ 11
- 0
tests/bugs/binaryCompat/TraceV2.aj 查看文件

@@ -0,0 +1,11 @@
aspect Trace {
public static boolean expectNoSuchMethodError = false;
before(): execution(void doit(..)) {
System.out.println("entering");
}
after() returning: execution(void doit(..)) {
System.out.println("exiting");
}
}

Loading…
取消
儲存