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

lixiaobao commented on HBASE-22082:
-----------------------------------

[oracle java 
codeconventions|https://www.oracle.com/technetwork/java/codeconventions-137265.html#587]

In my opinion, when using the class name access method, the compiler knows that 
the method is a static method and does not need to make too many judgments. 
When using instance, the compiler needs to determine if the method is a static 
method, and then directly replace the instance with the class name.

Class methods (static methods) are methods that don't work on an object, but 
that are for the whole class. 

When you call a class method on an instance, the code looks as if it is a 
regular non-static method that works on the object that you call it on. But 
that's not really the case, so code written in that way will look confusing. 

> Should not use an instance to access static members, which  will increases 
> compilation costs.
> ---------------------------------------------------------------------------------------------
>
>                 Key: HBASE-22082
>                 URL: https://issues.apache.org/jira/browse/HBASE-22082
>             Project: HBase
>          Issue Type: Improvement
>          Components: regionserver
>    Affects Versions: 1.4.5, 2.1.1, 2.0.4
>            Reporter: lixiaobao
>            Assignee: lixiaobao
>            Priority: Minor
>             Fix For: 3.0.0
>
>         Attachments: HBASE-22082.patch
>
>
> A little modification:
> In class MutationBatchOperation, the method prepareMiniBatchOperations has a 
> small change,we should not use an instance to access static members, which 
> will increases compilation costs.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to