cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <>
Subject Re: [cforms] refactoring questions (was Re: cvs commit: cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel
Date Wed, 21 Apr 2004 13:26:21 GMT

Ugo Cei wrote:
> Marc Portier wrote:
>> 3/ can getId() ever return null or "" on a widget instance? Can't we 
>> carefully asume programming error and allow for the accidental NPE to 
>> be thrown
> if (id == null || id.equals("")) {
>   throw new FormsConfigurationException("Widget id cannot be null.");
> }
> where FormsConfigurationException extends RuntimeException, of course ;-).

yeah, but this is something that never needs to be catched it really is 
a programming error, so I find the test for null unesessary and the 
possible resulting NPE as more then RTE enough to commincate the coding 

in any case (see other message) there seems to be room for some
semantical meaning to "" and null

>> 7/ should validation stop as soon as possible or continue to allow all 
>> validation errors to be set?
> If you can't make it optional, allow it to continue.

again see other message for the actual various conditions to consider

currently I have the same feeling that "by default we should continue",
and actually am not so far to see a real need for making it optional.

Marc Portier                  
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                          

View raw message