Fix bug in SimpleMethodMetadataReadingVisitor.Source.toString()
Prior to this commit, the toString() implementation did not separate method argument types with a comma or any form of separator, leading to results such as: org.example.MyClass.myMethod(java.lang.Stringjava.lang.Integer) instead of: org.example.MyClass.myMethod(java.lang.String,java.lang.Integer) Closes gh-27095
This commit is contained in:
parent
1bc236785c
commit
882004fc9b
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -32,6 +32,7 @@ import org.springframework.lang.Nullable;
|
||||||
* ASM method visitor that creates {@link SimpleMethodMetadata}.
|
* ASM method visitor that creates {@link SimpleMethodMetadata}.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
|
* @author Sam Brannen
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
|
final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
|
||||||
|
@ -144,14 +145,17 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append(this.declaringClassName);
|
builder.append(this.declaringClassName);
|
||||||
builder.append(".");
|
builder.append('.');
|
||||||
builder.append(this.methodName);
|
builder.append(this.methodName);
|
||||||
Type[] argumentTypes = Type.getArgumentTypes(this.descriptor);
|
Type[] argumentTypes = Type.getArgumentTypes(this.descriptor);
|
||||||
builder.append("(");
|
builder.append('(');
|
||||||
for (Type type : argumentTypes) {
|
for (int i = 0; i < argumentTypes.length; i++) {
|
||||||
builder.append(type.getClassName());
|
if (i != 0) {
|
||||||
|
builder.append(',');
|
||||||
|
}
|
||||||
|
builder.append(argumentTypes[i].getClassName());
|
||||||
}
|
}
|
||||||
builder.append(")");
|
builder.append(')');
|
||||||
value = builder.toString();
|
value = builder.toString();
|
||||||
this.toStringValue = value;
|
this.toStringValue = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue