mybatis-3
mybatis-3 copied to clipboard
Optimize the code in TypeAliasRegistry
Optimize the code in TypeAliasRegistry
@kang-hl There is a test shouldBeAbleToRegisterAliasWithNullType that fails with this. I haven't looked deeper but that would indicate null was allowed and thus the changes would break that logic. Please have a look at that test specifically to see if it indicates why usage is that way. For now cannot merge this change. The change itself seems fine but I don't know the deeper details as to why null allowed.
@kang-hl There is a test shouldBeAbleToRegisterAliasWithNullType that fails with this. I haven't looked deeper but that would indicate null was allowed and thus the changes would break that logic. Please have a look at that test specifically to see if it indicates why usage is that way. For now cannot merge this change. The change itself seems fine but I don't know the deeper details as to why null allowed.
fixed
I seemed to recall there was another section with updates...At any rate I don't think the else is necessary and think the first two if statements can be combined so its basically like the original just optionized to not call the get so many times as the intent here.
Coverage: 87.547% (+0.001%) from 87.545% when pulling fb2a6e97aa9e9207faa5c7fcbc25acf0b399874a on kang-hl:Optimize-TypeAliasRegistry into e68216bbcc798a29d6b763bfe6b8942126c23a7c on mybatis:master.
I seemed to recall there was another section with updates...At any rate I don't think the else is necessary and think the first two if statements can be combined so its basically like the original just optionized to not call the get so many times as the intent here.
Better performance in test shouldBeAbleToRegisterSameAliasWithSameTypeAgain.