]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java
fix format spec in exception reporting
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / NewTransactionModel.java
index 66b01276eb58094a9de66d9035ffae414532383e..7cbbeca219a47159b6970b301ddb047fb3ca29e2 100644 (file)
@@ -113,8 +113,10 @@ public class NewTransactionModel extends ViewModel {
         if (index == 0) {
             return header;
         }
-        else if (index <= items.size()) return items.get(index - 1);
-        else return trailer;
+
+        if (index <= items.size()) return items.get(index - 1);
+
+        return trailer;
     }
     // rules:
     // 1) at least two account names
@@ -277,7 +279,7 @@ public class NewTransactionModel extends ViewModel {
         public void ensureType(ItemType wantedType) {
             if (type != wantedType) {
                 throw new RuntimeException(
-                        String.format("Actual type (%d) differs from wanted (%s)", type,
+                        String.format("Actual type (%s) differs from wanted (%s)", type,
                                 wantedType));
             }
         }