Skip to content

Commit 5612c9b

Browse files
committed
Revert "Workaround JDK 17 javac bug for switch expression compilation"
This reverts commit 64a86dc.
1 parent 6e1ae87 commit 5612c9b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hibernate-core/src/main/java/org/hibernate/type/internal/BindingTypeHelper.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ public static JdbcMapping resolveBindType(
9797
final var javaType = value.getClass();
9898
final var temporalJavaType = (TemporalJavaType<?>) baseType.getJdbcJavaType();
9999
final var bindableType = (BindableType<?>) baseType;
100-
// Cast individual arms of the switch to avoid a JDK 17 javac bug
101-
return switch ( temporalJavaType.getPrecision() ) {
102-
case TIMESTAMP -> (JdbcMapping) resolveTimestampTemporalTypeVariant( javaType, bindableType, typeConfiguration );
103-
case DATE -> (JdbcMapping) resolveDateTemporalTypeVariant( javaType, bindableType, typeConfiguration );
104-
case TIME -> (JdbcMapping) resolveTimeTemporalTypeVariant( javaType, bindableType, typeConfiguration );
100+
return (JdbcMapping) switch ( temporalJavaType.getPrecision() ) {
101+
case TIMESTAMP -> resolveTimestampTemporalTypeVariant( javaType, bindableType, typeConfiguration );
102+
case DATE -> resolveDateTemporalTypeVariant( javaType, bindableType, typeConfiguration );
103+
case TIME -> resolveTimeTemporalTypeVariant( javaType, bindableType, typeConfiguration );
105104
};
106105
}
107106
}

0 commit comments

Comments
 (0)