Skip to content

fix: emit AllowInert annotation on legacy client callable methods#32

Merged
paodb merged 1 commit into
masterfrom
fix-31
Jun 1, 2026
Merged

fix: emit AllowInert annotation on legacy client callable methods#32
paodb merged 1 commit into
masterfrom
fix-31

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

@javier-godoy javier-godoy commented Jun 1, 2026

Close #31

Summary by CodeRabbit

  • Bug Fixes

    • Fixed proper finalization and propagation of internal annotations for client-callable method overrides, ensuring annotation metadata is correctly maintained during instrumentation.
  • Tests

    • Added test coverage for annotation metadata handling in client-callable method overrides.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cb4b1c0-2c36-4966-a0c8-bfc4ac22d099

📥 Commits

Reviewing files that changed from the base of the PR and between 97a2c3d and dca1dba.

📒 Files selected for processing (4)
  • src/main/java/com/flowingcode/vaadin/jsonmigration/ClassInstrumentationUtil.java
  • src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_AllowInert__V.java
  • src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest.java
  • src/test/java/com/vaadin/flow/component/internal/AllowInert.java

Walkthrough

ClassInstrumentationUtil now properly finalizes @ClientCallable annotations and propagates @AllowInert from original methods to generated overrides via reflection-based name matching. A test annotation stub and test case validate the propagation behavior.

Changes

AllowInert Annotation Propagation

Layer / File(s) Summary
AllowInert annotation stub definition
src/test/java/com/vaadin/flow/component/internal/AllowInert.java
Runtime-retained, method-targeting annotation stub that mirrors Vaadin 24+ marker for methods callable on inert components.
Bytecode annotation propagation in instrumentation
src/main/java/com/flowingcode/vaadin/jsonmigration/ClassInstrumentationUtil.java
Generated method overrides now call visitEnd() to finalize @ClientCallable annotation and conditionally re-emit @AllowInert when found on the original method via reflection-based class name comparison.
Test validation for annotation propagation
src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallable_AllowInert__V.java, src/test/java/com/flowingcode/vaadin/jsonmigration/LegacyClientCallablesTest.java
Test helper class with @AllowInert-annotated method, import updates for assertion utilities, and testAllowInert__V() case that reflectively verifies @AllowInert presence on the instrumented bridge method.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • FlowingCode/JsonMigrationHelper#16: Both PRs modify the same bytecode-generation logic in ClassInstrumentationUtil—the main PR refines the generated @ClientCallable method override annotations (via visitEnd() and propagating AllowInert), building directly on the instrumentation utility introduced in the retrieved PR.
  • FlowingCode/JsonMigrationHelper#19: Both PRs modify ClassInstrumentationUtil's bytecode generation for instrumented method overrides (main PR fixes @ClientCallable/AllowInert annotation emission; retrieved PR changes override instrumentation behavior/flags for generated methods), so the changes are code-level related.
  • FlowingCode/JsonMigrationHelper#18: Both PRs modify ClassInstrumentationUtil's bytecode-generation logic for the generated @ClientCallable method overrides (annotation writing vs. private-method invocation), so the changes are related at the override-generation code level.

Suggested reviewers

  • mlopezFC
  • paodb
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main change: emitting the AllowInert annotation on legacy client callable methods during bytecode instrumentation.
Linked Issues check ✅ Passed The PR fully addresses issue #31 by implementing the proposed fix to propagate @AllowInert annotations onto instrumented bridge methods alongside @ClientCallable.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #31: the core fix in ClassInstrumentationUtil, a test class demonstrating the use case, a test verifying the fix, and a stub annotation.

✏️ 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 fix-31

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.

@javier-godoy javier-godoy requested review from paodb and scardanzan June 1, 2026 19:54
@javier-godoy javier-godoy marked this pull request as ready for review June 1, 2026 19:54
@paodb paodb merged commit 9e2c114 into master Jun 1, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Jun 1, 2026
@paodb paodb deleted the fix-31 branch June 1, 2026 20:07
@paodb paodb moved this from Pending release to Done in Flowing Code Addons Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

@AllowInert is not propagated to the instrumented bridge method for @LegacyClientCallable

2 participants