2323
2424import java .util .Arrays ;
2525import java .util .List ;
26+ import java .util .Locale ;
2627
2728/**
2829 * Define standard column type for all the readers or writers that do not
@@ -82,11 +83,12 @@ public static ColumnType fromString(String type) {
8283 type = type .substring (0 , type .indexOf (ConstantValue .LEFT_PARENTHESIS_SYMBOL ));
8384 }
8485
86+ type = type .toUpperCase (Locale .ENGLISH );
8587 //为了支持无符号类型 如 int unsigned
86- if (StringUtils .containsIgnoreCase (type ,ConstantValue .DATA_TYPE_UNSIGNED )){
87- type = type .replaceAll (ConstantValue .DATA_TYPE_UNSIGNED ,"" ).trim ();
88+ if (StringUtils .contains (type ,ConstantValue .DATA_TYPE_UNSIGNED )){
89+ type = type .replace (ConstantValue .DATA_TYPE_UNSIGNED ,"" ).trim ();
8890 }
89- return valueOf (type . toUpperCase () );
91+ return valueOf (type );
9092 }
9193
9294 /**
@@ -95,16 +97,17 @@ public static ColumnType fromString(String type) {
9597 * @return
9698 */
9799 public static ColumnType getType (String type ){
100+ type = type .toUpperCase (Locale .ENGLISH );
98101 if (type .contains (ConstantValue .LEFT_PARENTHESIS_SYMBOL )){
99102 type = type .substring (0 , type .indexOf (ConstantValue .LEFT_PARENTHESIS_SYMBOL ));
100103 }
101104
102105 //为了支持无符号类型 如 int unsigned
103- if (StringUtils .containsIgnoreCase (type ,ConstantValue .DATA_TYPE_UNSIGNED )){
106+ if (StringUtils .contains (type ,ConstantValue .DATA_TYPE_UNSIGNED )){
104107 type = type .replaceAll (ConstantValue .DATA_TYPE_UNSIGNED ,"" ).trim ();
105108 }
106109
107- if (type .toLowerCase (). contains (ColumnType .TIMESTAMP .name (). toLowerCase ())){
110+ if (type .contains (ColumnType .TIMESTAMP .name ())){
108111 return TIMESTAMP ;
109112 }
110113
0 commit comments