From 8e03c3f875dbb467c0955c166044578824286e40 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Thu, 23 Oct 2014 12:23:33 +0200 Subject: Cosmetics : local vars renaming --- src/main/src/sync/BasicSyncTask.java | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/src/sync/BasicSyncTask.java b/src/main/src/sync/BasicSyncTask.java index 24f34a8..35f3b63 100644 --- a/src/main/src/sync/BasicSyncTask.java +++ b/src/main/src/sync/BasicSyncTask.java @@ -112,7 +112,7 @@ public class BasicSyncTask extends AbstractSyncTask { Iterator itSrc = srcReader.iterator(); Iterator itDst = dstReader.iterator(); - MVDataEntry src = null, dst = null; + MVDataEntry srcData = null, dstData = null; boolean srcExhausted = false; boolean dstExhausted = false; boolean abort = false; @@ -120,14 +120,14 @@ public class BasicSyncTask extends AbstractSyncTask { while ( !abort && !done ) { // Look-ahead srcReader if previous has been "poped" (or if never read yet) - if ( src == null ) { + if ( srcData == null ) { if ( !srcExhausted ) { srcExhausted = !itSrc.hasNext(); } if ( !srcExhausted ) { try { - src=itSrc.next(); - logger.trace("src read : " + src); + srcData=itSrc.next(); + logger.trace("src read : " + srcData); } catch (Exception e) { logger.error("Read failure detected on " + srcReader.getDataSourceName() + ". Aborting.", e); // Escape from the while loop @@ -137,14 +137,14 @@ public class BasicSyncTask extends AbstractSyncTask { } // Look-ahead dstReader if previous has been "poped" (or if never read yet) - if ( dst == null ) { + if ( dstData == null ) { if ( !dstExhausted ) { dstExhausted = !itDst.hasNext(); } if ( !dstExhausted ) { try { - dst = itDst.next(); - logger.trace("dst read : " + dst); + dstData = itDst.next(); + logger.trace("dst read : " + dstData); } catch (NoSuchElementException e) { logger.error("Read failure detected on " + dstReader.getDataSourceName() + ". Aborting.", e); // Escape from the while loop @@ -157,7 +157,7 @@ public class BasicSyncTask extends AbstractSyncTask { int compare; if ( !srcExhausted && !dstExhausted ) { // General case : check order precedence to take an action - compare = src.compareTo(dst); + compare = srcData.compareTo(dstData); } else if ( !srcExhausted && dstExhausted ) { // Particular case : dst is exhausted, it's like ( src < dst ) compare=-1; @@ -175,26 +175,26 @@ public class BasicSyncTask extends AbstractSyncTask { boolean actionRealized = false; // Take an action (insert/update/delete) if ( compare < 0 ) { - actionRealized = _insert(src); - src = null; + actionRealized = _insert(srcData); + srcData = null; // preserve dst until src key is not greater } else if ( compare > 0 ) { // dst current entry doesn't exists anymore (src key is greater than dst key) - actionRealized = _delete(dst); + actionRealized = _delete(dstData); // preserve src until dst key is not greater - dst = null; + dstData = null; } else /* ( compare == 0 ) */ { // src current entry already exists in dst, update it if necessary - Set changedAttr = src.getChangedAttributes(dst); + Set changedAttr = srcData.getChangedAttributes(dstData); if ( ! changedAttr.isEmpty() ) { - actionRealized = _update(src,dst,changedAttr); + actionRealized = _update(srcData,dstData,changedAttr); } else { // Already up-to-date, nothing to do actionRealized = true; } // Both src and dst have been used - src = null; - dst = null; + srcData = null; + dstData = null; } abort = !actionRealized; } /* while */ -- cgit v1.2.3