fix(xtext): match case-sensitive pattern lookups against the candidate name - #1551
Merged
Merged
Conversation
…e name PatternAwareEObjectDescriptionLookUp tested a QualifiedNamePattern against itself instead of against each candidate description's name. matches() returns false for any QualifiedNamePattern argument, so every case-sensitive pattern query (getExportedObjects(type, pattern, false)) returned an empty result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joaodinissf
added a commit
that referenced
this pull request
Sep 26, 2026
formal/README.md describes the method, target status, models and how to reproduce. formal/BUGS.md catalogues 51 findings (49 confirmed, 1 plausible, 1 refuted) plus 9 observations, all verified by three independent skeptics, with traces, test status, fix plans, a proposed fix-PR sequence and links to the fix PRs opened so far (#1550, #1551, #1552, #1553). REPORT.md is the chronological log of rounds 1-2. The patches are reference fixes used to show each disabled test turns green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rubenporras
approved these changes
Sep 28, 2026
joaodinissf
marked this pull request as ready for review
September 28, 2026 22:41
joaodinissf
added a commit
that referenced
this pull request
Sep 29, 2026
formal/README.md describes the method, target status, models and how to reproduce. formal/BUGS.md catalogues 51 findings (49 confirmed, 1 plausible, 1 refuted) plus 9 observations, all verified by three independent skeptics, with traces, test status, fix plans, a proposed fix-PR sequence and links to the fix PRs opened so far (#1550, #1551, #1552, #1553). REPORT.md is the chronological log of rounds 1-2. The patches are reference fixes used to show each disabled test turns green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 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.
Problem
PatternAwareEObjectDescriptionLookUp.getExportedObjects(type, name, ignoreCase)filters the candidates of a case-sensitive pattern query with:This tests the pattern against itself, not against the candidate
input.QualifiedNamePattern.matchesreturnsfalsefor anyQualifiedNamePatternargument (QualifiedNamePattern.java:263-264), so the predicate is always false. Every case-sensitive pattern query returns an empty result, whatever descriptions are stored. TheignoreCase=truepath and plain-name lookups are unaffected.This lookup backs DDK's resource descriptions (
ResourceDescription2,SimpleResourceDescription,FixedCopiedResourceDescription,FingerprintResourceDescription). Any case-sensitiveContainerQuerywith a name pattern (ContainerQuery.java:300) is therefore affected.Fix
Match the pattern against each candidate's name:
matches(input.getName()).Test
PatternAwareEObjectDescriptionLookUpTestis registered inXtextTestSuite:Foo*returnsFooandFooBarbut notfoobar, and an exact pattern returns its match. Both methods fail on master ([]) and pass with the fix.Local run: full
mvn clean verifypasses apart from failures that also occur on master in this environment; checkstyle and PMD are clean.Compatibility
Case-sensitive pattern queries now return results, which is the documented behaviour. Downstream code that worked around the empty result, for example by always passing
ignoreCase=true, may want to revisit that.Found by the formal model of the qualified-name lookup in #1549 (
formal/BUGS.md, TRIE-1). Lean proves the old predicate empty for all inputs (All.consumer_cs_empty), and 3/3 independent reviewers upheld it.🤖 Generated with Claude Code