【发布时间】:2011-11-25 23:36:01
【问题描述】:
我正在使用带有 ADT 插件的 Windows 和 Eclipse 3.7 Classic 进行 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 -> Window -> Preferences -> Java -> FindBugs -> Filter files -> “Exclude filter files” 部分附近的“Add...”按钮。
但是当我右键单击我的项目并选择“查找错误”->“查找错误”时,我仍然看到错误
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" />
与
<Class name="~.*" />
但错误仍然存在。
我试图重新启动 Eclipse - 没有运气。我什至认为 FindBugs 中可能存在错误,因此它不使用指定的文件,但来自 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
我做错了什么?请帮帮我!
【问题讨论】:
标签: java android eclipse adt findbugs