]> WPIA git - gigi.git/commitdiff
inopiae-dob: replaced some magic numbers by constants
authorINOPIAE <m.maengel@inopiae.de>
Sun, 15 May 2016 10:55:59 +0000 (12:55 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 9 Jun 2016 07:42:51 +0000 (09:42 +0200)
Change-Id: I097d320c95b2357978e452200747491a7f983b6d

src/org/cacert/gigi/dbObjects/User.java

index 8f7c3f148cc4cdc1a18b5e5b25a6aa7e2fb293c2..e831dfcc14bd4f7b05daa530b476e3e8fe451297 100644 (file)
@@ -41,6 +41,10 @@ public class User extends CertificateOwner {
 
     public static final int MINIMUM_AGE = 16;
 
+    public static final int POJAM_AGE = 14;
+
+    public static final int ADULT_AGE = 18;
+
     protected User(GigiResultSet rs) {
         super(rs.getInt("id"));
         updateName(rs);
@@ -134,7 +138,7 @@ public class User extends CertificateOwner {
     }
 
     public boolean canAssure() {
-        if ( !CalendarUtil.isOfAge(dob, 14)) { // PoJAM
+        if ( !CalendarUtil.isOfAge(dob, POJAM_AGE)) { // PoJAM
             return false;
         }
         if (getAssurancePoints() < 100) {
@@ -196,7 +200,7 @@ public class User extends CertificateOwner {
      * @return the maximal points @
      */
     public int getMaxAssurePoints() {
-        if ( !CalendarUtil.isOfAge(dob, 18)) {
+        if ( !CalendarUtil.isOfAge(dob, ADULT_AGE)) {
             return 10; // PoJAM
         }