@@ -57,7 +57,7 @@ static boolean hasMatchingLength(Column column, ColumnInformation columnInformat
57
57
return true ;
58
58
}
59
59
else {
60
- int sqlType = columnInformation .getTypeCode ();
60
+ final int sqlType = columnInformation .getTypeCode ();
61
61
if ( isStringType ( sqlType ) ) {
62
62
final int actualLength = columnInformation .getColumnSize ();
63
63
final Size size = column .getColumnSize ( dialect , metadata );
@@ -91,14 +91,14 @@ static String getFullColumnDeclaration(
91
91
Metadata metadata ,
92
92
Dialect dialect ,
93
93
SqlStringGenerationContext context ) {
94
- StringBuilder definition = new StringBuilder ();
94
+ final StringBuilder definition = new StringBuilder ();
95
95
appendColumn ( definition , column , table , metadata , dialect , context );
96
96
return definition .toString ();
97
97
}
98
98
99
99
100
100
static String getColumnDefinition (Column column , Metadata metadata , Dialect dialect ) {
101
- StringBuilder definition = new StringBuilder ();
101
+ final StringBuilder definition = new StringBuilder ();
102
102
appendColumnDefinition ( definition , column , metadata , dialect );
103
103
appendComment ( definition , column , dialect );
104
104
return definition .toString ();
@@ -235,28 +235,19 @@ private static String normalize(String typeName) {
235
235
}
236
236
else {
237
237
final String lowercaseTypeName = typeName .toLowerCase (Locale .ROOT );
238
- switch (lowercaseTypeName ) {
239
- case "int" :
240
- return "integer" ;
241
- case "character" :
242
- return "char" ;
243
- case "character varying" :
244
- return "varchar" ;
245
- case "binary varying" :
246
- return "varbinary" ;
247
- case "character large object" :
248
- return "clob" ;
249
- case "binary large object" :
250
- return "blob" ;
251
- case "interval second" :
252
- return "interval" ;
253
- case "double precision" :
254
- return "double" ;
238
+ return switch ( lowercaseTypeName ) {
239
+ case "int" -> "integer" ;
240
+ case "character" -> "char" ;
241
+ case "character varying" -> "varchar" ;
242
+ case "binary varying" -> "varbinary" ;
243
+ case "character large object" -> "clob" ;
244
+ case "binary large object" -> "blob" ;
245
+ case "interval second" -> "interval" ;
246
+ case "double precision" -> "double" ;
255
247
// todo: normalize DECIMAL to NUMERIC?
256
248
// normalize REAL to FLOAT?
257
- default :
258
- return lowercaseTypeName ;
259
- }
249
+ default -> lowercaseTypeName ;
250
+ };
260
251
}
261
252
}
262
253
@@ -265,7 +256,7 @@ private static String stripArgs(String typeExpression) {
265
256
return null ;
266
257
}
267
258
else {
268
- int i = typeExpression .indexOf ('(' );
259
+ final int i = typeExpression .indexOf ('(' );
269
260
return i >0 ? typeExpression .substring (0 ,i ).trim () : typeExpression ;
270
261
}
271
262
}
0 commit comments