如何处理flex中的Flex PMD错误?
运行 flex PMD 时,它在下面的行中抛出一些错误。
var strHandle:String = ConfigXMLModelLocator.getInstance().handle;
var appHandle:String = ConfigXMLModelLocator.getInstance().handle;
->此处显示错误。 var call:Object=service.getEVAInfo(strHandle,appHandle);
错误:- UseObjectType。不要使用对象类。使用动态类 Object 是一种不好的做法。更喜欢使用 强类型对象或标记接口,以避免重构时出现静默编译错误。
while running the flex PMD, it is throwing some errors in the below line.
var strHandle:String = ConfigXMLModelLocator.getInstance().handle;
var appHandle:String = ConfigXMLModelLocator.getInstance().handle;
->Error displaying here. var call:Object=service.getEVAInfo(strHandle,appHandle);
Error:- UseObjectType. Do not use Object class. It is a bad practice to use the dynamic class Object. Prefer using
strongly typed object, or marker interface in order to avoid silent compilation errors while refactoring.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果
getEVAInfo
返回Object
,则您对 Flex PMD 错误无能为力。忽略它,因为只要您知道自己在做什么,使用动态对象就没有问题。您还可以使用
//NOPMD
注释使 PMD 跳过此行。If
getEVAInfo
returns anObject
, there's nothing you can do about the Flex PMD error. Just ignore it as there's nothing wrong with using dynamic objects as long as you know what you are doing.You can also use the
//NOPMD
comment to make PMD skip this line.