langtools/test/tools/javac/annotations/neg/DeprecatedAnnotationTest/package-info.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/neg/DeprecatedAnnotationTest/package-info.java Fri Aug 12 11:49:18 2016 +0530
@@ -0,0 +1,30 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8068626
+ * @summary Add javac lint warning when the Deprecated annotation is used where it is a no-op
+ *
+ * @compile/fail/ref=DeprecatedAnnotationTest.out -Werror -Xlint:deprecation -XDrawDiagnostics package-info.java
+ */
+
+@Deprecated
+package p;
+
+class DeprecatedAnnotationTest implements AutoCloseable {
+
+ void foo(@Deprecated int p) {
+
+ @Deprecated int l;
+
+ try (@Deprecated DeprecatedAnnotationTest r = new DeprecatedAnnotationTest()) {
+ // ...
+ } catch (@Deprecated Exception e) {
+
+ }
+ }
+
+ @Override
+ public void close() throws Exception {
+ @SuppressWarnings("deprecation") // verify that we are able to suppress.
+ @Deprecated int x;
+ }
+}