aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/IfPCDDupMethod.java
blob: de771d5367b89edc78cc6ee2d2e664138ce102bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * Ajc produces duplicated methods, and javac complains:
 * <pre>..\ajworkingdir\AlreadyDefined.java:51: 
 *   signal$method_call10(java.lang.String) is already defined in AlreadyDefined
 *   private void signal$method_call10(final String msg) </pre>
 */
public class IfPCDDupMethod {
    public static void main(String[] args) { }
}

aspect AlreadyDefined {

    before(): ifFalse(Object)   { signal(""); }
	// must come second
    pointcut ifFalse (Object t) : this(t) && if(t instanceof Runnable ) ; 

	// same result for execution or call or withincode
    after() : withincode(static void IfPCDDupMethod.main(String[])) {
		signal("");
	}

    static void signal(String msg) {
    }
}