Re: svn commit: r1158546 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: LogFilePatternLayoutBuilder.java LogUI.java vfs/VFSLogFilePatternReceiver.java

Curt Arnold <[email protected]>
Newsgroups gmane.comp.apache.logging
Message-ID <[email protected]>
XML is case-sensitive by design driven at least in part of the cultural variance in character equivalences. There would be no expectation that if the documentation for a schema says "file", that you could get away with "FILE" or some other variation.

Seems to be an expensive way to get a check of an attribute if that is what you are trying to do in the context.  Typically it would be done like "file".Equals(appenderChild.getAttribute("name")).




On Aug 17, 2011, at 2:54 AM, Scott Deboy wrote:

> Any suggestions for where startsWith, endsWith or contains are used?
> 
> On Wed, Aug 17, 2011 at 12:44 AM, Scott Deboy <[email protected]> wrote:
> Thanks Stefan, I'll take care of it..
> 
> 
> On Wed, Aug 17, 2011 at 12:26 AM, Stefan Bodewig <[email protected]> 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, <[email protected]> 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
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.