chore: add check about legacy theme annotation#145
Conversation
WalkthroughAdded a private validation method assertNotLegacyTheme() to DynamicTheme.java that detects legacy Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/main/java/com/flowingcode/vaadin/addons/demo/DynamicTheme.java`:
- Around line 116-118: In DynamicTheme, the initialize(IndexHtmlResponse)
overload currently calls assertFeatureSupported() but misses the legacy-theme
check; update the initialize(IndexHtmlResponse) method to call
assertNotLegacyTheme() immediately after assertFeatureSupported() so both
initialization paths (initialize(AppShellSettings) and
initialize(IndexHtmlResponse)) enforce the same legacy-theme validation via
assertNotLegacyTheme().
- Around line 82-89: The method assertNotLegacyTheme() currently calls
AppShellRegistry.getInstance(context).getShell() and immediately dereferences
the result; add a null-check for the returned Class (e.g., store in
appShellClass and if (appShellClass == null) return) before calling
getAnnotation to avoid a NullPointerException, and keep the existing
IllegalStateException only when a Theme annotation is present; also verify that
initialize(IndexHtmlResponse) invokes assertNotLegacyTheme() (or perform the
same null-safe check there) so both initialization paths enforce the
legacy-theme check consistently.
e596d59 to
25afda7
Compare
|



Summary by CodeRabbit