[ 
https://issues.apache.org/jira/browse/HADOOP-11709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14361404#comment-14361404
 ] 

Haohui Mai commented on HADOOP-11709:
-------------------------------------

I don't quite follow that why this is necessary as it is a simple exercise of 
constant propagation from the compiler point of view?

> Time.NANOSECONDS_PER_MILLISECOND - use class level final constant instead of 
> method variable 
> ---------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-11709
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11709
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Ajith S
>            Assignee: Ajith S
>            Priority: Trivial
>              Labels: beginner, newbie
>
> NANOSECONDS_PER_MILLISECOND constant can be moved to class level instead of 
> creating it in each method call.
> {code}
> org.apache.hadoop.util.Time.java
>  public static long monotonicNow() {
>     final long NANOSECONDS_PER_MILLISECOND = 1000000;
>     return System.nanoTime() / NANOSECONDS_PER_MILLISECOND;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to