Skip to content

Commit

Permalink
Merge pull request #760 from seadowg/fix-immutable
Browse files Browse the repository at this point in the history
Fix immutable list operation
  • Loading branch information
seadowg authored Apr 26, 2024
2 parents 8908e4a + ac472aa commit 3f579c4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static java.util.Arrays.asList;

Expand Down Expand Up @@ -56,7 +58,10 @@ public void addProcessor(Processor processor) {
* (via {@link FileInstanceParser#isSupported(String, String)}) first.
*/
public void addFileInstanceParser(FileInstanceParser fileInstanceParser) {
fileInstanceParsers.add(0, fileInstanceParser);
fileInstanceParsers = Stream.concat(
Stream.of(fileInstanceParser),
fileInstanceParsers.stream()
).collect(Collectors.toList());
}

/**
Expand Down

0 comments on commit 3f579c4

Please sign in to comment.