Skip to content

Commit

Permalink
Nit: Remove unnecessary JdkSpecifics (#6729)
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy authored May 3, 2023
1 parent 3b5f987 commit 63f5230
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static java.util.Collections.singletonList;
import static org.projectnessie.nessie.relocated.protobuf.UnsafeByteOperations.unsafeWrap;
import static org.projectnessie.versioned.storage.common.indexes.StoreIndexElement.indexElement;
import static org.projectnessie.versioned.storage.common.util.JdkSpecifics.JDK_SPECIFIC;
import static org.projectnessie.versioned.storage.common.util.Ser.putVarInt;

import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -460,7 +459,7 @@ private ByteBuffer serializeKey(
ByteBuffer keyBuf = key.serialize(serializationBuffer);
int keyPos = keyBuf.position();
if (previousKey != null) {
int mismatch = JDK_SPECIFIC.mismatch(previousKey, keyBuf);
int mismatch = previousKey.mismatch(keyBuf);
checkState(mismatch != -1, "Previous and current keys must not be equal");
int strip = previousKey.remaining() - mismatch;
putVarInt(target, strip);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import static org.junit.jupiter.params.provider.Arguments.arguments;
import static org.projectnessie.versioned.storage.common.indexes.StoreKey.deserializeKey;
import static org.projectnessie.versioned.storage.common.indexes.StoreKey.key;
import static org.projectnessie.versioned.storage.common.util.JdkSpecifics.JDK_SPECIFIC;
import static org.projectnessie.versioned.storage.common.util.Util.STRING_100;
import static org.projectnessie.versioned.storage.common.util.Util.asHex;

Expand Down Expand Up @@ -235,7 +234,7 @@ private void utf8verify(char[] arr) {
bufferFromString.put((byte) 0);
bufferFromString.flip();

int mismatch = JDK_SPECIFIC.mismatch(bufferFromString, serToBufferFromString);
int mismatch = bufferFromString.mismatch(serToBufferFromString);
if (mismatch != -1) {
soft.assertThat(mismatch).describedAs("Mismatch at %d", mismatch).isEqualTo(-1);
}
Expand All @@ -244,7 +243,7 @@ private void utf8verify(char[] arr) {
ByteBuffer b2 = ByteBuffer.allocate(serToBufferFromString.capacity());
deser.serialize(b2);

mismatch = JDK_SPECIFIC.mismatch(serToBufferFromString, b2);
mismatch = serToBufferFromString.mismatch(b2);
if (mismatch != -1) {
soft.assertThat(mismatch).describedAs("Mismatch at %d", mismatch).isEqualTo(-1);
}
Expand Down

This file was deleted.

0 comments on commit 63f5230

Please sign in to comment.