pasha-kuznetsov opened a new issue #841: Unnecessary new Object[] {}, new 
String[] {} etc calls
URL: https://github.com/apache/bookkeeper/issues/841
 
 
   There are a few `new Object[] {}`, `new String[] {}` etc calls in BookKeeper 
code, mostly leftovers from the older `slf4j`'s `LOG` API which used to lack 
the `Object...` "vararg" method overloads. This makes it harder to read and 
maintain.
   
   **Example 1**
   ```
   LOG.info("Initialize rackaware ensemble placement policy @ {} @ {} : {}.",
           new Object[] { localNode, null == localNode ? "Unknown" : 
localNode.getNetworkLocation(),
               dnsResolver.getClass().getName() });
   ```
   can be simplified to:
   ```
   LOG.info("Initialize rackaware ensemble placement policy @ {} @ {} : {}.",
           localNode, null == localNode ? "Unknown" : 
localNode.getNetworkLocation(),
           dnsResolver.getClass().getName());
   ```
   
   **Example 2**
   ```
   new HashSet<String>(Arrays.asList(new String[] { FIELD_COUNTER }));
   ```
   can be simplified to
   ```
   new HashSet<String>(Arrays.asList(FIELD_COUNTER));
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to