Skip to content

Polish: incorrect ContextSize exception message and doc typos #29

Description

@lassevk

Small correctness/quality nits found during review:

1. Wrong exception messageDiffOptions.ContextSize (src/DiffLib/DiffOptions.cs:33-37):

if (value < 1)
    throw new ArgumentOutOfRangeException(nameof(value), value, "ContextSize must be greater than 1.");

The guard rejects value < 1, i.e. the requirement is >= 1, but the message says "greater than 1" (which would exclude the valid value 1). Also the nameof(value) reports the parameter as value; consider nameof(ContextSize) for a clearer message. The XML doc just above says "equal to or greater than 1", so the message contradicts the doc.

2. Doc typos:

  • DiffSection summary (DiffSection.cs:7): "matched or unmatch element portions from the two collectoins" → "unmatched" / "collections".
  • DiffOptions.ContextSize doc: "consequtive" → "consecutive".
  • StringSimilarityDiffElementAligner <see cref="StringSimilarity"/> in the constructor doc (:22) points at a type/name that isn't the constructor's own type — reads oddly.

None are behavioral except the exception message, but they're cheap to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions