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
117117 * @return True if clazz defines an equals override.
118118 */
119119 public static boolean overridesEquals (Class <?> clazz ) {
120+ if ( clazz .isRecord () || clazz .isEnum () ) {
121+ return true ;
122+ }
120123 Method equals ;
121124 try {
122125 equals = extractEqualsMethod ( clazz );
@@ -134,6 +137,9 @@ public static boolean overridesEquals(Class<?> clazz) {
134137 * @return True if clazz defines an hashCode override.
135138 */
136139 public static boolean overridesHashCode (Class <?> clazz ) {
140+ if ( clazz .isRecord () || clazz .isEnum () ) {
141+ return true ;
142+ }
137143 Method hashCode ;
138144 try {
139145 hashCode = extractHashCodeMethod ( clazz );
You can’t perform that action at this time.
0 commit comments