myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r939399 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Date Thu, 29 Apr 2010 17:35:12 GMT
Author: jakobk
Date: Thu Apr 29 17:35:11 2010
New Revision: 939399

URL: http://svn.apache.org/viewvc?rev=939399&view=rev
Log:
MYFACES-2686 javax.faces.FacesException: java.lang.NumberFormatException while initializing
if MANIFEST.MF version exceeds int value (changed int to long)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=939399&r1=939398&r2=939399&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Thu Apr 29 17:35:11 2010
@@ -2482,26 +2482,29 @@ public class FacesConfigurator
 
     static class Version implements Comparable<Version>
     {
-        private Integer[] parts;
+        // we have to use Long here, because the version number
+        // could be something like 20060714150240 and this value
+        // exceeds an Integer (see MYFACES-2686)
+        private Long[] parts;
 
         private boolean snapshot;
 
         public Version(String major, String minor, String maintenance, String extra, String
snapshot)
         {
-            parts = new Integer[4];
-            parts[0] = Integer.valueOf(major);
+            parts = new Long[4];
+            parts[0] = Long.valueOf(major);
 
             if (minor != null)
             {
-                parts[1] = Integer.valueOf(minor);
+                parts[1] = Long.valueOf(minor);
 
                 if (maintenance != null)
                 {
-                    parts[2] = Integer.valueOf(maintenance);
+                    parts[2] = Long.valueOf(maintenance);
 
                     if (extra != null)
                     {
-                        parts[3] = Integer.valueOf(extra);
+                        parts[3] = Long.valueOf(extra);
                     }
                 }
             }
@@ -2513,8 +2516,8 @@ public class FacesConfigurator
         {
             for (int i = 0; i < parts.length; i++)
             {
-                Integer left = parts[i];
-                Integer right = v.parts[i];
+                Long left = parts[i];
+                Long right = v.parts[i];
                 if (left == null)
                 {
                     if (right == null)
@@ -2570,8 +2573,8 @@ public class FacesConfigurator
 
                 for (int i = 0; i < parts.length; i++)
                 {
-                    Integer thisPart = parts[i];
-                    Integer otherPart = other.parts[i];
+                    Long thisPart = parts[i];
+                    Long otherPart = other.parts[i];
                     if (thisPart == null ? otherPart != null : !thisPart.equals(otherPart))
                     {
                         return false;
@@ -2590,7 +2593,7 @@ public class FacesConfigurator
         public int hashCode()
         {
             int hash = 0;
-            for (Integer part : parts)
+            for (Long part : parts)
             {
                 if (part != null)
                 {
@@ -2610,7 +2613,7 @@ public class FacesConfigurator
             builder.append(parts[0]);
             for (int i = 1; i < parts.length; i++)
             {
-                Integer val = parts[i];
+                Long val = parts[i];
                 if (val != null)
                 {
                     builder.append('.').append(val);



Mime
View raw message