Fix some codacy issues

This commit is contained in:
addshore 2017-05-16 11:29:33 +02:00
parent c712b561d4
commit 1785e9b179
2 changed files with 11 additions and 7 deletions

View file

@ -98,14 +98,14 @@ public class CommonsApplication extends Application {
} }
public static CommonsApplication getInstance() { public static CommonsApplication getInstance() {
if(instance == null) { if (instance == null) {
instance = new CommonsApplication(); instance = new CommonsApplication();
} }
return instance; return instance;
} }
public AbstractHttpClient getHttpClient() { public AbstractHttpClient getHttpClient() {
if(httpClient == null) { if (httpClient == null) {
httpClient = newHttpClient(); httpClient = newHttpClient();
} }
return httpClient; return httpClient;
@ -123,7 +123,7 @@ public class CommonsApplication extends Application {
} }
public MWApi getMWApi() { public MWApi getMWApi() {
if(api == null) { if (api == null) {
api = newMWApi(); api = newMWApi();
} }
return api; return api;
@ -134,14 +134,14 @@ public class CommonsApplication extends Application {
} }
public CacheController getCacheData() { public CacheController getCacheData() {
if(cacheData == null) { if (cacheData == null) {
cacheData = new CacheController(); cacheData = new CacheController();
} }
return cacheData; return cacheData;
} }
public RequestQueue getVolleyQueue() { public RequestQueue getVolleyQueue() {
if(volleyQueue == null) { if (volleyQueue == null) {
DiskBasedCache cache = new DiskBasedCache(getCacheDir(), 16 * 1024 * 1024); DiskBasedCache cache = new DiskBasedCache(getCacheDir(), 16 * 1024 * 1024);
volleyQueue = new RequestQueue(cache, new BasicNetwork(new HurlStack())); volleyQueue = new RequestQueue(cache, new BasicNetwork(new HurlStack()));
volleyQueue.start(); volleyQueue.start();
@ -150,7 +150,7 @@ public class CommonsApplication extends Application {
} }
public synchronized DBOpenHelper getDBOpenHelper() { public synchronized DBOpenHelper getDBOpenHelper() {
if(dbOpenHelper == null) { if (dbOpenHelper == null) {
dbOpenHelper = new DBOpenHelper(this); dbOpenHelper = new DBOpenHelper(this);
} }
return dbOpenHelper; return dbOpenHelper;

View file

@ -40,7 +40,11 @@ public class SignupActivity extends BaseActivity {
//Signup success, so clear cookies, notify user, and load LoginActivity again //Signup success, so clear cookies, notify user, and load LoginActivity again
Timber.d("Overriding URL %s", url); 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(); toast.show();
Intent intent = new Intent(CommonsApplication.getInstance(), LoginActivity.class); Intent intent = new Intent(CommonsApplication.getInstance(), LoginActivity.class);