ZanderXu opened a new pull request, #4667:
URL: https://github.com/apache/hadoop/pull/4667

   ### Description of PR
   
   When I read some class about Edits of NameNode, I found that there are much 
redundant cast inĀ FSEditLogOp.class, I feel that we should remove them.
   
   Such as:
   ```
   static UpdateBlocksOp getInstance(OpInstanceCache cache) {
     return (UpdateBlocksOp)cache.get(OP_UPDATE_BLOCKS);
   }
   ``` 
   
   Because cache.get() have cast the response to T, so we can remove the 
redundant cast.
   ```
   @SuppressWarnings("unchecked")
   public <T extends FSEditLogOp> T get(FSEditLogOpCodes opCode) {
     return useCache ? (T)CACHE.get().get(opCode) : (T)newInstance(opCode);
   } 
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to