You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2011/09/22 17:11:02 UTC

svn commit: r1174193 - /maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java

Author: olamy
Date: Thu Sep 22 15:11:02 2011
New Revision: 1174193

URL: http://svn.apache.org/viewvc?rev=1174193&view=rev
Log:
[WAGON-285] Repository constructor NPE should be more verbose.

Modified:
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java?rev=1174193&r1=1174192&r2=1174193&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java (original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java Thu Sep 22 15:11:02 2011
@@ -19,13 +19,13 @@ package org.apache.maven.wagon.repositor
  * under the License.
  */
 
-import java.io.Serializable;
-import java.util.Properties;
-
 import org.apache.maven.wagon.PathUtils;
 import org.apache.maven.wagon.WagonConstants;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.Serializable;
+import java.util.Properties;
+
 /**
  * This class is an abstraction of the location from/to resources
  * can be transfered.
@@ -34,7 +34,8 @@ import org.codehaus.plexus.util.StringUt
  * @version $Id$
  * @todo [BP] some things are specific to certain wagons (eg key stuff in authInfo, permissions)
  */
-public class Repository implements Serializable
+public class Repository
+    implements Serializable
 {
     private static final long serialVersionUID = 1312227676322136247L;
 
@@ -77,16 +78,16 @@ public class Repository implements Seria
     {
         if ( id == null )
         {
-            throw new NullPointerException( "id can not be null" );
+            throw new NullPointerException( "id can not be null for Repository with url=" + url );
         }
-        
+
         setId( id );
 
         if ( url == null )
         {
-            throw new NullPointerException( "url can not be null" );
+            throw new NullPointerException( "url can not be null for Repository with id=" + id );
         }
-        
+
         setUrl( url );
     }
 
@@ -103,7 +104,7 @@ public class Repository implements Seria
     /**
      * Retrieve the base directory of the repository. This is derived from the full repository URL, and
      * contains the entire path component.
-     * 
+     *
      * @return the base directory
      */
     public String getBasedir()