'How to overcome the FCBL_FIELD_COULD_BE_LOCAL issue in FindBugs?
In FindBugs, I am getting an issue like FCBL_FIELD_COULD_BE_LOCAL on the class name line of this code:
@Entity
@Table(name = "Student")
@Immutable
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class RetrievableStudent extends BaseStudent
{
@Id
@Column(name = "STUDENT_ID")
private long studentId;
@Column(name = "STUD_NOTE")
private String studenetNote;
}
How can I resolve this issue?
Solution 1:[1]
My POJO has already getters setters, equals, hashcode.
It worked when I tried adding @JsonProperty annotation, as my POJO is built for API response purposes.
If the POJO is for ORM purposes (means database entity) the on getters and setters @Column annotation should work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Akshay Sardhara |
