org.aspectj/tests/new/EmptyInterface.java
jhugunin 6cceb1b9c3 fix for Bugzilla Bug 49295
duplicate warning or second join point for constructor-execution
2004-01-28 00:36:05 +00:00

35 lines
760 B
Java

import org.aspectj.testing.Tester;
/** @testcase PR#36778 advise join points in subclass of empty interface */
public class EmptyInterface {
public static void main(String[] args) {
new C().go();
// at least constructor and method execution
if (2 > Log.hits) {
Tester.check(false, Log.log.toString());
}
}
}
aspect Log {
static int hits;
static StringBuffer log = new StringBuffer();
interface LoggedType {
}
declare parents: C implements LoggedType;
after(): within(LoggedType+)
//&& !initialization(new(..))
//&& !preinitialization(new(..)) // 1.1 only
{
hits++;
log.append(thisJoinPoint + ";");
}
}
class C {
void go() {}
}