Skip to content

Commit 37f406c

Browse files
committed
Small touch
1 parent 627e0b8 commit 37f406c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sentry/issues/auto_source_code_config/code_mapping.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,14 +591,15 @@ def get_path_from_module(module: str, abs_path: str) -> tuple[str, str]:
591591
if "." not in module:
592592
raise DoesNotFollowJavaPackageNamingConvention
593593

594-
parts = module.split(".")
594+
# Gets rid of the class name
595+
parts = module.rsplit(".", 1)[0].split(".")
595596

596-
if len(parts) > STACK_ROOT_MAX_LEVEL:
597+
if len(parts) >= STACK_ROOT_MAX_LEVEL:
597598
# com.example.foo.bar.Baz$InnerClass, Baz.kt ->
598599
# stack_root: com/example/
599600
# file_path: com/example/foo/bar/Baz.kt
600601
stack_root = "/".join(parts[:STACK_ROOT_MAX_LEVEL])
601-
file_path = "/".join(parts[:-1]) + "/" + abs_path
602+
file_path = "/".join(parts) + "/" + abs_path
602603
else:
603604
# a.Bar, Bar.kt -> stack_root: a/, file_path: a/Bar.kt
604605
stack_root = parts[0] + "/"

0 commit comments

Comments
 (0)