From fcf76878f08c128ccf904c0f1f496f060b6202c6 Mon Sep 17 00:00:00 2001 From: "Evgeniia.Fedotova" Date: Tue, 14 Nov 2023 11:15:20 +0100 Subject: [PATCH] fix bug with apiMethods parameter renaming (from apiCalls) --- .../org/jetbrains/research/ideFormerPlugin/server/Routing.kt | 4 ++-- .../ideFormerPlugin/server/requests/getReverseApiMethods.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/Routing.kt b/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/Routing.kt index d4d2417..94dc0a3 100644 --- a/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/Routing.kt +++ b/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/Routing.kt @@ -35,8 +35,8 @@ object IdeServerConstants { const val MISSING_FILENAME = "Missing file name" const val PROJECT_DIR_REMAINS_THE_SAME = "Project directory remains the same" const val PROJECT_DIR_WAS_CHANGED_TO = "Project directory was successfully changed to" - const val NEGATIVE_API_METHODS_CNT = "apiCallsCount parameter should be a positive integer" - const val NOT_A_NUMBER_API_METHODS_CNT = "apiCallsCount parameter should be a number" + const val NEGATIVE_API_METHODS_CNT = "apiMethodsCount parameter should be a positive integer" + const val NOT_A_NUMBER_API_METHODS_CNT = "apiMethodsCount parameter should be a number" const val API_EXECUTION_UNKNOWN_ERROR = "Unknown error while api method execution" const val INCORRECT_REQUESTED_FILE_EXTENSION = "Incorrect requested file extension: only .py, .kt, .java file can be processed" diff --git a/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/requests/getReverseApiMethods.kt b/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/requests/getReverseApiMethods.kt index 00cd1c9..cd57abc 100644 --- a/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/requests/getReverseApiMethods.kt +++ b/ide-former-plugin/ide-server/src/main/kotlin/org/jetbrains/research/ideFormerPlugin/server/requests/getReverseApiMethods.kt @@ -12,7 +12,7 @@ fun Routing.getReverseApiMethods(logger: Logger, ideStateKeeper: IdeStateKeeper) get("/reverse-api-methods/{apiMethodsCount?}") { val apiMethodsCountString = call.parameters["apiMethodsCount"] - val reversedApiCallsCount = if (apiMethodsCountString != null) { + val reversedApiMethodsCount = if (apiMethodsCountString != null) { val apiMethodsCount = apiMethodsCountString.toIntOrNull() ?: run { logger.error("Not a number api methods count parameter for reverse api method request") call.respondJson( @@ -38,7 +38,7 @@ fun Routing.getReverseApiMethods(logger: Logger, ideStateKeeper: IdeStateKeeper) ideStateKeeper.reverseLastApiMethods() } - call.respondJson("Last $reversedApiCallsCount api method(-s) was(were) reversed") + call.respondJson("Last $reversedApiMethodsCount api method(-s) was(were) reversed") logger.info("Server GET reverse api methods request is processed") } } \ No newline at end of file