Consistent use of StringUtils.hasLength(String) vs isEmpty(Object)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -420,7 +420,7 @@ public class SubProtocolWebSocketHandler
|
||||
}
|
||||
|
||||
SubProtocolHandler handler;
|
||||
if (!StringUtils.isEmpty(protocol)) {
|
||||
if (StringUtils.hasLength(protocol)) {
|
||||
handler = this.protocolHandlerLookup.get(protocol);
|
||||
if (handler == null) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -118,7 +118,7 @@ public abstract class AbstractHttpSendingTransportHandler extends AbstractTransp
|
||||
String query = request.getURI().getQuery();
|
||||
MultiValueMap<String, String> params = UriComponentsBuilder.newInstance().query(query).build().getQueryParams();
|
||||
String value = params.getFirst("c");
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
if (!StringUtils.hasLength(value)) {
|
||||
return null;
|
||||
}
|
||||
String result = UriUtils.decode(value, StandardCharsets.UTF_8);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -179,7 +179,7 @@ public class WebSocketServerSockJsSession extends AbstractSockJsSession implemen
|
||||
|
||||
public void handleMessage(TextMessage message, WebSocketSession wsSession) throws Exception {
|
||||
String payload = message.getPayload();
|
||||
if (StringUtils.isEmpty(payload)) {
|
||||
if (!StringUtils.hasLength(payload)) {
|
||||
return;
|
||||
}
|
||||
String[] messages;
|
||||
|
||||
Reference in New Issue
Block a user