Field accesses from inner classes aren't correctly considered. This happens with sb-contrib version 7.6.4 (current release).
Example code:
public final class Example
{
private final Map<String, String> map = new HashMap<>();
public Example(String value) { map.put("foo", value); }
public final class Inner
{
public String foo() { return map.get("foo"); }
}
}
This incorrectly reports the bugs DMC_DUBIOUS_MAP_COLLECTION, FCBL_FIELD_COULD_BE_LOCAL, and WOC_WRITE_ONLY_COLLECTION_FIELD.
The same code without the inner class does not report these bugs:
public final class Example
{
private final Map<String, String> map = new HashMap<>();
public Example(String value) { map.put("foo", value); }
public String foo() { return map.get("foo"); }
}
Field accesses from inner classes aren't correctly considered. This happens with sb-contrib version 7.6.4 (current release).
Example code:
This incorrectly reports the bugs DMC_DUBIOUS_MAP_COLLECTION, FCBL_FIELD_COULD_BE_LOCAL, and WOC_WRITE_ONLY_COLLECTION_FIELD.
The same code without the inner class does not report these bugs: