From: Damyan Ivanov Date: Sat, 5 Dec 2020 15:18:16 +0000 (+0200) Subject: HledgerVersion: declare members final X-Git-Tag: v0.16.0~23 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=491a244320eec6eff545492828b9d3916860c239;p=mobile-ledger.git HledgerVersion: declare members final --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/HledgerVersion.java b/app/src/main/java/net/ktnx/mobileledger/model/HledgerVersion.java index f3cbba21..ae9e77c8 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/HledgerVersion.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/HledgerVersion.java @@ -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; }