commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: svn commit: r395181 - /jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
Date Wed, 19 Apr 2006 18:55:18 GMT
On Wed, 2006-04-19 at 21:09 +1200, Simon Kitching wrote:
> Hi Robert,
> 
> As you can see I've had a go at fixing the odd diagnostic message. I'd
> be grateful if you could double-check this sometime.
> 
> ====
> The initial code did:
>   // match package plus first 4 chars
>   if (candidate.regionMatches(true, 0, name, 0, 38)) {...}
> I presume the "38" was meant to be
>   length("org.apache.commons.logging.impl.") + 4.
> However that works out to be 32+4=36. So the old code was actually
> testing the first 6 chars.
> 
> I decided to make the code a little more self-explanatory (defined
> constants etc) and went with the 4 chars as stated by the comment,
> rather than the 4 chars as implemented.

the comment's wrong: Jdk13Lumberjacklog and Jdk14Logger have the same
first 4 characters. 5 should be enough. (will need to check this when i
can find the time)

> ====
> I also switched from candidate.regionMatches(true, 0, name, ..) to
> name.regionMatches(true, 0, candidate, ...). Actually, on hindsight that
> wasn't necessary; I had another test in there for a while which used
> name and therefore made them all consistent. However 
>   x.regionMatches(.., y, ..) and
>   y.regionMatches(.., x, ..) 
> are both the same, yes? (as long as x and y are both non-null which they
> always are).

+1

> ====
> Also, rather than trimming the user-specified classname only before
> doing diagnostic output, the name is now trimmed within the
> findUserSpecifiedLogClassName.

+1

looks good

- robert



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message