You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Bentmann <be...@udo.edu> on 2010/12/03 13:53:39 UTC
Re: svn commit: r1041791 - /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
Hi Vincent,
> Author: vsiveton
> Date: Fri Dec 3 12:42:38 2010
> New Revision: 1041791
>
> URL: http://svn.apache.org/viewvc?rev=1041791&view=rev
> Log:
> o improved TransferFailedException catch for unknown hosts
> o take care of unknown hosts to prevent undesirable ping
>
> Modified:
> maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
> [...]
> @@ -241,13 +253,21 @@ public class RepositoryUtils
> }
> catch ( TransferFailedException e )
> {
> - if ( log.isDebugEnabled() )
> + if ( e.getCause().getClass().isAssignableFrom( UnknownHostException.class ) )
This yields an NPE if the exception has no cause. Something like this is
safer:
if ( e.getCause() instanceof UnknownHostException )
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r1041791 - /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
Posted by Vincent Siveton <vs...@apache.org>.
Thanks, I will fix it.
Vincent
2010/12/3 Benjamin Bentmann <be...@udo.edu>:
> Hi Vincent,
>
>> Author: vsiveton
>> Date: Fri Dec 3 12:42:38 2010
>> New Revision: 1041791
>>
>> URL: http://svn.apache.org/viewvc?rev=1041791&view=rev
>> Log:
>> o improved TransferFailedException catch for unknown hosts
>> o take care of unknown hosts to prevent undesirable ping
>>
>> Modified:
>>
>> maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
>> [...]
>> @@ -241,13 +253,21 @@ public class RepositoryUtils
>> }
>> catch ( TransferFailedException e )
>> {
>> - if ( log.isDebugEnabled() )
>> + if ( e.getCause().getClass().isAssignableFrom(
>> UnknownHostException.class ) )
>
> This yields an NPE if the exception has no cause. Something like this is
> safer:
>
> if ( e.getCause() instanceof UnknownHostException )
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org