Avoid use of Supplier in MergedAnnotationReadingVisitor.get
This commit is contained in:
parent
2bc7a3aa0a
commit
ddbb7c1b5b
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -23,7 +23,6 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.asm.AnnotationVisitor;
|
||||
import org.springframework.asm.SpringAsmInfo;
|
||||
|
|
@ -121,7 +120,7 @@ class MergedAnnotationReadingVisitor<A extends Annotation> extends AnnotationVis
|
|||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
static <A extends Annotation> AnnotationVisitor get(@Nullable ClassLoader classLoader,
|
||||
@Nullable Supplier<Object> sourceSupplier, String descriptor, boolean visible,
|
||||
@Nullable Object source, String descriptor, boolean visible,
|
||||
Consumer<MergedAnnotation<A>> consumer) {
|
||||
|
||||
if (!visible) {
|
||||
|
|
@ -133,7 +132,6 @@ class MergedAnnotationReadingVisitor<A extends Annotation> extends AnnotationVis
|
|||
return null;
|
||||
}
|
||||
|
||||
Object source = (sourceSupplier != null ? sourceSupplier.get() : null);
|
||||
try {
|
||||
Class<A> annotationType = (Class<A>) ClassUtils.forName(typeName, classLoader);
|
||||
return new MergedAnnotationReadingVisitor<>(classLoader, source, annotationType, consumer);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ final class SimpleAnnotationMetadataReadingVisitor extends ClassVisitor {
|
|||
@Override
|
||||
@Nullable
|
||||
public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
|
||||
return MergedAnnotationReadingVisitor.get(this.classLoader, this::getSource,
|
||||
return MergedAnnotationReadingVisitor.get(this.classLoader, getSource(),
|
||||
descriptor, visible, this.annotations::add);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
|
|||
@Override
|
||||
@Nullable
|
||||
public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
|
||||
return MergedAnnotationReadingVisitor.get(this.classLoader, this::getSource,
|
||||
return MergedAnnotationReadingVisitor.get(this.classLoader, getSource(),
|
||||
descriptor, visible, this.annotations::add);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue