cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r240120 - /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/ValidationError.java
Date Thu, 25 Aug 2005 19:05:48 GMT
Author: joerg
Date: Thu Aug 25 12:05:46 2005
New Revision: 240120

URL: http://svn.apache.org/viewcvs?rev=240120&view=rev
Log:
making the existence of ValidationError(XMLizable) more obvious by using it from the other
constructors

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/ValidationError.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/ValidationError.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/ValidationError.java?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/ValidationError.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/ValidationError.java
Thu Aug 25 12:05:46 2005
@@ -32,16 +32,16 @@
 public class ValidationError {
 
     /** Holds the error message. */
-    private XMLizable saxFragment;
+    private final XMLizable saxFragment;
 
     /**
      * @param i18n should the errorMessage be interpreted as an i18n key?
      */
     public ValidationError(String errorMessage, boolean i18n) {
         if (i18n) {
-            saxFragment = new I18nMessage(errorMessage);
+            this.saxFragment = new I18nMessage(errorMessage);
         } else {
-            saxFragment = new StringMessage(errorMessage);
+            this.saxFragment = new StringMessage(errorMessage);
         }
     }
 
@@ -49,21 +49,21 @@
      * @see I18nMessage#I18nMessage(java.lang.String)
      */
     public ValidationError(String errorMessageKey) {
-        this.saxFragment = new I18nMessage(errorMessageKey);
+        this(new I18nMessage(errorMessageKey));
     }
 
     /**
      * @see I18nMessage#I18nMessage(java.lang.String, java.lang.String[])
      */
     public ValidationError(String errorMessageKey, String[] parameters) {
-        this.saxFragment = new I18nMessage(errorMessageKey, parameters);
+        this(new I18nMessage(errorMessageKey, parameters));
     }
 
     /**
      * @see I18nMessage#I18nMessage(java.lang.String, java.lang.String[], boolean[])
      */
     public ValidationError(String errorMessageKey, String[] parameters, boolean[] keys) {
-        this.saxFragment = new I18nMessage(errorMessageKey, parameters, keys);
+        this(new I18nMessage(errorMessageKey, parameters, keys));
     }
 
     /**
@@ -81,16 +81,15 @@
      * a String error message key was supplied, the necessary I18n tags will be generated.
      */
     public void generateSaxFragment(ContentHandler contentHandler) throws SAXException {
-        if (saxFragment != null) {
-            saxFragment.toSAX(contentHandler);
+        if (this.saxFragment != null) {
+            this.saxFragment.toSAX(contentHandler);
         }
     }
     
     public boolean equals(Object obj) {
         if (obj instanceof ValidationError) {
             return ObjectUtils.equals(this.saxFragment, ((ValidationError)obj).saxFragment);
-        } else {
-            return false;
         }
+        return false;
     }
 }



Mime
View raw message