Bug Detection Specs
Bug detection specifications target common sources of runtime errors: null pointer exceptions, resource leaks, and concurrency issues. These rules catch bugs that the compiler cannot.
Specs in this category
| ID | Spec | Enforcement | Severity |
|---|---|---|---|
| BUG-001 | No Null Returns from Optional Methods | SpotBugs, SonarQube | critical |
| BUG-002 | Resource Leaks: Try-With-Resources | SpotBugs, SonarQube | critical |
| BUG-003 | Thread Safety: No Shared Mutable State | SpotBugs | critical |
How These Are Enforced
Bug detection specs are enforced via SpotBugs (static analysis) and SonarQube (deep dataflow analysis). These tools catch bugs that Checkstyle and ArchUnit cannot detect.