Skip to content

Custom Instrumentation caused : Cannot find annotation method 'since()' in type 'Deprecated' #12503

@xiangtianyu

Description

@xiangtianyu

Describe the bug

When i tried to created a custom instrumentation for different springboot version. It will cause this bug: /Users/user/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/6.0.15/bd96acb6a63c8fee3d7412082c27ab164294994f/spring-webmvc-6.0.15.jar(/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.class) warning: Cannot find annotation method 'since()' in type 'Deprecated'

Steps to reproduce

  1. create a custom instrumentation
  2. add dependency compileOnly("org.springframework.boot:spring-boot-starter-web:3.1.7") and add this code to advice
ConfigurableApplicationContext context = (ConfigurableApplicationContext) result;
Map<?, ?> handlerMethods = context.getBean("requestMappingHandlerMapping",
    RequestMappingHandlerMapping.class).getHandlerMethods();
  1. run gradle assemble

Expected behavior

build successfully

Actual behavior

/Users/user/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/6.0.15/bd96acb6a63c8fee3d7412082c27ab164294994f/spring-webmvc-6.0.15.jar(/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.class): warning: Cannot find annotation method 'since()' in type 'Deprecated'
error: warnings found and -Werror specified
1 error
1 warning

FAILURE: Build failed with an exception.

Javaagent or library instrumentation version

1.32.0

Environment

JDK: 17
OS: macos

Additional context

In spring 6.x, RequestMappingHandlerMapping used @Deprecated(since = "6.0"), "since" is since from jdk9. It seems that i used a class cannot be compiled with jdk8. Is there any suggestion for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions