this would have been the opportunity to dig deeper into model inheritance 
through this input location tracking feature

I won't have time to work on it for now, so don't hesitate to try

Regards,

Hervé

Le vendredi 12 avril 2019, 19:39:53 CEST Sylwester Lachiewicz a écrit :
> I thought that this simple fix fixes the error, but if there is some other
> reason I think you will be able to fix it better :)
> Sylwester
> 
> pt., 12 kwi 2019 o 19:23 Hervé BOUTEMY <[email protected]> napisał(a):
> > this avoid the NPE but does not fix the root cause = missing input
> > location
> > tracking
> > see first comment of https://issues.apache.org/jira/browse/MNG-6636
> > 
> > Do you want to try to fix the root cause?
> > 
> > Regards,
> > 
> > Hervé
> > 
> > Le jeudi 11 avril 2019, 22:06:00 CEST [email protected] a écrit :
> > > This is an automated email from the ASF dual-hosted git repository.
> > > 
> > > slachiewicz pushed a commit to branch reportsLocation-npe
> > > in repository https://gitbox.apache.org/repos/asf/maven.git
> > > 
> > > commit 38c70be83341d8198e7f8e53a31709b2336da162
> > > Author: Sylwester Lachiewicz <[email protected]>
> > > AuthorDate: Thu Apr 11 22:05:23 2019 +0200
> > > 
> > >     Fix reports Location NPE
> > > 
> > > ---
> > > 
> > >  .../apache/maven/model/plugin/DefaultReportingConverter.java   | 10
> > > 
> > > +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
> > > 
> > > diff --git
> > 
> > a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultR
> > e
> > 
> > > portingConverter.java
> > 
> > b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultR
> > e
> > 
> > > portingConverter.java index 683f494..2571104 100644
> > > ---
> > 
> > a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultR
> > e
> > 
> > > portingConverter.java +++
> > 
> > b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultR
> > e
> > 
> > > portingConverter.java @@ -235,12 +235,16 @@ public class
> > > DefaultReportingConverter
> > > 
> > >          if ( !reportSet.getReports().isEmpty() )
> > >          {
> > > 
> > > -            InputLocation location = reportSet.getLocation( "reports"
> > > );
> > > -            Xpp3Dom reports = new Xpp3Dom( "reports", location );
> > > +            InputLocation reportsLocation = reportSet.getLocation(
> > > "reports" ); +            if ( reportsLocation == null )
> > > +            {
> > > +                reportsLocation = location;
> > > +            }
> > > +            Xpp3Dom reports = new Xpp3Dom( "reports", reportsLocation
> > > );
> > > 
> > >              int n = 0;
> > >              for ( String report : reportSet.getReports() )
> > >              {
> > > 
> > > -                addDom( reports, "report", report,
> > > location.getLocation(
> > > n++ ) ); +                addDom( reports, "report", report,
> > > reportsLocation.getLocation( n++ ) ); }
> > > 
> > >              dom.addChild( reports );
> > >          
> > >          }
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to