refactor: log dynamic-theme initialization#144
Conversation
WalkthroughDynamicThemeInitializer is updated to discover and apply themes from multiple META-INF/dynamic-theme.properties resources via the class loader, replacing single-resource loading. Helper methods for URL parsing and theme reading are added alongside logging to track theme application sources. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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)
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: 1
🤖 Fix all issues with AI agents
In
`@src/main/java/com/flowingcode/vaadin/addons/demo/DynamicThemeInitializer.java`:
- Around line 50-57: The readTheme method currently returns empty silently when
the "theme" property is missing or invalid; update readTheme to (1) after
loading props check if props.getProperty("theme") is null or blank and log a
warning including the URL to indicate a misconfigured dynamic-theme.properties,
and (2) when mapping to DynamicTheme via DynamicTheme.valueOf, catch
IllegalArgumentException, log an error mentioning the invalid value and the URL,
and return Optional.empty; use the class logger (e.g., LOGGER or logger) for
these messages and keep the method signature and stream handling as-is.



Log the resolved path of dynamic-theme.properties to identify and troubleshoot classpath conflicts caused by downstream dependencies.
Summary by CodeRabbit