@@ -301,7 +301,7 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
301
301
302
302
if (modelVendorExtensions .containsKey (VENDOR_EXTENSION_SCHEMA )) {
303
303
// user already specified schema values
304
- LOGGER .info ("Found vendor extension in '" + modelName + " ' model, autogeneration skipped" );
304
+ LOGGER .info ("Found vendor extension in '{} ' model, autogeneration skipped" , modelName );
305
305
} else {
306
306
modelVendorExtensions .put (VENDOR_EXTENSION_SCHEMA , ktormSchema );
307
307
ktormSchema .put ("tableDefinition" , tableDefinition );
@@ -359,7 +359,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert
359
359
360
360
if (vendorExtensions .containsKey (VENDOR_EXTENSION_SCHEMA )) {
361
361
// user already specified schema values
362
- LOGGER .info ("Found vendor extension in '" + baseName + " ' property, autogeneration skipped" );
362
+ LOGGER .info ("Found vendor extension in '{} ' property, autogeneration skipped" , baseName );
363
363
return ;
364
364
}
365
365
@@ -688,7 +688,8 @@ public void processNullAndDefault(CodegenModel model, CodegenProperty property,
688
688
try {
689
689
columnDefinition .put ("colDefault" , toColumnTypeDefault (defaultValue , dataType , dataFormat ));
690
690
} catch (RuntimeException exception ) {
691
- LOGGER .warn ("Property '" + baseName + "' of model '" + model .getName () + "' mapped to data type which doesn't support default value" );
691
+ LOGGER .warn ("Property '{}' of model '{}' mapped to data type which doesn't support default value" ,
692
+ baseName , model .getName ());
692
693
columnDefinition .put ("colDefault" , null );
693
694
}
694
695
}
@@ -985,7 +986,7 @@ private Map<String, Object> toColumnTypeDefault(String defaultValue, String data
985
986
public String toDatabaseName (String name ) {
986
987
String identifier = toIdentifier (name , databaseNamePrefix , databaseNameSuffix );
987
988
if (identifier .length () > IDENTIFIER_MAX_LENGTH ) {
988
- LOGGER .warn ("Database name too long. Name '" + name + " ' will be truncated" );
989
+ LOGGER .warn ("Database name too long. Name '{} ' will be truncated" , name );
989
990
identifier = identifier .substring (0 , IDENTIFIER_MAX_LENGTH );
990
991
}
991
992
return identifier ;
@@ -1004,7 +1005,7 @@ public String toTableName(String name) {
1004
1005
identifier = underscore (identifier );
1005
1006
}
1006
1007
if (identifier .length () > IDENTIFIER_MAX_LENGTH ) {
1007
- LOGGER .warn ("Table name too long. Name '" + name + " ' will be truncated" );
1008
+ LOGGER .warn ("Table name too long. Name '{} ' will be truncated" , name );
1008
1009
identifier = identifier .substring (0 , IDENTIFIER_MAX_LENGTH );
1009
1010
}
1010
1011
return identifier ;
@@ -1023,7 +1024,7 @@ public String toColumnName(String name) {
1023
1024
identifier = underscore (identifier );
1024
1025
}
1025
1026
if (identifier .length () > IDENTIFIER_MAX_LENGTH ) {
1026
- LOGGER .warn ("Column name too long. Name '" + name + " ' will be truncated" );
1027
+ LOGGER .warn ("Column name too long. Name '{} ' will be truncated" , name );
1027
1028
identifier = identifier .substring (0 , IDENTIFIER_MAX_LENGTH );
1028
1029
}
1029
1030
return identifier ;
@@ -1042,13 +1043,13 @@ public String toIdentifier(String name, String prefix, String suffix) {
1042
1043
String escapedName = escapeQuotedIdentifier (name );
1043
1044
// Database, table, and column names cannot end with space characters.
1044
1045
if (escapedName .matches (".*\\ s$" )) {
1045
- LOGGER .warn ("Database, table, and column names cannot end with space characters. Check '" + name + "' name" );
1046
+ LOGGER .warn ("Database, table, and column names cannot end with space characters. Check '{}' name" , name );
1046
1047
escapedName = escapedName .replaceAll ("\\ s+$" , "" );
1047
1048
}
1048
1049
1049
1050
// Identifiers may begin with a digit but unless quoted may not consist solely of digits.
1050
1051
if (escapedName .matches ("^\\ d+$" )) {
1051
- LOGGER .warn ("Database, table, and column names cannot consist solely of digits. Check '" + name + "' name" );
1052
+ LOGGER .warn ("Database, table, and column names cannot consist solely of digits. Check '{}' name" , name );
1052
1053
escapedName = prefix + escapedName + suffix ;
1053
1054
}
1054
1055
@@ -1074,7 +1075,8 @@ public String escapeQuotedIdentifier(String identifier) {
1074
1075
Pattern regexp = Pattern .compile ("[^0-9a-zA-z$_\\ x0080-\\ xFFFF]" );
1075
1076
Matcher matcher = regexp .matcher (identifier );
1076
1077
if (matcher .find ()) {
1077
- LOGGER .warn ("Identifier '" + identifier + "' contains unsafe characters out of [0-9,a-z,A-Z$_] and U+0080..U+FFFF range" );
1078
+ LOGGER .warn ("Identifier '{}' contains unsafe characters out of [0-9,a-z,A-Z$_] and U+0080..U+FFFF range" ,
1079
+ identifier );
1078
1080
identifier = identifier .replaceAll ("[^0-9a-zA-z$_\\ x0080-\\ xFFFF]" , "" );
1079
1081
}
1080
1082
return identifier ;
@@ -1106,7 +1108,9 @@ public String escapeUnsafeCharacters(String input) {
1106
1108
public void setDefaultDatabaseName (String databaseName ) {
1107
1109
String escapedName = toDatabaseName (databaseName );
1108
1110
if (!escapedName .equals (databaseName )) {
1109
- LOGGER .error ("Invalid database name. '" + databaseName + "' cannot be used as identifier. Escaped value '" + escapedName + "' will be used instead." );
1111
+ LOGGER .error (
1112
+ "Invalid database name. '{}' cannot be used as identifier. Escaped value '{}' will be used instead." ,
1113
+ databaseName , escapedName );
1110
1114
}
1111
1115
this .defaultDatabaseName = escapedName ;
1112
1116
}
@@ -1152,7 +1156,8 @@ public void setIdentifierNamingConvention(String naming) {
1152
1156
this .identifierNamingConvention = naming ;
1153
1157
break ;
1154
1158
default :
1155
- LOGGER .warn ("\" " + naming + "\" is invalid \" identifierNamingConvention\" argument. Current \" " + this .identifierNamingConvention + "\" used instead." );
1159
+ LOGGER .warn ("\" {}\" is invalid \" identifierNamingConvention\" argument. Current \" {}\" used instead." ,
1160
+ naming , this .identifierNamingConvention );
1156
1161
}
1157
1162
}
1158
1163
0 commit comments