import java.util.ArrayList;
import java.util.Date;
+import java.util.Locale;
import java.util.concurrent.atomic.AtomicInteger;
import androidx.lifecycle.MutableLiveData;
public static MutableLiveData<String> accountFilter = new MutableLiveData<>();
public static void backgroundTaskStarted() {
int cnt = backgroundTaskCount.incrementAndGet();
- debug("data", String.format("background task count is %d after incrementing", cnt));
+ debug("data",
+ String.format(Locale.ENGLISH, "background task count is %d after incrementing",
+ cnt));
backgroundTasksRunning.postValue(cnt > 0);
}
public static void backgroundTaskFinished() {
int cnt = backgroundTaskCount.decrementAndGet();
- debug("data", String.format("background task count is %d after decrementing", cnt));
+ debug("data",
+ String.format(Locale.ENGLISH, "background task count is %d after decrementing",
+ cnt));
backgroundTasksRunning.postValue(cnt > 0);
}
public static void setCurrentProfile(MobileLedgerProfile newProfile) {
profile.set(newProfile);
}
public static int getProfileIndex(MobileLedgerProfile profile) {
- try (LockHolder lh = profiles.lockForReading()) {
+ try (LockHolder ignored = profiles.lockForReading()) {
for (int i = 0; i < profiles.size(); i++) {
MobileLedgerProfile p = profiles.get(i);
if (p.equals(profile)) return i;
return -1;
}
}
+ @SuppressWarnings("WeakerAccess")
public static int getProfileIndex(String profileUUID) {
- try (LockHolder lh = profiles.lockForReading()) {
+ try (LockHolder ignored = profiles.lockForReading()) {
for (int i = 0; i < profiles.size(); i++) {
MobileLedgerProfile p = profiles.get(i);
if (p.getUuid().equals(profileUUID)) return i;
profile = MobileLedgerProfile.loadAllFromDB(profileUUID);
}
else {
- try (LockHolder lh = profiles.lockForReading()) {
+ try (LockHolder ignored = profiles.lockForReading()) {
int i = getProfileIndex(profileUUID);
if (i == -1) i = 0;
profile = profiles.get(i);