From 491a244320eec6eff545492828b9d3916860c239 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 5 Dec 2020 17:18:16 +0200 Subject: [PATCH] HledgerVersion: declare members final --- .../net/ktnx/mobileledger/model/HledgerVersion.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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; } -- 2.39.5