InputLocation.merge() always loses line/column information
Found in: maven-4.0.x branch
File: api/maven-api-model/src/main/java/org/apache/maven/api/model/InputLocation.java (method merge(), lines ~215-240)
Severity: Low
Description
The merge() result always has lineNumber = -1 and columnNumber = -1, discarding the original location information from both target and source:
return InputLocation.of(-1, -1, InputSource.merge(source.getSource(), target.getSource()), locations);
While merging line numbers from two different source files is inherently ambiguous, there is no fallback to preserve at least one of the original locations. If source or target has valid line/column data, that information is lost, degrading the quality of error reporting for merged models.
InputLocation.merge() always loses line/column information
Found in: maven-4.0.x branch
File:
api/maven-api-model/src/main/java/org/apache/maven/api/model/InputLocation.java(methodmerge(), lines ~215-240)Severity: Low
Description
The
merge()result always haslineNumber = -1andcolumnNumber = -1, discarding the original location information from bothtargetandsource:While merging line numbers from two different source files is inherently ambiguous, there is no fallback to preserve at least one of the original locations. If
sourceortargethas valid line/column data, that information is lost, degrading the quality of error reporting for merged models.