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

2023.2: Remove uses of reflection from the grouped intention menu #1002

Open
sergej-koscejev opened this issue Nov 5, 2024 · 3 comments
Open

Comments

@sergej-koscejev
Copy link
Collaborator

EditorComponent#setIntentionMenuProducer API was introduced in 2023.2 (or perhaps earlier) to support the use case of custom grouped intention menu, so it should be possible to rewrite the code without accessing myLightBulb via reflection. This is important because modifying private final fields got more complicated in Java 21 and the current code does not work with MPS master.

@alexanderpann
Copy link
Collaborator

Is our reflection approach with Java 21 even possible? I am not sure if we can rewrite the code but we can give it a try.

@sergej-koscejev
Copy link
Collaborator Author

I saw some quite complicated code here and there on StackOverflow to work around final in JDK 21 but I'd rather invest effort towards moving to the API than maintaining hacks.

@sergej-koscejev
Copy link
Collaborator Author

https://stackoverflow.com/a/78249703 is the code I was referring to, in case we do decide to follow that route.

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

No branches or pull requests

2 participants