-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Labels
Description
Before Creating the Enhancement Request
- I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Programming Language of the Client
Java
Summary
Enhance MessageImpl to allow subclasses to access properties
Motivation
Currently, MessageImpl.properties is private and getProperties() returns a new HashMap copy. This prevents inheritance-based access to properties and creates unnecessary object allocations. Making properties protected allows subclasses to access the properties map directly, while returning an unmodifiable map prevents external modifications while avoiding object creation overhead.
Describe the Solution You'd Like
- Change MessageImpl.properties visibility from private to protected
- Modify getProperties() to return Collections.unmodifiableMap(properties) instead of new HashMap<>(properties)
This change enables:
- Inheritance-based access to properties in subclasses
- Immutable view of properties to prevent external modifications
- Better performance by avoiding unnecessary HashMap allocations
- Maintains backward compatibility while improving extensibility
Describe Alternatives You've Considered
None
Additional Context
No response