Skip to content

Core - #24

Closed
e4c5 wants to merge 21 commits into
masterfrom
core
Closed

Core#24
e4c5 wants to merge 21 commits into
masterfrom
core

Conversation

@e4c5

@e4c5 e4c5 commented Mar 28, 2026 •

Copy link
Copy Markdown
Owner

CodeAnt-AI Description

Split test-generation concerns out of the core library and improve evaluation fallbacks

What Changed

  • Moved test-generation coordination out of the core module and into a shared interface and state holder, so the core now hands off test creation without depending on concrete generator classes.
  • Repository and optional-return paths now handle both empty and populated results more reliably, including first-pass null cases and follow-up non-null stubs.
  • Mocking now falls back more safely when a real mock or evaluator cannot be built, reducing broken generated scenarios for hard-to-load types.
  • Enum values and Lombok-style setters are handled more safely during evaluation, and missing field metadata is logged more clearly instead of being silently ignored.
  • Truth-table handling now treats missing values consistently in boolean expressions.
  • Documentation and package metadata were updated to match the new core/test-generator split and current versions.

Impact

✅ Fewer broken generated tests for repositories
✅ Better handling of enums and Lombok accessors
✅ Clearer core module boundaries and setup docs

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Documentation
    • Rebranded to a core Java code-processing library, updated Quick Start to Java 21+, expanded configuration/specs, added companion modules, and removed standalone unit-test generation docs and diagrams.
  • New Features
    • Added a pluggable test-generation contract and centralized generator state to enable external generators.
  • Refactor
    • Delegated test-generation to companion modules and adjusted evaluator integrations.
  • Removal
    • Removed the built-in CLI/test-generator and associated generators and tests.
  • Chores
    • Bumped project version to 0.1.3.4; upgraded hql-parser dependency.

@codeant-ai

codeant-ai Bot commented Mar 28, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Mar 28, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR extracts in-core test-generation into a companion module, introduces GeneratorState and ITestGenerator to decouple evaluators from generators, updates evaluator/mock behaviors (Optional/repository, Mockito fallbacks), and removes legacy CLI/generator/asserter/parser implementations and many related tests and docs.

Changes

Cohort / File(s) Summary
Documentation & Config
AGENTS.md, PACKAGE.md, README.md, docs/configurations.md, docs/unit-test-generation-sequence.*
Rewrote docs to re-scope as "Antikythera Core", updated Java → 21, added companion modules, expanded configuration schema, and removed unit-test-generation sequence docs.
Build
pom.xml
Bumped project version 0.1.3.3 → 0.1.3.4 and upgraded com.raditha:hql-parser 1.0.0 → 1.0.3.
New core abstractions
src/main/java/.../evaluator/GeneratorState.java, src/main/java/.../evaluator/ITestGenerator.java
Added centralized static state for imports/when-then and an interface to decouple test-generator implementations.
Evaluator & mocking changes
src/main/java/.../evaluator/* (many files: SpringEvaluator.java, MockingEvaluator.java, DummyArgumentGenerator.java, MockingRegistry.java, MockReturnValueHandler.java, Evaluator.java, ArgumentGenerator.java, ControlFlowEvaluator.java, Reflect.java, Branching.java, BinaryOps.java, TruthTable.java)
Replaced TestGenerator static APIs with GeneratorState, introduced Mockito fallbacks and enum handling, improved Optional/repository result handling and branching, adjusted reflective/Lombok guards and logging, added Branching.registerBranch, and minor operator/format fixes.
Generator & parser removals
src/main/java/.../generator/*, src/main/java/.../parser/* (removed: Antikythera.java, TestGenerator.java, UnitTestGenerator.java, SpringTestGenerator.java, Factory.java, Asserter.java, JunitAsserter.java, TestNgAsserter.java, ControllerRequest.java, RestControllerParser.java, ServicesParser.java)
Deleted core test-generation orchestration, abstract and concrete generators, asserters, factory, controller helpers and parsers; responsibilities moved to companion module.
Tests removed
src/test/java/.../* (many test files listed in diff)
Removed numerous unit/integration tests tied to in-core generators, asserters, parsers, and evaluator behaviors. Review for test gaps required.
Minor/format edits
src/main/java/.../generator/QueryType.java, src/main/java/.../evaluator/BinaryOps.java
Tiny formatting/file-termination fixes.

Sequence Diagram(s)

sequenceDiagram
    participant SpringEvaluator as SpringEvaluator
    participant ITestGenerator as ITestGenerator[]
    participant GeneratorState as GeneratorState
    participant Filesystem as Filesystem
    participant Repository as Repository/DB

    SpringEvaluator->>Repository: evaluate repository call (may return row / no row)
    alt repository returns Optional-like result
        SpringEvaluator->>SpringEvaluator: branch and build Optional (of/empty)
    end
    SpringEvaluator->>GeneratorState: add imports / register when-then
    SpringEvaluator->>ITestGenerator: createTests(callable, MethodResponse)
    ITestGenerator-->>GeneratorState: read when-then & imports (collect)
    ITestGenerator->>GeneratorState: add imports / add when-then (during generation)
    ITestGenerator->>Filesystem: save() (persist generated artifacts)
    Filesystem-->>ITestGenerator: ack
    GeneratorState->>SpringEvaluator: shared state remains accessible
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

  • Bertie #8 — touches evaluator ↔ generator integration and shared when-then/import handling; likely overlaps with ITestGenerator/GeneratorState refactor.

Poem

🐰 I hopped through code with nimble feet,

Core trimmed clean, responsibilities meet,
Generators now rest in a new nest,
When-then and imports find a common chest,
A tiny burrow, tidy and sweet.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title "Core" is vague and does not convey meaningful information about the changeset. It uses a generic term without describing the actual changes made. Use a more descriptive title that summarizes the main change, such as 'Extract test generation into ITestGenerator interface and refactor core evaluation' or 'Separate test generation from core library logic'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch core

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Mar 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pom.xml (1)

124-130: ⚠️ Potential issue | 🔴 Critical

The specified hql-parser version 1.0.3 does not exist; downgrade to the latest available version 1.0.0.

The pom.xml specifies hql-parser version 1.0.3, but the official GitHub repository (e4c5/hql-parser) and Maven Central only have v1.0.0 available (released 2026-03-13). This will cause a build failure as the dependency cannot be resolved. Update the dependency version to 1.0.0:

Dependency fix
        <!-- HQL/JPQL Parser with ANTLR4 -->
        <dependency>
            <groupId>com.raditha</groupId>
            <artifactId>hql-parser</artifactId>
            <version>1.0.0</version>
            <scope>compile</scope>
        </dependency>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pom.xml` around lines 124 - 130, The pom declares a non-existent dependency
version for com.raditha:hql-parser (artifactId hql-parser) at version 1.0.3
which will fail resolution; update the <version> for the dependency with groupId
"com.raditha" and artifactId "hql-parser" to the available release "1.0.0" so
Maven can resolve the artifact during build.
🧹 Nitpick comments (8)
src/main/java/sa/com/cloudsolutions/antikythera/generator/TruthTable.java (1)

690-699: Extract shared logical-operand normalization to avoid drift.

AND and OR now duplicate the same null/Integer coercion flow. A small helper will keep semantics aligned and reduce future regressions.

♻️ Proposed refactor
+    private static Object normalizeLogicalOperand(Object operand) {
+        if (operand instanceof Integer i) {
+            return i != 0;
+        }
+        return operand;
+    }
+
     private Object evaluateBinaryExpression(BinaryExpr binaryExpr, Map<Expression, Object> truthValues) {
         var leftExpr = binaryExpr.getLeft();
         var rightExpr = binaryExpr.getRight();
         Object left = evaluateCondition(leftExpr, truthValues);
         Object right = evaluateCondition(rightExpr, truthValues);

         return switch (binaryExpr.getOperator()) {
             case AND -> {
                 if (left == null || right == null) yield null;
-                if (left instanceof Integer l) {
-                    left = l != 0;
-                }
-                if (right instanceof Integer r) {
-                    right = r != 0;
-                }
+                left = normalizeLogicalOperand(left);
+                right = normalizeLogicalOperand(right);
                 yield ((Boolean) left) && (Boolean) right;
             }
             case OR -> {
                 if (left == null || right == null) yield null;
-                if (left instanceof Integer l) {
-                    left = l != 0;
-                }
-                if (right instanceof Integer r) {
-                    right = r != 0;
-                }
+                left = normalizeLogicalOperand(left);
+                right = normalizeLogicalOperand(right);
                 yield ((Boolean) left) || (Boolean) right;
             }

Also applies to: 701-709

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/sa/com/cloudsolutions/antikythera/generator/TruthTable.java`
around lines 690 - 699, The AND/OR branches in TruthTable (case AND and case OR)
duplicate null checks and Integer→Boolean coercion; extract a small helper
(e.g., coerceToBoolean(Object) returning Boolean or null, or
normalizeOperands(Object left, Object right) that returns a pair/array) and use
it from both branches to perform the null check and Integer-to-Boolean
conversion before evaluating ((Boolean)left) && ((Boolean)right) or
((Boolean)left) || ((Boolean)right); update the switch cases to call the helper
and yield the boolean result or null as appropriate so semantics are identical
and centralized.
src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockReturnValueHandler.java (1)

37-42: Consider catching specific exception type instead of broad Exception.

The try/catch prevents failures from propagating, which is appropriate for fallback behavior. However, catching Exception could mask unexpected errors (e.g., OutOfMemoryError won't be caught, but RuntimeException subtypes will be silently swallowed). Consider catching AntikytheraException specifically, which is what EvaluatorFactory.create throws according to the context snippets.

♻️ Proposed fix
+import sa.com.cloudsolutions.antikythera.exception.AntikytheraException;
...
         if (AntikytheraRunTime.getCompilationUnit(clsName) != null) {
             try {
                 result = EvaluatorFactory.create(clsName, Evaluator.class);
-            } catch (Exception e) {
+            } catch (AntikytheraException e) {
                 logger.debug("EvaluatorFactory failed for {}, falling back to default/mock", clsName, e);
             }
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockReturnValueHandler.java`
around lines 37 - 42, Replace the broad catch(Exception) in
MockReturnValueHandler around the call to EvaluatorFactory.create(clsName,
Evaluator.class) with a catch for the specific checked exception thrown by the
factory (AntikytheraException) so only expected creation failures are swallowed
for fallback; update the catch signature to catch(AntikytheraException e), keep
the existing logger.debug(...) behavior, and add any necessary import for
AntikytheraException so unexpected RuntimeExceptions still propagate.
src/main/java/sa/com/cloudsolutions/antikythera/evaluator/GeneratorState.java (2)

16-18: Static mutable state is not thread-safe.

The static collections whenThen and imports lack synchronization. If Antikythera is ever used in a multi-threaded context (e.g., parallel test generation), concurrent modifications could cause ConcurrentModificationException or data corruption. If single-threaded use is guaranteed by design, document this constraint; otherwise, consider using Collections.synchronizedList/synchronizedSet or thread-local storage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/GeneratorState.java`
around lines 16 - 18, GeneratorState currently holds mutable static collections
whenThen and imports which are not thread-safe; update GeneratorState to either
(a) replace the static List<Expression> whenThen and Set<ImportDeclaration>
imports with thread-safe equivalents using
Collections.synchronizedList/newCopyOnWriteArrayList and
Collections.synchronizedSet/CopyOnWriteArraySet, or (b) convert them to
ThreadLocal instances so each thread gets its own collections, or (c) remove
static scope and make them instance fields managed by the caller; pick one
approach, update usages of whenThen and imports accordingly (methods referencing
GeneratorState.whenThen or GeneratorState.imports), and add a brief Javadoc note
documenting the thread-safety guarantee chosen.

30-32: Mutable collection returned directly; consider defensive copy or unmodifiable view.

getWhenThen() returns the internal List<Expression> directly, allowing callers to modify the shared state unexpectedly. This can lead to subtle bugs if a caller clears or modifies the list.

♻️ Proposed fix
 public static List<Expression> getWhenThen() {
-    return whenThen;
+    return Collections.unmodifiableList(whenThen);
 }

Add import java.util.Collections; at the top. Apply the same pattern to getImports():

 public static Set<ImportDeclaration> getImports() {
-    return imports;
+    return Collections.unmodifiableSet(imports);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/GeneratorState.java`
around lines 30 - 32, getWhenThen() currently returns the internal mutable List
whenThen, exposing shared state; change it to return an unmodifiable view (e.g.,
wrap whenThen with Collections.unmodifiableList) or a defensive copy so callers
cannot mutate the internal list, and apply the same treatment to getImports();
update imports to include java.util.Collections if using unmodifiableList and
ensure method signatures remain the same.
src/main/java/sa/com/cloudsolutions/antikythera/evaluator/ControlFlowEvaluator.java (1)

34-34: Redundant import within the same package.

GeneratorState is in the same package (sa.com.cloudsolutions.antikythera.evaluator), so this import is unnecessary.

🧹 Suggested fix
-import sa.com.cloudsolutions.antikythera.evaluator.GeneratorState;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/ControlFlowEvaluator.java`
at line 34, Remove the redundant import of GeneratorState from the top of
ControlFlowEvaluator.java (the explicit import line "import
sa.com.cloudsolutions.antikythera.evaluator.GeneratorState;") since
GeneratorState is in the same package; simply delete that import statement and
ensure the class ControlFlowEvaluator still compiles (no other changes needed).
src/main/java/sa/com/cloudsolutions/antikythera/evaluator/mock/MockingRegistry.java (1)

352-352: Default String value changed from descriptive to numeric.

The default mock String was changed from "Ibuprofen" to "0". While "0" is shorter, a descriptive string like "test" or the previous value makes it easier to trace mock data in tests and logs.

If this was intentional for consistency with other numeric defaults, consider using "test" or similar for better traceability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/mock/MockingRegistry.java`
at line 352, In MockingRegistry update the String default in the switch branch
handling "String" and "java.lang.String" (the case that constructs a new
StringLiteralExpr) to use a descriptive default (e.g., "test" or the previous
"Ibuprofen") instead of "0"; locate the case that currently returns new
StringLiteralExpr("0") and change the literal value to a readable string to
improve traceability in tests and logs.
PACKAGE.md (1)

101-102: Relative link may not resolve correctly for package consumers.

The note references the companion module but doesn't include a link. Consumers viewing this on GitHub Packages may not know where to find it. Consider adding a full GitHub URL.

📝 Suggested improvement
 > The test generation CLI (`Antikythera`) and concrete generators (`TestGenerator`, `UnitTestGenerator`,
-> `SpringTestGenerator`) live in the companion module `antikythera-test-generator`.
+> `SpringTestGenerator`) live in the companion module [`antikythera-test-generator`](https://github.com/Cloud-Solutions-International/antikythera-test-generator).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@PACKAGE.md` around lines 101 - 102, Update the PACKAGE.md sentence
referencing the companion module so the module name is a clickable full GitHub
URL; replace or augment the plain text "antikythera-test-generator" with a
complete repository or package URL (e.g.,
https://github.com/<org>/antikythera-test-generator) and ensure the CLI and
generator names (Antikythera, TestGenerator, UnitTestGenerator,
SpringTestGenerator) remain mentioned for context so consumers viewing GitHub
Packages can navigate directly to the companion module.
src/main/java/sa/com/cloudsolutions/antikythera/evaluator/DummyArgumentGenerator.java (1)

77-86: Sentinel value new Object() may cause unexpected behavior.

Using new Object() as a sentinel allows traversing null-checks, but downstream code expecting a specific type may throw ClassCastException when accessing the value. Consider whether this trade-off is acceptable, or document the limitation.

The initializer correctly uses Mockito.mock() for code generation, so the generated test will work properly. The sentinel is only for evaluation-time branching.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/DummyArgumentGenerator.java`
around lines 77 - 86, The sentinel currently created as new Object() can cause
ClassCastException at evaluation time; instead produce a type-compatible
sentinel by creating a mock instance of the target type so the runtime value
matches the declared type. In DummyArgumentGenerator, replace the new Object()
passed to new Variable(...) with a mock instance of the class represented by
typeName (use the same MockingRegistry.MOCKITO + ClassOrInterfaceType/typeName
approach used for the initializer), keeping mockVar, Variable, MethodCallExpr
and the existing initializer logic intact so both the evaluation sentinel and
the generated code use a mock of the correct type.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 60-61: The two relative links in the README (the link text
"antikythera-test-generator" and "antikythera-examples") use inconsistent or
incorrect relative paths; update both link targets so they point to the actual
README or directory location (for example replace
"../antikythera-test-generator/README.md" with the correct relative path to that
package's README and ensure "../antikythera-examples/" points to the intended
directory or README file), keeping the visible link text unchanged and verifying
the links render correctly on GitHub.
- Around line 8-10: The relative link "../antikythera-test-generator/README.md"
in README.md won't resolve on GitHub; update the markdown link (the text
containing "../antikythera-test-generator/README.md") to a GitHub-friendly URL
by replacing the relative path with either the absolute GitHub repository README
URL (e.g.,
https://github.com/<org>/antikythera-test-generator/blob/main/README.md) or a
full HTTPS link to the package's documentation site so the link works when
viewed on GitHub.

---

Outside diff comments:
In `@pom.xml`:
- Around line 124-130: The pom declares a non-existent dependency version for
com.raditha:hql-parser (artifactId hql-parser) at version 1.0.3 which will fail
resolution; update the <version> for the dependency with groupId "com.raditha"
and artifactId "hql-parser" to the available release "1.0.0" so Maven can
resolve the artifact during build.

---

Nitpick comments:
In `@PACKAGE.md`:
- Around line 101-102: Update the PACKAGE.md sentence referencing the companion
module so the module name is a clickable full GitHub URL; replace or augment the
plain text "antikythera-test-generator" with a complete repository or package
URL (e.g., https://github.com/<org>/antikythera-test-generator) and ensure the
CLI and generator names (Antikythera, TestGenerator, UnitTestGenerator,
SpringTestGenerator) remain mentioned for context so consumers viewing GitHub
Packages can navigate directly to the companion module.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/ControlFlowEvaluator.java`:
- Line 34: Remove the redundant import of GeneratorState from the top of
ControlFlowEvaluator.java (the explicit import line "import
sa.com.cloudsolutions.antikythera.evaluator.GeneratorState;") since
GeneratorState is in the same package; simply delete that import statement and
ensure the class ControlFlowEvaluator still compiles (no other changes needed).

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/DummyArgumentGenerator.java`:
- Around line 77-86: The sentinel currently created as new Object() can cause
ClassCastException at evaluation time; instead produce a type-compatible
sentinel by creating a mock instance of the target type so the runtime value
matches the declared type. In DummyArgumentGenerator, replace the new Object()
passed to new Variable(...) with a mock instance of the class represented by
typeName (use the same MockingRegistry.MOCKITO + ClassOrInterfaceType/typeName
approach used for the initializer), keeping mockVar, Variable, MethodCallExpr
and the existing initializer logic intact so both the evaluation sentinel and
the generated code use a mock of the correct type.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/GeneratorState.java`:
- Around line 16-18: GeneratorState currently holds mutable static collections
whenThen and imports which are not thread-safe; update GeneratorState to either
(a) replace the static List<Expression> whenThen and Set<ImportDeclaration>
imports with thread-safe equivalents using
Collections.synchronizedList/newCopyOnWriteArrayList and
Collections.synchronizedSet/CopyOnWriteArraySet, or (b) convert them to
ThreadLocal instances so each thread gets its own collections, or (c) remove
static scope and make them instance fields managed by the caller; pick one
approach, update usages of whenThen and imports accordingly (methods referencing
GeneratorState.whenThen or GeneratorState.imports), and add a brief Javadoc note
documenting the thread-safety guarantee chosen.
- Around line 30-32: getWhenThen() currently returns the internal mutable List
whenThen, exposing shared state; change it to return an unmodifiable view (e.g.,
wrap whenThen with Collections.unmodifiableList) or a defensive copy so callers
cannot mutate the internal list, and apply the same treatment to getImports();
update imports to include java.util.Collections if using unmodifiableList and
ensure method signatures remain the same.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/mock/MockingRegistry.java`:
- Line 352: In MockingRegistry update the String default in the switch branch
handling "String" and "java.lang.String" (the case that constructs a new
StringLiteralExpr) to use a descriptive default (e.g., "test" or the previous
"Ibuprofen") instead of "0"; locate the case that currently returns new
StringLiteralExpr("0") and change the literal value to a readable string to
improve traceability in tests and logs.

In
`@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockReturnValueHandler.java`:
- Around line 37-42: Replace the broad catch(Exception) in
MockReturnValueHandler around the call to EvaluatorFactory.create(clsName,
Evaluator.class) with a catch for the specific checked exception thrown by the
factory (AntikytheraException) so only expected creation failures are swallowed
for fallback; update the catch signature to catch(AntikytheraException e), keep
the existing logger.debug(...) behavior, and add any necessary import for
AntikytheraException so unexpected RuntimeExceptions still propagate.

In `@src/main/java/sa/com/cloudsolutions/antikythera/generator/TruthTable.java`:
- Around line 690-699: The AND/OR branches in TruthTable (case AND and case OR)
duplicate null checks and Integer→Boolean coercion; extract a small helper
(e.g., coerceToBoolean(Object) returning Boolean or null, or
normalizeOperands(Object left, Object right) that returns a pair/array) and use
it from both branches to perform the null check and Integer-to-Boolean
conversion before evaluating ((Boolean)left) && ((Boolean)right) or
((Boolean)left) || ((Boolean)right); update the switch cases to call the helper
and yield the boolean result or null as appropriate so semantics are identical
and centralized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be7c835e-8c8c-48fa-9c5a-4d0528420357

📥 Commits

Reviewing files that changed from the base of the PR and between d41815c and 0327858.

📒 Files selected for processing (48)
  • AGENTS.md
  • PACKAGE.md
  • README.md
  • docs/configurations.md
  • docs/unit-test-generation-sequence.html
  • docs/unit-test-generation-sequence.md
  • pom.xml
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/ArgumentGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/BinaryOps.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Branching.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/ControlFlowEvaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/DummyArgumentGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Evaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/GeneratorState.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/ITestGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockReturnValueHandler.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockingEvaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Reflect.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/SpringEvaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/mock/MockingRegistry.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/Antikythera.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/Asserter.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/ControllerRequest.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/Factory.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/JunitAsserter.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/QueryType.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/SpringTestGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/TestGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/TestNgAsserter.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/TruthTable.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/UnitTestGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/parser/RestControllerParser.java
  • src/main/java/sa/com/cloudsolutions/antikythera/parser/ServicesParser.java
  • src/test/java/sa/com/cloudsolutions/antikythera/evaluator/TestFields.java
  • src/test/java/sa/com/cloudsolutions/antikythera/evaluator/TestQueries.java
  • src/test/java/sa/com/cloudsolutions/antikythera/evaluator/TestSpringEvaluator.java
  • src/test/java/sa/com/cloudsolutions/antikythera/finch/TestFinch.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/BaseRepositoryQueryTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/FactoryTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/JunitAsserterTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/ProjectGeneratorTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/SideEffectTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/TestSpringGenerator.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/TestTestGenerator.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/TestTruthTable.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/UnitTestGeneratorTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/parser/RestControllerParserTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/parser/ServicesParserTest.java
💤 Files with no reviewable changes (29)
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/BinaryOps.java
  • src/test/java/sa/com/cloudsolutions/antikythera/finch/TestFinch.java
  • docs/unit-test-generation-sequence.html
  • src/test/java/sa/com/cloudsolutions/antikythera/parser/RestControllerParserTest.java
  • docs/unit-test-generation-sequence.md
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/JunitAsserter.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/ProjectGeneratorTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/parser/ServicesParserTest.java
  • src/main/java/sa/com/cloudsolutions/antikythera/parser/ServicesParser.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/BaseRepositoryQueryTest.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/UnitTestGenerator.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/SideEffectTest.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/Factory.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/UnitTestGeneratorTest.java
  • src/main/java/sa/com/cloudsolutions/antikythera/parser/RestControllerParser.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/TestNgAsserter.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/ControllerRequest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/JunitAsserterTest.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/TestSpringGenerator.java
  • src/test/java/sa/com/cloudsolutions/antikythera/evaluator/TestQueries.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/TestTruthTable.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/Antikythera.java
  • src/test/java/sa/com/cloudsolutions/antikythera/evaluator/TestFields.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/FactoryTest.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/Asserter.java
  • src/test/java/sa/com/cloudsolutions/antikythera/generator/TestTestGenerator.java
  • src/test/java/sa/com/cloudsolutions/antikythera/evaluator/TestSpringEvaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/SpringTestGenerator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/generator/TestGenerator.java

Comment thread README.md
Comment thread README.md
Comment thread src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Reflect.java Outdated
@codeant-ai

codeant-ai Bot commented Mar 28, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 56: The "Companion Modules" heading currently uses ATX style ("##
Companion Modules") which conflicts with the repository's markdownlint MD003
rule; change it to Setext style by replacing the ATX heading with a Setext
underline version (use a === underline for top-level or --- for second-level as
appropriate) for the "Companion Modules" heading so it matches the rest of the
README and silences the MD003 lint warning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b7d2d05-bcda-4992-96d3-db4852af2178

📥 Commits

Reviewing files that changed from the base of the PR and between 0327858 and f978a41.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Reflect.java (1)

27-27: Redundant same-package import.

GeneratorState is in the same package (sa.com.cloudsolutions.antikythera.evaluator) as Reflect. Java does not require explicit imports for classes within the same package.

♻️ Remove unnecessary import
-import sa.com.cloudsolutions.antikythera.evaluator.GeneratorState;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Reflect.java` at
line 27, Remove the redundant import of GeneratorState from the top of Reflect
(the explicit "import
sa.com.cloudsolutions.antikythera.evaluator.GeneratorState;" line); since
Reflect and GeneratorState share the same package, delete that import statement
so the code relies on package-local visibility and avoid the unnecessary import.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Reflect.java`:
- Line 27: Remove the redundant import of GeneratorState from the top of Reflect
(the explicit "import
sa.com.cloudsolutions.antikythera.evaluator.GeneratorState;" line); since
Reflect and GeneratorState share the same package, delete that import statement
so the code relies on package-local visibility and avoid the unnecessary import.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f1c3a28-c318-40d6-8474-72360742fa23

📥 Commits

Reviewing files that changed from the base of the PR and between f978a41 and 9d668e5.

📒 Files selected for processing (3)
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockingEvaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/Reflect.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/SpringEvaluator.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/SpringEvaluator.java
  • src/main/java/sa/com/cloudsolutions/antikythera/evaluator/MockingEvaluator.java

@e4c5 e4c5 closed this Mar 28, 2026
@e4c5
e4c5 deleted the core branch March 28, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant