Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogstashMarker refactoring #636

Merged
merged 10 commits into from
Sep 10, 2021
Merged

LogstashMarker refactoring #636

merged 10 commits into from
Sep 10, 2021

Conversation

brenuart
Copy link
Collaborator

@brenuart brenuart commented Sep 8, 2021

Most Logstash marker don't have any children/reference at all. Creating the referenceList upfront is a waste of memory and additional pressure on the GC. This PR modifies the implementation to create the reference list eagerly when the first reference is added. See #617 (comment) for the motivations behind this change.

Most Logstash marker don't have any children/reference at all. Creating the referenceList upfront is a waste of memory and additional pressure on the GC.

This commit modifies the implementation to create the reference list when the first reference is added.
This class is now our own implementation - remove copy of SLF4J copyright notice
@brenuart brenuart linked an issue Sep 8, 2021 that may be closed by this pull request
@brenuart
Copy link
Collaborator Author

brenuart commented Sep 8, 2021

@philsttr EmptyLogstashMarker does not override equals/hascode. Equality is therefore solely on the marker name. Most (if not all) other logstash markers also require that "other" is of the exact same class. Shouldn't it be the case here as well ?

Copy link
Collaborator

@philsttr philsttr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philsttr EmptyLogstashMarker does not override equals/hascode. Equality is therefore solely on the marker name. Most (if not all) other logstash markers also require that "other" is of the exact same class. Shouldn't it be the case here as well ?

Yes, please add a check for the same class.

contains() should accept null values and return false in this case. Calling code will not have to test for nullability before using the method and still have a consistent result
Revert changes made to equals() in f29bb2c
@brenuart brenuart merged commit d57511c into main Sep 10, 2021
@brenuart brenuart deleted the marker-refactoring branch September 10, 2021 09:13
@philsttr philsttr added this to the 7.0 milestone Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants