ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Ausianik <Pavel_Ausia...@epam.com>
Subject optimizing write() and StringUtils.lineSeparator
Date Fri, 15 Nov 2002 15:22:31 GMT
> Hi,
> 
> While doing a patch replacing write(A  +B  +C ) to separated writes I have
> made a mistake. Usually compiler concatenates strings which already
> constants, and I when write following code
> 
>       sink.write('>' + StringUtils.lineSeparator);	
> 
> it will be single constant too. This however does not happens since
> StringUtils.lineSeparator right now is not a Constant in fact but var (it
> assigned after class load).  It defined as follows
> 
>   public static final String lineSeparator =
>     System.getProperty("line.separator", "\n");
> 
> To fix the problem is necessary to either redefine  lineSeparator  like
> 
>   public static final String lineSeparator = "\n";
> 
> or change 6 classes were improper usage appears.
> 
> I think in fact is possible to hardcode separator, since anyway we  use it
> the internet, were we know nothing about other part we communicate to
> (either server or client).
> 
> Best regards,
> Pavel Ausianik
> 

Mime
View raw message