Skip to content

DESCRIBE emits body-less CREATE JAVA ACTION for source-less (add-on module) actions, which fails to re-parse (roundtrip break) #637

@ako

Description

@ako

Summary

DESCRIBE of a Java action only emits the mandatory as $$ ... $$; body when the .java source file is readable from the project. Add-on / Marketplace modules ship without Java source on disk, so for those actions DESCRIBE emits a statement with no body — e.g.:

create java action Foo.Bar(RawJson: String not null, SyncTimestamp: DateTime not null) returns Integer
-- return NAME: 'ReturnValueName';

The grammar (createJavaActionStatement) requires ... RETURNS type AS DOLLAR_STRING SEMICOLON?, so the body is not optional. The emitted MDL fails to re-parse, and because the statement never terminates, the parser desyncs and cascades into every following statement. This breaks the documented "DESCRIBE roundtrip" guarantee and makes describe module … with all non-re-executable for any module containing a source-less Java action.

Reproduction

create java action RT.A(P: String not null) returns Integer;   -- body-less, as DESCRIBE emits for source-less actions
$ mxcli check repro.mdl
  - line 1:52 no viable alternative at input 'Integer'

With a body it parses (capitalised types are fine — the body is the missing piece):

create java action RT.A(P: String not null) returns Integer as $$ return 0L; $$;   -- ✓ Syntax OK

Real-world trigger

describe module OntologyViewer with all on an app with Marketplace connectors (AmazonBedrock, MCPClient, …). The entity/grant and page/snippet sections now round-trip (#633, #634), but the Java-action section is emitted body-less and the rest of the dump cascades from it.

Expected

DESCRIBE should always emit an as $$ ... $$; body. When the source can't be read, emit a clearly-marked placeholder body (a comment) so the output re-parses, rather than emitting an invalid body-less statement.

Environment

mxcli built from current main; reproduced via mxcli check (syntax only, no project needed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions