This is about rule S1948 for Java. It is similar to [SONARJAVA-2442] - Jira. We have EJBs containing additional injected fields with the annotation @javax.annotation.Resource
import java.io.Serializable;
import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateful;
@Stateful
public class TestBean implements Serializable
{
@Resource
private SessionContext sc; //FP here on "sc"
}
Like SONARJAVA-2442, as this field is injected, the field is inherently serializable.
(For @EJB or @PersistenceContext there is no issue raised)
Verified with Sonarlint for Eclipse 7.7, not connected.
I tested with SonarLint 7.9 for Eclipse (not connected) and the issue remains: The field sc is marked with java:S1948 “Make “sc” transient or serializable”.