File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
src/main/java/com/yanglb/codegen/core Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ protected void onGeneration() throws CodeGenException {
5050
5151 // 默认使用UTF-8编码
5252 GenTypes .Writer supportWriter = GenTypes .Writer .utf8 ;
53- if (writableModel .getEncode () == "ascii" ) supportWriter = GenTypes .Writer .ascii ;
53+ if ("ascii" . equals ( writableModel .getEncode ()) ) supportWriter = GenTypes .Writer .ascii ;
5454
5555 // 写入到文件中
5656 IWriter writer = GenFactory .createByName (Conf .getString (Conf .CATEGORY_WRITER , supportWriter .name ()));
Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ protected void onGeneration() throws CodeGenException {
4141 ITableReader tableReader = GenFactory .createByName (parameterModel .getCmdModel ().getReader ());
4242 tableReader .setStartPoint (3 , 2 );
4343 List <TableModel > list = tableReader .reader (this .parameterModel .getFile (), this .parameterModel .getSheets ());
44- if (list .size () == 0 ) {
44+ if (list .isEmpty () ) {
4545 throw new CodeGenException (Resources .getString ("E_003" ));
4646 }
4747
4848 // 获取语言(每种语言翻译一次)
49- List <String > langList = new ArrayList <String >();
49+ List <String > langList = new ArrayList <>();
5050 TableModel tableModel = list .get (0 );
5151 for (String key : tableModel .getColumns ()) {
5252 if (!"id" .equals (key )) {
@@ -61,7 +61,7 @@ protected void onGeneration() throws CodeGenException {
6161
6262 // 默认使用UTF-8编码
6363 GenTypes .Writer supportWriter = GenTypes .Writer .utf8 ;
64- if (writableModel .getEncode () == "ascii" ) supportWriter = GenTypes .Writer .ascii ;
64+ if ("ascii" . equals ( writableModel .getEncode ()) ) supportWriter = GenTypes .Writer .ascii ;
6565
6666 // 写入到文件中
6767 IWriter writer = GenFactory .createByName (Conf .getString (Conf .CATEGORY_WRITER , supportWriter .name ()));
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ protected void onBeforeTranslate() throws CodeGenException {
3333
3434 // 文件名
3535 String fileName = getFileName ();
36- if (fileName .equals ( "" )) {
36+ if (fileName .isEmpty ( )) {
3737 // 空文件名
3838 fileName = this .msgLang ;
3939 } else {
@@ -51,7 +51,6 @@ protected String getSplitString() {
5151
5252 /**
5353 * 获取当前语言是否为默认语言
54- * @return
5554 */
5655 protected boolean isDefaultLanguage () {
5756 return this .msgLang .equals ("default" );
You can’t perform that action at this time.
0 commit comments