Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up changes for builders PR #7074

Merged
merged 2 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -72,6 +72,9 @@ public static MediaSupport create(Config config) {
* @return a new {@link JacksonSupport}
*/
public static MediaSupport create(Config config, String name) {
Objects.requireNonNull(config);
Objects.requireNonNull(name);

ObjectMapper objectMapper = new ObjectMapper()
.registerModule(new ParameterNamesModule())
.registerModule(new Jdk8Module())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package io.helidon.nima.http.media.jsonb;

import java.util.Objects;

import io.helidon.common.GenericType;
import io.helidon.common.config.Config;
import io.helidon.common.http.Headers;
Expand Down Expand Up @@ -69,6 +71,9 @@ public static MediaSupport create(Config config) {
* @see #create(io.helidon.common.config.Config)
*/
public static MediaSupport create(Config config, String name) {
Objects.requireNonNull(config);
Objects.requireNonNull(name);

return new JsonbSupport(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Objects;

import io.helidon.common.GenericType;
import io.helidon.common.http.ContentDisposition;
Expand All @@ -47,7 +48,7 @@ public class PathSupport implements MediaSupport {
* @param name name of this instance
*/
protected PathSupport(String name) {
this.name = name;
this.name = Objects.requireNonNull(name);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.Optional;

import io.helidon.common.GenericType;
Expand Down Expand Up @@ -50,7 +51,7 @@ public class StringSupport implements MediaSupport {
* @param name name of this instance
*/
protected StringSupport(String name) {
this.name = name;
this.name = Objects.requireNonNull(name);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.helidon.nima.http.media.multipart;

import java.lang.System.Logger.Level;
import java.util.Objects;
import java.util.Optional;

import io.helidon.common.GenericType;
Expand Down Expand Up @@ -48,7 +49,7 @@ public class MultiPartSupport implements MediaSupport {
private MediaContext context;

private MultiPartSupport(String name) {
this.name = name;
this.name = Objects.requireNonNull(name);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.helidon.nima.webserver;

import java.util.List;
import java.util.Objects;

import io.helidon.nima.webserver.spi.ProtocolConfig;

Expand All @@ -37,6 +38,7 @@ private ProtocolConfigs(List<ProtocolConfig> protocolConfigs) {
* @return protocol configuration handler
*/
public static ProtocolConfigs create(List<ProtocolConfig> protocolConfigs) {
Objects.requireNonNull(protocolConfigs);
return new ProtocolConfigs(protocolConfigs);
}

Expand All @@ -53,6 +55,9 @@ public static ProtocolConfigs create(List<ProtocolConfig> protocolConfigs) {
*/
public <T extends ProtocolConfig> List<T> config(String protocolType,
Class<T> protocolConfigType) {
Objects.requireNonNull(protocolType);
Objects.requireNonNull(protocolConfigType);

return protocolConfigs.stream()
.filter(it -> protocolType.equals(it.type()))
.filter(it -> protocolConfigType.isAssignableFrom(it.getClass()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ServerConfigInterceptor implements Prototype.BuilderInterceptor<ServerConf
public ServerConfig.BuilderBase<?, ?> intercept(ServerConfig.BuilderBase<?, ?> target) {
if (target.sockets().containsKey(WebServer.DEFAULT_SOCKET_NAME)) {
throw new ConfigException("Default socket must be configured directly on server config node, or through"
+ " ServerConfig.Builder, not as a separated socket.");
+ " \"ServerConfig.Builder\", not as a separated socket.");
}

return target;
Expand Down