maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r587356 - /maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Date Tue, 23 Oct 2007 01:39:06 GMT
Author: brianf
Date: Mon Oct 22 18:39:06 2007
New Revision: 587356

URL: http://svn.apache.org/viewvc?rev=587356&view=rev
Log:
MNG-3201: added toString()

Modified:
    maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java

Modified: maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=587356&r1=587355&r2=587356&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Mon Oct 22 18:39:06 2007
@@ -1711,4 +1711,30 @@
         }
     }
     
+    /**
+     * Default toString
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer(30);
+        sb.append( "MavenProject: " );
+        sb.append( this.getGroupId() );
+        sb.append( ":" );
+        sb.append( this.getArtifactId() );
+        sb.append( ":" );
+        sb.append( this.getVersion() );
+        sb.append( " @ " );
+        
+        try 
+        {
+            sb.append( this.getFile().getPath() );
+        }
+        catch (NullPointerException e)
+        {
+            //don't log it.
+        }
+        
+        return sb.toString();        
+    }
+    
 }



Mime
View raw message