Skip to content

Commit

Permalink
Use <> operator where appropriate now minimum Java version is Java 8
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Thomas <markt@apache.org>
  • Loading branch information
markt-asf committed May 7, 2020
1 parent be98529 commit 363c757
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
* Copyright (c) 2018, 2020 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -167,7 +167,7 @@ public ClientEndpointConfig.Builder configurator(ClientEndpointConfig.Configurat
* @return the builder instance
*/
public ClientEndpointConfig.Builder preferredSubprotocols(List<String> preferredSubprotocols) {
this.preferredSubprotocols = (preferredSubprotocols == null) ? new ArrayList<String>()
this.preferredSubprotocols = (preferredSubprotocols == null) ? new ArrayList<>()
: preferredSubprotocols;
return this;
}
Expand All @@ -180,7 +180,7 @@ public ClientEndpointConfig.Builder preferredSubprotocols(List<String> preferred
* @return the builder instance
*/
public ClientEndpointConfig.Builder extensions(List<Extension> extensions) {
this.extensions = (extensions == null) ? new ArrayList<Extension>() : extensions;
this.extensions = (extensions == null) ? new ArrayList<>() : extensions;
return this;
}

Expand All @@ -191,7 +191,7 @@ public ClientEndpointConfig.Builder extensions(List<Extension> extensions) {
* @return the builder instance
*/
public ClientEndpointConfig.Builder encoders(List<Class<? extends Encoder>> encoders) {
this.encoders = (encoders == null) ? new ArrayList<Class<? extends Encoder>>() : encoders;
this.encoders = (encoders == null) ? new ArrayList<>() : encoders;
return this;
}

Expand All @@ -202,7 +202,7 @@ public ClientEndpointConfig.Builder encoders(List<Class<? extends Encoder>> enco
* @return this builder instance
*/
public ClientEndpointConfig.Builder decoders(List<Class<? extends Decoder>> decoders) {
this.decoders = (decoders == null) ? new ArrayList<Class<? extends Decoder>>() : decoders;
this.decoders = (decoders == null) ? new ArrayList<>() : decoders;
return this;
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
* Copyright (c) 2018, 2020 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -32,7 +32,7 @@ final class DefaultClientEndpointConfig implements ClientEndpointConfig {
private List<Extension> extensions;
private List<Class<? extends Encoder>> encoders;
private List<Class<? extends Decoder>> decoders;
private Map<String, Object> userProperties = new HashMap<String, Object>();
private Map<String, Object> userProperties = new HashMap<>();
private ClientEndpointConfig.Configurator clientEndpointConfigurator;

DefaultClientEndpointConfig(List<String> preferredSubprotocols, List<Extension> extensions,
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
* Copyright (c) 2018, 2020 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -40,7 +40,7 @@ final class DefaultServerEndpointConfig implements ServerEndpointConfig {
private List<Extension> extensions;
private List<Class<? extends Encoder>> encoders;
private List<Class<? extends Decoder>> decoders;
private Map<String, Object> userProperties = new HashMap<String, Object>();
private Map<String, Object> userProperties = new HashMap<>();
private ServerEndpointConfig.Configurator serverEndpointConfigurator;

// The builder ensures nothing except configurator can be {@code null}.
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019 Oracle and/or its affiliates and others.
* Copyright (c) 2018, 2020 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -281,7 +281,7 @@ private Builder(Class<?> endpointClass, String path) {
* @return this builder instance
*/
public ServerEndpointConfig.Builder encoders(List<Class<? extends Encoder>> encoders) {
this.encoders = (encoders == null) ? new ArrayList<Class<? extends Encoder>>() : encoders;
this.encoders = (encoders == null) ? new ArrayList<>() : encoders;
return this;
}

Expand All @@ -292,7 +292,7 @@ public ServerEndpointConfig.Builder encoders(List<Class<? extends Encoder>> enco
* @return this builder instance.
*/
public ServerEndpointConfig.Builder decoders(List<Class<? extends Decoder>> decoders) {
this.decoders = (decoders == null) ? new ArrayList<Class<? extends Decoder>>() : decoders;
this.decoders = (decoders == null) ? new ArrayList<>() : decoders;
return this;
}

Expand All @@ -303,7 +303,7 @@ public ServerEndpointConfig.Builder decoders(List<Class<? extends Decoder>> deco
* @return this builder instance
*/
public ServerEndpointConfig.Builder subprotocols(List<String> subprotocols) {
this.subprotocols = (subprotocols == null) ? new ArrayList<String>() : subprotocols;
this.subprotocols = (subprotocols == null) ? new ArrayList<>() : subprotocols;
return this;
}

Expand All @@ -314,7 +314,7 @@ public ServerEndpointConfig.Builder subprotocols(List<String> subprotocols) {
* @return this builder instance.
*/
public ServerEndpointConfig.Builder extensions(List<Extension> extensions) {
this.extensions = (extensions == null) ? new ArrayList<Extension>() : extensions;
this.extensions = (extensions == null) ? new ArrayList<>() : extensions;
return this;
}

Expand Down

0 comments on commit 363c757

Please sign in to comment.