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

Gilles commented on TEXT-58:
----------------------------

I've not checked the code, but are those methods actually useful (other than 
being used internally by TEXT codes)?

If the functionality is necessary in the public API, and since much defensive 
copying happens anyway, why not define a single method
{code}
public String[][] getEscape(EscapeId id) {
    return copy(escapes.get(id));
}
{code}
where the {{EscapeId}} argument would be an {{enum}}, {{escapes}} a static 
instance of {{EnumMap<EscapeId, String[][]>}} and {{copy}} a private method 
performing the copy?


> All uppercase methods?
> ----------------------
>
>                 Key: TEXT-58
>                 URL: https://issues.apache.org/jira/browse/TEXT-58
>             Project: Commons Text
>          Issue Type: Improvement
>            Reporter: Gilles
>            Priority: Trivial
>              Labels: api, convention, standard
>             Fix For: 1.0
>
>
> Class {{o.a.c.text.translate.EntityArrays}} contains methods names with all 
> uppercase letters (and underscores).
> I understand that they create copies of _static_ constants (although even 
> that is not true since they return arrays!), but are you sure you want to 
> release a new component that does not follow the usual convention?
> I understand these comes from LANG but isn't it the right time to fix the API?



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

Reply via email to