• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

raphw / byte-buddy / #801

27 Oct 2025 09:37AM UTC coverage: 84.715% (-0.4%) from 85.118%
#801

push

raphw
Fix imports.

29586 of 34924 relevant lines covered (84.72%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.19
/byte-buddy-dep/src/main/java/net/bytebuddy/asm/AnnotationRemoval.java
1
/*
2
 * Copyright 2014 - Present Rafael Winterhalter
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.bytebuddy.asm;
17

18
import net.bytebuddy.build.HashCodeAndEqualsPlugin;
19
import net.bytebuddy.description.annotation.AnnotationDescription;
20
import net.bytebuddy.description.field.FieldDescription;
21
import net.bytebuddy.description.field.FieldList;
22
import net.bytebuddy.description.method.MethodDescription;
23
import net.bytebuddy.description.method.MethodList;
24
import net.bytebuddy.description.method.ParameterDescription;
25
import net.bytebuddy.description.type.TypeDescription;
26
import net.bytebuddy.implementation.Implementation;
27
import net.bytebuddy.matcher.ElementMatcher;
28
import net.bytebuddy.pool.TypePool;
29
import net.bytebuddy.utility.CompoundList;
30
import net.bytebuddy.utility.OpenedClassReader;
31
import net.bytebuddy.utility.nullability.MaybeNull;
32
import org.objectweb.asm.AnnotationVisitor;
33
import org.objectweb.asm.ClassVisitor;
34
import org.objectweb.asm.FieldVisitor;
35
import org.objectweb.asm.MethodVisitor;
36

37
import java.util.HashMap;
38
import java.util.Map;
39

40
import static net.bytebuddy.matcher.ElementMatchers.any;
41
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
42
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
43
import static net.bytebuddy.matcher.ElementMatchers.none;
44

45
/**
46
 * A visitor wrapper that removes annotations from the instrumented type.
47
 */
48
@HashCodeAndEqualsPlugin.Enhance
49
public class AnnotationRemoval extends AsmVisitorWrapper.AbstractBase {
50

51
    /**
52
     * Indicates that neither method annotations and method parameter annotations should be considered.
53
     */
54
    private static final int METHOD_NONE = -4;
55

56
    /**
57
     * Indicates that bother method annotations and method parameter annotations should be considered.
58
     */
59
    private static final int METHOD_ALL = -3;
60

61
    /**
62
     * Indicates that only method annotations should be considered.
63
     */
64
    private static final int METHOD_ONLY = -2;
65

66
    /**
67
     * Indicates that only method parameter annotations should be considered.
68
     */
69
    private static final int METHOD_PARAMETERS = -1;
70

71
    /**
72
     * {@code true} if annotations on the type should be removed.
73
     */
74
    private final boolean type;
75

76
    /**
77
     * Matches fields from which annotations should be removed.
78
     */
79
    private final ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher;
80

81
    /**
82
     * Matches methods from which annotations should be removed.
83
     */
84
    private final ElementMatcher<? super MethodDescription> methodMatcher;
85

86
    /**
87
     * Matches annotations that should be removed.
88
     */
89
    private final ElementMatcher<? super AnnotationDescription> annotationMatcher;
90

91
    /**
92
     * Indices the method parameter index from which annotations should be removed,
93
     * or a negative value to indicate different treatment.
94
     */
95
    private final int parameters;
96

97
    /**
98
     * Creates a visitor for annotation removal.
99
     *
100
     * @param type              {@code true} if annotations on the type should be removed.
101
     * @param fieldMatcher      Matches fields from which annotations should be removed.
102
     * @param methodMatcher     Matches methods from which annotations should be removed.
103
     * @param annotationMatcher Matches annotations that should be removed.
104
     * @param parameters        Indices the method parameter index from which annotations should be removed,
105
     *                          or a negative value to indicate different treatment.
106
     */
107
    protected AnnotationRemoval(boolean type,
108
                                ElementMatcher<? super FieldDescription.InDefinedShape.InDefinedShape> fieldMatcher,
109
                                ElementMatcher<? super MethodDescription> methodMatcher,
110
                                ElementMatcher<? super AnnotationDescription> annotationMatcher,
111
                                int parameters) {
1✔
112
        this.type = type;
1✔
113
        this.fieldMatcher = fieldMatcher;
1✔
114
        this.methodMatcher = methodMatcher;
1✔
115
        this.annotationMatcher = annotationMatcher;
1✔
116
        this.parameters = parameters;
1✔
117
    }
1✔
118

119
    /**
120
     * Creates a visitor that removes all annotations that match the specified matcher from the instrumented type.
121
     *
122
     * @param matcher The matcher to indicate what annotations to remove.
123
     * @return A visitor that removes the specified annotations.
124
     */
125
    public static AnnotationRemoval strip(ElementMatcher<? super AnnotationDescription> matcher) {
126
        return new AnnotationRemoval(true, any(), any(), matcher, METHOD_ALL);
1✔
127
    }
128

129
    /**
130
     * Creates a visitor that only removes annotations from the type.
131
     *
132
     * @return An appropriate visitor for annotation removal.
133
     */
134
    public AsmVisitorWrapper onType() {
135
        return new AnnotationRemoval(true, none(), none(), annotationMatcher, METHOD_NONE);
1✔
136
    }
137

138
    /**
139
     * Creates a visitor that only removes annotations from fields that match the specified matcher.
140
     *
141
     * @param matcher A matcher that indicates from what fields annotations should be removed.
142
     * @return An appropriate visitor for annotation removal.
143
     */
144
    public AsmVisitorWrapper onFields(ElementMatcher<? super FieldDescription> matcher) {
145
        return new AnnotationRemoval(false, matcher, none(), annotationMatcher, METHOD_NONE);
1✔
146
    }
147

148
    /**
149
     * Creates a visitor that removes annotations from methods that match the specified matcher.
150
     *
151
     * @param matcher A matcher that indicates from what methods annotations should be removed.
152
     * @return An appropriate visitor for annotation removal.
153
     */
154
    public AsmVisitorWrapper onMethods(ElementMatcher<? super MethodDescription> matcher) {
155
        return onInvokables(isMethod().and(matcher));
1✔
156
    }
157

158
    /**
159
     * Creates a visitor that removes annotations from methods and their parameters that match the specified matcher.
160
     *
161
     * @param matcher A matcher that indicates from what methods annotations should be removed.
162
     * @return An appropriate visitor for annotation removal.
163
     */
164
    public AsmVisitorWrapper onMethodsAndParameters(ElementMatcher<? super MethodDescription> matcher) {
165
        return onInvokablesAndParameters(isMethod().and(matcher));
1✔
166
    }
167

168
    /**
169
     * Creates a visitor that removes annotations from method parameters where the method matches the specified matcher.
170
     *
171
     * @param matcher A matcher that indicates from what methods annotations should be removed.
172
     * @return An appropriate visitor for annotation removal.
173
     */
174
    public AsmVisitorWrapper onMethodParameters(ElementMatcher<? super MethodDescription> matcher) {
175
        return onInvokableParameters(isMethod().and(matcher));
1✔
176
    }
177

178
    /**
179
     * Creates a visitor that removes annotations from the method parameters with the given index
180
     * where the method matches the specified matcher.
181
     *
182
     * @param matcher   A matcher that indicates from what methods annotations should be removed.
183
     * @param parameter The index of the parameter of which to remove annotations.
184
     * @return An appropriate visitor for annotation removal.
185
     */
186
    public AsmVisitorWrapper onMethodParameter(ElementMatcher<? super MethodDescription> matcher, int parameter) {
187
        return onInvokableParameter(isMethod().and(matcher), parameter);
1✔
188
    }
189

190
    /**
191
     * Creates a visitor that removes annotations from constructors that match the specified matcher.
192
     *
193
     * @param matcher A matcher that indicates from what constructors annotations should be removed.
194
     * @return An appropriate visitor for annotation removal.
195
     */
196
    public AsmVisitorWrapper onConstructors(ElementMatcher<? super MethodDescription> matcher) {
197
        return onInvokables(isConstructor().and(matcher));
1✔
198
    }
199

200
    /**
201
     * Creates a visitor that removes annotations from constructors and their parameters that match the specified matcher.
202
     *
203
     * @param matcher A matcher that indicates from what constructors annotations should be removed.
204
     * @return An appropriate visitor for annotation removal.
205
     */
206
    public AsmVisitorWrapper onConstructorsAndParameters(ElementMatcher<? super MethodDescription> matcher) {
207
        return onInvokablesAndParameters(isConstructor().and(matcher));
1✔
208
    }
209

210
    /**
211
     * Creates a visitor that removes annotations from constructor parameters where the constructor matches the specified matcher.
212
     *
213
     * @param matcher A matcher that indicates from what constructors annotations should be removed.
214
     * @return An appropriate visitor for annotation removal.
215
     */
216
    public AsmVisitorWrapper onConstructorParameters(ElementMatcher<? super MethodDescription> matcher) {
217
        return onInvokableParameters(isConstructor().and(matcher));
1✔
218
    }
219

220
    /**
221
     * Creates a visitor that removes annotations from the constructor parameters with the given index
222
     * where the constructor matches the specified matcher.
223
     *
224
     * @param matcher   A matcher that indicates from what constructors annotations should be removed.
225
     * @param parameter The index of the parameter of which to remove annotations.
226
     * @return An appropriate visitor for annotation removal.
227
     */
228
    public AsmVisitorWrapper onConstructorParameter(ElementMatcher<? super MethodDescription> matcher, int parameter) {
229
        return onInvokableParameter(isConstructor().and(matcher), parameter);
1✔
230
    }
231

232
    /**
233
     * Creates a visitor that removes annotations from constructors or methods that match the specified matcher.
234
     *
235
     * @param matcher A matcher that indicates from what constructors or methods annotations should be removed.
236
     * @return An appropriate visitor for annotation removal.
237
     */
238
    public AsmVisitorWrapper onInvokables(ElementMatcher<? super MethodDescription> matcher) {
239
        return new AnnotationRemoval(false, none(), matcher, annotationMatcher, METHOD_ONLY);
1✔
240
    }
241

242
    /**
243
     * Creates a visitor that removes annotations from constructors or methods and their parameters
244
     * that match the specified matcher.
245
     *
246
     * @param matcher A matcher that indicates from what constructors or methods annotations should be removed.
247
     * @return An appropriate visitor for annotation removal.
248
     */
249
    public AsmVisitorWrapper onInvokablesAndParameters(ElementMatcher<? super MethodDescription> matcher) {
250
        return new AnnotationRemoval(false, none(), matcher, annotationMatcher, METHOD_ALL);
1✔
251
    }
252

253
    /**
254
     * Creates a visitor that removes annotations from constructor or method parameters where the
255
     * constructor or method matches the specified matcher.
256
     *
257
     * @param matcher A matcher that indicates from what constructors or methods annotations should be removed.
258
     * @return An appropriate visitor for annotation removal.
259
     */
260
    public AsmVisitorWrapper onInvokableParameters(ElementMatcher<? super MethodDescription> matcher) {
261
        return new AnnotationRemoval(false, none(), matcher, annotationMatcher, METHOD_PARAMETERS);
1✔
262
    }
263

264
    /**
265
     * Creates a visitor that removes annotations from the constructor or method parameters with the given index
266
     * where the constructor or method matches the specified matcher.
267
     *
268
     * @param matcher   A matcher that indicates from what constructors or methods annotations should be removed.
269
     * @param parameter The index of the parameter of which to remove annotations.
270
     * @return An appropriate visitor for annotation removal.
271
     */
272
    public AsmVisitorWrapper onInvokableParameter(ElementMatcher<? super MethodDescription> matcher, int parameter) {
273
        if (parameter < 0) {
1✔
274
            throw new IllegalArgumentException("Parameter index cannot be negative: " + parameter);
×
275
        }
276
        return new AnnotationRemoval(false, none(), matcher, annotationMatcher, parameter);
1✔
277
    }
278

279
    /**
280
     * {@inheritDoc}
281
     */
282
    public ClassVisitor wrap(TypeDescription instrumentedType,
283
                             ClassVisitor classVisitor,
284
                             Implementation.Context implementationContext,
285
                             TypePool typePool,
286
                             FieldList<FieldDescription.InDefinedShape> fields,
287
                             MethodList<?> methods,
288
                             int writerFlags,
289
                             int readerFlags) {
290
        Map<String, AnnotationDescription> mappedAnnotations = new HashMap<String, AnnotationDescription>();
1✔
291
        if (type) {
1✔
292
            for (AnnotationDescription annotation : instrumentedType.getDeclaredAnnotations()) {
1✔
293
                mappedAnnotations.put(annotation.getAnnotationType().getDescriptor(), annotation);
1✔
294
            }
1✔
295
        }
296
        Map<String, FieldDescription.InDefinedShape> mappedFields = new HashMap<String, FieldDescription.InDefinedShape>();
1✔
297
        for (FieldDescription.InDefinedShape fieldDescription : fields) {
1✔
298
            mappedFields.put(fieldDescription.getInternalName() + fieldDescription.getDescriptor(), fieldDescription);
1✔
299
        }
1✔
300
        Map<String, MethodDescription> mappedMethods = new HashMap<String, MethodDescription>();
1✔
301
        for (MethodDescription methodDescription : CompoundList.<MethodDescription>of(methods, new MethodDescription.Latent.TypeInitializer(instrumentedType))) {
1✔
302
            mappedMethods.put(methodDescription.getInternalName() + methodDescription.getDescriptor(), methodDescription);
1✔
303
        }
1✔
304
        return new AnnotationRemovingClassVisitor(classVisitor, fieldMatcher, methodMatcher, annotationMatcher, parameters, mappedFields, mappedMethods, mappedAnnotations);
1✔
305
    }
306

307
    /**
308
     * A class visitor that removes annotations.
309
     */
310
    private static class AnnotationRemovingClassVisitor extends ClassVisitor {
311

312
        /**
313
         * Matches fields from which annotations should be removed.
314
         */
315
        private final ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher;
316

317
        /**
318
         * Matches methods from which annotations should be removed.
319
         */
320
        private final ElementMatcher<? super MethodDescription> methodMatcher;
321

322
        /**
323
         * Matches annotations that should be removed.
324
         */
325
        private final ElementMatcher<? super AnnotationDescription> annotationMatcher;
326

327
        /**
328
         * Indices the method parameter index from which annotations should be removed,
329
         * or a negative value to indicate different treatment.
330
         */
331
        private final int parameters;
332

333
        /**
334
         * A map of internal field names and descriptors to consider for removal.
335
         */
336
        private final Map<String, FieldDescription.InDefinedShape> fields;
337

338
        /**
339
         * A map of internal method names and descriptors to consider for removal.
340
         */
341
        private final Map<String, MethodDescription> methods;
342

343
        /**
344
         * A map of annotation type descriptors names and descriptors to consider for removal.
345
         */
346
        private final Map<String, AnnotationDescription> annotations;
347

348
        /**
349
         * Creates a class visitor for annotation removal.
350
         *
351
         * @param classVisitor      The class visitor to delegate to.
352
         * @param fieldMatcher      Matches fields from which annotations should be removed.
353
         * @param methodMatcher     Matches methods from which annotations should be removed.
354
         * @param annotationMatcher Matches annotations that should be removed.
355
         * @param parameters        Indices the method parameter index from which annotations should be removed,
356
         *                          or a negative value to indicate different treatment.
357
         * @param fields            A map of internal field names and descriptors to consider for removal.
358
         * @param methods           A map of internal method names and descriptors to consider for removal.
359
         * @param annotations       A map of annotation type descriptors names and descriptors to consider for removal.
360
         */
361
        private AnnotationRemovingClassVisitor(ClassVisitor classVisitor,
362
                                               ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher,
363
                                               ElementMatcher<? super MethodDescription> methodMatcher,
364
                                               ElementMatcher<? super AnnotationDescription> annotationMatcher,
365
                                               int parameters,
366
                                               Map<String, FieldDescription.InDefinedShape> fields,
367
                                               Map<String, MethodDescription> methods,
368
                                               Map<String, AnnotationDescription> annotations) {
369
            super(OpenedClassReader.ASM_API, classVisitor);
1✔
370
            this.fieldMatcher = fieldMatcher;
1✔
371
            this.methodMatcher = methodMatcher;
1✔
372
            this.annotationMatcher = annotationMatcher;
1✔
373
            this.parameters = parameters;
1✔
374
            this.fields = fields;
1✔
375
            this.methods = methods;
1✔
376
            this.annotations = annotations;
1✔
377
        }
1✔
378

379
        @Override
380
        @MaybeNull
381
        public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
382
            AnnotationDescription annotation = annotations.get(descriptor);
1✔
383
            return annotation != null && annotationMatcher.matches(annotation)
1✔
384
                    ? null
385
                    : super.visitAnnotation(descriptor, visible);
1✔
386
        }
387

388
        @Override
389
        @MaybeNull
390
        public FieldVisitor visitField(int modifiers, String internalName, String descriptor, String signature, Object value) {
391
            FieldVisitor fieldVisitor = super.visitField(modifiers, internalName, descriptor, signature, value);
1✔
392
            if (fieldVisitor == null) {
1✔
393
                return null;
×
394
            }
395
            FieldDescription.InDefinedShape fieldDescription = fields.get(internalName + descriptor);
1✔
396
            if (fieldDescription != null && fieldMatcher.matches(fieldDescription)) {
1✔
397
                Map<String, AnnotationDescription> mappedAnnotations = new HashMap<String, AnnotationDescription>();
1✔
398
                for (AnnotationDescription annotation : fieldDescription.getDeclaredAnnotations()) {
1✔
399
                    mappedAnnotations.put(annotation.getAnnotationType().getDescriptor(), annotation);
1✔
400
                }
1✔
401
                return new AnnotationRemovingFieldVisitor(fieldVisitor, annotationMatcher, mappedAnnotations);
1✔
402
            } else {
403
                return fieldVisitor;
1✔
404
            }
405
        }
406

407
        @Override
408
        @MaybeNull
409
        public MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, String signature, String[] exception) {
410
            MethodVisitor methodVisitor = super.visitMethod(modifiers, internalName, descriptor, signature, exception);
1✔
411
            if (methodVisitor == null) {
1✔
412
                return null;
×
413
            }
414
            MethodDescription methodDescription = methods.get(internalName + descriptor);
1✔
415
            if (methodDescription != null && methodMatcher.matches(methodDescription)) {
1✔
416
                Map<Integer, Map<String, AnnotationDescription>> mappedParameterAnnotations = new HashMap<Integer, Map<String, AnnotationDescription>>();
1✔
417
                if (parameters >= 0 || parameters == METHOD_PARAMETERS || parameters == METHOD_ALL) {
1✔
418
                    for (ParameterDescription parameter : methodDescription.getParameters()) {
1✔
419
                        Map<String, AnnotationDescription> mappedAnnotations = new HashMap<String, AnnotationDescription>();
1✔
420
                        if (parameter.getIndex() == parameters || parameters < 0) {
1✔
421
                            for (AnnotationDescription annotation : parameter.getDeclaredAnnotations()) {
1✔
422
                                mappedAnnotations.put(annotation.getAnnotationType().getDescriptor(), annotation);
1✔
423
                            }
1✔
424
                        }
425
                        mappedParameterAnnotations.put(parameter.getIndex(), mappedAnnotations);
1✔
426
                    }
1✔
427
                }
428
                Map<String, AnnotationDescription> mappedAnnotations = new HashMap<String, AnnotationDescription>();
1✔
429
                if (parameters == METHOD_ONLY || parameters == METHOD_ALL) {
1✔
430
                    for (AnnotationDescription annotation : methodDescription.getDeclaredAnnotations()) {
1✔
431
                        mappedAnnotations.put(annotation.getAnnotationType().getDescriptor(), annotation);
1✔
432
                    }
1✔
433
                }
434
                return new AnnotationRemovingMethodVisitor(methodVisitor, annotationMatcher, mappedParameterAnnotations, mappedAnnotations);
1✔
435
            } else {
436
                return methodVisitor;
1✔
437
            }
438
        }
439
    }
440

441
    /**
442
     * A field visitor that removes annotations.
443
     */
444
    private static class AnnotationRemovingFieldVisitor extends FieldVisitor {
445

446
        /**
447
         * Matches annotations that should be removed.
448
         */
449
        private final ElementMatcher<? super AnnotationDescription> annotationMatcher;
450

451
        /**
452
         * A map of annotation type descriptors names and descriptors to consider for removal.
453
         */
454
        private final Map<String, AnnotationDescription> annotations;
455

456
        /**
457
         * Creates a visitor for removing annotations from fields.
458
         *
459
         * @param fieldVisitor      The field visitor to delegate to.
460
         * @param annotationMatcher AMatches annotations that should be removed.
461
         * @param annotations       A map of annotation type descriptors names and descriptors to consider for removal.
462
         */
463
        private AnnotationRemovingFieldVisitor(FieldVisitor fieldVisitor,
464
                                               ElementMatcher<? super AnnotationDescription> annotationMatcher,
465
                                               Map<String, AnnotationDescription> annotations) {
466
            super(OpenedClassReader.ASM_API, fieldVisitor);
1✔
467
            this.annotationMatcher = annotationMatcher;
1✔
468
            this.annotations = annotations;
1✔
469
        }
1✔
470

471
        @Override
472
        @MaybeNull
473
        public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
474
            AnnotationDescription annotation = annotations.get(descriptor);
1✔
475
            return annotation != null && annotationMatcher.matches(annotation)
1✔
476
                    ? null
477
                    : super.visitAnnotation(descriptor, visible);
×
478
        }
479
    }
480

481
    /**
482
     * Creates a visitor for removing annotations from methods and method parameters.
483
     */
484
    private static class AnnotationRemovingMethodVisitor extends MethodVisitor {
485

486
        /**
487
         * Matches annotations that should be removed.
488
         */
489
        private final ElementMatcher<? super AnnotationDescription> annotationMatcher;
490

491
        /**
492
         * A map of parameter indices to maps of annotation type descriptors names and descriptors to consider
493
         * for removal.
494
         */
495
        private final Map<Integer, Map<String, AnnotationDescription>> parameterAnnotations;
496

497
        /**
498
         * A map of annotation type descriptors names and descriptors to consider for removal.
499
         */
500
        private final Map<String, AnnotationDescription> annotations;
501

502
        /**
503
         * Creates an annotation removing method visitor.
504
         *
505
         * @param methodVisitor        The method visitor to delegate to.
506
         * @param annotationMatcher    Matches annotations that should be removed.
507
         * @param parameterAnnotations A map of parameter indices to maps of annotation type descriptors names and
508
         *                             descriptors to consider for removal.
509
         * @param annotations          A map of annotation type descriptors names and descriptors to consider for removal.
510
         */
511
        private AnnotationRemovingMethodVisitor(MethodVisitor methodVisitor,
512
                                                ElementMatcher<? super AnnotationDescription> annotationMatcher,
513
                                                Map<Integer, Map<String, AnnotationDescription>> parameterAnnotations,
514
                                                Map<String, AnnotationDescription> annotations) {
515
            super(OpenedClassReader.ASM_API, methodVisitor);
1✔
516
            this.annotationMatcher = annotationMatcher;
1✔
517
            this.parameterAnnotations = parameterAnnotations;
1✔
518
            this.annotations = annotations;
1✔
519
        }
1✔
520

521
        @Override
522
        @MaybeNull
523
        public AnnotationVisitor visitParameterAnnotation(int parameter, String descriptor, boolean visible) {
524
            Map<String, AnnotationDescription> annotations = parameterAnnotations.get(parameter);
1✔
525
            if (annotations != null) {
1✔
526
                AnnotationDescription annotation = annotations.get(descriptor);
1✔
527
                return annotation != null && annotationMatcher.matches(annotation)
1✔
528
                        ? null
529
                        : super.visitParameterAnnotation(parameter, descriptor, visible);
×
530
            } else {
531
                return super.visitParameterAnnotation(parameter, descriptor, visible);
1✔
532
            }
533
        }
534

535
        @Override
536
        @MaybeNull
537
        public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
538
            AnnotationDescription annotation = annotations.get(descriptor);
1✔
539
            return annotation != null && annotationMatcher.matches(annotation)
1✔
540
                    ? null
541
                    : super.visitAnnotation(descriptor, visible);
1✔
542
        }
543
    }
544
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc