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

SchemaImpl and CatalogImpl $replace() and $traverse() methods shouldn't recurse into Name or Comment parts #15022

Closed
lukaseder opened this issue May 4, 2023 · 1 comment

Comments

@lukaseder
Copy link
Member

We're currently recursing into Name and Comment parts from within SchemaImpl and CatalogImpl methods $replace() and $traverse():

    @Override
    public final <R> R $traverse(Traverser<?, R> traverser) {
        return QOM.traverse(traverser, this, getQualifiedName());
    }

    @Override
    public final QueryPart $replace(Replacer replacer) {
        return QOM.replace(this, getQualifiedName(), getCommentPart(), CatalogImpl::new, replacer);
    }

This isn't being done in any other Named type, including TableImpl, TableFieldImpl, and many many others:

image

Let's remove this recursion for these reasons:

  • Consistency
  • Accidental effects (users not expecting this)
  • Performance
@lukaseder
Copy link
Member Author

Since there might be a (very unlikely) behavioural regression in a customer implementation of a Replacer call, I won't backport this change.

3.14 New query object model automation moved this from To do to Done May 4, 2023
lukaseder added a commit that referenced this issue May 4, 2023
methods shouldn't recurse into Name or Comment parts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant