From 50e711384b79f1d45a3a414d211cf57df6279b63 Mon Sep 17 00:00:00 2001 From: "Anosh D. Ullenius" Date: Sat, 20 Jun 2020 22:44:01 +0200 Subject: [PATCH] Remove redundant usage of 'this' keyword --- src/main/java/dev/personnummer/Personnummer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/personnummer/Personnummer.java b/src/main/java/dev/personnummer/Personnummer.java index 67df42f..599a6cb 100644 --- a/src/main/java/dev/personnummer/Personnummer.java +++ b/src/main/java/dev/personnummer/Personnummer.java @@ -50,7 +50,7 @@ public static Personnummer parse(String personnummer) throws PersonnummerExcepti private final boolean isMale; public boolean isMale() { - return this.isMale; + return isMale; } public boolean isFemale() { @@ -90,7 +90,7 @@ public String getControlNumber() { } public int getAge() { - return (LocalDate.of(Integer.parseInt(this.fullYear), Integer.parseInt(this.month), this.realDay).until(LocalDate.now())).getYears(); + return (LocalDate.of(Integer.parseInt(fullYear), Integer.parseInt(month), realDay).until(LocalDate.now())).getYears(); } /** @@ -178,7 +178,7 @@ public String format() { * @return Formatted personal identity number. */ public String format(boolean longFormat) { - return (longFormat ? this.fullYear : this.year) + this.month + this.day + (longFormat ? "" : separator()) + numbers; + return (longFormat ? fullYear : year) + month + day + (longFormat ? "" : separator()) + numbers; } /**