How can I make private List <T> list; or private Map<String, Value> unknownData; serializable? These are variable in my class whose parent is serializable but SonarQube is complaining about transient or Serializable change
myClass.java
public class MyClass implements Serializable {
  private static final long serialVersionUID = 0L;
  protected  List<T>  list = new ArrayList<T>();

In the class(es) declaration(s), extend the types with Serializable.
For example :
public class MyClass<T extends Serializable>{ ...
and
public class MyOtherClass<Value extends Serializable>{ ...
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With