ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darrell DeBoer <darr...@apache.org>
Subject Re: [myrmidon] PATCH: NameValidator (modified)
Date Sun, 10 Mar 2002 12:38:46 GMT
Hi,

This is a modified version of the earlier patch, which adds a new cascading 
exception, ProjectException, which is thrown whenever an error occurs during 
project building. Any errors which are thrown in external code (eg 
NameValidator) are cascaded as ProjectExceptions.

This is a pretty big change to the style of Exception handling, and reflects 
my personal preference on how to do this. But it's significantly different to 
the way DefaultProjectBuilder *was* working, so let me know if it's not the 
Myrmidon way.

BTW, I didn't modify the ProjectBuilder interface, as this would require 
adding this exception to the public API. Maybe it should be, but I'll leave 
that decision to those more familiar with the package structure.

On a similar note: the NameValidator class is used by both 
myrmidon.components.DefaultProjectBuilder and 
myrmidon.components.DefaultTaskContext. Where should code like this go?

ciao
Daz


On Sat, 9 Mar 2002 23:39, Darrell DeBoer wrote:
> Hi
>
> Attached is a patch addressing the myrmidon TODO items:
>   "Validate project and target names in DefaultProjectBuilder..."
>   "Similarly, validate property names, using the same rules."
>
> The rules I've currently set up:
> * For project and target names.
>     - Letters and digits are permitted anywhere.
>     - Whitespace is permitted internally
>     - "_" is allowed as first character, and "_-." as internal characters.
> * For property names:
>     - As per project and target names, but no whitespace is permitted.
> These rules will be trivial to modify.
>
> Change details:
> * NameValidator provides a reasonably flexible mechanism for
> specifying/testing name validity.
> * NameValidator is used by DefaultProjectBuilder for project and target
> names, and by DefaultTaskContext for Property names.
> * Added a bunch of tests
>
> ciao
> Daz
>
> (Hmmm - I just thought that I should probably adjust "todo.xml" as part of
> my patch. Maybe next time...)

Mime
View raw message