Skip to content

Commit 002acbc

Browse files
fix: remove duplicate _get_pom_root_cached definition and stale comments
1 parent dd3264f commit 002acbc

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

codeflash/cli_cmds/init_java.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ def detect_java_source_root(project_root: Path) -> str:
8787
if source_dir is not None and source_dir.text:
8888
return source_dir.text
8989

90-
# Fallback to src directory
91-
9290
# Fallback to src directory
9391
if (project_root / "src").is_dir():
9492
return "src"
@@ -109,8 +107,6 @@ def detect_java_test_root(project_root: Path) -> str:
109107
if test_source_dir is not None and test_source_dir.text:
110108
return test_source_dir.text
111109

112-
# Fallback patterns
113-
114110
# Fallback patterns
115111
if (project_root / "test").is_dir():
116112
return "test"
@@ -531,20 +527,6 @@ def get_java_test_command(build_tool: JavaBuildTool) -> str:
531527

532528
@lru_cache(maxsize=8)
533529
def _get_pom_root_cached(project_root: Path) -> Union[ET.Element, None]:
534-
"""Parse pom.xml once and cache the result."""
535-
pom_path = project_root / "pom.xml"
536-
if not pom_path.exists():
537-
return None
538-
try:
539-
tree = ET.parse(pom_path)
540-
return tree.getroot()
541-
except ET.ParseError:
542-
return None
543-
544-
545-
@lru_cache(maxsize=8)
546-
def _get_pom_root_cached(project_root: Path) -> Union[ET.Element, None]:
547-
"""Parse pom.xml once and cache the result."""
548530
pom_path = project_root / "pom.xml"
549531
if not pom_path.exists():
550532
return None

0 commit comments

Comments
 (0)