diff options
Diffstat (limited to 'patches/api/0003-Test-changes.patch')
-rw-r--r-- | patches/api/0003-Test-changes.patch | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/patches/api/0003-Test-changes.patch b/patches/api/0003-Test-changes.patch index a9fa8a4131..a1db2f75de 100644 --- a/patches/api/0003-Test-changes.patch +++ b/patches/api/0003-Test-changes.patch @@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f + } +} diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java -index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbdeffda5d9f 100644 +index 64e7aef6220097edefdff3b98a771b988365930d..d9091ba1e5a55e03adca98305233cce9d6888609 100644 --- a/src/test/java/org/bukkit/AnnotationTest.java +++ b/src/test/java/org/bukkit/AnnotationTest.java @@ -29,7 +29,13 @@ public class AnnotationTest { @@ -103,7 +103,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbde }; @Test -@@ -67,14 +83,40 @@ public class AnnotationTest { +@@ -67,14 +83,48 @@ public class AnnotationTest { } if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations)) { @@ -132,8 +132,16 @@ index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbde for (int i = 0; i < paramTypes.length; i++) { if (mustBeAnnotated(paramTypes[i]) ^ isWellAnnotated(method.invisibleParameterAnnotations == null ? null : method.invisibleParameterAnnotations[i])) { + // Paper start -+ if (method.invisibleTypeAnnotations != null || method.visibleTypeAnnotations != null) { -+ for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : java.util.Objects.requireNonNullElse(method.invisibleTypeAnnotations, method.visibleTypeAnnotations)) { ++ if (method.invisibleTypeAnnotations != null) { ++ for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : method.invisibleTypeAnnotations) { ++ final org.objectweb.asm.TypeReference ref = new org.objectweb.asm.TypeReference(invisibleTypeAnnotation.typeRef); ++ if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && java.util.Arrays.asList(ACCEPTED_ANNOTATIONS).contains(invisibleTypeAnnotation.desc)) { ++ continue dancing; ++ } ++ } ++ } ++ if (method.visibleTypeAnnotations != null) { ++ for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : method.visibleTypeAnnotations) { + final org.objectweb.asm.TypeReference ref = new org.objectweb.asm.TypeReference(invisibleTypeAnnotation.typeRef); + if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && java.util.Arrays.asList(ACCEPTED_ANNOTATIONS).contains(invisibleTypeAnnotation.desc)) { + continue dancing; @@ -144,7 +152,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbde ParameterNode paramNode = parameters == null ? null : parameters.get(i); String paramName = paramNode == null ? null : paramNode.name; -@@ -91,13 +133,18 @@ public class AnnotationTest { +@@ -91,13 +141,18 @@ public class AnnotationTest { Collections.sort(errors); @@ -167,7 +175,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbde } private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException { -@@ -140,6 +187,11 @@ public class AnnotationTest { +@@ -140,6 +195,11 @@ public class AnnotationTest { // Exceptions are excluded return false; } @@ -179,7 +187,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbde for (String excludedClass : EXCLUDED_CLASSES) { if (excludedClass.equals(clazz.name)) { -@@ -152,7 +204,7 @@ public class AnnotationTest { +@@ -152,7 +212,7 @@ public class AnnotationTest { private static boolean isMethodIncluded(@NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull Map<String, ClassNode> allClasses) { // Exclude private, synthetic and deprecated methods @@ -188,7 +196,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..a899f63eb2ce58b3cf708e91819cbbde return false; } -@@ -170,11 +222,30 @@ public class AnnotationTest { +@@ -170,11 +230,30 @@ public class AnnotationTest { if ("<init>".equals(method.name) && isAnonymous(clazz)) { return false; } |