Here's the breakdown of this week's bug pattern.
下面是本周的错误模式的小结。
For more discussion on this issue, see my article The Null Flag bug pattern.
关于这个问题的更多讨论,请参阅我的文章空标志错误模式。
Programmers can identify the problem by learning about the Double Descent bug pattern.
程序员可通过学习DoubleDescent 错误模式来识别这种问题。
He mentions AspectJ specifically in "The Null Flag bug pattern" in connection with exceptions.
他在与异常有关的“The NullFlagbug pattern”中特别提到了AspectJ。
Returning a flag value would have many of the same problems as the Null Flag bug pattern we discussed last time.
返回一个标志值将引起许多与我们上次讨论的空标志错误模式一样的错误。
As you learned last month, the first step in writing a bug pattern detector is clearly identifying the bug pattern.
正如您在 上一期 中所学的,编写bug模式的第一个步骤是清楚地标识 bug 模式。
But FindBugs is different — it USES bytecode analysis and a host of plug-in bug pattern detectors to find common bugs in code.
但是FindBugs不同,它利用字节码分析和很多内置的bug模式检测器来查找代码中的常见bug。
These contain information about all the try-catch blocks in the method, so you'll have to correlate the throw and catch information to identify the bug pattern.
它们包含关于方法中所有try - catch块的信息,所以您必须将抛出信息和捕获信息关联,以标识bug模式。
To detect this bug pattern, you'll need to know where the try-catch blocks are, what might be thrown out of the try block, and what is caught in the catch blocks.
要检测此bug模式,则需要知道try -catch块的位置、try块可能抛出的内容以及在catch块中将捕获的内容。
So if FindBugs is a bug pattern detector, it stands to reason that it can also serve as an auditing tool to measure the degree of compliance with a set of design principles.
因此如果FindBugs是bug模式检测器,那么它理所当然可以用作审核工具,衡量代码与一组设计原理的符合程度。
The process of tuning a detector involves looking at the false alarms and refining the bug pattern so as to eliminate some false alarms without excluding too many actual bugs.
优化检测器的过程包括查找假警报和细化bug模式,以消除某些假警报,同时不要将太多的真实bug排除在外。
Bug patterns often stem from confusing features of the language or the class library; this bug pattern stems from the somewhat counterintuitive fact that RuntimeException extends Exception.
bug模式通常源自语言的模糊功能或类库;出现此bug模式是因为RuntimeException扩展了Exception,这稍微有点违反常理。
For more discussion on this issue, see my article "The Null Flag Bug Pattern".
关于这个问题的更多讨论,请参阅我的文章《空标志错误模式》。
For more discussion on this issue, see my article "The Null Flag Bug Pattern".
关于这个问题的更多讨论,请参阅我的文章《空标志错误模式》。
应用推荐