Skip to content

Commit 3b31d77

Browse files
committed
modernize code using java 17 syntax
1 parent e968b15 commit 3b31d77

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ protected String columnType(int sqlTypeCode) {
218218
case NCHAR -> columnType( CHAR );
219219
case NVARCHAR -> columnType( VARCHAR );
220220
case NCLOB, CLOB -> "string";
221-
case BINARY, VARBINARY, BLOB ->"bytes";
221+
case BINARY, VARBINARY, BLOB -> "bytes";
222222

223223
// We do not use the time with timezone type because PG deprecated it and it lacks certain operations like subtraction
224224
// case TIME_UTC:

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ protected String columnType(int sqlTypeCode) {
236236
// since there's no real difference between TEXT and VARCHAR,
237237
// except for the length limit, we can just use 'text' for the
238238
// "long" string types
239-
case LONG32VARCHAR,LONG32NVARCHAR -> "text";
239+
case LONG32VARCHAR, LONG32NVARCHAR -> "text";
240240
// use oid as the blob/clob type on Postgres because
241241
// the JDBC driver doesn't allow using bytea/text through LOB APIs
242-
case BLOB, CLOB,NCLOB -> "oid";
242+
case BLOB, CLOB, NCLOB -> "oid";
243243
// use bytea as the "long" binary type (that there is no
244244
// real VARBINARY type in Postgres, so we always use this)
245245
case BINARY, VARBINARY, LONG32VARBINARY -> "bytea";

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseAnywhereDialect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected String columnType(int sqlTypeCode) {
7171
case LONG32VARCHAR -> "long varchar";
7272
case LONG32NVARCHAR -> "long nvarchar";
7373
case LONG32VARBINARY -> "long binary";
74-
case NCLOB ->"ntext";
74+
case NCLOB -> "ntext";
7575
default -> super.columnType( sqlTypeCode );
7676
};
7777
}

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/function/json/SingleStoreJsonArrayAppendFunction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ private static void buildJsonPath(
7777
if ( pathElement instanceof JsonPathHelper.JsonAttribute attribute ) {
7878
sqlAppender.appendSingleQuoteEscapedString( attribute.attribute() );
7979
}
80-
else if ( pathElement instanceof JsonPathHelper.JsonParameterIndexAccess parameterName) {
81-
throw new QueryException( "JSON path [" + jsonPath + "] uses parameter [" + parameterName + "] that is not passed" );
80+
else if ( pathElement instanceof JsonPathHelper.JsonParameterIndexAccess indexParameter) {
81+
throw new QueryException( "JSON path [" + jsonPath + "] uses parameter [" + indexParameter.parameterName() + "] that is not passed" );
8282
}
8383
else {
8484
sqlAppender.appendSql( '\'' );

hibernate-core/src/main/java/org/hibernate/action/internal/CollectionAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public String toString() {
148148
@Override
149149
public int compareTo(ComparableExecutable executable) {
150150
// sort first by role name
151-
final var roleComparison = collectionRole.compareTo( executable.getPrimarySortClassifier() );
151+
final int roleComparison = collectionRole.compareTo( executable.getPrimarySortClassifier() );
152152
return roleComparison != 0
153153
? roleComparison
154154
//then by fk

0 commit comments

Comments
 (0)