Make spotBugs happy

This commit is contained in:
Sylvia van Os
2021-01-17 23:31:05 +01:00
parent 66573fd2da
commit d7356704ea
3 changed files with 4 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.2.1'
implementation 'io.wcm.tooling.spotbugs:io.wcm.tooling.spotbugs.annotations:1.0.0'
// Third-party
implementation 'com.journeyapps:zxing-android-embedded:4.1.0@aar'

View File

@@ -53,7 +53,7 @@ public class ImportURIHelper {
if (store == null || note == null || cardId == null || barcodeType == null) throw new InvalidObjectException("Not a valid import URI");
String unparsedExpiry = uri.getQueryParameter(EXPIRY);
if(unparsedExpiry != null && unparsedExpiry != "")
if(unparsedExpiry != null && !unparsedExpiry.equals(""))
{
expiry = new Date(Long.parseLong(unparsedExpiry));
}

View File

@@ -229,6 +229,7 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
tabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public void onTabSelected(TabLayout.Tab tab) {
showPart(tab.getText().toString());
}
@@ -239,6 +240,7 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
}
@Override
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public void onTabReselected(TabLayout.Tab tab) {
showPart(tab.getText().toString());
}