lishunli / nutz

Automatically exported from code.google.com/p/nutz
0 stars 0 forks source link

dao: DefaultEntityMaker代码逻辑错误 #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
// Is befores? or afters?
                    if (null != ef.getBeforeInsert())
                        befores.add
(ef.getBeforeInsert());
                    else if (null != ef.getAfterInsert
())
                        afters.add
(ef.getAfterInsert());

                    // Append to Entity
                    if (null != ef) {
                        entity.addField(ef);
                    }
没有判断ef是否为null就调getBeforeInsert等,后面又来判断null

Original issue reported on code.google.com by jiongs...@gmail.com on 19 Mar 2010 at 5:17

GoogleCodeExporter commented 9 years ago
fix in r962

虽然根据前面的逻辑 ef ,永远不可能为null,但是后面的 
if(null!=ef)就显得多余了。
将整块代码通过 if(null!=ef) 保护起来,有利于代码的健壮

Original comment by zozoh...@gmail.com on 19 Mar 2010 at 7:37

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 13 May 2010 at 11:03

GoogleCodeExporter commented 9 years ago
Verified in 1.a.28

Original comment by wendal1985@gmail.com on 15 May 2010 at 8:29