Bug 1316023 - Version 2 of fixes. Removed unreachable statements. r=sebastian
authorSwaroop Rao <swaroop.rao@gmail.com>
Mon, 21 Nov 2016 20:00:31 -0500
changeset 324684 dcdee53249e1afe2cc62b50dcdfe5a1f5f2dcd3d
parent 324683 b37f2a4bd333912ef621d3fb3f85d0df14473dd6
child 324685 5e3fb7348212c811644fb8449304214e8d63587c
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssebastian
bugs1316023
milestone53.0a1
Bug 1316023 - Version 2 of fixes. Removed unreachable statements. r=sebastian MozReview-Commit-ID: 5gQEJVmboOr
mobile/android/base/java/org/mozilla/gecko/DataReportingNotification.java
mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/FormHistoryRepositorySession.java
mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/PasswordsRepositorySession.java
--- a/mobile/android/base/java/org/mozilla/gecko/DataReportingNotification.java
+++ b/mobile/android/base/java/org/mozilla/gecko/DataReportingNotification.java
@@ -56,21 +56,16 @@ public class DataReportingNotification {
             } else {
                 // Silently update the version.
                 SharedPreferences.Editor editor = dataPrefs.edit();
                 editor.putInt(PREFS_POLICY_VERSION, DATA_REPORTING_VERSION);
                 editor.apply();
             }
             return;
         }
-
-        if (currentVersion >= DATA_REPORTING_VERSION) {
-            // Do nothing, we're at a current (or future) version.
-            return;
-        }
     }
 
     /**
      * Launch a notification of the data policy, and record notification time and version.
      */
     public static void notifyDataPolicy(Context context, SharedPreferences sharedPrefs) {
         boolean result = false;
         try {
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/FormHistoryRepositorySession.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/FormHistoryRepositorySession.java
@@ -612,20 +612,16 @@ public class FormHistoryRepositorySessio
               Logger.trace(LOG_TAG, "Remote is newer, and deleted. Purging local.");
               deleteExistingRecord(existingRecord);
               trackRecord(record);
               delegate.onRecordStoreSucceeded(record.guid);
               return;
             }
 
             Logger.trace(LOG_TAG, "Remote is older, local is not deleted. Ignoring.");
-            if (!locallyModified) {
-              Logger.warn(LOG_TAG, "Inconsistency: old remote record is deleted, but local record not modified!");
-              // Ensure that this is tracked for upload.
-            }
             return;
           }
           // End deletion logic.
 
           // Now we're processing a non-deleted incoming record.
           if (existingRecord == null) {
             Logger.trace(LOG_TAG, "Looking up match for record " + record.guid);
             existingRecord = findExistingRecordByPayload(record);
@@ -667,20 +663,16 @@ public class FormHistoryRepositorySessio
             Logger.trace(LOG_TAG, "Remote is newer, and not deleted. Storing.");
             replaceExistingRecordWithRegularRecord(record, existingRecord);
             trackRecord(record);
             delegate.onRecordStoreSucceeded(record.guid);
             return;
           }
 
           Logger.trace(LOG_TAG, "Remote is older, local is not deleted. Ignoring.");
-          if (!locallyModified) {
-            Logger.warn(LOG_TAG, "Inconsistency: old remote record is not deleted, but local record not modified!");
-          }
-          return;
         } catch (Exception e) {
           Logger.error(LOG_TAG, "Store failed for " + record.guid, e);
           delegate.onRecordStoreFailed(e, record.guid);
           return;
         }
       }
     };
 
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/PasswordsRepositorySession.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/PasswordsRepositorySession.java
@@ -311,20 +311,17 @@ public class PasswordsRepositorySession 
           trace("Both local and remote records have been modified.");
           if (remoteRecord.lastModified > existingRecord.lastModified) {
             trace("Remote is newer, and deleted. Deleting local.");
             storeRecordDeletion(remoteRecord);
             return;
           }
 
           trace("Remote is older, local is not deleted. Ignoring.");
-          if (!locallyModified) {
-            Logger.warn(LOG_TAG, "Inconsistency: old remote record is deleted, but local record not modified!");
-            // Ensure that this is tracked for upload.
-          }
+
           return;
         }
         // End deletion logic.
 
         // Validate the incoming record.
         if (!remoteRecord.isValid()) {
             Logger.warn(LOG_TAG, "Incoming record is invalid. Reporting store failed.");
             delegate.onRecordStoreFailed(new RuntimeException("Can't store invalid password record."), record.guid);