maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylwester Lachiewicz <slachiew...@gmail.com>
Subject Re: [maven] 01/01: Fix reports Location NPE
Date Fri, 12 Apr 2019 17:39:53 GMT
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 <herve.boutemy@free.fr> 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 slachiewicz@apache.org 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 <slachiewicz@apache.org>
> > 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/DefaultRe
> > portingConverter.java
> >
> b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultRe
> > portingConverter.java index 683f494..2571104 100644
> > ---
> >
> a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultRe
> > portingConverter.java +++
> >
> b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultRe
> > 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: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message