cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7478] - java.lang.NullPointerException in AbstractValidatorAction
Date Wed, 27 Mar 2002 13:18:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7478>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7478

java.lang.NullPointerException in AbstractValidatorAction

nicolaken@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED



------- Additional Comments From nicolaken@apache.org  2002-03-27 13:18 -------
Please try this and see if it's ok.
I tried http://localhost:8080/cocoon/formvalidation/test
and it works.

 -------------------------------------

    /**
     * Returns the value of 'nullable' attribute from given configuration or
     * from given constraints, value present in constrints takes precedence,
     * false when attribute is not present in either of them.
     */
    private boolean getNullable(Configuration conf, Configuration cons) {
        /* check nullability */
        try {
            String tmp = cons.getAttribute("nullable");
            return "yes".equals(tmp) || "true".equals(tmp);
        } catch (ConfigurationException e) {
           getLogger().debug ("Error while using constraints: "+e);
        } catch (NullPointerException npe) {
           getLogger().debug ("NullPointerException while using 
constraints: "+npe);
        } finally {
            getLogger().debug ("Using configuration instead of 
constraints.");             
            String tmp = conf.getAttribute("nullable", "no");
            return "yes".equals(tmp) || "true".equals(tmp);
        }        
    }

    /**
     * Returns the default value from given configuration or constraints.
     * Value present in constraints takes precedence, null is returned when no
     * default attribute is present in eiher of them.
     */
    private String getDefault(Configuration conf, Configuration cons) {
        String dflt = null;
        try {
            dflt = cons.getAttribute("default");
        } catch (ConfigurationException e) {
           getLogger().debug ("Error while using constraints: "+e);
        } catch (NullPointerException npe) {
           getLogger().debug ("NullPointerException while using 
constraints: "+npe);
        } finally {
           getLogger().debug ("Using configuration instead of 
constraints.");        
           dflt = conf.getAttribute("default", "");
        }    
        
        if ("".equals(dflt.trim())) {
            dflt = null;
        }
        return dflt;
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message