Polishing

This commit is contained in:
Juergen Hoeller
2017-10-23 19:03:56 +02:00
parent 99d39eb2ee
commit db7d71503d
4 changed files with 42 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -150,7 +150,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
try {
Method[] methods = getIntrospectedClass().getDeclaredMethods();
Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>();
Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>(4);
for (Method method : methods) {
if (!method.isBridge() && method.getAnnotations().length > 0 &&
AnnotatedElementUtils.isAnnotated(method, annotationName)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@@ -77,12 +77,13 @@ public class MethodMetadataReadingVisitor extends MethodVisitor implements Metho
@Override
public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
String className = Type.getType(desc).getClassName();
this.methodMetadataSet.add(this);
String className = Type.getType(desc).getClassName();
return new AnnotationAttributesReadingVisitor(
className, this.attributesMap, this.metaAnnotationMap, this.classLoader);
}
@Override
public String getMethodName() {
return this.methodName;