Skip to content

docs(skill): record jvmmodel-batch learnings in xtend-to-java - #1540

Merged
joaodinissf merged 1 commit into
masterfrom
docs/xtend-skill-jvmmodel-learnings
Sep 23, 2026
Merged

joaodinissf merged 1 commit into
masterfrom
docs/xtend-skill-jvmmodel-learnings

Conversation

@joaodinissf

@joaodinissf joaodinissf commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Records in the xtend-to-java skill what the final jvmmodel batch (#1536) taught, and makes the skill repository-agnostic so it can be reused in other Eclipse/Tycho/Xtext projects: commands use <parent-pom> / <target-module> placeholders, and repository conventions (license header, shared JDT settings) come from the repository itself. Documentation only; no code.

  • Tier 4 templates stay on the reference StringConcatenation chain when they carry newLineIfNotEmpty() after a dynamic value, a two-argument indented append of a possibly multi-line value, appendImmediate, or a StringConcatenationClient value. append(null) appends nothing, so a nullable String moved into .formatted() wraps in Strings.emptyIfNull, other nullable values in Objects.toString(value, "").
  • JvmTypeReferenceBuilder.typeRef is provably non-null; to* builders with a nullable name stay guarded.
  • Dispatcher case order is taken from xtend-gen, never from source order; the terminal else-throw stays.
  • Checkstyle JavadocMethod vs "never invent Javadoc": complete the missing tag from a sibling overload.
  • xbase.lib types stay in public signatures and callee-demanded callbacks.
  • BooleanExpressionComplexity vs SimplifyBooleanReturns: guard clauses or a named local, no suppression.
  • PMD StringToString: Integer.toString(x) is neutral; dropping toString() on a String needs a non-null proof, otherwise Objects.requireNonNull.
  • Module-scoped gate commands include the target-platform module; clear the stale xtend-gen output before the first compile; diff -r -x '.*' for the freshness check.
  • If the build runs compare-version-with-baselines (tycho-p2-extras-plugin): a separate build: bump commit for the bundle, then features and update site only where they also equal the baseline.
  • .project Xtext builder/nature stay only while the module still has Xtext-language resources; otherwise they were Xtend's and go.

🤖 Generated with Claude Code

@joaodinissf
joaodinissf force-pushed the docs/xtend-skill-jvmmodel-learnings branch 2 times, most recently from 11b0dfb to 8314d0c Compare September 18, 2026 22:54
Do not split the translate step per file — every intermediate commit before the last file
would be broken anyway, so per-file translate commits only multiply the broken range.

## Tycho baseline bump

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would not add this, as it is different for downstream projects

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. The section now applies only when the build runs the baseline check, and names no DDK modules.

🤖 Drafted with Claude Code

After every batch:

1. **Compile gate**: `mvn -pl :<module> -am -DskipTests compile -f ./ddk-parent/pom.xml` — must pass.
1. **Compile gate**: `mvn -pl :ddk-target,:<module> -am -DskipTests compile -f ./ddk-parent/pom.xml` — must pass.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would not add this, as it is different for downstream projects

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, replaced with generic placeholders.

🤖 Drafted with Claude Code

2. **Test gate**: `mvn verify -f ./ddk-parent/pom.xml --batch-mode --fail-at-end` — must pass.
3. **Static analysis gate**: `mvn checkstyle:check pmd:check spotbugs:check -f ./ddk-parent/pom.xml` — must pass.

`:ddk-target` must be in every `-pl` list — the target artifact is not in `~/.m2`. Before the first

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would not add this, as it is different for downstream projects

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, now phrased as a generic Tycho rule.

🤖 Drafted with Claude Code

9. **Verify the file compiles:**
```bash
mvn -pl :<module> -am -DskipTests compile -f ./ddk-parent/pom.xml > mvn-output.txt 2>&1
mvn -pl :ddk-target,:<module> -am -DskipTests compile -f ./ddk-parent/pom.xml > mvn-output.txt 2>&1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

probably this and the others need to be more generic so that it is not so tied with DDK naming, don't you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I went through the whole skill: no DDK-specific names are left apart from the @Tag section, which only applies to projects using the DDK test framework.

🤖 Drafted with Claude Code

@joaodinissf
joaodinissf force-pushed the docs/xtend-skill-jvmmodel-learnings branch from 8314d0c to 411e777 Compare September 22, 2026 21:33
@joaodinissf
joaodinissf marked this pull request as ready for review September 22, 2026 21:34
@joaodinissf
joaodinissf enabled auto-merge (rebase) September 22, 2026 21:34
Learned migrating the ten jvmmodel files (expression, export, scope), written
so the skill applies to any Eclipse/Tycho/Xtext repository: commands use
<parent-pom> and <target-module> placeholders, and repository conventions
(license header, shared JDT settings) are taken from the repository itself.

1. Tier 4 stays on the reference StringConcatenation chain when it has
   newLineIfNotEmpty after a dynamic value, two-arg append of a possibly
   multi-line value, appendImmediate, or a StringConcatenationClient
   value; append(null) appends nothing, so a nullable String moved into
   .formatted() wraps in Strings.emptyIfNull and other nullable values in
   Objects.toString(value, "").
2. JvmTypeReferenceBuilder.typeRef is provably non-null; to* builders with a
   nullable name stay guarded.
3. Dispatcher case order comes from xtend-gen, not source order; the terminal
   else-throw stays, Java's definite-return analysis needs it.
4. Checkstyle JavadocMethod vs rule 1: complete missing @PARAM tags from a
   sibling overload; move dispatch Javadoc off the Void overload.
5. xbase.lib types stay in public signatures and callee-demanded callbacks.
6. BooleanExpressionComplexity vs SimplifyBooleanReturns: guard clauses or a
   named local, never a suppression.
7. PMD StringToString: Integer.toString(x) is neutral; dropping toString()
   on a String needs a non-null proof, else Objects.requireNonNull.
8. Module-scoped gate commands must include the target-platform module;
   clear the stale xtend-gen output before the first compile; diff -r -x '.*'
   for the freshness check.
9. If the reactor runs compare-version-with-baselines (tycho-p2-extras-plugin):
   separate build: bump
   commit; features and category only when they also equal the baseline;
   the sources artifact is compared.
10. .project Xtext builder/nature stay only while the module still has
    Xtext-language resources; otherwise they were Xtend's and go.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaodinissf
joaodinissf force-pushed the docs/xtend-skill-jvmmodel-learnings branch from 411e777 to ea936bb Compare September 22, 2026 22:10
@joaodinissf
joaodinissf merged commit e784f41 into master Sep 23, 2026
4 checks passed
@joaodinissf
joaodinissf deleted the docs/xtend-skill-jvmmodel-learnings branch September 23, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants