myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r827000 - in /myfaces/tobago/branches/tobago-1.0.x/core/src: main/java/org/apache/myfaces/tobago/component/ main/java/org/apache/myfaces/tobago/taglib/component/ test/java/org/apache/myfaces/tobago/component/
Date Tue, 20 Oct 2009 08:48:26 GMT
Author: lofwyr
Date: Tue Oct 20 08:48:25 2009
New Revision: 827000

URL: http://svn.apache.org/viewvc?rev=827000&view=rev
Log:
TOBAGO-803: Value 'occurence' of OrderBy is misspelled and should be renamed to 'occurrence'

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/component/UIMessages.java
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java
    myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/component/UIMessages.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/component/UIMessages.java?rev=827000&r1=826999&r2=827000&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/component/UIMessages.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/component/UIMessages.java
Tue Oct 20 08:48:25 2009
@@ -19,6 +19,7 @@
 
 import org.apache.commons.collections.iterators.SingletonIterator;
 import org.apache.myfaces.tobago.TobagoConstants;
+import org.apache.myfaces.tobago.util.Deprecation;
 
 import javax.faces.application.FacesMessage;
 import javax.faces.context.FacesContext;
@@ -253,9 +254,16 @@
     SEVERITY;
 
     public static final String OCCURENCE_STRING = "occurence";
+    public static final String OCCURRENCE_STRING = "occurrence";
     public static final String SEVERITY_STRING = "severity";
 
     public static OrderBy parse(String key) {
+      if (OCCURENCE_STRING.equals(key)) {
+        Deprecation.LOG.warn("Please use '" + OCCURRENCE_STRING + "' instead of '" + OCCURENCE_STRING
+ "'");
+      }
+      if (OCCURRENCE_STRING.equals(key)) {
+        key = OCCURENCE_STRING;
+      }
       return valueOf(key.toUpperCase());
     }
 

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java?rev=827000&r1=826999&r2=827000&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MessagesTagDeclaration.java
Tue Oct 20 08:48:25 2009
@@ -91,8 +91,11 @@
    */
   @TagAttribute
   @UIComponentTagAttribute(
-          allowedValues = {UIMessages.OrderBy.OCCURENCE_STRING, UIMessages.OrderBy.SEVERITY_STRING},
-          defaultValue = UIMessages.OrderBy.OCCURENCE_STRING)
+          allowedValues = {
+              UIMessages.OrderBy.OCCURRENCE_STRING, 
+              UIMessages.OrderBy.SEVERITY_STRING, 
+              UIMessages.OrderBy.OCCURENCE_STRING},
+          defaultValue = UIMessages.OrderBy.OCCURRENCE_STRING)
   void setOrderBy(String orderBy);
 
   /**

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java?rev=827000&r1=826999&r2=827000&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/test/java/org/apache/myfaces/tobago/component/UIMessagesUnitTest.java
Tue Oct 20 08:48:25 2009
@@ -129,6 +129,7 @@
   public void testOrderByEnum() {
     assertEquals(2, UIMessages.OrderBy.values().length);
     assertEquals(UIMessages.OrderBy.OCCURENCE, UIMessages.OrderBy.parse(UIMessages.OrderBy.OCCURENCE_STRING));
+    assertEquals(UIMessages.OrderBy.OCCURENCE, UIMessages.OrderBy.parse(UIMessages.OrderBy.OCCURRENCE_STRING));
     assertEquals(UIMessages.OrderBy.SEVERITY, UIMessages.OrderBy.parse(UIMessages.OrderBy.SEVERITY_STRING));
   }
 



Mime
View raw message