[
https://issues.apache.org/jira/browse/LANG-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14165023#comment-14165023
]
Sebb commented on LANG-1043:
----------------------------
As far as I can tell, all these use cases would require additional validation
anyway.
In which case using a suitable regex expression check would be preferable.
As to the "Ronseal" test, I assume you are referring to the advert (possibly UK
only) which has the tag-line "does what it says on the tin"?
In this case, the tin says:
{quote}
Checks if the CharSequence contains only uppercase characters.
...
@return true if only contains uppercase characters, and is non-null
{quote}
I read that as meaning that if the sequence contains anything other than
uppcase characters then the result is false.
There is even an example with spaces.
So as far as I am concerned, it does pass the Ronseal test.
However there are no examples with non-alphabetic characters; perhaps that
should be addressed.
Note that the behaviour is analogous to isNumeric and isAllLowerCase.
I agree with Duncan that the current behaviour is as documented.
I am against adding this new method as it does not seem to me to have a valid
use-case, and is therefore unnecessary.
> isAllUpperCase should only check Alpha characters
> -------------------------------------------------
>
> Key: LANG-1043
> URL: https://issues.apache.org/jira/browse/LANG-1043
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.3.2
> Reporter: Frédéric JECKER
> Fix For: Discussion
>
> Attachments: LANG-1043.patch
>
>
> Currently, isAllUpperCase checks character by character if the current
> character is UpperCase or not using Character.isUpperCase().
> The problem is that characters like spaces aren't considered as uppercase
> characters.
> IMHO, isAllUpperCase should only check the state of alpha characters so that :
> - StringUtils.isAllUpperCase("ABC DEF GHI") = true (false currently)
> - StringUtils.isAllUpperCase("ABC / DEF") = true (false currently)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)