Skip to content

intent: a string value in a posts: set: renders as a bare Java identifier - the generated post handler does not compile #7246

Description

@delchev

Describe the bug

GlueIntentGenerator.postSetExpr renders a posts: set: value to a Java expression, and its string-literal branch tests the value against "[^"]*" — it only fires when the value still carries its double quotes. YAML strips them first, so an authored

posts:
  - name: goodsIssueNote
    forEntity: GoodsIssue
    event: create
    into: StockNote
    idempotentBy: GoodsIssue
    set:
      Note: "issued"

reaches the renderer as issued, misses every branch and falls through the final pass-through, so the template emits

row.Note = issued;

The generated module does not compile. The construct's own javadoc (PostIntent) documents "a quoted string" as a supported form, and GluePostsTest asserts the item/negation/integer/source forms only — so nothing catches it.

Expected

A set: value that is not one of the recognised expression forms and is not numeric renders as a Java string literal (escaped — the #7154 / #7241 family), or generation refuses it with a message naming the rule and the field. Silently emitting an identifier is the one outcome that cannot be right.

Context

Found while building the posts: fixture for #7179 (PR #7245): the fixture had to avoid a string value to keep the generated handler compilable. postSetExpr in components/engine/engine-intent/.../generator/GlueIntentGenerator.java; the pass-through's own comment already calls itself "best effort".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions