-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Two LogstashMarker are equal if:
- they have the same name (immutable)
- they have the same references (children markers)
Problem is additional markers can be added to the reference list after a LogstashMarker is created breaking the equals/hashCode methods. This can lead to unpredictable and strange behaviour when the marker is used in a Set or as a Key in a Map.
Ability to add children to a marker (references) is a standard Slf4J behaviour mandated by the marker interface. However, the legacy Slf4J BasicMarker implementation does not include the referenced elements in the equals/hashCode computation... only the LogstashMarker does. I'm not fully aware of all the Marker particularities and I can't see why the Logstash version should behave that way.
@philstr What's your opinion? Are you aware of the reasons? If none can be identified, may be we could just get rid of this behaviour and rely on the standard equals/hashCode... ?