Issue
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
In order to resolve that issue you need to use you fields somewhere in your class. What FindBugs is telling you is that your fields in your class are never used as the fields.
How you using your fields that were retrieved from database? Maybe you need to add getters
? For now, your fields are useless (unless you don't using them with reflection, which is not good).
Answered By - Izbassar Tolegen
Answer Checked By - Mary Flores (JavaFixing Volunteer)