Fix assertions in StompHeaderAccessor [SPR-14625] #19192
while looking into #19191 I noticed another case of unnecessary and rather costly string concatenations. Not as severe as in #19191 but with a factor of 8 it still has an effect. Applications that send a lot of websocket messages could benefit from this as it eases the pressure on the heap.
I used traditional if statements instead of the supplier functionality in Assert in order to be able to backport it to 4.3.x or even 4.2.x - much like the fixes for #19191.
Affects: 4.2.7, 4.3.2
Reference URL: #1139
Backported to: 4.2.8
The text was updated successfully, but these errors were encountered:
Sam Brannen commented
FYI: on Spring 5.0, the proposed changes can be rewritten as lambda expressions as follows.
Assert.state(SimpMessageType.MESSAGE.equals(getMessageType()), () -> "Unexpected message type " + getMessage()); Assert.state(SimpMessageType.MESSAGE.equals(getMessageType()), () -> "Unexpected message type " + getMessage());
Juergen Hoeller commented
Good catch again... Those assertions in
A further assertion in that class, in