maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1049047 - in /maven/surefire/trunk: .gitignore surefire-api/pom.xml surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultReportEntry.java surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
Date Tue, 14 Dec 2010 11:21:54 GMT
Author: krosenvold
Date: Tue Dec 14 11:21:53 2010
New Revision: 1049047

URL: http://svn.apache.org/viewvc?rev=1049047&view=rev
Log:
o Added minimizing of shaded jar

- Removed shaded commons-lang dependency by using autogenerated equals/hashcode/tostring from
ide
- Re-added an overload that seemed to be missing every now and then for the IT's

Added:
    maven/surefire/trunk/.gitignore
Modified:
    maven/surefire/trunk/surefire-api/pom.xml
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultReportEntry.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java

Added: maven/surefire/trunk/.gitignore
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/.gitignore?rev=1049047&view=auto
==============================================================================
--- maven/surefire/trunk/.gitignore (added)
+++ maven/surefire/trunk/.gitignore Tue Dec 14 11:21:53 2010
@@ -0,0 +1,6 @@
+*.iml
+*.ipr
+target
+*.iws
+surefire-api/dependency-reduced-pom.xml
+

Modified: maven/surefire/trunk/surefire-api/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/pom.xml?rev=1049047&r1=1049046&r2=1049047&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/pom.xml (original)
+++ maven/surefire/trunk/surefire-api/pom.xml Tue Dec 14 11:21:53 2010
@@ -35,11 +35,6 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.1</version>
-    </dependency>
   </dependencies>
 
   <build>
@@ -55,6 +50,7 @@
               <goal>shade</goal>
             </goals>
             <configuration>
+              <minimizeJar>true</minimizeJar>
               <artifactSet>
                 <includes>
                   <include>org.codehaus.plexus:plexus-utils</include>

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultReportEntry.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultReportEntry.java?rev=1049047&r1=1049046&r2=1049047&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultReportEntry.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultReportEntry.java
Tue Dec 14 11:21:53 2010
@@ -42,7 +42,7 @@ public class DefaultReportEntry
 
     public DefaultReportEntry( String source, String name, String message, StackTraceWriter
stackTraceWriter )
     {
-        super( source, name, null, message, stackTraceWriter, null );
+        super( source, name, null, message, stackTraceWriter );
     }
 
     public DefaultReportEntry( String source, String name, String message, StackTraceWriter
stackTraceWriter,

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java?rev=1049047&r1=1049046&r2=1049047&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReportEntry.java
Tue Dec 14 11:21:53 2010
@@ -19,10 +19,6 @@ package org.apache.maven.surefire.report
  * under the License.
  */
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
 // todo: Make this an interface when surefire 2.7.1 compiles with surefire 2.7.0
 public class ReportEntry
 {
@@ -122,37 +118,63 @@ public class ReportEntry
         return elapsed;
     }
 
-    public boolean equals( Object obj )
+    public boolean equals( Object o )
     {
-        if ( !( obj instanceof ReportEntry ) )
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
         {
             return false;
         }
-        if ( this == obj )
+
+        ReportEntry that = (ReportEntry) o;
+
+        if ( elapsed != null ? !elapsed.equals( that.elapsed ) : that.elapsed != null )
         {
-            return true;
+            return false;
+        }
+        if ( group != null ? !group.equals( that.group ) : that.group != null )
+        {
+            return false;
+        }
+        if ( message != null ? !message.equals( that.message ) : that.message != null )
+        {
+            return false;
+        }
+        if ( name != null ? !name.equals( that.name ) : that.name != null )
+        {
+            return false;
+        }
+        if ( source != null ? !source.equals( that.source ) : that.source != null )
+        {
+            return false;
+        }
+        if ( stackTraceWriter != null
+            ? !stackTraceWriter.equals( that.stackTraceWriter )
+            : that.stackTraceWriter != null )
+        {
+            return false;
         }
-        ReportEntry rhs = (ReportEntry) obj;
-        return new EqualsBuilder().append( getSourceName(), rhs.getSourceName() ).append(
getName(),
-                                                                                        
 rhs.getName() ).append(
-            getGroup(), rhs.getGroup() ).append( getMessage(), rhs.getMessage() ).append(
getStackTraceWriter(),
-                                                                                        
 rhs.getStackTraceWriter() ).isEquals();
-    }
 
-    public String toString()
-    {
-        return new ToStringBuilder( this ).append( "source", getSourceName() ).append( "name",
getName() ).append(
-            "group", getGroup() ).append( "message", getMessage() ).append( "stackTraceWriter",
-                                                                            getStackTraceWriter()
).toString();
+        return true;
     }
 
     public int hashCode()
     {
-        // you pick a hard-coded, randomly chosen, non-zero, odd number
-        // ideally different for each class
-        // good resource at http://primes.utm.edu/lists/small/1000.txt
-        return new HashCodeBuilder( 5897, 6653 ).append( getSourceName() ).append( getName()
).append(
-            getGroup() ).append( getMessage() ).append( getStackTraceWriter() ).toHashCode();
+        int result = source != null ? source.hashCode() : 0;
+        result = 31 * result + ( name != null ? name.hashCode() : 0 );
+        result = 31 * result + ( group != null ? group.hashCode() : 0 );
+        result = 31 * result + ( message != null ? message.hashCode() : 0 );
+        result = 31 * result + ( stackTraceWriter != null ? stackTraceWriter.hashCode() :
0 );
+        result = 31 * result + ( elapsed != null ? elapsed.hashCode() : 0 );
+        return result;
     }
 
+    public String toString()
+    {
+        return "ReportEntry{" + "source='" + source + '\'' + ", name='" + name + '\'' + ",
group='" + group + '\'' +
+            ", message='" + message + '\'' + ", stackTraceWriter=" + stackTraceWriter + ",
elapsed=" + elapsed + '}';
+    }
 }



Mime
View raw message