首页 > 编程语言 > 详细

java代码静态分析工具

时间:2019-07-12 17:28:18      阅读:96      评论:0      收藏:0      [点我收藏+]

需求:有些基础类型的遍历,值希望它被赋予指定的几个值,赋予其他值能够别编译器(IDEA/eclipse)提醒

Android studu结合自己的插件,引入

<!-- https://mvnrepository.com/artifact/com.android.support/support-annotations -->
<dependency>
    <groupId>com.android.support</groupId>
    <artifactId>support-annotations</artifactId>
    <version>22.0.0</version>
</dependency>

使用@IntDef/@StringDef可以满足需求

idea也有类似的:

<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>17.0.0</version>
        </dependency>

有个问题,android的满足需求,但是不能用到IDEA,idea上的静态代码分析,又不能满足需求,记一下,回头解决

java代码静态分析工具

原文:https://www.cnblogs.com/donfaquir/p/11177244.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!