File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
hibernate-core/src/main/java/org/hibernate/internal/util Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,9 @@ public static Method extractHashCodeMethod(Class<?> clazz) throws NoSuchMethodEx
117
117
* @return True if clazz defines an equals override.
118
118
*/
119
119
public static boolean overridesEquals (Class <?> clazz ) {
120
+ if ( clazz .isRecord () || clazz .isEnum () ) {
121
+ return true ;
122
+ }
120
123
Method equals ;
121
124
try {
122
125
equals = extractEqualsMethod ( clazz );
@@ -134,6 +137,9 @@ public static boolean overridesEquals(Class<?> clazz) {
134
137
* @return True if clazz defines an hashCode override.
135
138
*/
136
139
public static boolean overridesHashCode (Class <?> clazz ) {
140
+ if ( clazz .isRecord () || clazz .isEnum () ) {
141
+ return true ;
142
+ }
137
143
Method hashCode ;
138
144
try {
139
145
hashCode = extractHashCodeMethod ( clazz );
You can’t perform that action at this time.
0 commit comments