On 06/12/2014 16:07, Konstantin Kolinko wrote:
> 2014-12-05 18:18 GMT+03:00  <ma...@apache.org>:
>> Author: markt
>> Date: Fri Dec  5 15:18:46 2014
>> New Revision: 1643323
>>
>> URL: http://svn.apache.org/r1643323
>> Log:
>> Replace System.getProperty("line.separator") with System.lineSeparator()
>>
>> Modified:
>>     tomcat/trunk/java/org/apache/catalina/connector/CoyoteWriter.java
>>     tomcat/trunk/java/org/apache/catalina/security/Constants.java
>>     tomcat/trunk/java/org/apache/catalina/security/SecurityListener.java
>>     tomcat/trunk/java/org/apache/el/parser/ParseException.java
>>     tomcat/trunk/java/org/apache/jasper/Constants.java
>>     tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java
>>     tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
>>     tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java
>>     tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java
>>     tomcat/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
>>     tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java
>>     tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
>>     tomcat/trunk/java/org/apache/juli/JdkLoggerFormatter.java
>>     tomcat/trunk/java/org/apache/juli/OneLineFormatter.java
>>     tomcat/trunk/java/org/apache/juli/VerbatimFormatter.java
>>     tomcat/trunk/java/org/apache/tomcat/buildutil/CheckEol.java
>>     tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
>>
> 
> A small bikeshed issue:
> 
> I think in many places it is better to cache the value in a local
> final variable inside a method rather than repeatedly call the getter.
> 
> The first example in files changed by this commit:
> /java/org/apache/el/parser/ParseException.java
> 
> In Jasper there are several places where line separator is used
> repeatedly in the same method and they can benefit from such local
> variable, e.g.
> /java/org/apache/jasper/compiler/DefaultErrorHandler.java

Are you sure? I'd expect the complier to optimise this and therefore
prefer cleaner code.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to