/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4989091 5050782 5051962
* @summary Tests Declaration.getAnnotation method
* @library ../../lib
* @compile -source 1.5 GetAnno.java
*/
}
// Annotations used by tests
@interface AT1 {
long l();
String s();
RetentionPolicy e();
AT2 a();
}
@interface AT2 {
}
@interface AT3 {
}
// Array-valued elements of various kinds.
@interface AT4 {
boolean[] bs();
long[] ls();
}
"a=@GetAnno$AT2())")
throw new AssertionError();
return a;
}
}
"ls=[9, 8], " +
"ss=[black, white], " +
"es=[CLASS, SOURCE], " +
"as=[@GetAnno$AT2(), @GetAnno$AT2()])")
return m.getAnnotation(AT4.class);
}
return m.getAnnotation(AT3.class);
}
AT3 a = getAnnotationWithClass1();
try {
throw new AssertionError();
} catch (MirroredTypeException e) {
return e.getTypeMirror();
}
}
@AT3(boolean.class)
try {
throw new AssertionError();
} catch (MirroredTypeException e) {
return e.getTypeMirror();
}
}
// 5050782
}
/**
* Verify that an annotation created by Declaration.getAnnotation()
* has the same hash code as a like annotation created by core
* reflection.
*/
public boolean getAnnotationHashCode() {
try {
} catch (NoSuchMethodException e) {
assert false;
}
}
}