Using AspectJ, how do you replace an existing annotation?
I have the following code
declare @method : @Test * *(..) : @Test(timeout=10);
Which generates the following error on every test method:
... already has an annotation of type org.junit.Test, cannot add a second
instance [Xlint:elementAlreadyAnnotated]
Of course, the error makes sense but what is the syntax to say, "remove the @Test
annotation from all methods that have it. Then replace it with @Test(timeout=10)
"