Update django/aiservice/languages/java/testgen.py

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
Saurabh Misra 2026-02-01 12:32:40 -08:00 committed by GitHub
parent 3e769dd192
commit b691c8fdda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,11 +308,15 @@ def _validate_java_syntax(code: str) -> bool:
if "class " not in code:
return False
# Check for invalid import aliasing (Java doesn't support "import X as Y")
# Check for invalid import aliasing (Java doesn't support "import X as Y")
if re.search(r'import\s+[\w.]+\s+as\s+\w+', code):
return False
return True
return False
return True
def _has_test_functions(code: str) -> bool: