Author: hboutemy
Date: Mon Dec  6 23:09:03 2010
New Revision: 1042842

URL: http://svn.apache.org/viewvc?rev=1042842&view=rev
Log:
[MPIR-171] fixed numeric timezone support

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

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java?rev=1042842&r1=1042841&r2=1042842&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
 Mon Dec  6 23:09:03 2010
@@ -41,6 +41,7 @@ import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
+import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.validator.UrlValidator;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
@@ -361,4 +362,22 @@ public class ProjectInfoReportUtils
 
         return conn;
     }
+
+    public static boolean isNumber( String str )
+    {
+        if ( str.startsWith( "+" ) )
+        {
+            str = str.substring( 1 );
+        }
+        return NumberUtils.isNumber( str );
+    }
+
+    public static int toInt( String str, int defaultValue )
+    {
+        if ( str.startsWith( "+" ) )
+        {
+            str = str.substring( 1 );
+        }
+        return NumberUtils.toInt( str, defaultValue );
+    }
 }

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/TeamListReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/TeamListReport.java?rev=1042842&r1=1042841&r2=1042842&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/TeamListReport.java
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/TeamListReport.java
 Mon Dec  6 23:09:03 2010
@@ -279,7 +279,8 @@ public class TeamListReport
             {
                 tableCell( member.getTimezone() );
 
-                if ( !NumberUtils.isNumber( member.getTimezone() ) && 
StringUtils.isNotEmpty( member.getTimezone() ) )
+                if ( StringUtils.isNotEmpty( member.getTimezone() )
+                    && ( !ProjectInfoReportUtils.isNumber( 
member.getTimezone().trim() ) ) )
                 {
                     String tz = member.getTimezone().trim();
                     try
@@ -320,7 +321,7 @@ public class TeamListReport
                     else
                     {
                         // check if number is between -12 and +14
-                        int tz = NumberUtils.toInt( 
member.getTimezone().trim(), Integer.MIN_VALUE );
+                        int tz = ProjectInfoReportUtils.toInt( 
member.getTimezone().trim(), Integer.MIN_VALUE );
                         if ( tz == Integer.MIN_VALUE || !( tz >= -12 && tz <= 
14 ) )
                         {
                             text( null );


Reply via email to