Skip to content

Conversation

jeho0815
Copy link
Contributor

If a Rest class has no method, it will declared a nullpoint exception, so add a null check to avoid. In dev stage, maybe has some empty implement.

…, so add a null check to avoid. In dev stage, maybe has some empty implement.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 85.6% when pulling 6df63ef on jeho0815:master into e6c04f0 on ServiceComb:master.

paramName = correctMethodParameterName(paramName);

JavaType paramJavaType = ConverterMgr.findJavaType(classLoader,
if (swagger.getPaths() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

当一个接口没有定义任何方法的时候,会出现swagger.getPaths为空?这种情况也该是不合理的接口定义吧。是否打印一个日志警告。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

空实现的时候就会出现空指针异常,开发过程有时会同时复制多个,暂时没有实现的模块,启动就会有问题,后面都会有具体实现,只影响开发阶段,日志警告意义不大。

Copy link
Contributor

Choose a reason for hiding this comment

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

这种情况还是不要留着吧。开发的时候一些可能的垃圾代码,还去容错不是好的实践。 这里能够构造出一个测试用例来的话还可以考虑下。

Copy link
Member

Choose a reason for hiding this comment

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

日志能够帮助用户快速定位问题, 建议还是把错误日志加上吧!

@jeho0815 jeho0815 closed this Sep 22, 2017
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.

4 participants