spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Introduce `IndexAccessor` SPI to configure the SpEL `Indexer`

Open jackmiking opened this issue 4 years ago • 2 comments

closes gh-26409.

jackmiking avatar Jan 30 '21 09:01 jackmiking

To be honest, I am having a difficult time detecting your proposed changes in this PR due to all of the noise associated with reformatting of code that you did not touch.

Please undo all changes to existing code lines that you have not touched. Also, please note that we do not allow star imports (.*).

Please also make sure that you adhere to the project's Code Style.

Once you have done that, please squash your commits and force push your changes to this PR.

Thanks

sbrannen avatar Jan 31 '21 14:01 sbrannen

I have adjusted the code style. But I am not pretty sure whether it meets the requirements.

jackmiking avatar Feb 08 '21 06:02 jackmiking

Current work on this issue can be viewed in the following feature branch.

https://github.com/spring-projects/spring-framework/compare/main...sbrannen:spring-framework:issues/gh-26478-spel-IndexAccessor

sbrannen avatar Mar 26 '24 15:03 sbrannen

it's glad to hear your response. Your affirmation cheers me up. I am anticipating the day it is merged into the release version.

jackmiking avatar Apr 10 '24 07:04 jackmiking

自动回复:你的邮件我已经收到,如果需要回复的我会尽快回复的。感谢你的谅解····

jackmiking avatar Apr 10 '24 14:04 jackmiking

This has been merged into main in ae3dc0d4b1a6a25d1680b4d1bd02a9d55f20c063 along with an additional 6 commits that revise the PR.

For an example, see the JacksonArrayNodeIndexAccessor in IndexingTests:

https://github.com/spring-projects/spring-framework/blob/ae3dc0d4b1a6a25d1680b4d1bd02a9d55f20c063/spring-expression/src/test/java/org/springframework/expression/spel/IndexingTests.java#L646-L687

@jackmiking, thanks again for putting together the initial prototype!

@artembilan, @pilak, @jackmiking, @jdomigon, @martin-jamszolik, and anyone else interested, we would be grateful if you could try this out in the upcoming 6.2 M1 release (scheduled for tomorrow) and let us know if you run into any issues or come up with any ideas for how to improve (or simplify) the new IndexAccessor SPI.

Cheers,

Sam


p.s. I have opened a separate issue (#32613) to introduce compilation support for an IndexAccessor in Spring Framework 6.2 M2, analogous to the existing CompilablePropertyAccessor SPI and tentatively named CompilableIndexAccessor.

sbrannen avatar Apr 10 '24 14:04 sbrannen

I have reviewed the code and made some cases. It works great.

jackmiking avatar Apr 18 '24 06:04 jackmiking

Hi @jackmiking,

Thanks for trying it out and letting us know that it works! 👍

sbrannen avatar Apr 18 '24 10:04 sbrannen