diff --git a/spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java b/spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java index 850f08c325..128a4a827f 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 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. @@ -21,8 +21,8 @@ import org.springframework.beans.factory.parsing.ProblemReporter; import org.springframework.core.type.MethodMetadata; /** - * Represents a {@link Configuration @Configuration} class method marked with the - * {@link Bean @Bean} annotation. + * Represents a {@link Configuration @Configuration} class method annotated with + * {@link Bean @Bean}. * * @author Chris Beams * @author Juergen Hoeller @@ -60,4 +60,5 @@ final class BeanMethod extends ConfigurationMethod { getMetadata().getMethodName()), getResourceLocation()); } } + } diff --git a/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadata.java b/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadata.java index 5d1b21d3c0..a3f2ce644f 100644 --- a/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadata.java +++ b/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadata.java @@ -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. @@ -21,8 +21,7 @@ import org.springframework.core.annotation.MergedAnnotations; import org.springframework.core.type.MethodMetadata; /** - * {@link MethodMetadata} created from a - * {@link SimpleMethodMetadataReadingVisitor}. + * {@link MethodMetadata} created from a {@link SimpleMethodMetadataReadingVisitor}. * * @author Phillip Webb * @since 5.2 @@ -86,7 +85,7 @@ final class SimpleMethodMetadata implements MethodMetadata { return !isStatic() && !isFinal() && !isPrivate(); } - public boolean isPrivate() { + private boolean isPrivate() { return (this.access & Opcodes.ACC_PRIVATE) != 0; } diff --git a/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java b/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java index f8af7e8e65..38ba349999 100644 --- a/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java +++ b/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java @@ -43,7 +43,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { private final int access; - private final String name; + private final String methodName; private final String descriptor; @@ -56,13 +56,13 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { SimpleMethodMetadataReadingVisitor(@Nullable ClassLoader classLoader, String declaringClassName, - int access, String name, String descriptor, Consumer consumer) { + int access, String methodName, String descriptor, Consumer consumer) { super(SpringAsmInfo.ASM_VERSION); this.classLoader = classLoader; this.declaringClassName = declaringClassName; this.access = access; - this.name = name; + this.methodName = methodName; this.descriptor = descriptor; this.consumer = consumer; } @@ -80,7 +80,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { if (!this.annotations.isEmpty()) { String returnTypeName = Type.getReturnType(this.descriptor).getClassName(); MergedAnnotations annotations = MergedAnnotations.of(this.annotations); - SimpleMethodMetadata metadata = new SimpleMethodMetadata(this.name, + SimpleMethodMetadata metadata = new SimpleMethodMetadata(this.methodName, this.access, this.declaringClassName, returnTypeName, annotations); this.consumer.accept(metadata); } @@ -89,7 +89,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { private Object getSource() { Source source = this.source; if (source == null) { - source = new Source(this.declaringClassName, this.name, this.descriptor); + source = new Source(this.declaringClassName, this.methodName, this.descriptor); this.source = source; } return source; @@ -103,16 +103,16 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { private final String declaringClassName; - private final String name; + private final String methodName; private final String descriptor; @Nullable private String toStringValue; - Source(String declaringClassName, String name, String descriptor) { + Source(String declaringClassName, String methodName, String descriptor) { this.declaringClassName = declaringClassName; - this.name = name; + this.methodName = methodName; this.descriptor = descriptor; } @@ -120,7 +120,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { public int hashCode() { int result = 1; result = 31 * result + this.declaringClassName.hashCode(); - result = 31 * result + this.name.hashCode(); + result = 31 * result + this.methodName.hashCode(); result = 31 * result + this.descriptor.hashCode(); return result; } @@ -135,7 +135,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { } Source otherSource = (Source) other; return (this.declaringClassName.equals(otherSource.declaringClassName) && - this.name.equals(otherSource.name) && this.descriptor.equals(otherSource.descriptor)); + this.methodName.equals(otherSource.methodName) && this.descriptor.equals(otherSource.descriptor)); } @Override @@ -145,7 +145,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor { StringBuilder builder = new StringBuilder(); builder.append(this.declaringClassName); builder.append("."); - builder.append(this.name); + builder.append(this.methodName); Type[] argumentTypes = Type.getArgumentTypes(this.descriptor); builder.append("("); for (Type type : argumentTypes) {