8200128: Fix some "annoations" typos
Reviewed-by: alanb
This commit is contained in:
parent
2fd847eb0e
commit
5c8c67c523
@ -81,7 +81,7 @@ import java.lang.annotation.*;
|
|||||||
*
|
*
|
||||||
* @implNote
|
* @implNote
|
||||||
* This annotation only takes effect for fields of classes loaded by the boot
|
* This annotation only takes effect for fields of classes loaded by the boot
|
||||||
* loader. Annoations on fields of classes loaded outside of the boot loader
|
* loader. Annotations on fields of classes loaded outside of the boot loader
|
||||||
* are ignored.
|
* are ignored.
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
|
@ -49,7 +49,7 @@ public class IsAnnotationType {
|
|||||||
failures += test(String.class, false);
|
failures += test(String.class, false);
|
||||||
failures += test(Enum.class, false);
|
failures += test(Enum.class, false);
|
||||||
failures += test(java.math.RoundingMode.class, false);
|
failures += test(java.math.RoundingMode.class, false);
|
||||||
// Classes in java.lang.annoation
|
// Classes in java.lang.annotation
|
||||||
failures += test(Annotation.class, false);
|
failures += test(Annotation.class, false);
|
||||||
failures += test(Retention.class, true);
|
failures += test(Retention.class, true);
|
||||||
failures += test(RetentionPolicy.class, false);
|
failures += test(RetentionPolicy.class, false);
|
||||||
@ -57,7 +57,7 @@ public class IsAnnotationType {
|
|||||||
failures += test(AnnotationPoseur.class, false);
|
failures += test(AnnotationPoseur.class, false);
|
||||||
|
|
||||||
if (failures > 0) {
|
if (failures > 0) {
|
||||||
throw new RuntimeException("Unexepcted annotation " +
|
throw new RuntimeException("Unexpected annotation " +
|
||||||
"status detected.");
|
"status detected.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ import jdk.internal.org.objectweb.asm.*;
|
|||||||
public class ClassFileGenerator {
|
public class ClassFileGenerator {
|
||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
public static void main(String... args) throws Exception {
|
||||||
classFileWriter("AnnotationWithVoidReturn.class", AnnoationWithVoidReturnDump.dump());
|
classFileWriter("AnnotationWithVoidReturn.class", AnnotationWithVoidReturnDump.dump());
|
||||||
classFileWriter("AnnotationWithParameter.class", AnnoationWithParameterDump.dump());
|
classFileWriter("AnnotationWithParameter.class", AnnotationWithParameterDump.dump());
|
||||||
classFileWriter("AnnotationWithExtraInterface.class", AnnotationWithExtraInterfaceDump.dump());
|
classFileWriter("AnnotationWithExtraInterface.class", AnnotationWithExtraInterfaceDump.dump());
|
||||||
classFileWriter("AnnotationWithException.class", AnnotationWithExceptionDump.dump());
|
classFileWriter("AnnotationWithException.class", AnnotationWithExceptionDump.dump());
|
||||||
classFileWriter("AnnotationWithHashCode.class", AnnotationWithHashCodeDump.dump());
|
classFileWriter("AnnotationWithHashCode.class", AnnotationWithHashCodeDump.dump());
|
||||||
@ -65,7 +65,7 @@ public class ClassFileGenerator {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private static class AnnoationWithVoidReturnDump implements Opcodes {
|
private static class AnnotationWithVoidReturnDump implements Opcodes {
|
||||||
public static byte[] dump() throws Exception {
|
public static byte[] dump() throws Exception {
|
||||||
ClassWriter cw = new ClassWriter(0);
|
ClassWriter cw = new ClassWriter(0);
|
||||||
MethodVisitor mv;
|
MethodVisitor mv;
|
||||||
@ -106,7 +106,7 @@ public class ClassFileGenerator {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private static class AnnoationWithParameterDump implements Opcodes {
|
private static class AnnotationWithParameterDump implements Opcodes {
|
||||||
public static byte[] dump() throws Exception {
|
public static byte[] dump() throws Exception {
|
||||||
|
|
||||||
ClassWriter cw = new ClassWriter(0);
|
ClassWriter cw = new ClassWriter(0);
|
||||||
|
@ -72,7 +72,7 @@ public class BasicRepeatingAnnotations {
|
|||||||
}
|
}
|
||||||
a = BasicNonRepeatingAnno.class.getAnnotation(Foo.class);
|
a = BasicNonRepeatingAnno.class.getAnnotation(Foo.class);
|
||||||
if (a == null) {
|
if (a == null) {
|
||||||
throw new RuntimeException("Repeated annoation not directly present");
|
throw new RuntimeException("Repeated annotation not directly present");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ public class ExceptionParameters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
|
@TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
|
||||||
public String exceptionRepeatableAnnoation() {
|
public String exceptionRepeatableAnnotation() {
|
||||||
return "void exception() { try { new Object(); } catch(@RTA @RTA Exception e) { } }";
|
return "void exception() { try { new Object(); } catch(@RTA @RTA Exception e) { } }";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public class MethodParameters {
|
|||||||
genericLocation = { 0, 0 }, paramIndex = 1)
|
genericLocation = { 0, 0 }, paramIndex = 1)
|
||||||
@TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
|
@TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
|
||||||
genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
|
genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
|
||||||
public String methodParamAsVarargRepeatableAnnoattion() {
|
public String methodParamAsVarargRepeatableAnnotation() {
|
||||||
return "void test(Object b, @RTC @RTC String @RTA @RTA [] @RTB @RTB ... a) { }";
|
return "void test(Object b, @RTC @RTC String @RTA @RTA [] @RTB @RTB ... a) { }";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user