public aspect StaticInitializationWithParameterizedTypesMatching { pointcut allowedStaticInit() : staticinitialization(GenericInterface+); pointcut allowedStaticInitClass() : staticinitialization(GenericImplementingClass+); // matches ConcreteImplementingClass // matches ConcreteExtendingClass declare warning : allowedStaticInit() : "clinit(GenericInterface+)"; // matches ConcreteExtendingClass declare warning : allowedStaticInitClass() : "clinit(GenericImplementingClass+)"; // no matches declare warning : staticinitialization(GenericInterface+) : "should not match"; // no matches declare warning : staticinitialization(GenericInterface+) : "should not match"; }