Skip to content

Commit

Permalink
Bug 1081388: Add missing @OverRide annotations. r=rnewman
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisKitching committed Oct 12, 2014
1 parent bbf7b1a commit b2d1cad
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,36 +90,42 @@ public boolean shouldLogVerbose(String logTag) {
return out;
}

@Override
public void error(String tag, String message, Throwable error) {
if (shouldLogError(tag)) {
inner.error(tag, message, error);
}
}

@Override
public void warn(String tag, String message, Throwable error) {
if (shouldLogWarn(tag)) {
inner.warn(tag, message, error);
}
}

@Override
public void info(String tag, String message, Throwable error) {
if (shouldLogInfo(tag)) {
inner.info(tag, message, error);
}
}

@Override
public void debug(String tag, String message, Throwable error) {
if (shouldLogDebug(tag)) {
inner.debug(tag, message, error);
}
}

@Override
public void trace(String tag, String message, Throwable error) {
if (shouldLogVerbose(tag)) {
inner.trace(tag, message, error);
}
}

@Override
public void close() {
inner.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,32 @@ public boolean shouldLogVerbose(String logTag) {
return true;
}

@Override
public void error(String tag, String message, Throwable error) {
Log.e(tag, message, error);
}

@Override
public void warn(String tag, String message, Throwable error) {
Log.w(tag, message, error);
}

@Override
public void info(String tag, String message, Throwable error) {
Log.i(tag, message, error);
}

@Override
public void debug(String tag, String message, Throwable error) {
Log.d(tag, message, error);
}

@Override
public void trace(String tag, String message, Throwable error) {
Log.v(tag, message, error);
}

@Override
public void close() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public LevelFilteringLogWriter(int logLevel, LogWriter inner) {
this.logLevel = logLevel;
}

@Override
public void close() {
inner.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public boolean shouldLogVerbose(String tag) {
return true;
}

@Override
public void close() {
if (closed) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public SimpleTagLogWriter(String tag, LogWriter inner) {
this.tag = tag;
}

@Override
protected String getMainTag() {
return tag;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,32 @@ public boolean shouldLogVerbose(String tag) {
return true;
}

@Override
public void error(String tag, String message, Throwable error) {
inner.error(tag, message, error);
}

@Override
public void warn(String tag, String message, Throwable error) {
inner.warn(tag, message, error);
}

@Override
public void info(String tag, String message, Throwable error) {
inner.info(tag, message, error);
}

@Override
public void debug(String tag, String message, Throwable error) {
inner.debug(tag, message, error);
}

@Override
public void trace(String tag, String message, Throwable error) {
inner.trace(tag, message, error);
}

@Override
public void close() {
inner.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public QuickPasswordStretcher(String password) {
this.password = password;
}

@Override
public synchronized byte[] getQuickStretchedPW(byte[] emailUTF8) throws UnsupportedEncodingException, GeneralSecurityException {
if (emailUTF8 == null) {
throw new IllegalArgumentException("emailUTF8 must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1371,10 +1371,12 @@ public Cursor getEventsSince(long time) {
"date, environment, measurement_name, measurement_version, field_name");
}

@Override
public int getEventCount() {
return getRowCount("events");
}

@Override
public int getEnvironmentCount() {
return getRowCount("environments");
}
Expand All @@ -1394,6 +1396,7 @@ private int getRowCount(String table) {
* @param curEnv The ID of the current environment.
* @return The number of environments and addon entries deleted.
*/
@Override
public int deleteDataBefore(final long time, final int curEnv) {
final SQLiteDatabase db = this.helper.getWritableDatabase();
db.beginTransaction();
Expand Down Expand Up @@ -1598,6 +1601,7 @@ public void deleteMeasurements() {
* Prunes the given number of least-recently used environments. Note that orphaned environments
* are not removed and the environment cache is cleared.
*/
@Override
public void pruneEnvironments(final int numToPrune) {
final SQLiteDatabase db = this.helper.getWritableDatabase();
db.beginTransaction();
Expand Down Expand Up @@ -1625,6 +1629,7 @@ public void pruneEnvironments(final int numToPrune) {
* events reaches the given maximum. Note that this technicality means this method cannot be
* used to delete all events.
*/
@Override
public void pruneEvents(final int maxNumToPrune) {
final SQLiteDatabase db = this.helper.getWritableDatabase();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ public PrunePolicyDatabaseStorage(final Context context, final String profilePat
this.currentEnvironmentID = -1;
}

@Override
public void pruneEvents(final int count) {
getStorage().pruneEvents(count);
}

@Override
public void pruneEnvironments(final int count) {
getStorage().pruneEnvironments(count);

Expand All @@ -59,25 +61,30 @@ public void pruneEnvironments(final int count) {
* current environment from the profile cache, it will not delete data so be sure to prune by
* other methods (e.g. {@link pruneEvents}) as well.
*/
@Override
public int deleteDataBefore(final long time) {
return getStorage().deleteDataBefore(time, getCurrentEnvironmentID());
}

@Override
public void cleanup() {
final HealthReportDatabaseStorage storage = getStorage();
// The change to auto_vacuum will only take affect after a vacuum.
storage.disableAutoVacuuming();
storage.vacuum();
}

@Override
public int getEventCount() {
return getStorage().getEventCount();
}

@Override
public int getEnvironmentCount() {
return getStorage().getEnvironmentCount();
}

@Override
public void close() {
if (client != null) {
client.release();
Expand Down
1 change: 1 addition & 0 deletions mobile/android/base/sync/CredentialException.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public CredentialException(final Throwable e) {
super(e);
}

@Override
public void updateStats(GlobalSession globalSession, SyncResult syncResult) {
syncResult.stats.numAuthExceptions += 1;
}
Expand Down
2 changes: 2 additions & 0 deletions mobile/android/base/sync/JSONRecordFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ public AuthHeaderProvider getAuthHeaderProvider() {
return authHeaderProvider;
}

@Override
public String ifUnmodifiedSince() {
return null;
}

@Override
public void handleRequestSuccess(SyncStorageResponse response) {
if (response.wasSuccessful()) {
try {
Expand Down
4 changes: 4 additions & 0 deletions mobile/android/base/sync/MetaGlobal.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,12 @@ public AuthHeaderProvider getAuthHeaderProvider() {
return authHeaderProvider;
}

@Override
public String ifUnmodifiedSince() {
return null;
}

@Override
public void handleRequestSuccess(SyncStorageResponse response) {
if (this.isUploading) {
this.handleUploadSuccess(response);
Expand All @@ -355,6 +357,7 @@ private void handleDownloadSuccess(SyncStorageResponse response) {
this.callback.handleFailure(response);
}

@Override
public void handleRequestFailure(SyncStorageResponse response) {
if (response.getStatusCode() == 404) {
this.callback.handleMissing(this, response);
Expand All @@ -363,6 +366,7 @@ public void handleRequestFailure(SyncStorageResponse response) {
this.callback.handleFailure(response);
}

@Override
public void handleRequestError(Exception e) {
this.callback.handleError(e);
}
Expand Down
3 changes: 3 additions & 0 deletions mobile/android/base/sync/SyncConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public EditorBranch(SyncConfiguration config, String prefix) {
this.editor = config.getEditor();
}

@Override
public void apply() {
// Android <=r8 SharedPreferences.Editor does not contain apply() for overriding.
this.editor.commit();
Expand Down Expand Up @@ -85,6 +86,7 @@ public Editor putString(String key, String value) {

// Not marking as Override, because Android <= 10 doesn't have
// putStringSet. Neither can we implement it.
@Override
public Editor putStringSet(String key, Set<String> value) {
throw new RuntimeException("putStringSet not available.");
}
Expand Down Expand Up @@ -160,6 +162,7 @@ public String getString(String key, String defValue) {

// Not marking as Override, because Android <= 10 doesn't have
// getStringSet. Neither can we implement it.
@Override
public Set<String> getStringSet(String key, Set<String> defValue) {
throw new RuntimeException("getStringSet not available.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public Crypto5MiddlewareRepositorySessionCreationDelegate(Crypto5MiddlewareRepos
this.repository = repository;
this.outerDelegate = outerDelegate;
}

@Override
public void onSessionCreateFailed(Exception ex) {
this.outerDelegate.onSessionCreateFailed(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public RepositorySessionBeginDelegate deferredBeginDelegate(ExecutorService exec
}
}

@Override
public void begin(RepositorySessionBeginDelegate delegate) throws InvalidSessionTransitionException {
inner.begin(new MiddlewareRepositorySessionBeginDelegate(this, delegate));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public CleanThread(RepositorySessionCleanDelegate delegate, Context context) {
this.context = context;
}

@Override
public void run() {
try {
getDataAccessor(context).purgeDeleted();
Expand Down Expand Up @@ -67,6 +68,7 @@ public CreateSessionThread(RepositorySessionCreationDelegate delegate, Context c
this.context = context;
}

@Override
public void run() {
sessionCreator(delegate, context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ synchronized protected SQLiteDatabase getCachedWritableDatabase() {
return writableDatabase;
}

@Override
synchronized public void close() {
if (readableDatabase != null) {
readableDatabase.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public void onClick(View v) {
cancelConnectHandler(v);
// Set cancel click handler to leave account setup.
cancelButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
cancelClickHandler(v);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ protected void wipeLocal() {
// Do nothing.
}

@Override
public Integer getStorageVersion() {
return null; // Never include these engines in any meta/global records.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public ServerLocalSynchronizerSession(Synchronizer synchronizer, SynchronizerSes
super(synchronizer, delegate);
}

@Override
public void onFirstFlowCompleted(RecordsChannel recordsChannel, long fetchEnd, long storeEnd) {
// Fetch failures always abort.
int numRemoteFetchFailed = recordsChannel.getFetchFailureCount();
Expand All @@ -50,6 +51,7 @@ public void onFirstFlowCompleted(RecordsChannel recordsChannel, long fetchEnd, l
super.onFirstFlowCompleted(recordsChannel, fetchEnd, storeEnd);
}

@Override
public void onSecondFlowCompleted(RecordsChannel recordsChannel, long fetchEnd, long storeEnd) {
// Fetch failures always abort.
int numLocalFetchFailed = recordsChannel.getFetchFailureCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public synchronized void synchronize() {

// This is the delegate for the *first* flow.
RecordsChannelDelegate channelAToBDelegate = new RecordsChannelDelegate() {
@Override
public void onFlowCompleted(RecordsChannel recordsChannel, long fetchEnd, long storeEnd) {
session.onFirstFlowCompleted(recordsChannel, fetchEnd, storeEnd);
}
Expand Down

0 comments on commit b2d1cad

Please sign in to comment.