Make a property serializable when serializable implemented through inheritance

I’m using enterprise SonarQube in my project and when I run an analysis it shows the “Make “account” transient or serializable” issue while already implementing the Serializable through inheritance. I have another couple of models which follow the same approach but there is no error in there.
But when I explicitly implement the Serializable interface, the issue is no longer showing.
I raised this as a question in Stackoverflow but did not get any answers.

Necessary information,

  • Enterprise SonarQube version is 9.8.0
  • The SonarQube is deployed in a cloud sever(a long time ago, maintaining properly)
  • I need to understand why this issue pops up while it was implemented through inheritance implicitly, and like to resolve error without implementing explicitly
  • I tried following solutions,
    • Tried removing all the properties and methods from class but still got the issue
    • But when implemented the interface explicitly, issue resolved
  • Stackoverflow question - java - SonarQube - Make "account" transient or serializable - Stack Overflow

Hi,

Welcome to the community!

Can you provide a concise reproducer, and the rule id please? The rule ID will look like java:Snnnn.

 
Thx,
Ann

Can you please explain what you mean by “concise reproducer”, are you expecting the steps to reproduce this issue.
Rule ID - java:S1948

Hi,

Yes, we need the minimum of (compilable) code to reproduce the error.

 
Ann