From 4eebddc818fdd2b6913ad13288b43fca7e7f8266 Mon Sep 17 00:00:00 2001 From: kento_yoshida Date: Wed, 3 Jul 2024 09:44:14 +0000 Subject: [PATCH] Refactor deleteCursor method: Change to private and reset cursorId after deletion - Changed the visibility of the deleteCursor method to private to encapsulate cursor deletion logic. - Added logic to reset cursorId to null after successfully deleting the cursor. - Ensured better encapsulation and state management within the KintoneClient class. --- src/main/java/org/embulk/input/kintone/KintoneClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/embulk/input/kintone/KintoneClient.java b/src/main/java/org/embulk/input/kintone/KintoneClient.java index 0e66058..59909a3 100644 --- a/src/main/java/org/embulk/input/kintone/KintoneClient.java +++ b/src/main/java/org/embulk/input/kintone/KintoneClient.java @@ -125,11 +125,12 @@ public void createCursor(final PluginTask task, final Schema schema) } } - public void deleteCursor() + private void deleteCursor() { if (this.cursorId != null) { try { this.recordClient.deleteCursor(this.cursorId); + this.cursorId = null; } catch (KintoneApiRuntimeException e) { this.logger.error(e.toString());