2003-04-23 01:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
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();
|
2003-04-24 23:05:44 +02:00
|
|
|
interface LoggedType {
|
|
|
|
}
|
2003-04-23 01:13:18 +02:00
|
|
|
declare parents: C implements LoggedType;
|
2004-01-28 01:36:05 +01:00
|
|
|
after(): within(LoggedType+)
|
2003-04-24 23:05:44 +02:00
|
|
|
//&& !initialization(new(..))
|
|
|
|
//&& !preinitialization(new(..)) // 1.1 only
|
2003-04-23 01:13:18 +02:00
|
|
|
{
|
|
|
|
hits++;
|
|
|
|
log.append(thisJoinPoint + ";");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class C {
|
|
|
|
void go() {}
|
|
|
|
}
|