You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2011/07/31 18:30:06 UTC

svn commit: r1152589 - /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java

Author: hboutemy
Date: Sun Jul 31 16:30:05 2011
New Revision: 1152589

URL: http://svn.apache.org/viewvc?rev=1152589&view=rev
Log:
[MPIR-228] relaxed algorithm to detect HTML content for license

Modified:
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java?rev=1152589&r1=1152588&r2=1152589&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java Sun Jul 31 16:30:05 2011
@@ -341,8 +341,8 @@ public class LicenseReport
                 int bodyStart = licenseContentLC.indexOf( "<body" );
                 int bodyEnd = licenseContentLC.indexOf( "</body>" );
 
-                if ( ( licenseContentLC.startsWith( "<!doctype html" )
-                    || licenseContentLC.startsWith( "<html>" ) ) && bodyStart >= 0 && bodyEnd >= 0 )
+                if ( ( licenseContentLC.contains( "<!doctype html" ) || licenseContentLC.contains( "<html>" ) ) 
+                    && ( ( bodyStart >= 0 ) && ( bodyEnd > bodyStart ) ) )
                 {
                     bodyStart = licenseContentLC.indexOf( ">", bodyStart ) + 1;
                     String body = licenseContent.substring( bodyStart, bodyEnd );