When using container class with public fields and serializing this class false positive (urf_unread_public_or_protected_field) is reported. I.E:
:::java
class Container {
public String containdField;
}
class WebRsource {
private static Gson gson = new GsonBuilder().registerTypeAdapter(JsonContent.class, new JsonContentAdapter()).create();
@GET
public String getJSON() {
Container container = new Container();
container.containdField = "Some String"; //<--here you get false positive
return gson.toJson(container);
}
Do you have any recommendations for reducing false positives, other than just disabling the detector? Trying to figure out what might be accessed via Gson seems very difficult.