Merge pull request #917 from RSBat/master

Fix Codacy issues
This commit is contained in:
Yusuke Matsubara 2017-10-27 22:26:44 +09:00 committed by GitHub
commit b0e8175003
20 changed files with 47 additions and 46 deletions

View file

@ -178,8 +178,8 @@ public class CommonsApplication extends Application {
public boolean deviceHasCamera() {
PackageManager pm = getPackageManager();
return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) ||
pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)
|| pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
}
public void clearApplicationData(Context context, LogoutListener logoutListener) {

View file

@ -248,8 +248,8 @@ public class LoginActivity extends AccountAuthenticatorActivity {
@Override
public void afterTextChanged(Editable editable) {
boolean enabled = usernameEdit.getText().length() != 0 && passwordEdit.getText().length() != 0 &&
(BuildConfig.DEBUG || twoFactorEdit.getText().length() != 0 || twoFactorEdit.getVisibility() != View.VISIBLE);
boolean enabled = usernameEdit.getText().length() != 0 && passwordEdit.getText().length() != 0
&& (BuildConfig.DEBUG || twoFactorEdit.getText().length() != 0 || twoFactorEdit.getVisibility() != View.VISIBLE);
loginButton.setEnabled(enabled);
}
}

View file

@ -123,9 +123,10 @@ public class FileUtils {
} catch (IllegalArgumentException e) {
Timber.d(e);
} finally {
if (cursor != null)
if (cursor != null) {
cursor.close();
}
}
return null;
}

View file

@ -23,8 +23,8 @@ public class FragmentUtils {
.commitNow();
return true;
} catch (IllegalStateException e) {
Timber.e(e, "Could not add & commit fragment. " +
"Did you mean to call commitAllowingStateLoss?");
Timber.e(e, "Could not add & commit fragment. "
+ "Did you mean to call commitAllowingStateLoss?");
}
return false;
}