cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Re: cvs commit: cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/ant AntBuildGenerator.java CocoonTask.java
Date Sat, 17 Apr 2004 15:53:27 GMT
Ugo Cei dijo:
> Il giorno 17/apr/04, alle 15:31, Antonio Gallardo ha scritto:
>
>> I think it is a good programming practice plus:
>>
>> It saves resources.
>
> No, it does not.
>
> ``String literals-or, more generally, strings that are the values of
> constant expressions (ยง15.28)-are "interned" so as to share unique
> instances, using the method String.intern.''
>
> (http://java.sun.com/docs/books/jls/second_edition/html/
> lexical.doc.html#101083)
>
> This means, unless I'm seriously mistaken, that you can always use ""
> instead of StringUtils.EMPTY without using a single bit of memory more.
> And there's no GC involved.

Thanks for pointing out the error. You are right. I will rewrote it as it
maybe. The change was really meaningless and the original code too.

Best Regards,

Antonio Gallardo.

Mime
View raw message