Fix bounds check (#3612)

* Fix bounds check

* Update instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspectAttributeBinder.java

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
This commit is contained in:
Trask Stalnaker 2021-07-19 17:29:45 -07:00 committed by GitHub
parent d5185acaff
commit e2d23cd8c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ public class WithSpanAspectAttributeBinder extends BaseAttributeBinder {
if (!value.isEmpty()) {
return value;
}
if (parameterNames != null && parameterNames.length >= index) {
if (parameterNames != null && index < parameterNames.length) {
String parameterName = parameterNames[index];
if (parameterName != null && !parameterName.isEmpty()) {
return parameterName;