Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
fix: fix lowercase issue for function name
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 30, 2022
1 parent 92f1f59 commit d31422b
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ class JavaApiAnalyser {

if (call.NodeName == "RestTemplate" && call.FunctionName != "<init>") {
var method = ""
val lowercase = functionName.lowercase()
when {
functionName.startsWith("Get") -> {
lowercase.startsWith("get") -> {
method = "Get"
}
functionName.startsWith("Post") -> {
lowercase.startsWith("post") -> {
method = "Post"
}
functionName.startsWith("Delete") -> {
lowercase.startsWith("delete") -> {
method = "Delete"
}
functionName.startsWith("Put") -> {
lowercase.startsWith("put") -> {
method = "Put"
}
}
Expand All @@ -58,11 +59,13 @@ class JavaApiAnalyser {
url = call.Parameters[0].TypeValue.removePrefix("\"").removeSuffix("\"")
}

demands = demands + ContainerDemand(
source_caller = node.NodeName,
target_url = url,
target_http_method = method
)
if (method.isNotEmpty()) {
demands = demands + ContainerDemand(
source_caller = node.NodeName,
target_url = url,
target_http_method = method
)
}
}
}
}
Expand Down

0 comments on commit d31422b

Please sign in to comment.