On 11/17/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Bernd Fondermann wrote:
On 11/17/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Output code 2 from jdk 1.4
String s2 = s + test + s1 + test + i;
Output code 2 from jdk 1.5
String s2 = (new
On 11/18/06, robert burrell donkin [EMAIL PROTECTED] wrote:
On 11/17/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Bernd Fondermann wrote:
On 11/17/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Output code 2 from jdk 1.4
String s2 = s + test + s1 + test + i;
Output code 2
I don't like this approach.
I think we should wait to refactor this component until we'll switch to
java 5 as the required jvm so we can introduce a Logger interface with
the mixin's methods we need.
If you want to avoid complex evaluation for debugging you will have to
use the
On 11/18/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
I don't like this approach.
most people don't like this approach the first time they see it: it feels wrong
but give it time and think about it carefully before rushing to judgement
I think we should wait to refactor this component until
Am Samstag, den 18.11.2006, 08:53 + schrieb robert burrell donkin:
Imho it is really interesting to see that in jdk 1.5 the string
concatenation is replaced by StringBuilder by default and this way is
even better than using the StringBuffer.
perhaps one plan would be to factor out
Stefano Bagnara wrote:
I think we should wait to refactor this component until we'll switch to
java 5 as the required jvm so we can introduce a Logger interface with
the mixin's methods we need.
Can you illustrate the pattern you have in mind for such a future approach?
--- Noel
Noel J. Bergman wrote:
Stefano Bagnara wrote:
I think we should wait to refactor this component until we'll switch to
java 5 as the required jvm so we can introduce a Logger interface with
the mixin's methods we need.
Can you illustrate the pattern you have in mind for such a future
On 11/18/06, Joachim Draeger [EMAIL PROTECTED] wrote:
Am Samstag, den 18.11.2006, 08:53 + schrieb robert burrell donkin:
Imho it is really interesting to see that in jdk 1.5 the string
concatenation is replaced by StringBuilder by default and this way is
even better than using the
On 11/18/06, robert burrell donkin [EMAIL PROTECTED] wrote:
On 11/18/06, Joachim Draeger [EMAIL PROTECTED] wrote:
Am Samstag, den 18.11.2006, 08:53 + schrieb robert burrell donkin:
Imho it is really interesting to see that in jdk 1.5 the string
concatenation is replaced by
Hi Bernd,
Am Freitag, den 17.11.2006, 08:42 +0100 schrieb Bernd Fondermann:
I also ran with jdk5 that code in a loop of 1 million iterations using
foo = foo and bar = bar (this is FAR from any realistic scenario).
sigh Microbenchmarking, again! ;-)
Could it be you are testing loop
Joachim Draeger schrieb:
Hi Bernd,
Am Freitag, den 17.11.2006, 08:42 +0100 schrieb Bernd Fondermann:
I also ran with jdk5 that code in a loop of 1 million iterations using
foo = foo and bar = bar (this is FAR from any realistic scenario).
sigh Microbenchmarking, again! ;-)
Norman Maurer wrote:
Joachim Draeger schrieb:
...
BTW: I have often seen NPE *bugs* in debug messages, that appeared
magically when the costumer has turned on *de*bugging. :-) This could
avoided by putting a try/catch block around...
Joachim
Im against this.. Even if the
Vincenzo Gianferrari Pini wrote:
BTW: I have often seen NPE *bugs* in debug messages, that appeared
magically when the costumer has turned on *de*bugging. :-) This could
avoided by putting a try/catch block around...
Im against this.. Even if the NPE is in the debug message it should
:-)
Vincenzo
Joachim Draeger wrote:
Vincenzo Gianferrari Pini wrote:
BTW: I have often seen NPE *bugs* in debug messages, that appeared
magically when the costumer has turned on *de*bugging. :-) This could
avoided by putting a try/catch block around...
Im against this.. Even if the
Bernd Fondermann wrote:
On 11/17/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Output code 2 from jdk 1.4
String s2 = s + test + s1 + test + i;
Output code 2 from jdk 1.5
String s2 = (new StringBuilder()).append(s).append(test)
.append(s1).append(test).append(i).toString();
robert burrell donkin wrote:
On 11/14/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Maybe this helps on this topic:
http://wiki.java.net/bin/view/Javapedia/AlwaysUseStringBufferMisconception#Concatenating_Literal_Strings
note that the misconception the link talks about is concatinating
string
Stefano Bagnara wrote:
Input code 2:
String res = foo + test + bar + test + i;
Output code 2 from jdk 1.4
String s2 = s + test + s1 + test + i;
Output code 2 from jdk 1.5
String s2 = (new StringBuilder()).append(s).append(test)
.append(s1).append(test).append(i).toString();
On 11/17/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Output code 2 from jdk 1.4
String s2 = s + test + s1 + test + i;
Output code 2 from jdk 1.5
String s2 = (new StringBuilder()).append(s).append(test)
.append(s1).append(test).append(i).toString();
I also ran with jdk5 that
On 11/14/06, Bernd Fondermann [EMAIL PROTECTED] wrote:
On 11/14/06, Joachim Draeger [EMAIL PROTECTED] wrote:
Memory garbage should not be a problem any longer in the light of
generational GCs.
I'm not sure how you arrive at this sweeping conclusion!
Profligate use of memory is a problem no
The path that you suggest is the exact opposite of a code review and code
change that we deliberately undertook after performance testing.
isLogLevelEnabled should be used before formatting the message, and
StringBuffers is more efficient than String concatentation at very little
cost.
We can
On 11/14/06, Stefano Bagnara [EMAIL PROTECTED] wrote:
Maybe this helps on this topic:
http://wiki.java.net/bin/view/Javapedia/AlwaysUseStringBufferMisconception#Concatenating_Literal_Strings
note that the misconception the link talks about is concatinating
string literals, not variables
use
headers/body) or when doing really much concats.
I would use isDebugEnabled() only inside a loop and not in a per command
issue.
To make it clear: I'm not proposing refactoring all around James. I just
don't want to make extensive use of isLogEnabled() and StringBuffer().
I'm going to remove
On 11/14/06, Joachim Draeger [EMAIL PROTECTED] wrote:
Hi!
Am I hitting another controversy topic? ;-)
Example from ImapHandler.java
catch ( IOException e ) {
if ( getLogger().isErrorEnabled() ) {
StringBuffer exceptionBuffer =
new
( IOException e ) {
getLogger().error( Cannot open connection from + remoteHost + (
+ remoteIP + ): + e.getMessage() );
throw e;
}
To make it clear: I'm not proposing refactoring all around James. I just
don't want to make extensive use of isLogEnabled() and StringBuffer().
I'm
24 matches
Mail list logo