From cc3ae8eaf7449bba5a88cf6aa6340141fe620e68 Mon Sep 17 00:00:00 2001 From: Henry Coles Date: Fri, 16 Jun 2023 16:42:39 +0100 Subject: [PATCH] ensure interface change is backwards compatible --- .../engine/gregor/MethodMutatorFactory.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pitest/src/main/java/org/pitest/mutationtest/engine/gregor/MethodMutatorFactory.java b/pitest/src/main/java/org/pitest/mutationtest/engine/gregor/MethodMutatorFactory.java index 9d77d904d..093e98edf 100644 --- a/pitest/src/main/java/org/pitest/mutationtest/engine/gregor/MethodMutatorFactory.java +++ b/pitest/src/main/java/org/pitest/mutationtest/engine/gregor/MethodMutatorFactory.java @@ -45,15 +45,28 @@ default MethodVisitor create(MutationContext context, return null; } - + @Deprecated + default AnnotationVisitor createForAnnotation(NoMethodContext context, AnnotationInfo annotationInfo, AnnotationVisitor next) { + return createForAnnotation((BasicContext) context, annotationInfo, next); + } default AnnotationVisitor createForAnnotation(BasicContext context, AnnotationInfo annotationInfo, AnnotationVisitor next) { return null; } - default boolean skipAnnotation(BasicContext nonMethodContext, AnnotationInfo annotationInfo) { + @Deprecated + default boolean skipAnnotation(NoMethodContext context, AnnotationInfo annotationInfo) { + return skipAnnotation((BasicContext) context, annotationInfo); + } + + default boolean skipAnnotation(BasicContext context, AnnotationInfo annotationInfo) { return false; } + @Deprecated + default FieldVisitor createForField(NoMethodContext context, FieldInfo fieldInfo, FieldVisitor fieldVisitor) { + return createForField((BasicContext) context, fieldInfo, fieldVisitor); + } + default FieldVisitor createForField(BasicContext context, FieldInfo fieldInfo, FieldVisitor fieldVisitor) { return null; }