Skip to content

FilterIndexInput and FilterIndexOutput override the behavior of the instance that they decorate #15452

@blerer

Description

@blerer

Description

FilterIndexInput and FilterIndexOutput do not always delegate calls to the instances that they decorate which can cause them to override the behavior of the instances they are delegating to.
For example, it is possible in your own IndexInput implementation to override readMapOfStrings but if an instance of your classe is decorated by a FilterIndexInput instance when readMapOfStrings is called the logic that will be called is the one of DataInput.readMapOfStrings.
This behavior is verified by the TestFilterIndexInput.testOverrides unit test.
This approach seems error prone to me and go against the implementation of the methods like readMapOfStrings that could have been made final if they should not have been overridden.

Happy to provide a patch if that problem is recognize as such. :-)

Version and environment details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions