Skip to content

Conversation

eric-lee-ltk
Copy link
Contributor

method checkMicroserviceName has already validate whether name is empty or not, there is no need to validate it again, right?

@eric-lee-ltk eric-lee-ltk deleted the optimize/remove_redudant_validation branch July 11, 2017 04:50
@eric-lee-ltk eric-lee-ltk restored the optimize/remove_redudant_validation branch July 17, 2017 09:56
@eric-lee-ltk eric-lee-ltk reopened this Jul 17, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 85.223% when pulling 51ce0f1 on eric-lee-ltk:optimize/remove_redudant_validation into 8195895 on ServiceComb:master.

conf.getString(DefinitionConst.qulifiedServiceNameKey, DefinitionConst.defaultMicroserviceName);
if (!StringUtils.isEmpty(name)) {
checkMicroserviceName(name);
combinedFrom.add(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have corresponding test to verify that this is indeed redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like there has no unit tests for this class and no test covers this scene.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combinedFrom will throw NPE when name is null and the logic is different after change when name is empty

@eric-lee-ltk eric-lee-ltk changed the title removed redudant validation logic removed redundant validation logic Jul 17, 2017
conf.getString(DefinitionConst.qulifiedServiceNameKey, DefinitionConst.defaultMicroserviceName);
if (!StringUtils.isEmpty(name)) {
checkMicroserviceName(name);
combinedFrom.add(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combinedFrom will throw NPE when name is null and the logic is different after change when name is empty

@eric-lee-ltk eric-lee-ltk deleted the optimize/remove_redudant_validation branch July 19, 2017 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants