Skip to content

Commit 50e7113

Browse files
ulleniusJohannestegner
authored andcommitted
Remove redundant usage of 'this' keyword
1 parent 82e0cb2 commit 50e7113

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/dev/personnummer/Personnummer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static Personnummer parse(String personnummer) throws PersonnummerExcepti
5050
private final boolean isMale;
5151

5252
public boolean isMale() {
53-
return this.isMale;
53+
return isMale;
5454
}
5555

5656
public boolean isFemale() {
@@ -90,7 +90,7 @@ public String getControlNumber() {
9090
}
9191

9292
public int getAge() {
93-
return (LocalDate.of(Integer.parseInt(this.fullYear), Integer.parseInt(this.month), this.realDay).until(LocalDate.now())).getYears();
93+
return (LocalDate.of(Integer.parseInt(fullYear), Integer.parseInt(month), realDay).until(LocalDate.now())).getYears();
9494
}
9595

9696
/**
@@ -178,7 +178,7 @@ public String format() {
178178
* @return Formatted personal identity number.
179179
*/
180180
public String format(boolean longFormat) {
181-
return (longFormat ? this.fullYear : this.year) + this.month + this.day + (longFormat ? "" : separator()) + numbers;
181+
return (longFormat ? fullYear : year) + month + day + (longFormat ? "" : separator()) + numbers;
182182
}
183183

184184
/**

0 commit comments

Comments
 (0)