mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
# Pull Request Checklist ## Description - [ ] **Breaking Changes**: Document any breaking changes (if applicable) - [ ] **Description of PR**: Clear and concise description of what this PR accomplishes - [ ] **Related Issues**: Link to any related issues or tickets ## Testing - [ ] **Test cases Attached**: All relevant test cases have been added/updated - [ ] **Manual Testing**: Manual testing completed for the changes ## Monitoring & Debugging - [ ] **Logging in place**: Appropriate logging has been added for debugging user issues - [ ] **Sentry will be able to catch errors**: Error handling ensures Sentry can capture and report errors - [ ] **Avoid Dev based/Prisma logging**: No development-only or Prisma-specific logging in production code ## Configuration - [ ] **Env variables newly added**: Any new environment variables are documented in .env.example file or mentioned in description --- ## Additional Notes <!-- Add any additional context, screenshots, or notes for reviewers here --> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: HeshamHM28 <HeshamMohamedFathy@outlook.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-39-200.ec2.internal> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Kevin Turcios <turcioskevinr@gmail.com> Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
42 lines
1.4 KiB
Python
42 lines
1.4 KiB
Python
"""Java language handler implementation.
|
|
|
|
Thin delegation layer that routes requests to the actual module implementations.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from core.languages.java.optimizer import optimize_java
|
|
from core.languages.java.testgen import testgen_java
|
|
|
|
if TYPE_CHECKING:
|
|
from authapp.auth import AuthenticatedRequest
|
|
from core.shared.optimizer_models import OptimizeSchema
|
|
from core.shared.optimizer_schemas import OptimizeErrorResponseSchema, OptimizeResponseSchema
|
|
from core.shared.testgen_models import TestGenErrorResponseSchema, TestGenResponseSchema, TestGenSchema
|
|
|
|
|
|
class JavaHandler:
|
|
"""Java language handler."""
|
|
|
|
language = "java"
|
|
|
|
supports_testgen = True
|
|
supports_optimizer = True
|
|
supports_code_repair = False
|
|
supports_jit_rewrite = False
|
|
supports_optimization_review = False
|
|
supports_explanations = False
|
|
|
|
async def testgen_generate(
|
|
self, request: AuthenticatedRequest, data: TestGenSchema
|
|
) -> tuple[int, TestGenResponseSchema | TestGenErrorResponseSchema]:
|
|
"""Generate tests for Java code."""
|
|
return await testgen_java(request, data)
|
|
|
|
async def optimizer_optimize(
|
|
self, request: AuthenticatedRequest, data: OptimizeSchema
|
|
) -> tuple[int, OptimizeResponseSchema | OptimizeErrorResponseSchema]:
|
|
"""Optimize Java code for performance."""
|
|
return await optimize_java(request, data)
|