]> git.ktnx.net Git - mobile-ledger.git/commitdiff
name variable keeping auto-closed resource 'ignored'
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 19 Apr 2019 17:24:39 +0000 (20:24 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 19 Apr 2019 20:56:44 +0000 (23:56 +0300)
app/src/main/java/net/ktnx/mobileledger/model/Data.java

index 010756f94269c5f3db761f3c7db1bf83b8443cad..d183c4c8094b65401c82284f5a89949cc4322804 100644 (file)
@@ -60,7 +60,7 @@ public final class Data {
         profile.set(newProfile);
     }
     public static int getProfileIndex(MobileLedgerProfile profile) {
         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;
             for (int i = 0; i < profiles.size(); i++) {
                 MobileLedgerProfile p = profiles.get(i);
                 if (p.equals(profile)) return i;
@@ -70,7 +70,7 @@ public final class Data {
         }
     }
     public static int getProfileIndex(String profileUUID) {
         }
     }
     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;
             for (int i = 0; i < profiles.size(); i++) {
                 MobileLedgerProfile p = profiles.get(i);
                 if (p.getUuid().equals(profileUUID)) return i;
@@ -98,7 +98,7 @@ public final class Data {
             profile = MobileLedgerProfile.loadAllFromDB(profileUUID);
         }
         else {
             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);
                 int i = getProfileIndex(profileUUID);
                 if (i == -1) i = 0;
                 profile = profiles.get(i);