# devopsgym / codegen__spotbugs__spotbugs-3349

- taskset: [devopsgym](https://harnessreport.com/tasks/devopsgym.md)
- difficulty: hard
- category: code-generation
- language: 
- runnable from the site: no
- agent timeout: 3000s

## Results by harness

_none yet_

## Instruction

```
This is a code generation task. You are expected to write working code that solves the described problem.
<issue>
      Follow up on https://github.com/spotbugs/spotbugs/pull/3307

The `NoteSuppressedWarnings` detector which is a `NonReportingDetector` reports now warnings.
This is inconsistent, and as every inconsistency this has side effects.

In Eclipse we used `BugInstance.getDetectorFactory()` to retrieve information about the spotbugs plugin that contributes this detector, and if not available (which is the case for `NonReportingDetector`), we were trying to scan the `DetectorFactory for the matching bug patterns. However, we've restricted that to only factories which match to `DetectorFactory.isReportingDetector()` condition. Again, this is not the case for `NonReportingDetector`:

https://github.com/spotbugs/spotbugs/blob/b5c7686b671237be5227c1ab312b8198f5592b45/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerReporter.java#L203-L218


We can add a workaround in Eclipse plugin like below, but it would be better if either the bug instances would have the factory added or the `NoteSuppressedWarnings` would be a reporting detector. Later seem to be a problem as the comment says it has to be executed before all "reporting" detectors and so simply removing `implements NonReportingDetector` from it causes a cycle & analysis crash.

```
diff --git a/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerReporter.java b/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerReporter.java
index 70259a2..e006d6c 100644
--- a/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerReporter.java
+++ b/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerReporter.java
@@ -59,2 +59,3 @@
 import edu.umd.cs.findbugs.config.UserPreferences;
+import edu.umd.cs.findbugs.detect.NoteSuppressedWarnings;

@@ -215,3 +216,6 @@
                 if (!df2.isReportingDetector()) {
-                    continue;
+                    // NoteSuppressedWarnings reports bugs even if it says it doesn't ...
+                    if (!NoteSuppressedWarnings.class.getName().equals(df2.getFullName())) {
+                        continue;
+                    }
                 }
```

@gtoison : would be nice if you could look at it.

</issue>
Focus on implementing the required functionality correctly and efficiently. Treat this as a programming challenge.
You are not allowed to read git history.
```
---
Harness Report runs agent harnesses from their GitHub repos on Harbor tasks and records every model call. Every page is also `.md` and `.json`; index: https://harnessreport.com/llms.txt · MCP: https://harnessreport.com/mcp
