zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration on zookeeper-server
Date Mon, 12 Aug 2019 19:55:49 GMT
enixon commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration
on zookeeper-server
URL: https://github.com/apache/zookeeper/pull/1049#discussion_r313086056
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/Util.java
 ##########
 @@ -122,50 +121,55 @@ public static File getLogDir(Properties props){
      * @param props properties container
      * @return value of the dbFormatConversion attribute
      */
-    public static String getFormatConversionPolicy(Properties props){
+    public static String getFormatConversionPolicy(Properties props) {
         return props.getProperty(DB_FORMAT_CONV);
     }
 
     /**
      * Extracts zxid from the file name. The file name should have been created
      * using one of the {@link #makeLogName(long)} or {@link #makeSnapshotName(long)}.
-     * 
-     * @param name the file name to parse
+     *
+     * @param name   the file name to parse
      * @param prefix the file name prefix (snapshot or log)
      * @return zxid
      */
     public static long getZxidFromName(String name, String prefix) {
         long zxid = -1;
-        String nameParts[] = name.split("\\.");
+        String[] nameParts = name.split("\\.");
         if (nameParts.length >= 2 && nameParts[0].equals(prefix)) {
             try {
                 zxid = Long.parseLong(nameParts[1], 16);
-            } catch (NumberFormatException e) {
+            } catch (NumberFormatException ignore) {
+
             }
         }
         return zxid;
     }
 
     /**
      * Reads a transaction entry from the input archive.
+     *
      * @param ia archive to read from
      * @return null if the entry is corrupted or EOF has been reached; a buffer
      * (possible empty) containing serialized transaction record.
      * @throws IOException
      */
     public static byte[] readTxnBytes(InputArchive ia) throws IOException {
-        try{
+        try {
             byte[] bytes = ia.readBuffer("txtEntry");
             // Since we preallocate, we define EOF to be an
             // empty transaction
-            if (bytes.length == 0)
+            if (bytes.length == 0) {
                 return bytes;
+            }
             if (ia.readByte("EOF") != 'B') {
                 LOG.error("Last transaction was partial.");
                 return null;
             }
             return bytes;
-        }catch(EOFException e){}
+        } catch (EOFException ignore) {
+
 
 Review comment:
   should the pattern of adding a `// no-op` comment apply here?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message