Merge branch 'master' into salsubaiee/master_fix_issue_509
diff --git a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
index 2a9783b..88c65ff 100644
--- a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
+++ b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
@@ -325,7 +325,6 @@
 
         List<CompilationUnit> cUnits = testCaseCtx.getTestCase().getCompilationUnit();
         for (CompilationUnit cUnit : cUnits) {
-
             testFileCtxs = testCaseCtx.getTestFiles(cUnit);
             expectedResultFileCtxs = testCaseCtx.getExpectedResultFiles(cUnit);
 
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
index 3b6c650..ace47a2 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
@@ -64,8 +64,7 @@
     }
 
     private String prepareRootMetaDataFileName(String mountPoint, String nodeId, int ioDeviceId) {
-        return mountPoint + File.separator + ROOT_METADATA_DIRECTORY + File.separator + 
-                 nodeId + "_" + "iodevice" + ioDeviceId;
+        return mountPoint + ROOT_METADATA_DIRECTORY + File.separator + nodeId + "_" + "iodevice" + ioDeviceId;
     }
 
     public void initialize(String nodeId, String rootDir, boolean isNewUniverse, ResourceIdFactory resourceIdFactory)
@@ -127,6 +126,7 @@
             }
         };
 
+        long maxResourceId = 0;
         for (int i = 0; i < numIODevices; i++) {
             String rootMetadataFileName = prepareRootMetaDataFileName(mountPoints[i], nodeId, i) + File.separator
                     + ROOT_METADATA_FILE_NAME_PREFIX;
@@ -149,7 +149,6 @@
                 continue;
             }
 
-            long maxResourceId = 0;
             File[] dataverseFileList = rootDirFile.listFiles();
             if (dataverseFileList == null) {
                 throw new HyracksDataException("Metadata dataverse doesn't exist.");
@@ -188,11 +187,11 @@
                     }
                 }
             }
-            resourceIdFactory.initId(maxResourceId + 1);
-            if (LOGGER.isLoggable(Level.INFO)) {
-                LOGGER.info("The resource id factory is intialized with the value: " + (maxResourceId + 1));
-                LOGGER.info("Completed the initialization of the local resource repository");
-            }
+        }
+        resourceIdFactory.initId(maxResourceId + 1);
+        if (LOGGER.isLoggable(Level.INFO)) {
+            LOGGER.info("The resource id factory is intialized with the value: " + (maxResourceId + 1));
+            LOGGER.info("Completed the initialization of the local resource repository");
         }
     }