Fix regressing caused by merged PR

This commit is contained in:
James Agnew
2019-11-26 08:48:10 -03:00
parent 06765640e2
commit dd299100bf
2 changed files with 4 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import org.hibernate.search.elasticsearch.cfg.ElasticsearchIndexStatus;
import org.hibernate.search.elasticsearch.cfg.IndexSchemaManagementStrategy; import org.hibernate.search.elasticsearch.cfg.IndexSchemaManagementStrategy;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.Arrays; import java.util.Arrays;
@@ -331,6 +332,7 @@ public class HapiProperties {
return HapiProperties.getProperty(ALLOWED_BUNDLE_TYPES, ""); return HapiProperties.getProperty(ALLOWED_BUNDLE_TYPES, "");
} }
@Nonnull
public static Set<String> getSupportedResourceTypes() { public static Set<String> getSupportedResourceTypes() {
String[] types = defaultString(getProperty("supported_resource_types")).split(","); String[] types = defaultString(getProperty("supported_resource_types")).split(",");
return Arrays.stream(types) return Arrays.stream(types)

View File

@@ -67,8 +67,8 @@ public class JpaRestfulServer extends RestfulServer {
.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT"); .getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
// Customize supported resource types // Customize supported resource types
Set<String> supportedResourceTypes = HapiProperties.getSupportedResourceTypes(); Set<String> supportedResourceTypes = HapiProperties.getSupportedResourceTypes();
if (!supportedResourceTypes.contains("SearchParameter")) { if (!supportedResourceTypes.isEmpty() && !supportedResourceTypes.contains("SearchParameter")) {
supportedResourceTypes.add("SearchParameter"); supportedResourceTypes.add("SearchParameter");
} }