Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Jun 22, 2021
1 parent 3214786 commit d469f62
Showing 3 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -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.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 @@ public NonOverridableMethodError() {
getMetadata().getMethodName()), getResourceLocation());
}
}

}
Original file line number Diff line number Diff line change
@@ -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.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 @@ public boolean isOverridable() {
return !isStatic() && !isFinal() && !isPrivate();
}

public boolean isPrivate() {
private boolean isPrivate() {
return (this.access & Opcodes.ACC_PRIVATE) != 0;
}

Original file line number Diff line number Diff line change
@@ -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<SimpleMethodMetadata> consumer) {
int access, String methodName, String descriptor, Consumer<SimpleMethodMetadata> 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 @@ public void visitEnd() {
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 @@ public void visitEnd() {
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,24 +103,24 @@ static final class Source {

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;
}

@Override
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 @@ public boolean equals(@Nullable Object other) {
}
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 @@ public String toString() {
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) {

0 comments on commit d469f62

Please sign in to comment.