Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@

package org.springframework.cloud.config.server.environment;

import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.config.server.support.EnvironmentRepositoryProperties;

/**
* @author Clay McCoy
* @author Geonwook Ham
*/
@ConfigurationProperties("spring.cloud.config.server.awss3")
public class AwsS3EnvironmentProperties implements EnvironmentRepositoryProperties {
Expand Down Expand Up @@ -48,6 +52,16 @@ public class AwsS3EnvironmentProperties implements EnvironmentRepositoryProperti

private int order = DEFAULT_ORDER;

private List<String> searchPaths = new ArrayList<>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be Collections.emptyList()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we initialized searchPaths using Collections.emptyList() to optimize memory usage and guarantee immutability by default.


public List<String> getSearchPaths() {
return searchPaths;
}

public void setSearchPaths(List<String> searchPaths) {
this.searchPaths = searchPaths;
}

public String getRegion() {
return region;
}
Expand Down
Loading