]> git.ktnx.net Git - mobile-ledger.git/commitdiff
HledgerVersion: declare members final
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 5 Dec 2020 15:18:16 +0000 (17:18 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 20 Dec 2020 10:05:32 +0000 (10:05 +0000)
app/src/main/java/net/ktnx/mobileledger/model/HledgerVersion.java

index f3cbba213e4218e0e8dfdb68d4f2528d92144a89..ae9e77c83acdbfd657d584863feeb55a70d7df9c 100644 (file)
@@ -23,14 +23,15 @@ import androidx.annotation.Nullable;
 import java.util.Locale;
 
 public class HledgerVersion {
-    private int major;
-    private int minor;
-    private int patch;
-    private boolean isPre_1_20;
-    private boolean hasPatch;
+    private final int major;
+    private final int minor;
+    private final int patch;
+    private final boolean isPre_1_20;
+    private final boolean hasPatch;
     public HledgerVersion(int major, int minor) {
         this.major = major;
         this.minor = minor;
+        this.patch = 0;
         this.isPre_1_20 = false;
         this.hasPatch = false;
     }
@@ -44,7 +45,7 @@ public class HledgerVersion {
     public HledgerVersion(boolean pre_1_20) {
         if (!pre_1_20)
             throw new IllegalArgumentException("pre_1_20 argument must be true");
-        this.major = this.minor = 0;
+        this.major = this.minor = this.patch = 0;
         this.isPre_1_20 = true;
         this.hasPatch = false;
     }