Skip to content

Commit

Permalink
Ensure processor lists are unmodifiable
Browse files Browse the repository at this point in the history
Thanks @nknize!

Signed-off-by: Michael Froh <froh@amazon.com>
  • Loading branch information
msfroh committed May 22, 2023
1 parent da7baac commit faabc42
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Pipeline {

private final NamedWriteableRegistry namedWriteableRegistry;

Pipeline(
private Pipeline(
String id,
@Nullable String description,
@Nullable Integer version,
Expand All @@ -62,7 +62,7 @@ class Pipeline {
this.namedWriteableRegistry = namedWriteableRegistry;
}

public static Pipeline create(
static Pipeline create(
String id,
Map<String, Object> config,
Map<String, Processor.Factory<SearchRequestProcessor>> requestProcessorFactories,
Expand Down Expand Up @@ -111,7 +111,7 @@ private static <T extends Processor> List<T> readProcessors(
processors.add(processorFactories.get(type).create(processorFactories, tag, description, config));
}
}
return processors;
return Collections.unmodifiableList(processors);
}

String getId() {
Expand Down

0 comments on commit faabc42

Please sign in to comment.