commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (VALIDATOR-341) Make TLD list configurable
Date Wed, 10 Jun 2015 21:57:01 GMT

    [ https://issues.apache.org/jira/browse/VALIDATOR-341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14581142#comment-14581142
] 

Sebb commented on VALIDATOR-341:
--------------------------------

Regarding the design of the patch: I think it's a good idea to have a separate list for the
customisations.

However, I wonder whether it is necessary to support anything other than creating a list.
I cannot think of a use case where it would be necessary to change a custom list once it has
been created. This would simplify the code; it would just be necessary to have a single method
to sort the custom entries and then store them. In which case, having a List is unnecessary
overhead. It would require less space to use an array. Also I would consider initialising
the custom lists as empty arrays; there's then no need to check if the array exists.

It would still be possible to clear a custom list - just pass an empty array to the method.

To guarantee thread-safety and consistency, it would be necessary to copy the provided custom
array (arrays are always mutable). But if the calling code promised to behave itself - i.e.
not modify the array - it would be possible to dispense with the copy. Maybe there could be
two methods, a specialised one which re-uses the input array, and a more general one that
clones the array. Plus perhaps one which reads from a file (which could of course use the
copy-free method).

> Make TLD list configurable
> --------------------------
>
>                 Key: VALIDATOR-341
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-341
>             Project: Commons Validator
>          Issue Type: New Feature
>          Components: Framework
>            Reporter: Benedikt Ritter
>              Labels: TLD, domains, email
>         Attachments: RequestForComments.patch
>
>
> Since the list of valid TLDs changes from time to time, it makes sense to let users configure
the list of valid TLDs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message