Change annotation value of field annotation in Java 8
问题 I think title describes the problem. Here's some code: import static org.junit.Assert.assertEquals; import java.lang.annotation.*; public class Main { public static void main(String[] args) throws Exception { assertEquals("foo", Main.class.getDeclaredMethod("myMethod").getAnnotation(Anno.class).param()); // the magic here -> set to bar assertEquals("bar", Main.class.getDeclaredMethod("myMethod").getAnnotation(Anno.class).param()); } @Anno(param = "foo") public void myMethod() {} @Retention