From e7fbff7c47602a7a9df895a0006a42e847f2f3a4 Mon Sep 17 00:00:00 2001 From: gautamomento <89037104+gautamomento@users.noreply.github.com> Date: Thu, 30 Sep 2021 15:50:32 -0700 Subject: [PATCH] feat: change overloaded private method name (#48) I am attempting to pull the sdk in another gradle package and the compile fails looking for ByteString ``` /Users/gautamkanvinde/repos/client-sdk-examples/java-gradle/lib/src/main/java/momento/client/example/Library.java:11: error: cannot access ByteString CacheSetResponse resp = client.set("key", "value", 1000); ^ class file for com.google.protobuf.ByteString not found 1 error ``` I have a theory that this is due to the overloaded methods and wanted to test this out quick. --- momento-sdk/src/main/java/momento/sdk/Cache.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/momento-sdk/src/main/java/momento/sdk/Cache.java b/momento-sdk/src/main/java/momento/sdk/Cache.java index 794544bc..f3a3928e 100644 --- a/momento-sdk/src/main/java/momento/sdk/Cache.java +++ b/momento-sdk/src/main/java/momento/sdk/Cache.java @@ -167,18 +167,18 @@ public CacheGetResponse get(String key) { * @throws IOException if an error occurs opening ByteBuffer for request body. */ public CacheSetResponse set(String key, ByteBuffer value, int ttlSeconds) { - return set(convert(key), convert(value), ttlSeconds); + return sendSet(convert(key), convert(value), ttlSeconds); } public CacheSetResponse set(String key, String value, int ttlSeconds) { - return set(convert(key), convert(value), ttlSeconds); + return sendSet(convert(key), convert(value), ttlSeconds); } public CacheSetResponse set(byte[] key, byte[] value, int ttlSeconds) { - return set(convert(key), convert(value), ttlSeconds); + return sendSet(convert(key), convert(value), ttlSeconds); } - private CacheSetResponse set(ByteString key, ByteString value, int ttlSeconds) { + private CacheSetResponse sendSet(ByteString key, ByteString value, int ttlSeconds) { Optional span = buildSpan("java-sdk-set-request"); try (Scope ignored = (span.map(ImplicitContextKeyed::makeCurrent).orElse(null))) { SetResponse rsp = blockingStub.set(buildSetRequest(key, value, ttlSeconds * 1000));