mirror of https://github.com/apache/maven.git
[MNG-6636] merge reports location tracking
- avoids NPE during DefaultReportingConverter work - fixes missing location tracking when parent values injected into existing child values
This commit is contained in:
parent
1e03388d5b
commit
869b615189
|
@ -1475,6 +1475,24 @@ protected void mergeReportSet_Reports( ReportSet target, ReportSet source, boole
|
|||
merged.addAll( tgt );
|
||||
merged.addAll( src );
|
||||
target.setReports( merged );
|
||||
|
||||
InputLocation sourceLocation = source.getLocation( "reports" );
|
||||
if ( sourceLocation != null )
|
||||
{
|
||||
InputLocation targetLocation = target.getLocation( "reports" );
|
||||
if ( targetLocation == null )
|
||||
{
|
||||
target.setLocation( "reports", sourceLocation );
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( int i = 0; i < src.size(); i++ )
|
||||
{
|
||||
targetLocation.setLocation( Integer.valueOf( tgt.size() + i ),
|
||||
sourceLocation.getLocation( Integer.valueOf( i ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue