jpountz commented on issue #14985:
URL: https://github.com/apache/lucene/issues/14985#issuecomment-3114138600
Yes, like I wrote above we try to only delegate abstract methods in our
`Filter*` classes. For instance, imagine a `FilterDirectory` that adds some
magic bytes to the beginning of every file. It overrides `createOutput` to
write these bytes and `openInput` to skip these bytes. The default
implementation of `copyFrom` only relies on `createOutput`, so it works. If now
you start delegating `copyFrom` in `FilterDirectory`, it would copy files as-is
without adding the magic bytes at the beginning. In general, this causes two
problems:
- this may break existing implementations,
- to be correct, all `FilterDirectory` implementations should review
whether they need to override `copyFrom`, while `copyFrom` is always correct
today.
Your point is valid though, `copyFrom` being correct is one thing, but if
it's inefficient, there's still a bug. In similar situations in the past, we
made such methods abstract to convey the expectation that implementations
should carefully consider whether/how to implement it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]