Skip to content

Fix typo in DELIMITER constant #2158

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

Closed
wants to merge 1 commit into from
Closed
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 @@ -1214,13 +1214,14 @@ public int compareTo(Part that) {
* {@literal keyspace:id}.
*
* @author Mark Paluch
* @author Stefan Berger
* @since 1.8.10
*/
public static class KeyspaceIdentifier {

public static final String PHANTOM = "phantom";
public static final String DELIMITTER = ":";
public static final String PHANTOM_SUFFIX = DELIMITTER + PHANTOM;
public static final String DELIMITER = ":";
public static final String PHANTOM_SUFFIX = DELIMITER + PHANTOM;

private final String keyspace;
private final String id;
Expand All @@ -1244,7 +1245,7 @@ public static KeyspaceIdentifier of(String key) {
Assert.isTrue(isValid(key), String.format("Invalid key %s", key));

boolean phantomKey = key.endsWith(PHANTOM_SUFFIX);
int keyspaceEndIndex = key.indexOf(DELIMITTER);
int keyspaceEndIndex = key.indexOf(DELIMITER);
String keyspace = key.substring(0, keyspaceEndIndex);
String id;

Expand All @@ -1270,7 +1271,7 @@ public static boolean isValid(@Nullable String key) {
return false;
}

int keyspaceEndIndex = key.indexOf(DELIMITTER);
int keyspaceEndIndex = key.indexOf(DELIMITER);

return keyspaceEndIndex > 0 && key.length() > keyspaceEndIndex;
}
Expand All @@ -1293,13 +1294,14 @@ public boolean isPhantomKey() {
* {@literal keyspace:id}.
*
* @author Mark Paluch
* @author Stefan Berger
* @since 1.8.10
*/
public static class BinaryKeyspaceIdentifier {

public static final byte[] PHANTOM = KeyspaceIdentifier.PHANTOM.getBytes();
public static final byte DELIMITTER = ':';
public static final byte[] PHANTOM_SUFFIX = ByteUtils.concat(new byte[] { DELIMITTER }, PHANTOM);
public static final byte DELIMITER = ':';
public static final byte[] PHANTOM_SUFFIX = ByteUtils.concat(new byte[] { DELIMITER }, PHANTOM);

private final byte[] keyspace;
private final byte[] id;
Expand All @@ -1324,7 +1326,7 @@ public static BinaryKeyspaceIdentifier of(byte[] key) {

boolean phantomKey = ByteUtils.startsWith(key, PHANTOM_SUFFIX, key.length - PHANTOM_SUFFIX.length);

int keyspaceEndIndex = ByteUtils.indexOf(key, DELIMITTER);
int keyspaceEndIndex = ByteUtils.indexOf(key, DELIMITER);
byte[] keyspace = extractKeyspace(key, keyspaceEndIndex);
byte[] id = extractId(key, phantomKey, keyspaceEndIndex);

Expand All @@ -1344,7 +1346,7 @@ public static boolean isValid(byte[] key) {
return false;
}

int keyspaceEndIndex = ByteUtils.indexOf(key, DELIMITTER);
int keyspaceEndIndex = ByteUtils.indexOf(key, DELIMITER);

return keyspaceEndIndex > 0 && key.length > keyspaceEndIndex;
}
Expand Down