"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "documentation/src/test/java/example/Person.java" between
junit5-r5.3.2.tar.gz and junit5-r5.4.0.tar.gz

About: JUnit 5 is a unit testing framework for the Java programming language.

Person.java  (junit5-r5.3.2):Person.java  (junit5-r5.4.0)
/* /*
* Copyright 2015-2018 the original author or authors. * Copyright 2015-2019 the original author or authors.
* *
* All rights reserved. This program and the accompanying materials are * All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which * made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at * accompanies this distribution and is available at
* *
* http://www.eclipse.org/legal/epl-v20.html * http://www.eclipse.org/legal/epl-v20.html
*/ */
package example; package example.domain;
import java.time.LocalDate; import java.time.LocalDate;
public class Person { public class Person {
enum Gender { public enum Gender {
F, M F, M
} }
private String firstName; private String firstName;
private String lastName; private String lastName;
private Gender gender; private Gender gender;
private LocalDate dateOfBirth; private LocalDate dateOfBirth;
public Person(String firstName, String lastName) { public Person(String firstName, String lastName) {
this.firstName = firstName; this.firstName = firstName;
skipping to change at line 64 skipping to change at line 64
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((firstName == null) ? 0 : firstName.ha shCode()); result = prime * result + ((firstName == null) ? 0 : firstName.ha shCode());
result = prime * result + ((lastName == null) ? 0 : lastName.hash Code()); result = prime * result + ((lastName == null) ? 0 : lastName.hash Code());
return result; return result;
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj) {
return true; return true;
if (obj == null) }
if (obj == null) {
return false; return false;
if (getClass() != obj.getClass()) }
if (getClass() != obj.getClass()) {
return false; return false;
}
Person other = (Person) obj; Person other = (Person) obj;
if (firstName == null) { if (firstName == null) {
if (other.firstName != null) if (other.firstName != null) {
return false; return false;
}
} }
else if (!firstName.equals(other.firstName)) else if (!firstName.equals(other.firstName)) {
return false; return false;
}
if (lastName == null) { if (lastName == null) {
if (other.lastName != null) if (other.lastName != null) {
return false; return false;
}
} }
else if (!lastName.equals(other.lastName)) else if (!lastName.equals(other.lastName)) {
return false; return false;
}
return true; return true;
} }
@Override @Override
public String toString() { public String toString() {
return "Person [firstName=" + firstName + ", lastName=" + lastNam e + "]"; return "Person [firstName=" + firstName + ", lastName=" + lastNam e + "]";
} }
} }
 End of changes. 15 change blocks. 
10 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)