Skip to content

Commit

Permalink
Remove redundant usage of 'this' keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
ullenius authored and Johannestegner committed Jun 25, 2020
1 parent 82e0cb2 commit 50e7113
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/dev/personnummer/Personnummer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 50e7113

Please sign in to comment.