summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2014-10-23 12:23:33 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2015-04-14 07:44:58 +0200
commit8e03c3f875dbb467c0955c166044578824286e40 (patch)
tree6191527fa157f80d53c1c6b77555c86293763f0f /src/main
parent2ee579091065829b027c74f14f0442a97da7d797 (diff)
downloadsssync-8e03c3f875dbb467c0955c166044578824286e40.tar.gz
sssync-8e03c3f875dbb467c0955c166044578824286e40.tar.bz2
sssync-8e03c3f875dbb467c0955c166044578824286e40.zip
Cosmetics : local vars renaming
Diffstat (limited to 'src/main')
-rw-r--r--src/main/src/sync/BasicSyncTask.java32
1 files 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<MVDataEntry> itSrc = srcReader.iterator();
Iterator<MVDataEntry> 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<String> changedAttr = src.getChangedAttributes(dst);
+ Set<String> 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 */