Author: jvanzyl
Date: Tue May 31 09:13:01 2005
New Revision: 179232

URL: http://svn.apache.org/viewcvs?rev=179232&view=rev
Log:
o improving error report so that you know what the g:a is if the version and
type are null.

Modified:
    
maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java

Modified: 
maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java?rev=179232&r1=179231&r2=179232&view=diff
==============================================================================
--- 
maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
 (original)
+++ 
maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
 Tue May 31 09:13:01 2005
@@ -62,36 +62,40 @@
      * !!! WARNING !!! Never put <classifier/> in the POM. It is for mojo use
      * only. Classifier is for specifying derived artifacts, like ejb-client.
      */
-    public DefaultArtifact( String groupId, String artifactId, String version, 
String scope, String type,
+    public DefaultArtifact( String groupId,
+                            String artifactId,
+                            String version,
+                            String scope,
+                            String type,
                             String classifier )
     {
         // These should help us catch coding errors until this code gets a 
whole lot clearer
-        if ( type == null )
-        {
-            throw new NullPointerException( "Artifact type cannot be null." );
-        }
-
         if( groupId == null )
         {
             throw new NullPointerException( "Artifact groupId cannot be null." 
);
         }
-        
-        this.groupId = groupId;
-        
 
         if( artifactId == null )
         {
             throw new NullPointerException( "Artifact artifactId cannot be 
null." );
         }
-        
-        this.artifactId = artifactId;
-        
+
+        // From here at least we can report the g:a
+
+        if ( type == null )
+        {
+            throw new NullPointerException( "Artifact type cannot be null for 
" + groupId + ":" + artifactId );
+        }
 
         if( version == null )
         {
-            throw new NullPointerException( "Artifact version cannot be null." 
);
+            throw new NullPointerException( "Artifact version cannot be null 
for " + groupId + ":" + artifactId );
         }
-        
+
+        this.groupId = groupId;
+
+        this.artifactId = artifactId;
+
         this.version = version;
 
         this.type = type;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to