import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
if (m.find()) {
transactionId = Integer.valueOf(m.group(1));
state = ParserState.EXPECTING_TRANSACTION_DESCRIPTION;
- L(String.format("found transaction %d → expecting description",
+ L(String.format(Locale.ENGLISH,
+ "found transaction %d → expecting description",
transactionId));
progress.setProgress(++processedTransactionCount);
if (maxTransactionId < transactionId)
return String.format("Error parsing date '%s'", date);
}
state = ParserState.EXPECTING_TRANSACTION_DETAILS;
- L(String.format("transaction %d created for %s (%s) →" +
- " expecting details", transactionId, date,
- m.group(2)));
+ L(String.format(Locale.ENGLISH,
+ "transaction %d created for %s (%s) →" +
+ " expecting details", transactionId, date, m.group(2)));
}
break;
transaction.addAccount(
new LedgerTransactionAccount(acc_name,
Float.valueOf(amount), currency));
- L(String.format("%d: %s = %s", transaction.getId(),
- acc_name, amount));
+ L(String.format(Locale.ENGLISH, "%d: %s = %s",
+ transaction.getId(), acc_name, amount));
}
else throw new IllegalStateException(String.format(
"Can't parse transaction %d " + "details: %s",
if (transactionOrder == DetectedTransactionOrder.UNKNOWN) {
if (orderAccumulator > 30) {
transactionOrder = DetectedTransactionOrder.FILE;
- debug("rtt", String.format(
+ debug("rtt", String.format(Locale.ENGLISH,
"Detected native file order after %d transactions (factor %d)",
processedTransactionCount, orderAccumulator));
progress.setTotal(Data.transactions.size());
}
else if (orderAccumulator < -30) {
transactionOrder = DetectedTransactionOrder.REVERSE_CHRONOLOGICAL;
- debug("rtt", String.format(
+ debug("rtt", String.format(Locale.ENGLISH,
"Detected reverse chronological order after %d transactions (factor %d)",
processedTransactionCount, orderAccumulator));
}
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) {
import net.ktnx.mobileledger.ui.transaction_list.TransactionListViewModel;
import net.ktnx.mobileledger.utils.Colors;
import net.ktnx.mobileledger.utils.LockHolder;
+import net.ktnx.mobileledger.utils.Logger;
import net.ktnx.mobileledger.utils.MLDB;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Locale;
import java.util.Observer;
import androidx.appcompat.app.ActionBarDrawerToggle;
long now = new Date().getTime();
if ((lastUpdate == null) || (now > (lastUpdate.getTime() + (24 * 3600 * 1000)))) {
if (lastUpdate == null) debug("db::", "WEB data never fetched. scheduling a fetch");
- else debug("db",
- String.format("WEB data last fetched at %1.3f and now is %1.3f. re-fetching",
- lastUpdate.getTime() / 1000f, now / 1000f));
+ else debug("db", String.format(Locale.ENGLISH,
+ "WEB data last fetched at %1.3f and now is %1.3f. re-fetching",
+ lastUpdate.getTime() / 1000f, now / 1000f));
scheduleTransactionListRetrieval();
}
mBackMeansToAccountList = false;
}
else {
- debug("fragments", String.format("manager stack: %d",
+ debug("fragments", String.format(Locale.ENGLISH, "manager stack: %d",
fragmentManager.getBackStackEntryCount()));
super.onBackPressed();
final MobileLedgerProfile profile = Data.profile.get();
long last_update = (profile != null) ? profile.getLongOption(MLDB.OPT_LAST_SCRAPE, 0L) : 0;
- debug("transactions", String.format("Last update = %d", last_update));
+ debug("transactions", String.format(Locale.ENGLISH, "Last update = %d", last_update));
if (last_update == 0) {
Data.lastUpdateDate.postValue(null);
}
@NotNull
@Override
public Fragment getItem(int position) {
- debug("main", String.format("Switching to fragment %d", position));
+ debug("main", String.format(Locale.ENGLISH, "Switching to fragment %d", position));
switch (position) {
case 0:
// debug("flow", "Creating account summary fragment");
import net.ktnx.mobileledger.ui.profiles.ProfileDetailFragment;
import net.ktnx.mobileledger.utils.Colors;
+import java.util.Locale;
+
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
if (profile == null) throw new AssertionError(
String.format("Can't get profile " + "(index:%d) from the global list", index));
- debug("profiles", String.format("Editing profile %s (%s); hue=%d", profile.getName(),
- profile.getUuid(), profile.getThemeId()));
+ debug("profiles", String.format(Locale.ENGLISH, "Editing profile %s (%s); hue=%d",
+ profile.getName(), profile.getUuid(), profile.getThemeId()));
}
super.onCreate(savedInstanceState);
import net.ktnx.mobileledger.utils.ObservableValue;
import java.util.Collections;
+import java.util.Locale;
import java.util.Observer;
import androidx.annotation.NonNull;
public void onBindViewHolder(@NonNull final ProfileListViewHolder holder, int position) {
final MobileLedgerProfile profile = Data.profiles.get(position);
final MobileLedgerProfile currentProfile = Data.profile.get();
- debug("profiles", String.format("pos %d: %s, current: %s", position, profile.getUuid(),
+ debug("profiles", String.format(Locale.ENGLISH,"pos %d: %s, current: %s", position, profile.getUuid(),
(currentProfile == null) ? "<NULL>" : currentProfile.getUuid()));
holder.itemView.setTag(profile);