Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static java method invocation in step #622

Closed
a1shadows opened this issue Feb 9, 2024 · 7 comments · Fixed by #628
Closed

Static java method invocation in step #622

a1shadows opened this issue Feb 9, 2024 · 7 comments · Fixed by #628
Assignees

Comments

@a1shadows
Copy link
Collaborator

Right not it looks like it is only possible to invoke instance methods from objects as part of a step. Is it also possible to invoke static methods like System#currentTimeMillis?

If not, I can look into adding this as a feature

@a1shadows
Copy link
Collaborator Author

@authorjapps what are your thoughts

@authorjapps
Copy link
Owner

Right not it looks like it is only possible to invoke instance methods from objects as part of a step. Is it also possible to invoke static methods like System#currentTimeMillis?

If not, I can look into adding this as a feature

Hello mate @a1shadows ,
It should straight away work even now as uses Reflection.
But Happy for you to look at and fix it via a PR if this doesn't work.
My suggestion would be to pick this after the Retry comment you raised has been fixed please.
Many Thanks

@a1shadows
Copy link
Collaborator Author

@authorjapps Going by the code in JavaMethodExecutorImpl, the code always fetches an instance from the injector before calling a method. I don't think this will work for static methods

@authorjapps
Copy link
Owner

Got you @a1shadows , let's get this fixed.
I remember in some instances it worked in the past, but may be we wrapped it by a Class n nonstatic method.
Let's make it better from usability point.
Better to fix. Would advise a separate PR for this.

Thanks once again for your diligence in looking into it.

@authorjapps
Copy link
Owner

Got you @a1shadows , let's get this fixed. I remember in some instances it worked in the past, but may be we wrapped it by a Class n nonstatic method. Let's make it better from usability point. Better to fix. Would advise a separate PR for this.

Thanks once again for your diligence in looking into it.

@a1shadows, I think you can pick this 1st(when you are ready) because the other issue/feature in still under discussion.

@a1shadows
Copy link
Collaborator Author

@authorjapps Sure, I'll start looking into this

@authorjapps
Copy link
Owner

This feature is available in v 1.0.36 and higher when released.

PENDING:

  • Documentation for this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants