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 ModuleModel update Properties #8832

Merged
merged 2 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class Environment extends LifecycleAdapter implements ApplicationExt {

protected CompositeConfiguration globalConfiguration;

private List<Map<String, String>> globalConfigurationMaps;
protected List<Map<String, String>> globalConfigurationMaps;

private CompositeConfiguration defaultDynamicGlobalConfiguration;

Expand Down Expand Up @@ -293,6 +293,9 @@ public String getLocalMigrationRule() {
public void refreshClassLoaders() {
propertiesConfiguration.refresh();
loadMigrationRule();
this.globalConfiguration = null;
this.globalConfigurationMaps = null;
this.defaultDynamicGlobalConfiguration = null;
}

public Configuration getDynamicGlobalConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void setDynamicConfiguration(DynamicConfiguration dynamicConfiguration) {
@Override
public void destroy() throws IllegalStateException {
this.orderedPropertiesConfiguration = null;
this.globalConfiguration = null;
this.dynamicGlobalConfiguration = null;
this.dynamicConfiguration = null;
}
Expand Down Expand Up @@ -213,5 +214,8 @@ public String getLocalMigrationRule() {
public void refreshClassLoaders() {
orderedPropertiesConfiguration.refresh();
applicationDelegate.refreshClassLoaders();
this.globalConfiguration = null;
this.globalConfigurationMaps = null;
this.dynamicGlobalConfiguration = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Set;

public class OrderedPropertiesConfiguration implements Configuration{
private Properties properties = new Properties();
private Properties properties;
private ModuleModel moduleModel;

public OrderedPropertiesConfiguration(ModuleModel moduleModel) {
Expand All @@ -35,6 +35,7 @@ public OrderedPropertiesConfiguration(ModuleModel moduleModel) {
}

public void refresh() {
properties = new Properties();
ExtensionLoader<OrderedPropertiesProvider> propertiesProviderExtensionLoader = moduleModel.getExtensionLoader(OrderedPropertiesProvider.class);
Set<String> propertiesProviderNames = propertiesProviderExtensionLoader.getSupportedExtensions();
if (propertiesProviderNames == null || propertiesProviderNames.isEmpty()) {
Expand Down