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() { public boolean deviceHasCamera() {
PackageManager pm = getPackageManager(); PackageManager pm = getPackageManager();
return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) || return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)
pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT); || pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
} }
public void clearApplicationData(Context context, LogoutListener logoutListener) { public void clearApplicationData(Context context, LogoutListener logoutListener) {

View file

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

View file

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

View file

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