-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)type: bugA general bugA general bug
Milestone
Description
Andrei Amariei opened SPR-13385 and commented
org.springframework.messaging.MessageHeaders can be modified using Map.Entry.setValue() method like in the following snippet:
Integer value = 123;
Map<String, Object> map = new HashMap<String, Object>();
map.put("test", value);
MessageHeaders headers = new MessageHeaders(map);
headers.entrySet().iterator().next().setValue(124);Immutability should be achievable using something like in java.util.Collections.UnmodifiableMap.entrySet()
Doesn't seem like a big problem, but it's in contradiction with the documentation of the class which describes it as immutable
Affects: 4.2 GA
Issue Links:
- MessageHeaders is declared immutable - but writeObject() removes any non-serializable fields [SPR-13541] #18117 MessageHeaders is declared immutable - but writeObject() removes any non-serializable fields
Referenced from: commits 8cd2837
Metadata
Metadata
Assignees
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)type: bugA general bugA general bug