Any suggestions for where startsWith, endsWith or contains are used?

On Wed, Aug 17, 2011 at 12:44 AM, Scott Deboy <scott.deboy@gmail.com> wrote:
Thanks Stefan, I'll take care of it..


On Wed, Aug 17, 2011 at 12:26 AM, Stefan Bodewig <bodewig@apache.org> wrote:
Hi Scott,

I don't know why commit mails go to the general list, but this one
caught my eye:

On 2011-08-17, <sdeboy@apache.org> wrote:

>                  Node fileNameNode = appenderChild.getAttributes().getNamedItem("name");
> -                if (fileNameNode != null && fileNameNode.getNodeValue().equals("file")) {
> +                If (fileNameNode != null && fileNameNode.getNodeValue().toLowerCase().equals("file")) {

this is a locale sensitive comparison which is likely to cause problems
in the famous Turkish/Azeri locale case ("I".toLowerCase() != "i"
there).

You may want to use fileNameNode.getNodeValue().equalsIgnoreCase("file")
instead, which is safe.

Stefan