diff --git a/mobile/android/app/checkstyle.xml b/mobile/android/app/checkstyle.xml
index 06b158e42695..80f7aff92c79 100644
--- a/mobile/android/app/checkstyle.xml
+++ b/mobile/android/app/checkstyle.xml
@@ -55,7 +55,7 @@
+ LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY"/>
diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java b/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
index bc35b31a6bb4..071c03911fa7 100644
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1492,7 +1492,7 @@ public class GeckoAppShell
List plugins = pm.queryIntentServices(new Intent(PLUGIN_ACTION),
PackageManager.GET_SERVICES | PackageManager.GET_META_DATA);
- synchronized(mPackageInfoCache) {
+ synchronized (mPackageInfoCache) {
// clear the list of existing packageInfo objects
mPackageInfoCache.clear();
@@ -1619,7 +1619,7 @@ public class GeckoAppShell
return null;
}
- synchronized(mPackageInfoCache) {
+ synchronized (mPackageInfoCache) {
for (PackageInfo pkgInfo : mPackageInfoCache) {
if (pluginLib.contains(pkgInfo.packageName)) {
return pkgInfo.packageName;
diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java b/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java
index f5bedaed4dfd..f1f4229a3b1f 100644
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java
@@ -253,7 +253,7 @@ final class GeckoEditable extends JNIObject
if (mActions.isEmpty()) {
mActionsActive.acquireUninterruptibly();
mActions.offer(action);
- } else synchronized(this) {
+ } else synchronized (this) {
// tryAcquire here in case Gecko thread has just released it
mActionsActive.tryAcquire();
mActions.offer(action);
@@ -350,7 +350,7 @@ final class GeckoEditable extends JNIObject
throw new IllegalStateException("empty actions queue");
}
- synchronized(this) {
+ synchronized (this) {
if (mActions.isEmpty()) {
mActionsActive.release();
}
diff --git a/mobile/android/base/java/org/mozilla/gecko/Tab.java b/mobile/android/base/java/org/mozilla/gecko/Tab.java
index 17e50cca1fa3..3fb76fa1793e 100644
--- a/mobile/android/base/java/org/mozilla/gecko/Tab.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tab.java
@@ -763,25 +763,25 @@ public class Tab {
}
public void addPluginLayer(Object surfaceOrView, Layer layer) {
- synchronized(mPluginLayers) {
+ synchronized (mPluginLayers) {
mPluginLayers.put(surfaceOrView, layer);
}
}
public Layer getPluginLayer(Object surfaceOrView) {
- synchronized(mPluginLayers) {
+ synchronized (mPluginLayers) {
return mPluginLayers.get(surfaceOrView);
}
}
public Collection getPluginLayers() {
- synchronized(mPluginLayers) {
+ synchronized (mPluginLayers) {
return new ArrayList(mPluginLayers.values());
}
}
public Layer removePluginLayer(Object surfaceOrView) {
- synchronized(mPluginLayers) {
+ synchronized (mPluginLayers) {
return mPluginLayers.remove(surfaceOrView);
}
}
diff --git a/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java b/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java
index 406ee42b5e8e..b0238345026e 100644
--- a/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java
+++ b/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java
@@ -296,7 +296,7 @@ public class Favicons {
final LoadFaviconTask task =
new LoadFaviconTask(context, pageURL, targetURL, 0, callback, targetSize, true);
final int taskId = task.getId();
- synchronized(loadTasks) {
+ synchronized (loadTasks) {
loadTasks.put(taskId, task);
}
task.execute();
@@ -369,7 +369,7 @@ public class Favicons {
final LoadFaviconTask task =
new LoadFaviconTask(context, pageURL, faviconURL, flags, listener, targetSize, false);
final int taskId = task.getId();
- synchronized(loadTasks) {
+ synchronized (loadTasks) {
loadTasks.put(taskId, task);
}
task.execute();
@@ -567,7 +567,7 @@ public class Favicons {
}
public static void removeLoadTask(int taskId) {
- synchronized(loadTasks) {
+ synchronized (loadTasks) {
loadTasks.delete(taskId);
}
}
diff --git a/mobile/android/base/java/org/mozilla/gecko/favicons/LoadFaviconTask.java b/mobile/android/base/java/org/mozilla/gecko/favicons/LoadFaviconTask.java
index ecf2b715d9f4..7c75a4848a27 100644
--- a/mobile/android/base/java/org/mozilla/gecko/favicons/LoadFaviconTask.java
+++ b/mobile/android/base/java/org/mozilla/gecko/favicons/LoadFaviconTask.java
@@ -381,7 +381,7 @@ public class LoadFaviconTask {
Bitmap image;
// Determine if there is already an ongoing task to fetch the Favicon we desire.
// If there is, just join the queue and wait for it to finish. If not, we carry on.
- synchronized(loadsInFlight) {
+ synchronized (loadsInFlight) {
// Another load of the current Favicon is already underway
LoadFaviconTask existingTask = loadsInFlight.get(faviconURL);
if (existingTask != null && !existingTask.isCancelled()) {
@@ -565,7 +565,7 @@ public class LoadFaviconTask {
void onCancelled() {
Favicons.removeLoadTask(id);
- synchronized(loadsInFlight) {
+ synchronized (loadsInFlight) {
// Only remove from the hashmap if the task there is the one that's being canceled.
// Cancellation of a task that would have chained is not interesting to the hashmap.
final LoadFaviconTask primary = loadsInFlight.get(faviconURL);
diff --git a/mobile/android/base/java/org/mozilla/gecko/favicons/cache/FaviconCache.java b/mobile/android/base/java/org/mozilla/gecko/favicons/cache/FaviconCache.java
index 0276b462be65..664f8b2f3267 100644
--- a/mobile/android/base/java/org/mozilla/gecko/favicons/cache/FaviconCache.java
+++ b/mobile/android/base/java/org/mozilla/gecko/favicons/cache/FaviconCache.java
@@ -451,7 +451,7 @@ public class FaviconCache {
* @return true if this element already existed in the list, false otherwise. (Useful for preventing multiple-insertion.)
*/
private boolean setMostRecentlyUsedWithinRead(FaviconCacheElement element) {
- synchronized(reorderingLock) {
+ synchronized (reorderingLock) {
boolean contained = ordering.remove(element);
ordering.offer(element);
return contained;
diff --git a/mobile/android/base/java/org/mozilla/gecko/home/HomePanelsManager.java b/mobile/android/base/java/org/mozilla/gecko/home/HomePanelsManager.java
index afeef48e16a3..a1b3b4dcd89c 100644
--- a/mobile/android/base/java/org/mozilla/gecko/home/HomePanelsManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HomePanelsManager.java
@@ -326,7 +326,7 @@ public class HomePanelsManager implements GeckoEventListener {
pm.requestPanelsById(ids, new RequestCallback() {
@Override
public void onComplete(List panelInfos) {
- synchronized(panelRequestLock) {
+ synchronized (panelRequestLock) {
latestPanelInfos.addAll(panelInfos);
Log.d(LOGTAG, "executeRefresh: fetched panel infos: " + panelInfos.size());
@@ -336,7 +336,7 @@ public class HomePanelsManager implements GeckoEventListener {
});
try {
- synchronized(panelRequestLock) {
+ synchronized (panelRequestLock) {
panelRequestLock.wait(PANEL_INFO_TIMEOUT_MSEC);
Log.d(LOGTAG, "executeRefresh: done fetching panel infos");
diff --git a/mobile/android/base/java/org/mozilla/gecko/home/PanelInfoManager.java b/mobile/android/base/java/org/mozilla/gecko/home/PanelInfoManager.java
index 6908c794bdc3..10db65ea1a30 100644
--- a/mobile/android/base/java/org/mozilla/gecko/home/PanelInfoManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/PanelInfoManager.java
@@ -75,7 +75,7 @@ public class PanelInfoManager implements GeckoEventListener {
public void requestPanelsById(Set ids, RequestCallback callback) {
final int requestId = sRequestId.getAndIncrement();
- synchronized(sCallbacks) {
+ synchronized (sCallbacks) {
// If there are no pending callbacks, register the event listener.
if (sCallbacks.size() == 0) {
EventDispatcher.getInstance().registerGeckoThreadListener(this,
@@ -131,7 +131,7 @@ public class PanelInfoManager implements GeckoEventListener {
final RequestCallback callback;
final int requestId = message.getInt("requestId");
- synchronized(sCallbacks) {
+ synchronized (sCallbacks) {
callback = sCallbacks.get(requestId);
sCallbacks.delete(requestId);
diff --git a/mobile/android/base/java/org/mozilla/gecko/javaaddons/JavaAddonManagerV1.java b/mobile/android/base/java/org/mozilla/gecko/javaaddons/JavaAddonManagerV1.java
index 2e8d6d92e630..f361773ca5de 100644
--- a/mobile/android/base/java/org/mozilla/gecko/javaaddons/JavaAddonManagerV1.java
+++ b/mobile/android/base/java/org/mozilla/gecko/javaaddons/JavaAddonManagerV1.java
@@ -39,7 +39,7 @@ public class JavaAddonManagerV1 implements NativeEventListener {
private final org.mozilla.gecko.EventDispatcher mDispatcher;
- // Protected by synchronized(this).
+ // Protected by synchronized (this).
private final Map mGUIDToDispatcherMap = new HashMap<>();
public static synchronized JavaAddonManagerV1 getInstance() {
@@ -153,7 +153,7 @@ public class JavaAddonManagerV1 implements NativeEventListener {
private final String guid;
private final String dexFileName;
- // Protected by synchronized(this).
+ // Protected by synchronized (this).
private final Map> mListenerToWrapperMap = new IdentityHashMap<>();
public EventDispatcherImpl(String guid, String dexFileName) {