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

Implement ISpanAppendable in CharBlockArray and CharTermAttributeImpl #1028

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

paulirwin
Copy link
Contributor

@paulirwin paulirwin commented Nov 17, 2024

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Implement ISpanAppendable in CharBlockArray and CharTermAttributeImpl

Fixes #1026

Description

This adds ISpanAppendable to the CharBlockArray and CharTermAttributeImpl classes. The classes implement the interface explicitly so that we can provide a default implementation that returns itself rather than ISpanAppendable, to match the existing Append overloads.

Note that while IAppendable is now redundant in the interface list for these types, I left it there for Lucene source compatibility and reference, since ISpanAppendable does not exist in Lucene.

@paulirwin
Copy link
Contributor Author

@NightOwl888 I intend to mark this ready for review once #1018 is merged, leaving as draft for now. I'll also likely have to resolve a merge conflict at that point too.

@paulirwin paulirwin marked this pull request as ready for review November 18, 2024 20:49
@paulirwin paulirwin added the notes:breaking-change Has changes that will break backward compatibility label Nov 19, 2024
@paulirwin paulirwin changed the title Implement ISpanAppendable in CharBlockArray and ICharTermAttribute/CharTermAttributeImpl BREAKING: Implement ISpanAppendable in CharBlockArray and ICharTermAttribute/CharTermAttributeImpl Nov 19, 2024
Copy link
Contributor

@NightOwl888 NightOwl888 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

There were a few more changes included than required. Copying spans is much less optimized on .NET Framework than using other copy methods, so we should add the Append(ReadOnlySpan<char>) method without changing the implementations of the other overloads. Please see the inline comments.

@paulirwin paulirwin changed the title BREAKING: Implement ISpanAppendable in CharBlockArray and ICharTermAttribute/CharTermAttributeImpl Implement ISpanAppendable in CharBlockArray and CharTermAttributeImpl Nov 19, 2024
@paulirwin paulirwin added notes:improvement An enhancement to an existing feature and removed notes:breaking-change Has changes that will break backward compatibility labels Nov 19, 2024
@paulirwin paulirwin dismissed NightOwl888’s stale review November 19, 2024 20:48

All requested changes implemented

@paulirwin paulirwin merged commit 0e54d66 into apache:master Nov 19, 2024
199 checks passed
@paulirwin paulirwin deleted the issue/1026 branch November 19, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes:improvement An enhancement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ISpanAppendable in CharBlockArray and ICharTermAttribute/CharTermAttributeImpl
2 participants