I am being pulled up by Sonar due to the following line of code:
public void setFileNames(LinkedHashSet<String> fileNames) {
With the error message:
Avoid using implementation types like 'LinkedHashSet'; use the interface instead
What is the way around this when I want to represent a non-sorted Set
which keeps its insertion order? Do I just use a Set
and make it clear that the iteration order will be kept?
The stored data will be serialized using JaxB and the iteration order is essential after deserialization.
(I am aware of and completely understand this)