Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-04 Thread Paul Smith
On Fri, 2003-12-05 at 13:19, Raymond DeCampo wrote: > Paul Smith wrote: > >>The hashcode computation must be fast in itself, at least significantly > >>faster than 'equals' method invocations which return false. > >> > >>I think that String.hashcode computation is kinda slow depending on the JDK

Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-04 Thread Raymond DeCampo
Paul Smith wrote: The hashcode computation must be fast in itself, at least significantly faster than 'equals' method invocations which return false. I think that String.hashcode computation is kinda slow depending on the JDK because it iterates on ALL the characters of the String. M. Yes

Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-03 Thread Paul Smith
> The hashcode computation must be fast in itself, at least significantly > faster than 'equals' method invocations which return false. > > I think that String.hashcode computation is kinda slow depending on the JDK > because it iterates on ALL the characters of the String. M. Yes, I thin

Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-03 Thread Ceki Gülcü
At 08:02 AM 12/4/2003 +1100, Paul Smith wrote: On Thu, 2003-12-04 at 07:54, Ceki Gülcü wrote: > Yes. The general contact for the hashcode method says: > > 1 Two equal objects must have the same hashcode. > 2 Two unequal objects can have the same hashcode. > > Item 1 does *not* mean that unequal o

Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-03 Thread Paul Smith
On Thu, 2003-12-04 at 07:54, Ceki GÃlcà wrote: > Yes. The general contact for the hashcode method says: > > 1 Two equal objects must have the same hashcode. > 2 Two unequal objects can have the same hashcode. > > Item 1 does *not* mean that unequal objects must have different hashcodes, > which

Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-03 Thread Ceki Gülcü
At 07:46 AM 12/4/2003 +1100, you wrote: We can add this as the first line as an optimization: if( this == rObject) { return true; } right! I'll add this now. Also, will the hashCode based on the timestamp be enough to be consistent with equals? Yes. The general contact for the hashcode method

Re: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-12-03 Thread Paul Smith
> + > + public boolean equals(Object rObject) { > + > + if(!(rObject instanceof LoggingEvent)) { > + return false; > + } We can add this as the first line as an optimization: if( this == rObject) { return true; } Also, will the hashCode based on the timestam

RE: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi LoggingEvent.java

2003-02-18 Thread Nicko Cadell
I would suggest adding support to the pattern layout to support the logging event properties. Syntax like: %P{name} Would be sufficient. Nicko > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 18 February 2003 19:58 > To: [EMAIL PROTECTED] > Subject: cvs