SonarQube catch 22 with serializable lists

First, I had a class line by line:

public class MyClass implements Serializable { private List<Role> roles; } 

SonarQube noted that List , a member of the serializable class, is not serializable. Fair enough, I will switch to a serializable implementation of List as an ArrayList .

 public class MyClass implements Serializable { private ArrayList<Role> roles; } 

At this point, SonarQube is unhappy that β€œroles should use an interface, such as a List, and not as an implementation of the ArrayList type, which returns me to where I was originally.

Is there a way out of this cycle?

+5
source share
1 answer

It looks like your problem was solved just two days ago.

http://jira.codehaus.org/browse/SONARJAVA-808

+2
source

All Articles