-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
128 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module equalsverifier_jpms { | ||
exports nl.jqno.equalsverifier.jpms.model; | ||
|
||
opens nl.jqno.equalsverifier.jpms.model; | ||
|
||
requires java.desktop; | ||
requires java.naming; | ||
requires java.rmi; | ||
requires java.sql; | ||
} |
24 changes: 24 additions & 0 deletions
24
equalsverifier-test-jpms/src/main/java/nl/jqno/equalsverifier/jpms/model/ClassPoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package nl.jqno.equalsverifier.jpms.model; | ||
|
||
import java.util.Objects; | ||
|
||
public final class ClassPoint { | ||
|
||
private final int x; | ||
private final int y; | ||
|
||
private ClassPoint(int x, int y) { | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
return obj instanceof ClassPoint other && x == other.x && y == other.y; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(x, y); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...rifier-test-jpms/src/main/java/nl/jqno/equalsverifier/jpms/model/ClassPointContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package nl.jqno.equalsverifier.jpms.model; | ||
|
||
import java.util.Objects; | ||
|
||
public final class ClassPointContainer { | ||
private final ClassPoint cp; | ||
|
||
private ClassPointContainer(ClassPoint cp) { | ||
this.cp = cp; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
return obj instanceof ClassPointContainer other && Objects.equals(cp, other.cp); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(cp); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...-test-jpms/src/main/java/nl/jqno/equalsverifier/jpms/model/FieldsFromJdkModulesHaver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package nl.jqno.equalsverifier.jpms.model; | ||
|
||
import java.util.Objects; | ||
|
||
public final class FieldsFromJdkModulesHaver { | ||
private final java.awt.Color desktopAwtColor; | ||
private final java.rmi.server.UID rmiUid; | ||
private final java.sql.Date sqlDate; | ||
private final javax.naming.Reference namingReference; | ||
|
||
private FieldsFromJdkModulesHaver( | ||
java.awt.Color c, | ||
java.rmi.server.UID u, | ||
java.sql.Date d, | ||
javax.naming.Reference r) { | ||
this.desktopAwtColor = c; | ||
this.rmiUid = u; | ||
this.sqlDate = d; | ||
this.namingReference = r; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
return obj instanceof FieldsFromJdkModulesHaver other | ||
&& Objects.equals(desktopAwtColor, other.desktopAwtColor) | ||
&& Objects.equals(rmiUid, other.rmiUid) | ||
&& Objects.equals(sqlDate, other.sqlDate) | ||
&& Objects.equals(namingReference, other.namingReference); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(desktopAwtColor, rmiUid, sqlDate, namingReference); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
equalsverifier-test-jpms/src/main/java/nl/jqno/equalsverifier/jpms/model/NonFinal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package nl.jqno.equalsverifier.jpms.model; | ||
|
||
import java.util.Objects; | ||
|
||
public class NonFinal { | ||
private final int i; | ||
|
||
public NonFinal(int i) { | ||
this.i = i; | ||
} | ||
|
||
@Override | ||
public final boolean equals(Object obj) { | ||
return obj instanceof NonFinal other && Objects.equals(i, other.i); | ||
} | ||
|
||
@Override | ||
public final int hashCode() { | ||
return Objects.hash(i); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
equalsverifier-test-jpms/src/main/java/nl/jqno/equalsverifier/jpms/model/Records.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package nl.jqno.equalsverifier.jpms.model; | ||
|
||
public final class Records { | ||
public record RecordPoint(int x, int y) {} | ||
|
||
public record RecordPointContainer(RecordPoint rp) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters