Polish contribution
See gh-30710
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
@@ -239,11 +239,12 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
|
||||
|
||||
public long[] getHeartbeat() {
|
||||
String rawValue = getFirstNativeHeader(STOMP_HEARTBEAT_HEADER);
|
||||
int pos = rawValue != null ? rawValue.indexOf(',') : -1;
|
||||
int pos = (rawValue != null ? rawValue.indexOf(',') : -1);
|
||||
if (pos == -1) {
|
||||
return Arrays.copyOf(DEFAULT_HEARTBEAT, 2);
|
||||
}
|
||||
return new long[] {Long.parseLong(rawValue, 0, pos, 10), Long.parseLong(rawValue, pos + 1, rawValue.length(), 10)};
|
||||
return new long[] {Long.parseLong(rawValue, 0, pos, 10),
|
||||
Long.parseLong(rawValue, pos + 1, rawValue.length(), 10)};
|
||||
}
|
||||
|
||||
public void setAcceptVersion(String acceptVersion) {
|
||||
|
||||
@@ -280,11 +280,12 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
|
||||
@Nullable
|
||||
public long[] getHeartbeat() {
|
||||
String rawValue = getFirst(HEARTBEAT);
|
||||
int pos = rawValue != null ? rawValue.indexOf(',') : -1;
|
||||
int pos = (rawValue != null ? rawValue.indexOf(',') : -1);
|
||||
if (pos == -1) {
|
||||
return null;
|
||||
}
|
||||
return new long[] {Long.parseLong(rawValue, 0, pos, 10), Long.parseLong(rawValue, pos + 1, rawValue.length(), 10)};
|
||||
return new long[] {Long.parseLong(rawValue, 0, pos, 10),
|
||||
Long.parseLong(rawValue, pos + 1, rawValue.length(), 10)};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user