From 1785e9b179be96702d219fb9851bc9cac1b0e868 Mon Sep 17 00:00:00 2001 From: addshore Date: Tue, 16 May 2017 11:29:33 +0200 Subject: [PATCH] Fix some codacy issues --- .../java/fr/free/nrw/commons/CommonsApplication.java | 12 ++++++------ .../fr/free/nrw/commons/auth/SignupActivity.java | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java index 2a4f4ac65..91ce3c1ef 100644 --- a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java +++ b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java @@ -98,14 +98,14 @@ public class CommonsApplication extends Application { } public static CommonsApplication getInstance() { - if(instance == null) { + if (instance == null) { instance = new CommonsApplication(); } return instance; } public AbstractHttpClient getHttpClient() { - if(httpClient == null) { + if (httpClient == null) { httpClient = newHttpClient(); } return httpClient; @@ -123,7 +123,7 @@ public class CommonsApplication extends Application { } public MWApi getMWApi() { - if(api == null) { + if (api == null) { api = newMWApi(); } return api; @@ -134,14 +134,14 @@ public class CommonsApplication extends Application { } public CacheController getCacheData() { - if(cacheData == null) { + if (cacheData == null) { cacheData = new CacheController(); } return cacheData; } public RequestQueue getVolleyQueue() { - if(volleyQueue == null) { + if (volleyQueue == null) { DiskBasedCache cache = new DiskBasedCache(getCacheDir(), 16 * 1024 * 1024); volleyQueue = new RequestQueue(cache, new BasicNetwork(new HurlStack())); volleyQueue.start(); @@ -150,7 +150,7 @@ public class CommonsApplication extends Application { } public synchronized DBOpenHelper getDBOpenHelper() { - if(dbOpenHelper == null) { + if (dbOpenHelper == null) { dbOpenHelper = new DBOpenHelper(this); } return dbOpenHelper; diff --git a/app/src/main/java/fr/free/nrw/commons/auth/SignupActivity.java b/app/src/main/java/fr/free/nrw/commons/auth/SignupActivity.java index 530953c9f..62ccb5731 100644 --- a/app/src/main/java/fr/free/nrw/commons/auth/SignupActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/auth/SignupActivity.java @@ -40,7 +40,11 @@ public class SignupActivity extends BaseActivity { //Signup success, so clear cookies, notify user, and load LoginActivity again Timber.d("Overriding URL %s", url); - Toast toast = Toast.makeText(CommonsApplication.getInstance(), "Account created!", Toast.LENGTH_LONG); + Toast toast = Toast.makeText( + CommonsApplication.getInstance(), + "Account created!", + Toast.LENGTH_LONG + ); toast.show(); Intent intent = new Intent(CommonsApplication.getInstance(), LoginActivity.class);