Skip to content

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Nov 6, 2025

Backport

This will backport the following commits from master to maven-4.0.x:

Questions ?

Please refer to the Backport tool documentation

The location for properties (Map elements) was being captured AFTER calling
nextText(), which moves the parser position past the element. This resulted
in incorrect location information.

This commit fixes the timing of location capture for properties by saving
the line and column numbers BEFORE calling nextText().

Changes:
- Modified src/mdo/reader-stax.vm to capture location before nextText() for properties
- Added comprehensive unit tests for location reporting:
  * testLocationReportingForElements() - tests regular elements with exact line/column numbers
  * testLocationReportingForAttributes() - tests XML attributes (root, child.scm.connection.inherit.append.path)
    Note: Attributes get the location of their containing element since XMLStreamReader doesn't
    provide individual attribute positions
  * testLocationReportingForListElements() - tests list elements (modules) with exact line/column numbers

(cherry picked from commit 6f5c837)

# Conflicts:
#	src/mdo/reader-stax.vm
@gnodet gnodet merged commit f877d83 into apache:maven-4.0.x Nov 6, 2025
22 checks passed
@github-actions github-actions bot added this to the 4.0.0 milestone Nov 6, 2025
@gnodet gnodet deleted the backport/maven-4.0.x/pr-11402 branch November 6, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working mvn40

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant