Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use Thread context ClassLoader for loading I18n ResourceBundle #19791

Merged
merged 11 commits into from
Aug 23, 2024

Conversation

platosha
Copy link
Contributor

  • fix: use Thread context ClassLoader for loading I18n ResourceBundle
  • fix: make sure DefaultInstantiator also uses thread context ClassLoader for menu and i18n resources

@platosha platosha added hilla Issues related to Hilla target/24.4 labels Aug 15, 2024
Copy link

github-actions bot commented Aug 15, 2024

Test Results

1 133 files  + 1  1 133 suites  +1   1h 30m 32s ⏱️ + 2m 37s
7 358 tests + 2  7 308 ✅ + 2  50 💤 ±0  0 ❌ ±0 
7 718 runs  +23  7 658 ✅ +23  60 💤 ±0  0 ❌ ±0 

Results for commit 1a46e92. ± Comparison against base commit 7973103.

♻️ This comment has been updated with latest results.

ResourceBundle caches resources internally, this affects translation resources for the I18n feature. However, after a hot reload of a SpringBoot application in dev mode, up-to-date translations are expected in the output.

With this change, a RestartClassLoader is used in SpringBoot applications for loading translation ResourceBundle, so that the translation bundles are reloaded on hot reload.

Fixes vaadin/hilla#2554
@platosha platosha changed the title fix/ap/hilla 2554 fix: use Thread context ClassLoader for loading I18n ResourceBundle Aug 21, 2024
@platosha platosha marked this pull request as ready for review August 22, 2024 07:05
@@ -30,18 +33,34 @@
import com.vaadin.flow.server.InvalidMenuAccessControlException;
import com.vaadin.flow.server.VaadinContext;
import com.vaadin.flow.server.VaadinService;
import org.mockito.invocation.InvocationOnMock;

import static org.junit.Assert.assertThrows;

public class DefaultInstantiatorMenuAccessControlTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should perhaps be marked with @NotThreadSafe as we use a set current in the test

@caalador caalador enabled auto-merge (squash) August 23, 2024 09:34
@vaadin-bot vaadin-bot added +0.1.0 and removed +0.0.1 labels Aug 23, 2024
Copy link

sonarcloud bot commented Aug 23, 2024

@caalador caalador merged commit 10eb5dd into main Aug 23, 2024
25 of 26 checks passed
@caalador caalador deleted the fix/ap/hilla-2554 branch August 23, 2024 10:03
vaadin-bot pushed a commit that referenced this pull request Aug 23, 2024
…19791)

ResourceBundle caches resources internally, this affects translation resources for the I18n feature. However, after a hot reload of a SpringBoot application in dev mode, up-to-date translations are expected in the output.

With this change, a RestartClassLoader is used in SpringBoot applications for loading translation ResourceBundle, so that the translation bundles are reloaded on hot reload.

Fixes vaadin/hilla#2554
vaadin-bot added a commit that referenced this pull request Aug 23, 2024
…19791) (#19821)

ResourceBundle caches resources internally, this affects translation resources for the I18n feature. However, after a hot reload of a SpringBoot application in dev mode, up-to-date translations are expected in the output.

With this change, a RestartClassLoader is used in SpringBoot applications for loading translation ResourceBundle, so that the translation bundles are reloaded on hot reload.

Fixes vaadin/hilla#2554

Co-authored-by: Anton Platonov <anton@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants