提交 1e841340 编写于 作者: J jjh

7029823: (ann) test/java/lang/annotation/package-info.java no longer compiles

Summary: Use @Deprecated instead of @java.lang.annotation.Documented
Reviewed-by: jjg, smarks
上级 14be8646
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -21,8 +21,6 @@
* questions.
*/
import java.lang.annotation.Documented;
public class PackageMain {
public static void main(String[] args) throws Exception {
Class<?> c = Class.forName("foo.bar.Baz");
......@@ -30,7 +28,7 @@ public class PackageMain {
System.out.println("cl=" + c.getClassLoader());
Package p = c.getPackage();
System.out.println("p=" + p);
Documented d = p.getAnnotation(Documented.class);
Deprecated d = p.getAnnotation(Deprecated.class);
if (d == null) throw new Error();
}
}
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -31,7 +31,7 @@
* @run main PackageMain
*/
@java.lang.annotation.Documented
@Deprecated
package foo.bar;
class Baz {}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册