7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @library /testlibrary
27 * @summary Test that type annotations are retained after a retransform
28 * @run main RedefineAnnotations buildagent
29 * @run main/othervm -javaagent:redefineagent.jar RedefineAnnotations
30 */
31
32 import static com.oracle.java.testlibrary.Asserts.assertTrue;
33 import java.io.FileNotFoundException;
34 import java.io.PrintWriter;
35 import java.lang.NoSuchFieldException;
36 import java.lang.NoSuchMethodException;
37 import java.lang.RuntimeException;
38 import java.lang.annotation.Annotation;
39 import java.lang.annotation.ElementType;
40 import java.lang.annotation.Retention;
41 import java.lang.annotation.RetentionPolicy;
42 import java.lang.annotation.Target;
43 import java.lang.instrument.ClassFileTransformer;
44 import java.lang.instrument.IllegalClassFormatException;
45 import java.lang.instrument.Instrumentation;
46 import java.lang.instrument.UnmodifiableClassException;
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @library /testlibrary
27 * @build com.oracle.java.testlibrary.*
28 * @summary Test that type annotations are retained after a retransform
29 * @run main RedefineAnnotations buildagent
30 * @run main/othervm -javaagent:redefineagent.jar RedefineAnnotations
31 */
32
33 import static com.oracle.java.testlibrary.Asserts.assertTrue;
34 import java.io.FileNotFoundException;
35 import java.io.PrintWriter;
36 import java.lang.NoSuchFieldException;
37 import java.lang.NoSuchMethodException;
38 import java.lang.RuntimeException;
39 import java.lang.annotation.Annotation;
40 import java.lang.annotation.ElementType;
41 import java.lang.annotation.Retention;
42 import java.lang.annotation.RetentionPolicy;
43 import java.lang.annotation.Target;
44 import java.lang.instrument.ClassFileTransformer;
45 import java.lang.instrument.IllegalClassFormatException;
46 import java.lang.instrument.Instrumentation;
47 import java.lang.instrument.UnmodifiableClassException;
|