Address NRT review feedback and clear remaining warnings - #164
Merged
Conversation
- MapToExistingLanguageIfPossible now returns the empty string (not null) for empty input, honoring its [return: NotNullIfNotNull] contract. - Removed the incorrect [MemberNotNullWhen(false, Id, Source, Target)] from XLiffTransUnit.IsEmpty: IsEmpty is a conjunction, so !IsEmpty does not imply all three members are non-null. Adjusted ToString and XLiffBody.AddTransUnitRaw, which relied on that bogus guarantee. - DefaultInstalledStringFilePath now throws a clear InvalidOperationException instead of passing a possibly-null folder to Path.Combine. - StringCache is backed by a nullable field and throws a clear InvalidOperationException instead of being `null!` and NREing when the minimal constructor was used. - MergeXliffDocuments hoists the trans-unit id once per iteration and skips units without one, replacing ten null-forgiving `tu.Id!` uses. - Fixed the four remaining warnings: CS8604 in XLiffBody (hoisted documented locals) and CS8618 for DefaultStringFilePath (defaults to string.Empty). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
imnasnainaec
marked this pull request as ready for review
August 31, 2026 19:31
hahn-kev
requested changes
Sep 1, 2026
hahn-kev
left a comment
There was a problem hiding this comment.
I'd like to fix the 2 tu.Id! overrides we have as that only holds true if the methods which set the Id never change. I'd opt to throw so we catch the issue early, but if that is highly likely to bubble up to the user then I'd probably avoid that. But we could always just add a test for each that would catch the error in CI.
hahn-kev
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In place of the long-winded AI-drafted reviews I posted on #157, I offer this pr pr.
This change is