我使用 Windows 和 Eclipse 3.7 Classic 以及 ADT 插件进行 Android 开发。
我刚刚安装了 FindBugs,它在自动生成的 R.java 类中发现了一个错误。
我想从 FindBugs 检查中排除此类。
我发现我可以在 xml 文件中为 FindBugs 定义排除过滤器,因此我创建了一个带有文本的文件 D:\Projects\eclipse\FindBugsExculde.xml
<FindBugsFilter>
<Match>
<Class name="com.android.demo.notepad3.R$attr" />
</Match>
</FindBugsFilter>
我已将此文件添加到“排除过滤文件”部分附近的 Eclipse -> 窗口 -> 首选项 -> Java -> FindBugs -> 过滤文件 -> “添加...”按钮。
但是当我右键单击我的项目并选择“查找错误”->“查找错误”时,我仍然看到错误
The class name com.android.demo.notepad3.R$attr doesn't start with an upper case letter
我什至尝试过更换
<Class name="com.android.demo.notepad3.R$attr" />
with
<Class name="~.*" />
但错误仍然存在。
我尝试重新启动 Eclipse - 没有成功。我什至认为 FindBugs 中可能存在 Bug,因此它不使用指定的文件,但 SysinternalsSuite 中的 Procmon.exe 显示每次我执行 FindBugs 时它都会使用它:
ProcessName Operation Path Result
javaw.exe QueryOpen D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe QueryOpen D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe CreateFile D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe CreateFile D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe QueryFileInternalInformationFile D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe CloseFile D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe ReadFile D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
javaw.exe CloseFile D:\Projects\eclipse\FindBugsExculde.xml SUCCESS
我究竟做错了什么?请帮我!