SpEL, InlineMap with negative values are not cached [SPR-17614] #22146
Labels
Milestone
Comments
This was referenced Jan 11, 2019
Hi there, I would like to add that this is also occurring in InlineMap.java class. |
Hello! I just created a merge request for this issue, fixing InlineMap and InlineList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Davide Pallaoro opened SPR-17614 and commented
Hi there,
I’ve seen that InlineMap class have a nice mechanism that, cache the value of the map if it is constant.
But if the map contains a negative number this caching mechanism is not working.
Take for example the following test
If you run the previous code, (using org.springframework.spring-expression:5.1.3.RELEASE) and set a breakpoint in
org.springframework.expression.spel.ast.InlineMap#getValueInternal
which code is the following..
You will notice that when executing MapCacheTest.testMapCached() this.constant is returned.
But when running MapCacheTest.testMapNOTCached() the code jump into the else statement and create a new map each time this method is called.
In a scenario with an high concurrency and with pretty big maps, this could decrease the performance of the app.
Let me know if everything is clear or you need some further details.
Many thanks and kind regards.
Affects: 5.1.3
Issue Links:
The text was updated successfully, but these errors were encountered: