Giter Club home page Giter Club logo

Comments (4)

skybber avatar skybber commented on July 22, 2024 2

SNAPSHOT release is also fixed. Thanks for report!

from hotswapagent.

jorgheymans avatar jorgheymans commented on July 22, 2024 1

Doing some digging. Spring changed the signature of org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#invokeCustomInitMethod a while ago: spring-projects/spring-framework@41ee233

So here

CtMethod invokeCustomInitMethod = clazz.getDeclaredMethod("invokeCustomInitMethod",
you would need to add support for the new method signature (an extra string parameter was added):

diff --git a/plugin/hotswap-agent-spring-plugin/src/main/java/org/hotswap/agent/plugin/spring/transformers/BeanFactoryTransformer.java b/plugin/hotswap-agent-spring-plugin/src/main/java/org/hotswap/agent/plugin/spring/transformers/BeanFactoryTransformer.java
index 2341fdec..d2922c0b 100644
--- a/plugin/hotswap-agent-spring-plugin/src/main/java/org/hotswap/agent/plugin/spring/transformers/BeanFactoryTransformer.java
+++ b/plugin/hotswap-agent-spring-plugin/src/main/java/org/hotswap/agent/plugin/spring/transformers/BeanFactoryTransformer.java
@@ -76,7 +76,8 @@ public class BeanFactoryTransformer {
         // try catch for custom init method
         CtMethod invokeCustomInitMethod = clazz.getDeclaredMethod("invokeCustomInitMethod",
             new CtClass[] {classPool.get(String.class.getName()), classPool.get("java.lang.Object"),
-                classPool.get("org.springframework.beans.factory.support.RootBeanDefinition")});
+                classPool.get("org.springframework.beans.factory.support.RootBeanDefinition"), 
+                classPool.get(String.class.getName())});
         invokeCustomInitMethod.addCatch(
             InitMethodEnhance.catchException("$2", "$$ha$LOGGER", "$e", "invokeCustomInitMethod", false),
             classPool.get("java.lang.Throwable"));

Unsure how this needs to be done if you want to support both versions of that class.

from hotswapagent.

skybber avatar skybber commented on July 22, 2024 1

I see that there is only a single method invokeCustomInitMethod in AbstractAutowireCapableBeanFactory, so the clazz.getDeclaredMethod(methodName) method of CtClass could be used, so the transformation would not depend on the method parameters.

from hotswapagent.

jorgheymans avatar jorgheymans commented on July 22, 2024

Woah thank you for the quick turn-around on this !

from hotswapagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.