import java.io.Serializable; public aspect StaticInitializationWithGenericTypesAdvanced { // basic bounds declare warning : staticinitialization(JustCallMeGeneric) : "simple match"; declare warning : staticinitialization(JustCallMeGeneric) : "matches since R and R extends Object are equivalent"; // interface bounds declare warning : staticinitialization(ClassWithInterfaceBounds) : "raw type should match"; declare warning : staticinitialization(ClassWithInterfaceBounds) // CW L19 : "unbound type variable does not match"; declare warning : staticinitialization(ClassWithInterfaceBounds) // CW L23 : "upper bound match on its own is not enough"; declare warning : staticinitialization(ClassWithInterfaceBounds) // CW L27 : "still no match, wrong number of i/f bounds"; declare warning : staticinitialization(ClassWithInterfaceBounds) : "matches all bounds"; declare warning : staticinitialization(ClassWithInterfaceBounds) : "still matches with interfaces specified in a different order"; // type variable inter-dependencies declare warning : staticinitialization(TypeVariablesTiedInKnots) // CW L40 : "no match, wrong upper bound on B"; declare warning : staticinitialization(TypeVariablesTiedInKnots) : "matches with type variable inter-dependencies"; // wildcards in patterns declare warning : staticinitialization(*) : "matches any generic type with one unbound type var"; declare warning : staticinitialization(*) : "any generic type with one type var bound to Number or subtype"; declare warning : staticinitialization(*) : "matches a generic type with any upper bound and i/f bounds"; } class ClassWithInterfaceBounds { T really; } class TypeVariablesTiedInKnots { S club; T later; } class JustCallMeGeneric { T simple; } class MinesADouble { D orQuit; }