问题标签 [findbugs]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
continuous-integration - luntbuild + maven + findbugs = OutOfMemoryException
我一直试图让 Luntbuild 为我们的项目生成和发布一个项目站点,包括 Findbugs 报告。所有其他报告(Cobertura、Surefire、JavaDoc、Dashboard)都可以正常工作,但 Findbugs 会出现 OutOfMemoryException。从报告生成中排除 findbugs 可以修复构建 --- 尽管显然没有 Findbugs 报告。
好笑的是我第一次在本地遇到这个问题,通过设置MAVEN_OPTS=-Xmx512m解决了。然而,这在 Luntbuild 中似乎还不够:将完全相同的选项设置为我的构建器的环境变量并没有什么不同。
我在 'net 上发现了一些帖子,说明您还应该将 -XX:MaxPermSize=512m 添加到 MAVEN_OPTS 和/或将 -Dmaven.findbugs.jvmargs=-Xmx512m 传递给 mvn.bat。这些(或它们的组合)似乎都没有帮助,所以任何提示将不胜感激!
干杯,约翰内斯
相关信息:Luntbuild 是 1.5.6,Maven 是 2.1.0,findbugs-maven-plugin 是 2.0.1。
这是相关 pom.xml 的 Findbugs 部分:
这是我的构建日志的标题:
我的构建日志的尾部:
请注意,显然 maven 只使用 70MB ......但这可能没有任何意义,因为 Findbugs 插件分叉了自己的进程。
java - 有没有办法忽略单个 FindBugs 警告?
使用 PMD,如果您想忽略特定警告,可以使用// NOPMD
忽略该行。
FindBugs 有类似的东西吗?
c++ - 查找未初始化成员变量的简单方法
我正在寻找一种简单的方法来查找未初始化的类成员变量。
在运行时或编译时找到它们都可以。
目前我在类构造函数中有一个断点,并一一检查成员变量。
maven-2 - 如何让 Hudson 生成 Findbugs 报告而不会因异常而失败?
更新
从 Hudson Findbugs 插件版本 4.3 开始,这不再是问题
结束更新
作为我的问题的一个例子,我正在尝试构建以下项目http://www.sonatype.com/books/mvnex-book/reference/multimodule.html
我将以下内容添加到 simple-parent/pom.xml
以下是 simple-weather/pom.xml 和 simple-webapp/pom.xml
我将以下可怕的 equals 方法插入到其中一个类中,以使 FindBugs 产生一些问题(因为 0 个错误没有错误):
我正在使用 Hudson 和 maven2 风格的项目。这项工作是针对有目标的简单父母pom
我得到以下异常:
版本信息:
- Maven 2.2.1
- Java 1.5.0_22
- Hudson 1.341(也可以在 1.339 上找到)在 JBoss 4.0.5.GA 中运行(在 4.2.2.GA 和 5.1.0.GA 上同样的错误)
- Maven FindBugs 插件 2.3
- Hudson FindBugs 插件 4.1
有想法该怎么解决这个吗?
c - Catching weird C pointer arithmetic bugs
I recently ran into a very sneaky bug, in which I forget to dereference a pointer to a string (char array) and thus sometimes overwrote one byte on the stack.
Bad:
Corrected:
GCC produced no warnings, and this error would've resulted in a very serious and real exploit as the value it sometimes overwrote held the size of a buffer. I only caught this bug because I got luckly and it caused an obvious failure.
Other than relying on luck and/or never using C for anything, what defensive coding techniques and tricks do you use to catch wierd C bugs?
I'm thinking about moving to valgrind's MemCheck, has anyone used it? I suspect it wouldn't have caught this bug. Anyone know?
Are there tools for catching pointer dereferencing or arithmetic bugs? Is that even possible?
UPDATE
Here is the requested example code, it does not throw any warnings.
Compiling causes no errors:
Running causes a seg fault:
This is the version of GCC I'm using:
java - 声纳不使用项目 pom.xml 中的 excludeFilterFile
我在我的项目 pom.xml 中配置了 findbugs(和 checkstyle):
这就像一个魅力。'mvn site' 生成正确使用指定 excludeFileterFile 的 finbugs 报告。
问题是当我尝试使用声纳插件时。('mvn sonar:sonar') 声纳不使用上面指定的排除过滤器。(但它会正确使用 checkstyle 抑制文件)。
运行“mvn sonar:sonar”时来自控制台的信息:
警告:备用用户设置文件:C:\Users\rgi.m2\settings.xml 无效。使用默认路径。
以及 target/sonar 目录中的 sonar-pom.xml:
请注意,sonar-pom.xml 中的 checkstyle 是指项目配置中的文件,但 findbugs exclude 文件是来自 sonar 的虚拟空文件。
任何人都知道如何让声纳使用项目 pom.xml 中定义的 finbugs 排除文件?
提前谢谢
/罗伊
java - Findbugs Annotations - 我的部署代码中是否需要 annotation.jar 和 jsr305.jar?
所以,我想使用 findbugs 注释来抑制我们认为可以的代码的警告。
我们是否需要将 annotation.jar 和 jsr305.jar 部署到我们的生产运行时,或者我们只需要在 Eclipse 项目和 unix 构建环境的类路径中使用这些 jar?
java - 类与接口上的 FindBugs 和 CheckForNull
有没有办法让 FindBugs 检查并警告我,如果 CheckForNull 注释出现在类中的方法的实现上,而不是在接口中的方法声明上?
我刚刚在我的应用程序中发现了一个错误,因为 FindBugs 没有发现缺少空检查,因为 CheckForNull 仅存在于 FooImpl 上,但不存在于 Foo 上,我不想手动发现此问题的所有其他位置。
java - 线程安全框架
下面的类不是线程安全的(证明下面的代码不是线程安全的)
是否有一个框架可以帮助编译时/运行时分析并告诉我们以下不是线程安全的?
对于编译时,理想情况下在 Eclipse 中会出现摆动的下划线并告诉我们该类不是线程安全的?
对于运行时,任何静态代码分析都会将该类视为非线程安全的吗?
java - Java 资源管理:了解 Findbugs 结果
Findbugs 让我对打开两个Closeable
实例的方法感到不满,但我不明白为什么。
来源
Findbugs 分析
Findbugs 告诉我
并指向与FileReader fileReader = ...
问题
谁错了:我还是 Findbugs?