I have a 3rd party-library over which I do not have control and which has some java code around the lines:
@Configuration
public class DemoConfig {
@Autowired
@Bean
public DemoService demoService() {
return new DemoService(demoService2());
}
@Bean
public DemoService2 demoService2() {
return new DemoService2();
}
}
The above code was working happily until Spring 6.2.0 at which point Spring started to reject the @Autowired as invalid (fair enough) and crashes the application (please refer BeanMethod class for detail).
My main question is: what are my otions here ?
Is my best option to programatically modify that 3rd-party library bytecode as part of my build-tool (gradle in this case) ?
Thanks a lot for your expertise and your time.
In the end, I programmatically edited the faulty jar-dependency bytecode (and stripped the impacted methods/classes from the superfluous annotation) as part of my gradle build, through a gradle "TransformAction" class (and a bytecode editor library; javassist in my case).