[MAGNOLIA-7225] Relative location might be not correctly resolved in RegexBasedPathToMetadataInferrer Created: 19/Dec/17  Updated: 20/Dec/17

Status: Open
Project: Magnolia
Component/s: None
Affects Version/s: 5.6
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Evzen Fochr Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

There is bug in RegexBasedPathToMetadataInferrer#relativeLocation method in catch block.
If string do not contain all groups specified in regexp pattern, matcher.end(matcher.groupCount()) returns 0 instead of index number after last group. It is caused by matcher.groupCount() that returns number of all groups specified in pattern, but
matcher.end([groupNumber]) looks into array where are present only groups that exists in parsed string.


Generated at Mon Feb 12 04:21:53 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.