Repository navigation
Conversation
…tion Studio Pro and mxbuild write a Java action's documentation as a javadoc block directly above `public class <Action>`. mxcli stored the documentation but wrote the .java file without the block, so a new action had none and every `create or modify java action` removed the one Studio Pro wrote; the next build put it back. GenerateSource and WriteJavaSourceFile now take the documentation, and the executor passes the action's documentation after the carry rule (the stated doc comment, else the stored one). It is written as mxbuild does: `/**`, one ` * <line>` per line (an empty line keeps the trailing space), ` */`, CRLF. No documentation, no block. The generated backend stubs are regenerated for the new signature. Closes mendixlabs#1653 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1653
What does it do?
The .java file mxcli writes for a Java action now has the javadoc block that Studio Pro and mxbuild
generate from the action's documentation, directly above the class:
Before this change a new action got no block, and every
create or modify java actionremoved the oneStudio Pro wrote; the next build put it back, so each rewrite produced a pair of unrelated diffs.
Root cause:
javaactions.GenerateSourcehad no documentation argument and wrote the imports, ablank line, then
public class ….WriteJavaSourceFile(backend interface, model SDK backend, mock,generated stubs) did not pass it either, although the executor had
ja.Documentationat hand.Change:
GenerateSourceandWriteJavaSourceFiletake adocumentationargument; the executorpasses
ja.Documentation, which is already the result of the carry rule (the stated doc comment, elsethe stored documentation, an explicitly empty one clears it).
writeClassJavadocwrites the formatmeasured on generated files:
/**, one* <line>per line (an empty line is*with the trailingspace),
*/, CRLF like the rest of the file. No documentation, no block, so the existing mxbuildgoldens are unchanged.
unimplemented_gen.goandunsupported_gen.goare regenerated, not edited.Not covered: a
*/inside the documentation would end the comment early; how mxbuild writes that is notmeasured, so it is written as is. The JavaScript action generator is not touched.
Files
sdk/javaactions/source.go:documentationargument,writeClassJavadocmdl/backend/java.go,mdl/backend/modelsdk/java_write.go,mdl/backend/mock/{backend,mock_java}.go:the argument through
WriteJavaSourceFilemdl/backend/modelsdk/unimplemented_gen.go,mdl/backend/mcp/unsupported_gen.go: regeneratedmdl/executor/cmd_javaactions.go: passesja.Documentationsdk/javaactions/javadoc_test.go,mdl/executor/cmd_javaactions_javadoc_test.go: new tests;existing callers in tests get the extra argument
CHANGELOG.md: entry under Unreleased / Fixed.claude/skills/fix-issue/findings/sdk/2026-10-25-java-action-source-without-class-javadoc.jsonTesting
TestGenerateSource_WritesTheDocumentationAsClassJavadoc:"Line one.\n\nLine three."gives/**,* Line one.,*,* Line three.,*/directly above the class, CRLF.TestGenerateSource_JavadocFromCRLFDocumentation: CRLF documentation gives the same file.TestGenerateSource_NoDocumentationNoJavadoc: no block without documentation (control; the mxbuildgoldens still match byte for byte).
TestGenerateSource_RegeneratesOverAFileWithJavadoc: regenerating over a file with the block givesit back unchanged.
TestCreateJavaAction_WritesTheSourceWithItsDocumentation: the executor handsWriteJavaSourceFilethe stated doc comment, the stored documentation when the statement has none, and
""for anexplicitly empty doc comment.
writeClassJavadoccall and the executor argumentreverted, the generator test and two executor cases fail; restored, they pass.
testdata/testapp-views(11.14.0): the issue'screate java actionwrites the block above;create or modifyfromdescribeleaves the file bytefor byte unchanged; changing the doc comment changes only the javadoc line.
make build,make testandmake lint(lint-go, lint-ts, check-conformance,check-test-timeouts) pass;
make check-findingspasses. (On macOS,cmd/mxcli/docker'sTestSyncJavaDependencies_*need asetsidon PATH, onmainas here; unrelated.)Checklist
create [or modify] java actionwrites the .java file without the class javadoc that Studio Pro and mxbuild generate from the documentation #1653mainbehaviourmake check-findingspasses🤖 Generated with Claude Code