Skip to content

Commit

Permalink
fix(java): fix packageName error for static import
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 6, 2022
1 parent e262aa0 commit 75aa5a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,11 @@ open class JavaFullIdentListener(
pkgName = imp.Source
clz = target
} else if (imp.UsageName.contains(methodName)) {
pkgName = imp.Source
clz = imp.Source.split(".").last()
val splitImp = imp.Source.split(".")
clz = splitImp.last()

val maybePackageName = splitImp.dropLast(1).joinToString(".")
pkgName = maybePackageName
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,6 @@ public class BlogRepositoryImpl {
val firstFunc = codeContainer.DataStructures[0].Functions[0]
assertEquals(firstFunc.FunctionCalls[0].FunctionName, "generateBatchInsertSql")
assertEquals(firstFunc.FunctionCalls[0].NodeName, "SqlGenerator")
assertEquals(firstFunc.FunctionCalls[0].Package, "infrastructure.utils")
}
}

0 comments on commit 75aa5a8

Please # to comment.